Data synchronization method based on periodic request pushing and continuous monitoring
Through the data synchronization method of periodic request push and continuous monitoring, automatic synchronization of user configuration and status information is realized between gateway stations, solving the problem of user information synchronization across the entire network in satellite networking, ensuring data consistency and integrity, and is applicable Data processing between gateways.
Patent Information
- Application Number
- CN202410854696.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
AI Technical Summary
During the satellite networking process, it is difficult for gateway stations to obtain user configuration or status information of other gateway stations, especially those that change frequently, such as user entry and exit status information, resulting in the management and control center being unable to synchronize users across the entire network in real time. information.
A data synchronization method based on periodic request push and continuous monitoring is adopted. Through a fully synchronous request and response mechanism, it ensures that user configuration and status information can be automatically synchronized between gateway stations. It has an error retransmission and transmission abort mechanism to ensure that data Consistency and completeness.
It realizes the automation of data synchronization between gateway stations, solves the problem that the management and control center cannot provide user information for the entire network, ensures the integrity and consistency of data transmission, and reduces the occupation of network resources.
Smart Images

Figure CN118714637A
Abstract
Description
Technical Field
[0001] The invention relates to the field of satellite communications, and in particular to a data synchronization method based on periodic request push and continuous monitoring. Background Art
[0002] At present, in the process of satellite networking, the users that each gateway can manage are limited to the users in the network that the gateway can manage. In the traditional mode, if a gateway wants to obtain the configuration or status information of other gateway users, the upper-level control center needs to send the corresponding information. However, for those data that change frequently, such as user entry and exit status information, the control center cannot inform the gateway. Therefore, when the gateway needs to manage the user configuration information and status information of the entire network, the gateways need to synchronize the user configuration information and status information they manage to the peer gateway.
[0003] Therefore, a data synchronization method needs to be designed to handle the data synchronization problem between gateways. Summary of the invention
[0004] In view of this, the present invention proposes a data synchronization method based on periodic request push and continuous monitoring. The present invention solves the problem that the control center cannot provide user information of the entire network, so that the gateway station can obtain the configuration information and status information of users of the entire network through synchronization; and the operation is simple, and it has the characteristics of automatic data synchronization and error retransmission, which is particularly suitable for data synchronization processing between gateway stations.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A data synchronization method based on periodic request push and continuous monitoring, where both gateways that need data synchronization periodically execute the following full synchronization request steps:
[0007] Every other heartbeat detection waiting cycle, it is determined whether there is a heartbeat from the opposite end gateway. If not, wait for the next heartbeat detection waiting cycle. If yes, first perform full synchronization locking, and generate the current timestamp and the local gateway number; then obtain the opposite end gateway number; finally send a full synchronization request to the opposite end gateway, the full synchronization request includes the local gateway number and the timestamp generated by the local gateway;
[0008] After the full synchronization request is completed, when the local gateway receives the synchronization data packet sent by the peer gateway, the following steps are performed:
[0009] The local gateway receives the synchronization data packet sent by the peer gateway, and determines whether the timestamp of the synchronization data packet is the same as the timestamp generated by the local gateway. If they are the same, the received synchronization data packet is stored in the temporary receiving buffer, and then a true response is returned to the peer gateway; if they are different, a false response is directly returned to the peer gateway;
[0010] After the full synchronization request is completed, when the local gateway sends a synchronization data packet to the peer gateway, the following steps are performed:
[0011] First, obtain the timestamp in the full synchronization request of the peer gateway, then retrieve the user information that needs to be synchronized and managed by the local gateway from the database, and calculate the number of packets to be sent based on the total amount of data to be synchronized and the amount of data to be sent each time. Then divide the user information to be synchronized into allCount parts, and each user information, the number of packets allCount, the packet index value of the current user information, and the timestamp in the full synchronization request of the peer gateway together constitute a synchronization data packet; finally, store allCount synchronization data packets in the temporary sending buffer in sequence;
[0012] The initial response result is false, and allCount synchronization data packets are sent in sequence. For each synchronization data packet sent, the following steps are performed:
[0013] First, determine whether there is a heartbeat from the peer gateway. If not, end the process and no more synchronization packets will be sent during this full synchronization process. If there is, send the current synchronization packet to the peer gateway and determine whether the response has timed out. If so, continue to determine whether there is a heartbeat from the peer gateway and try to send the current synchronization packet. At this time, if the peer gateway receives the same synchronization packet, it will return a response, but will not store the same synchronization packet in the temporary receiving buffer. If not, assign the returned response result to result and determine whether result is true. If so, continue to send the next synchronization packet until allCount synchronization packets have been sent successfully. If not, end the process and no more synchronization packets will be sent during this full synchronization process.
[0014] After the full synchronization request is completed, both gateways also perform the following monitoring steps:
[0015] After a listening waiting time, determine the data status in the temporary receiving buffer:
[0016] If there is no data in the temporary receiving buffer, it is determined that the synchronization data packet sent by the peer gateway has not been received, and the full synchronization fails. Then the temporary receiving buffer is cleared and the full synchronization request is made again;
[0017] If the allCount value in the temporary receive buffer is greater than the number of packet index values, it is determined that the synchronization data received by the full synchronization is incomplete and the full synchronization fails. Then the temporary receive buffer is cleared and the full synchronization request is made again;
[0018] If the allCount value in the temporary receive buffer is equal to the number of packet index values and both are greater than 0, it is determined that the synchronization data for full synchronization is complete and full synchronization is successful. The local gateway clears the old data information stored in the peer gateway, then releases the temporary receive buffer and stores the synchronization data packet in the database, and full synchronization is unlocked.
[0019] Due to the adoption of the above technical solution, the beneficial effects of the present invention compared with the prior art are:
[0020] 1. The present invention solves the problem that the control center cannot provide user information of the entire network, so that the information gateway can obtain the configuration information and status information of users of the entire network through synchronization.
[0021] 2. The present invention has an error retransmission mechanism to ensure the consistency and integrity of fully synchronized data.
[0022] 3. The present invention has a transmission suspension mechanism, which can terminate non-fully synchronous data transmission and reduce network resource usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Schematic diagram of the process of full synchronization request in an embodiment of the present invention.
[0024] Figure 2 The figure is a schematic diagram of a process of receiving a synchronization data packet in an embodiment of the present invention.
[0025] Figure 3 Schematic diagram of the monitoring process in an embodiment of the present invention.
[0026] Figure 4 The figure is a schematic diagram of a process of sending a synchronization data packet in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0028] A data synchronization method based on periodic request push and continuous monitoring divides the parameter synchronization process into two independent processes by analyzing the network environment and parameter characteristics. The parameter synchronization process is divided into two independent processes. Process one is a periodic request synchronization data process, which can be divided into three processes, A, B, and C. Process A is used to periodically send full synchronization requests, process B is used to receive data synchronized from the other end, and process C is used to continuously monitor whether the data synchronized from the other end meets the conditions to further determine the synchronization result; process two is the process of sending synchronization data.
[0029] The three sub-processes ABC in process one require the setting of auxiliary cache or auxiliary database. Now let’s take cache as an example to explain.
[0030] The cache name for receiving full synchronization data is userConfStatusCounterCache. The class of this object contains three properties. The first is the total number of packets allCount that need to be sent for this full synchronization. The second is the received index set. The third is the full synchronization data object class.
[0031] like Figure 1 As shown, process A is a periodic request:
[0032] The function of process A is to periodically send full synchronization requests to the peer gateway.
[0033] A1. The cycle executes the following process;
[0034] A1.1 Determine whether there is a heartbeat to the peer gateway. If not, wait for the next execution. If yes, continue to execute.
[0035] A1.2 Full synchronization locking, the locking process can be understood as setting a flag, represented by allSyncIsRunningFlag, that is, allSyncIsRunningFlag is set to true, and the current timestamp is generated as onlyAllSyncTimestamp and the gateway number of the self;
[0036] A1.3 obtains the peer gateway ID and initializes the userConfStatusCounterCache cache to receive new full synchronization data;
[0037] A1.4 sends a full synchronization request to the peer gateway.
[0038] like Figure 2 As shown, process B is to receive the synchronization data sent by the peer gateway:
[0039] B1. Receive synchronization data sent by the peer gateway;
[0040] B2. Determine whether the timestamp of the data sent is the same as the timestamp generated by the gateway in process A;
[0041] B2.1 If they are the same, the received data is put into the temporary cache userConfStatusCounterCache for subsequent use. The temporary cache includes the number of packages allCount and the set of package index values that need to be pushed for a full synchronization, and the response is returned as true;
[0042] B2.2 If they are different, the response is returned as false, notifying the other party that the timestamp of the full synchronization data sent by the peer gateway in this round is inconsistent with the timestamp onlyAllSyncTimestamp of the full synchronization requested by this gateway, that is, the full synchronization data received by this gateway at this time is not the latest request of this gateway. At this time, the peer gateway that receives the response to the old timestamp will stop sending the full synchronization data with the old timestamp, thereby reducing the occupation of network resources by invalid data.
[0043] like Figure 3 As shown, process C is a continuous monitoring process, which is used to monitor whether the data received in process B is complete. The steps of process C are as follows:
[0044] C1. If the current full synchronization lock is executed, execute the subsequent steps, otherwise wait for the next cycle;
[0045] C2. Set the duration of a monitoring wait, and the program will sleep during this period;
[0046] C3. After the time is up, the temporary cache userConfStatusCounterCache in process B is conditionally determined. At this time, the determination can be divided into three types;
[0047] C3.1 If there is no data in the cache, it means that the data pushed by the peer gateway has not been received, and the full synchronization has failed. Then the temporary receiving cache is cleared and process A is called again to execute the synchronization request;
[0048] C3.2 If the value of allCount in the cache is greater than the number of indexes in the index set, it means that part of the full synchronization data has been received, but the data is incomplete and the full synchronization fails. Then the temporary receiving cache is cleared and process A is called again to execute the synchronization request;
[0049] C3.3 If the value of allCount in the cache is equal to the number of indexes in the index set and both are greater than 0, it means that the fully synchronized data has been received and the data is complete. At this time, the full synchronization is successful, the local gateway clears the old data information stored in the peer gateway, releases the data in the temporary cache userConfStatusCounterCache, stores the data in the database, unlocks the full synchronization, and sets the value of allSyncIsRunningFlag to false. Specifically, the old data information stored in the peer gateway includes database data, etc.
[0050] Process 1 is that the local gateway sends a full synchronization request to the peer gateway and receives the data synchronized by the peer gateway.
[0051] The second process is that the local gateway receives the data synchronization request sent by the other gateway and synchronizes all of its own user information to the other gateway.
[0052] like Figure 4 As shown, the steps of process two are as follows:
[0053] 1. Get the timestamp of the request sent by the other end;
[0054] 2. Execute push tasks;
[0055] 2.1 Take the data of the gateway ID of this message from the database and put it into the temporary cache. According to the total number of data to be synchronized and the number of data to be sent in each packet, decide whether to send allCount times;
[0056] 2.2 The initialization response result is false;
[0057] 2.3 Send allCount data packets in a loop, that is, the peer gateway must receive all these allCount packets before it considers that the user information is fully synchronized.
[0058] 2.3.1 Start the loop and determine whether there is a heartbeat to the peer gateway. If yes, push the data to the peer gateway. If no, exit the loop of sending allCount packets of data, that is, no more data will be pushed in this full synchronization.
[0059] 2.3.2 Determine whether sending timeout occurs;
[0060] 2.3.2.1 If the sending does not time out, obtain the response result and assign it to result, and execute 2.3.3;
[0061] 2.3.2.2 If the sending timeout occurs, it means that the data synchronization of this packet has failed, and the cycle of 2.3.1 will continue until the data transmission of this packet is successful or the heartbeat of the peer gateway is lost; at this time, if the peer gateway receives the same synchronization data packet, it will return a response, but will not store the same synchronization data packet in the temporary receiving buffer;
[0062] 2.3.3 The data of this packet is sent, and the result is judged to be true;
[0063] 2.3.3.1 If result is true, execute 2.3 and send the next data packet;
[0064] 2.3.3.2 If result is false, that is, the peer gateway believes that the timestamp of the full synchronization data sent by us this time is inconsistent with the timestamp of the full synchronization required by the peer, that is, the full synchronization data sent by us this round are all invalid data. We should stop sending data in this round of full synchronization to reduce network resource usage, so we should jump out of the data sending loop of allCount packets, that is, no data will be pushed in this full synchronization.
[0065] In summary, the present invention solves the problem that the control center cannot provide user information of the entire network, so that the gateway station can obtain user configuration information and status information of the entire network through synchronization; and it is simple to operate, has the characteristics of automatic data synchronization and error retransmission, and is particularly suitable for data synchronization processing between gateway stations.
[0066] Those skilled in the art will appreciate that the embodiments described are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to the embodiments described. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A data synchronization method based on periodic request push and continuous monitoring, characterized in that: Both gateways that need data synchronization periodically execute the following full synchronization request steps: Every other heartbeat detection waiting cycle, it is determined whether there is a heartbeat from the opposite end gateway. If not, wait for the next heartbeat detection waiting cycle. If yes, first perform full synchronization locking, and generate the current timestamp and the local gateway number; then obtain the opposite end gateway number; finally send a full synchronization request to the opposite end gateway, the full synchronization request includes the local gateway number and the timestamp generated by the local gateway; After the full synchronization request is completed, when the local gateway receives the synchronization data packet sent by the peer gateway, the following steps are performed: The local gateway receives the synchronization data packet sent by the peer gateway, and determines whether the timestamp of the synchronization data packet is the same as the timestamp generated by the local gateway. If they are the same, the received synchronization data packet is stored in the temporary receiving buffer, and then a true response is returned to the peer gateway; if they are different, a false response is directly returned to the peer gateway; After the full synchronization request is completed, when the local gateway sends a synchronization data packet to the peer gateway, the following steps are performed: First, obtain the timestamp in the full synchronization request of the peer gateway, then retrieve the user information that needs to be synchronized and managed by the local gateway from the database, and calculate the number of packets to be sent based on the total amount of data to be synchronized and the amount of data to be sent each time. Then divide the user information to be synchronized into allCount parts, and each user information, the number of packets allCount, the packet index value of the current user information, and the timestamp in the full synchronization request of the peer gateway together constitute a synchronization data packet; finally, store allCount synchronization data packets in the temporary sending buffer in sequence; The initial response result is false, and allCount synchronization data packets are sent in sequence. For each synchronization data packet sent, the following steps are performed: First, determine whether there is a heartbeat from the peer gateway. If not, end the process and no more synchronization packets will be sent during this full synchronization process. If there is, send the current synchronization packet to the peer gateway and determine whether the response has timed out. If so, continue to determine whether there is a heartbeat from the peer gateway and try to send the current synchronization packet. At this time, if the peer gateway receives the same synchronization packet, it will return a response, but will not store the same synchronization packet in the temporary receiving buffer. If not, assign the returned response result to result and determine whether result is true. If so, continue to send the next synchronization packet until allCount synchronization packets have been sent successfully. If not, end the process and no more synchronization packets will be sent during this full synchronization process. After the full synchronization request is completed, both gateways also perform the following monitoring steps: After a listening waiting time, determine the data status in the temporary receiving buffer: If there is no data in the temporary receiving buffer, it is determined that the synchronization data packet sent by the peer gateway has not been received, and the full synchronization fails. Then the temporary receiving buffer is cleared and the full synchronization request is made again; If the allCount value in the temporary receive buffer is greater than the number of packet index values, it is determined that the synchronization data received by the full synchronization is incomplete and the full synchronization fails. Then the temporary receive buffer is cleared and the full synchronization request is made again; If the allCount value in the temporary receive buffer is equal to the number of packet index values and both are greater than 0, it is determined that the synchronization data for full synchronization is complete and full synchronization is successful. The local gateway clears the old data information stored in the peer gateway, then releases the temporary receive buffer and stores the synchronization data packet in the database, and full synchronization is unlocked.
