The product is primarily a server end of a pet positioning system, so servers are accessible on the extranet, allowing different pet positioning devices to access the server, upload information, register information and effectively track and monitor the performance of each object (pet) that needs to be located.
Pet positioning server software design
General requirements ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Overall functional requirements
Software development platform requirements.........................................................................................................................
2 Software development
- 1Software needs analysis 3
- General framework of the system
- 3 Design summary of software
- 4. Detailed design of software
1 Overall requirements
- 1 Overall functional requirements
The product is primarily a server end of a pet positioning system, so servers are accessible on the extranet, allowing different pet positioning devices to access the server, upload information, register information and effectively track and monitor the performance of each object (pet) that needs to be located.
Developers should opt for B/S structures or C/S structures based on a full analysis of needs.
The overall functional requirements are as follows:
A pet location signal launcher is a terminal with an built-in GPS and mobile communication module, hereinafter referred to as a pet locator of all types, which can be registered with a positioning server, including basic information on the pet locator, the equipment model of the locator, and the mode of operation of the locator.
Guardians can access servers with registration and locator information through their own terminals, such as mobile phones, handheld terminals for locator receivers, computers, etc., and can customize electronic fences for their own pets.
The pet locator allows for regular reporting of pet locator information to the server.
At the same time, the server can inform the owner (guardian) of the pet, the basic information of the pet locator, the real-time location information (geographical location).
The server warns the guardian’s terminal (cell phone, handheld locator receiver) that it is unable to provide technical services, requires a guardian to check the current state of the pet locator, and restarts or repairs the locator equipment.
Servers can maintain historical location information on pets and inform their owners of historical tracks.
Servers can have electronic fence alerts, and when pets are found beyond the electronic fence to alert the owners of pets to various terminals, they can also alert locators with receiving alarms.
The server can send out various types in different forms, depending on the needs of the pet ' s guardian, not only through end-of-pipe network access, but also through text messages, colour mail, telephone voice alerts.
- 2 Software development platform requirements
Database management system:
MySQL5.6 or above
Network architecture:
Fully supports TCP/IP protocol
Development tools or technical systems:
In order to ensure top-down compatibility of the software, more recent versions of more generic development tools such as J2EE (Java2 Platform Enterprise), Eclipse, Netbeans, Microsoft Visa Studio, etc. should be selected for development.
2 Software development
- 1 Software requirement analysis
With people's material standards of living rising, pets have become an option for a growing number of people in the face of amateur life. The masters love them like “babys” but also have emotional and spiritual satisfaction. But pets also imply an extra responsibility, not only that the rest of the world prefers to go out with their own pets, but also that it is necessary to keep them out of the house on a regular basis every day. But, after all, the outdoor environment is more complex, so that masters often fear for the safety of their pets, or for their loss or accident. Yet, with the great care of their masters, the loss of their pets continues to occur. It is believed that as the pet market flourishes, more and better intelligent pet location products will emerge, and their markets will grow more and more.
This pet location system was developed primarily to facilitate the owners of pets and to monitor their own pets in real time.
- 2 Overall architecture of the system
Logical architecture

Functional use case diagram

- 3 Software outline design

- 3.1 Owner information management module
The Master Information Management module provides information registers for pet owners, account log-in, pet locator binding, locator untiement, master's basic information modification, etc.
- 3.2 Pet positioning equipment information management
The pet locator information management module is used to register the pet locator with the server, certify the locator and untie the locator.

- 3.3 Pet positioning history track management
Patient positioning history track management, where the pet owner is asked about the location track of the pet over a certain period of time. Users can search not only for records of the historical track, but also remove records of the historical track.
- 3.4 Pet real-time positioning management
The server receives a real-time signal and is required to broadcast to all user terminals that bind the pet location device and inform the pet of the real-time location information.
The electronic fence can be a circle, irregular polygon or rectangle with the owner’s current position.
- 3.5 Special alarm management module
When a pet leaves the electronic fence, an electronic fence alert is sent to the respective master ' s terminal, alerting the user to the movement of the pet and preventing accidents such as the loss of the pet.
When the pet locator signal is weak, the power is insufficient, or when the locator signal is malfunctioning, you can notify the server of the malfunction, which informs the owner in real time to the terminal.
- 3.6 Communication management module
The communications management module is an intermediate, and its functions include connection between pet locator devices, breakwire reconnection, equipment heartbeat detection, and connection to the telephone voice platform, SMS platform.
- 4 Detailed design of software
Master control program
The master control program is a start-up Main program for the entire service, which is primarily responsible for the start-up (configuration reading, module loading) and closing of the system and log log log logs for the operation of the program. When running the master control program, it will read Params and load all modules Modules, including database module Data Modele, master information management module, pet locator information module, pet location history track module, pet real-time location module, special alarm module, communication management and recording of system operations in Log logs, which will be viewed as a ready administrator to detect whether the module is running correctly. , the test program, the test program (TestPmgram) contains some service functions of the service centre and test data, which determine how the system works according to the correct return value.

