Method for synchronizing electronic fences of central control system based on P2P (Peer-to-Peer)
By using P2P communication technology to synchronize electronic fence data in shared vehicle management system, the efficiency and cost problems of traditional update methods in weak network signals or offline scenarios are solved, and the ad hoc network data propagation between devices is realized, improving the stability and reliability of the system.
Patent Information
- Application Number
- CN202510224444.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In shared vehicle management, the traditional electronic fence data update method relies on the central server, which causes the equipment to fail to obtain the latest data in a timely manner in scenarios with weak network signals or offline, affecting the efficiency of operation and management, and a large number of equipment frequently requests the server, causing waste of bandwidth resources and increasing operating costs.
The electronic fence synchronization method based on P2P is adopted to realize automatic discovery, data exchange and version synchronization between devices through P2P communication technology. The device stores the electronic fence data in blocks according to geographical areas, and regularly broadcasts data version information through low-power Bluetooth technology to establish a P2P connection for differential updates.
Even when the network is unstable or offline, the system can still maintain timely update of electronic fence data, significantly reducing dependence on the central server, improving the stability and reliability of the system, reducing redundant data transmission and communication overhead, and reducing operating costs.
Smart Images

Figure CN120018093A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of shared vehicle management, and in particular to a P2P-based central control system electronic fence synchronization method. Background Art
[0002] Electronic fence technology plays an important role in the management of shared transportation vehicles. It is used to limit the parking area and operating range of vehicles. At present, the update of electronic fence data mainly relies on real-time communication between the device and the cloud server. The central control system needs to send requests to the server regularly to obtain the latest electronic fence information. This traditional data synchronization method has the following problems: In scenarios where the network signal is weak or offline, the device cannot obtain the latest electronic fence data in time, affecting the efficiency of operation and management; frequent requests from a large number of devices to the server will waste bandwidth resources, increase server load and operating costs; the electronic fence data in areas with dense vehicle distribution has a strong geographical correlation, and the traditional centralized update method fails to take advantage of this feature; At the same time, in the prior art, some solutions use local caching mechanisms to reduce server requests, but they still cannot solve the problem of data updating when the device is offline; therefore, the present invention proposes a P2P-based central control system electronic fence synchronization method to solve the problems existing in the prior art. Summary of the invention
[0003] In view of the above problems, the present invention proposes a P2P-based central control system electronic fence synchronization method, which is applied to data exchange and update of the central control system of shared transportation vehicles, especially electronic fence information synchronization when the device is offline. Through P2P communication technology, automatic discovery, data exchange and version synchronization between devices are realized, which solves the technical problems of the traditional electronic fence data update mode that relies on the central server in offline scenarios.
[0004] To achieve the purpose of the present invention, the present invention is implemented by the following technical scheme: a P2P-based central control system electronic fence synchronization method, comprising the following steps: S1: The electronic fence data is stored in blocks according to geographical areas; S2: The device is preset with the region identifier when it leaves the factory, and obtains the full data packet of the corresponding region from the central server when it is first connected to the network; S3: Each device maintains a dynamic version information table locally to record the data version status of the current region; S4: The device regularly broadcasts its own data version information through low-power Bluetooth BLE technology; S5: The device continues to scan the surrounding environment and establishes P2P communication with other devices in the same area through a preset handshake protocol; S6: After the connection is established, data version information is exchanged to verify the integrity and validity of the data. If passed, the local storage is updated and the version information table is modified.
[0005] A further improvement is that in S1, each data block contains a version number, a timestamp, an area identifier, fence coordinate information and related business rule configurations, and the division of data blocks is set according to the actual scope of the geographical area and the amount of data.
[0006] Further improvements are as follows: the data block adopts a hierarchical index structure, the header field contains the area identifier and the global version number, the body field stores the coordinate sequence and topological relationship of the geo-fence polygon, and the tail field is associated with the dynamic business rule configuration parameter set.
[0007] A further improvement is that in S2, the area identifier is encoded in a unique manner, and the area identifier of each device is unique and identifiable.
[0008] A further improvement is that in S3, the data version status of the current region includes: the current region identifier, the data version number and the latest update timestamp, so as to realize the data synchronization mechanism of incremental update.
[0009] A further improvement is that in S4, the broadcast information includes: area identification, data version number and timestamp, and the broadcast period is dynamically adjusted according to the power level of the device and the data update frequency.
[0010] A further improvement is that in S5, when other devices in the same area are found, a P2P communication connection is established through a preset handshake protocol, and the handshake protocol specifically includes: exchanging device identity certificates through asymmetric encryption, negotiating symmetric encryption session keys, and establishing an end-to-end encrypted channel using the session keys.
[0011] A further improvement is that: S6 comprises the following steps: After the connection is established, the devices first exchange detailed data version information, and determine whether data synchronization is required and the specific synchronization range by comparing the version number and timestamp; Data transmission adopts differential update mode, only the changed data content is transmitted; After obtaining new data, the receiver verifies the integrity and validity of the data through a verification mechanism. After the verification is passed, the local storage is updated and the version information table is modified.
[0012] Further improvements are: the differential update method adopts a binary difference algorithm, the transmission content includes a version difference identifier and compressed incremental data, and the incremental data is generated through the following steps: comparing the new and old version data blocks to generate a difference operation code, performing Huffman coding compression on the operation code and the associated data segment, and adding a header check field to form a transmission unit.
[0013] Further improvement is to verify the integrity and validity of the data through a verification mechanism, including the following steps: Verify data integrity through the SHA-256 algorithm; Perform geo-fence closure detection and coordinate validity verification.
[0014] The beneficial effects of the present invention are: 1. The present invention adopts P2P communication technology to realize ad hoc network data transmission between devices, which significantly reduces the dependence on the central server. Even when the network is unstable or completely offline, the system can still keep the electronic fence data updated in time, effectively improving the stability and reliability of the shared vehicle management system. By adopting regional block storage and incremental update mechanism, the device only synchronizes the changed part of the electronic fence data in the area to which it belongs, avoiding redundant data transmission. At the same time, the data compression technology is used to reduce the amount of transmitted data, reduce the communication overhead between devices, and improve data synchronization efficiency.
[0015] 2. The present invention designs a complete version control mechanism, ensures the orderliness of data updates by comparing version numbers and timestamps, adopts a data verification mechanism to verify the integrity and validity of transmitted data, prevents data damage or tampering, and ensures data consistency in a distributed environment. Compared with traditional solutions that rely on real-time network connections, the present invention reduces dependence on mobile communication networks and reduces communication costs. By synchronizing devices with each other, it reduces the load on the central server and reduces server expansion and maintenance costs.
[0016] 3. The present invention realizes the automatic synchronization and update of electronic fence data, ensuring that shared vehicles can obtain the latest operating rules in a timely manner. Compared with traditional solutions, it significantly improves the system response speed and improves the user experience. It not only solves the technical difficulties of data updating in offline environments, but also has significant advantages in transmission efficiency, data consistency and system cost. It provides an efficient and reliable solution for the electronic fence management of shared vehicles, which is of great significance to improving the level of shared vehicle operation management. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of the present invention; Figure 2 It is a schematic diagram of the data structure of the electronic fence of the present invention. DETAILED DESCRIPTION
[0018] In order to deepen the understanding of the present invention, the present invention will be further described in detail below in conjunction with examples. The examples are only used to explain the present invention and do not constitute a limitation on the protection scope of the present invention.
[0019] Embodiment 1 according to Figure 1 , 2 As shown, this embodiment proposes a P2P-based central control system electronic fence synchronization method, including the following steps: S1: The electronic fence data is stored in blocks according to geographical areas; each data block contains a version number, timestamp, area identifier, fence coordinate information and related business rule configuration, and the division of data blocks is set according to the actual scope of the geographical area and the amount of data; the data block adopts a hierarchical index structure, the header field contains the area identifier and the global version number, the body field stores the geographic fence polygon coordinate sequence and topological relationship, and the tail field is associated with the dynamic business rule configuration parameter set.
[0020] S2: The device is preset with the regional identifier when it leaves the factory, and obtains the full data packet of the corresponding area from the central server when it is connected to the network for the first time; the regional identifier adopts a unique coding method, and the regional identifier of each device is unique and identifiable.
[0021] S3: Each device maintains a dynamic version information table locally to record the data version status of the current region; the data version status of the current region includes: the current region identifier, the data version number and the latest update timestamp, so as to implement the data synchronization mechanism of incremental updates.
[0022] S4: The device regularly broadcasts its own data version information through low-power Bluetooth BLE technology; the broadcast information includes: region identification, data version number and timestamp, and the broadcast period is dynamically adjusted according to the device's power and data update frequency.
[0023] S5: The device continuously scans the surrounding environment and establishes P2P communication connections with other devices in the same area through a preset handshake protocol; when other devices in the same area are found, a P2P communication connection is established through a preset handshake protocol. The handshake protocol specifically includes: exchanging device identity certificates through asymmetric encryption, negotiating symmetric encryption session keys, and using session keys to establish an end-to-end encrypted channel.
[0024] S6: After the connection is established, data version information is exchanged, the integrity and validity of the data are verified, and the local storage is updated and the version information table is modified after passing. Specifically, the following steps are included: After the connection is established, the devices first exchange detailed data version information, and determine whether data synchronization is required and the specific synchronization range by comparing the version number and timestamp; data transmission adopts differential update mode, and only the changed data content is transmitted; after obtaining the new data, the receiver verifies the integrity and validity of the data through the verification mechanism, and updates the local storage and modifies the version information table after the verification passes.
[0025] The differential update method uses a binary difference algorithm. The transmission content includes a version difference identifier and compressed incremental data. The incremental data is generated through the following steps: comparing the new and old version data blocks to generate a difference operation code, performing Huffman coding compression on the operation code and the associated data segment, and adding a header check field to form a transmission unit. The integrity and validity of the data are verified through a verification mechanism, including the following steps: verifying data integrity through the SHA-256 algorithm; performing geo-fence closure detection and coordinate legitimacy verification.
[0026] Embodiment 2 according to Figure 1 , 2 As shown, this embodiment proposes a P2P-based central control system electronic fence synchronization method, which solves the technical problem that the electronic fence data cannot be updated in time when the vehicle is offline, including the following steps: The electronic fence data is stored in blocks according to geographical regions. Each data block contains a version number, timestamp, region ID, fence coordinate information, and related business rule configuration. The device presets the region ID when it leaves the factory, and obtains the electronic fence data packet of the corresponding region from the server when it is first connected to the network. Each device maintains a data version information table locally to record the data version status of the current region and implement an incremental update data synchronization mechanism.
[0027] In the specific implementation process, the device regularly broadcasts its own data version information through low-power Bluetooth (BLE) technology. The broadcast information contains key information such as area identification, data version number and timestamp. At the same time, the device continuously scans the surrounding environment. When other devices in the same area are found, a P2P communication connection is established through a preset handshake protocol. After the connection is established, the devices first exchange detailed data version information, and determine whether data synchronization is required and the specific synchronization range by comparing the version number and timestamp. Data transmission adopts differential update mode, and only the changed data content is transmitted, which effectively reduces communication overhead. After obtaining new data, the receiver verifies the integrity and validity of the data through the verification mechanism. After the verification is passed, the local storage is updated and the version information table is modified.
[0028] Through the innovative use of P2P communication technology, rapid synchronization of electronic fence data in an offline environment is achieved, changing the traditional data distribution model that completely relies on central servers. This solution significantly improves the availability of the system through self-organizing network data transmission between devices, and can keep electronic fence data updated in a timely manner even when the network is unstable or offline. The system performs directional data synchronization based on factory-preset regional information, avoiding data confusion and improving update efficiency. At the same time, the solution uses incremental update and data compression technology to optimize transmission performance, and ensures data consistency through version control and data verification mechanisms, providing an efficient and reliable technical solution for electronic fence management of shared vehicles. Electronic fence data synchronization can still be achieved when the device is offline, ensuring that the device can obtain the latest electronic fence information even in an environment with unstable network signals; through the P2P communication mechanism between devices, it reduces dependence on the central server, reduces server load and network bandwidth consumption, and improves system operation efficiency; it solves the problem of manual updates after vehicle regional deployment, and reduces operation and maintenance costs and error risks through automatic identification and switching mechanisms; it utilizes the interconnection capabilities between devices to achieve rapid dissemination of electronic fence data, improve data synchronization efficiency and real-time device management; it can not only effectively solve the data synchronization problem in offline scenarios, but also significantly reduce system operating costs, and improve the management efficiency and user experience of shared transportation.
[0029] The P2P-based central control system electronic fence synchronization method adopts P2P communication technology to realize the self-organizing network data transmission between devices, significantly reducing the dependence on the central server. Even in the case of unstable network or completely offline, the system can still keep the electronic fence data updated in time, effectively improving the stability and reliability of the shared vehicle management system. The regional block storage and incremental update mechanism are adopted, and the device only synchronizes the changed part of the electronic fence data in the area to which it belongs, avoiding redundant data transmission. At the same time, the amount of transmitted data is reduced by data compression technology, the communication overhead between devices is reduced, and the data synchronization efficiency is improved. In addition, the present invention designs a complete version control mechanism, ensures the orderliness of data update by comparing version numbers and timestamps, and adopts a data verification mechanism to verify the integrity and validity of transmitted data, prevents data damage or tampering, and ensures data consistency in a distributed environment. Compared with the traditional solution that relies on real-time network connection, the present invention reduces the dependence on mobile communication networks and reduces communication costs. Through mutual synchronization between devices, the load of the central server is reduced, and the server expansion and maintenance costs are reduced. At the same time, the present invention realizes the automatic synchronization and update of electronic fence data, ensuring that shared vehicles can obtain the latest operating rules in a timely manner. Compared with traditional solutions, it significantly improves the system response speed and improves the user experience. It not only solves the technical difficulties of data updating in offline environments, but also has significant advantages in transmission efficiency, data consistency and system cost. It provides an efficient and reliable solution for the electronic fence management of shared vehicles, which is of great significance to improving the level of shared vehicle operation management.
[0030] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A P2P-based central control system electronic fence synchronization method, characterized in that: The following steps are involved: S1: The electronic fence data is stored in blocks according to geographical areas; S2: The device is preset with the region identifier when it leaves the factory, and obtains the full data packet of the corresponding region from the central server when it is first connected to the network; S3: Each device maintains a dynamic version information table locally to record the data version status of the current region; S4: The device regularly broadcasts its own data version information through low-power Bluetooth BLE technology; S5: The device continues to scan the surrounding environment and establishes P2P communication with other devices in the same area through a preset handshake protocol; S6: After the connection is established, data version information is exchanged to verify the integrity and validity of the data. If passed, the local storage is updated and the version information table is modified.
2. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: In S1, each data block includes a version number, a timestamp, an area identifier, fence coordinate information, and related business rule configurations, and the division of data blocks is set according to the actual scope of the geographical area and the amount of data.
3. The P2P-based central control system electronic fence synchronization method according to claim 2, characterized in that: The data block adopts a hierarchical index structure. The header field contains the area identifier and the global version number, the body field stores the coordinate sequence and topological relationship of the geo-fence polygon, and the tail field is associated with the dynamic business rule configuration parameter set.
4. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: In S2, the area identifier adopts a unique coding method, and the area identifier of each device is unique and identifiable.
5. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: In S3, the data version status of the current region includes: the current region identifier, the data version number and the latest update timestamp, so as to implement the data synchronization mechanism of incremental update.
6. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: In S4, the broadcast information includes: area identification, data version number and timestamp, and the broadcast period is dynamically adjusted according to the power of the device and the data update frequency.
7. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: In S5, when other devices in the same area are found, a P2P communication connection is established through a preset handshake protocol, which specifically includes: exchanging device identity certificates through asymmetric encryption, negotiating symmetric encryption session keys, and establishing an end-to-end encrypted channel using the session keys.
8. The P2P-based central control system electronic fence synchronization method according to claim 1, characterized in that: The S6 comprises the following steps: After the connection is established, the devices first exchange detailed data version information, and determine whether data synchronization is required and the specific synchronization range by comparing the version number and timestamp; Data transmission adopts differential update mode, only the changed data content is transmitted; After obtaining new data, the receiver verifies the integrity and validity of the data through a verification mechanism. After the verification is passed, the local storage is updated and the version information table is modified.
9. The P2P-based central control system electronic fence synchronization method according to claim 8, characterized in that: The differential update method adopts a binary difference algorithm. The transmission content includes a version difference identifier and compressed incremental data. The incremental data is generated through the following steps: comparing the new and old version data blocks to generate a difference operation code, performing Huffman coding compression on the operation code and the associated data segment, and adding a header check field to form a transmission unit.
10. The P2P-based central control system electronic fence synchronization method according to claim 8, characterized in that: Verify the integrity and validity of data through the verification mechanism, including the following steps: Verify data integrity through the SHA-256 algorithm; Perform geo-fence closure detection and coordinate validity verification.
Citation Information
Cited By
Unmanned aircraft electronic fence credible release and operation verification system
CN121528034A