Figure 1 master control running flowchart
- 4.1 Owner information management module
The master information management module is responsible for certifying the rights of the pet owner, and for determining whether the user is a registered member, has access to the service, is a friend to a client, etc. The server server re-data is based on the Hibernate layer, where the user information class (User) is the public parameter most frequently transmitted by the service platform provider.
The process is simple, mainly searching the database's user information sheets and service customization tables, finding the user's current service status and filling in the User user category, returning to the system, which selects different service paths based on the knowledge. Note that newly registered users need to bind their pet locator devices to search for their pet location information.
Figure 2 User Main Data Membership Table
Class Name
user
Main data members
Main data member name
Description
String userName
Username
String nickName
User Nickname
String passMD5
User password cipher text, md5 encryption
String sex
User Gender
Date birthday
User date of birth
String address
User communication address
Datetime regDate
User registration time
String ip
User’s last login ip
unsigned int deviceListID
User-bound positioning device list
- 4.2 Pet positioning equipment information management
The RPE IM module is responsible for certifying the authority of the LPO, which determines whether the device is registered and has the right to receive the service.
Figure 3 LocatorDevice Major Data Membership Table
Class Name
LocatorDevice
Main data members
Main data member name
Description
String deviceName
Device name
String deviceID
Positioning device ID number, unique
String deviceToken
Token of the locator device, specifically indicating that the token is used to verify login similar to a password
- 4.3 Pet positioning history track management
The pet positioning history track management module, which contains a manager category LocalHistoryManager, first defines the basic format for positioning historical data. When users need to search for the pet locator history track, call GetHistoryByDate to get the locator history track.
Key Data Membership Table for Figure 4 Office
Class Name
Location
Main data members
Main data member name
Description
Datetime utctime
All location services are unified utc time.
float latitude
Latitude, format point.ddmm.mmmm(degree) format
char latitudeHemisphere
Latitudinal hemisphere, with values E (E) or W (W)
float longitude
Longitude dddmm.mmmm(degrees) format
char longitudeHemisphere
Longitude hemisphere E (Eastern longitude) or W (Western longitude)
Class Name
LocationHistoryManager
Main member functions
Main member function name
getHistoryByDate()
Obtain historical data of positioning, based on date nodes
addLocationHistory()
Increase historical positioning data
removeLocationHistory()
Delete historical positioning data
- 4.4 Pet real-time positioning management
The pet real-time positioning management module is responsible for receiving real-time positioning data for positioning devices and storing them in databases and memory. First, the manager category PetrealLocationManager is designed to manage real-time positioning information for pets
Figure 5 PetrealLocationManager Principal Member Functions
Class Name
PetRealLocationManager
Main member functions
Main member function name
AddPetRealLocationByDeviceID
Add real-time location information of a pet
UpdateRealLocationByDeviceID
Update real-time positioning information of pets
SetElectronicFenceByDeviceID
Set pet’s electronic fence information
ElectronicFence to define the type of electronic fence and basic information for pets
Figure 6 ElectronicFence Main Data Member
Class Name
ElectronicFence
Electronic Fence
Main data members
Main data member name
Description
int type
Fence type 0 circle, 1 rectangle, 2, polygon
int radius
Fence radius, for circular fences
int length
Fence length, for rectangular fences
int width
Fence width, used for rectangular fences
List <Point> Polygon
Used for polygonal fences
Figure 7 Process for real-time positioning information
- 4.5 Special alarm management
Special Alert was designed for the Special Alert module.
Class Name
SpecialAlert
Special Alert
Main member functions
Main member function name
CheckDeviceLocation
Every frame calls this method to check the current location of the device
IsLocationOutOfFence
Call this way to check if the equipment's out of the fence.
SendFenceAlertToUser
Warn the users of the fence and inform them that the pets are outside the fence.
ReciveDeviceAlertFromDevice
Accept fault alarms from positioning equipment
SendDeviceAlertToUser
Sends equipment failure alerts to users
Database design
Figure 8 User table structure
Name
Data type
Description
ID
INTEGER
User ID
userName
CHAR(100)
Username
passMD5
CHAR(32)
User Password
sex
CHAR(2)
User Gender
birthday
DATETIME
User date of birth
address
CHAR(255)
User communication address
regDate
DATETIME
Registration date
ip
CHAR(12)
ip address
deviceListID
CHAR(12)
Bind device list id
Figure 9 LocatorDevice Table Structure
Name
Data type
Description
deviceName
CHAR(100)
Equipment
deviceID
CHAR(32)
Positioning device ID number, unique
deviceToken
CHAR(2)
Token of the locator device, specifically indicating that the token is used to verify login similar to a password
Figure 10 Office Table Structure
Name
Data type
Description
localtionId
INTEGER
Positioning information id
utctime
INTEGER
All location services are unified utc time.
latitude
DOUBLE
Latitude, format point.ddmm.mmmm(degree) format
latitudeHemisphere
CHAR(1)
Latitudinal hemisphere, with values E (E) or W (W)
longitude
DOUBLE
Longitude dddmm.mmmm(degrees) format
longitudeHemisphere
CHAR(1)
Longitude hemisphere E (Eastern longitude) or W (Western longitude)
Figure 11 LocationHistory Table Structure
Name
Data type
Description
historyId
INTEGER
Positioning history id
utctime
INTEGER
All location services are unified utc time.
deviceID
CHAR(32)
Positioning device ID number, unique
Figure 12 Log table structure
Name
Data type
Description
LogID
int
Identity (auto-increment)
UserCode
varchar(50)
User Code
UserName
varchar(100)
Username
LoginIP
varchar(20)
Login IP
Type
int
Operation type
Operation
varchar(1000)
Operation Content
CreateDate
datetime
Operation Time
Remark
varchar(500)
Remarks
