Alternately updating cluster network mutual synchronization method, device and equipment and storage medium
Patent Information
- Application Number
- CN202311743289.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-12-15
AI Technical Summary
[0004]本发明的主要目的在于提供一种交替更新分簇网互同步方法、装置、设备及存储介质,旨在解决现有技术中同步方案中平均计算方法收敛速度慢,导致网络需要更多次迭代才能同步收敛,影响节点的入网时间,网络抗毁性较差;而权重计算方法实现难度和代价都较大的技术问题
[0036]本发明提出的交替更新分簇网互同步方法,通过获取分簇网的当前场景,在所述当前场景为网络初始化阶段场景时,在前M次迭代中更新所有子网蔟的首节点时钟;从M+1次迭代开始更新所有子网蔟中非蔟首节点;在更新所述非蔟首节点N次后,重新调整所述首节点时钟,并重新更新所述非蔟首节点,直至达到预设初始化同步次数,能够降低互同步方案的复杂度,提升了分簇网同步的实用性,提高了分簇网的网络时间全局收敛的收敛速度,保证了交替更新分簇网互同步的准确性和稳定性,提高了交替更新分簇网互同步的速度和效率。
Smart Images

Figure CN117693012B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of self-organizing network synchronization technology, and in particular to a method, apparatus, device and storage medium for alternating update of clustered network mutual synchronization. Background Technology
[0002] In a self-organizing network system, keeping the time of each node synchronized is a prerequisite for normal communication between nodes. For networks with a large number of nodes, the distributed mutual synchronization scheme has better robustness and effectiveness than the master-slave synchronization scheme, and therefore has become the core synchronization technology of self-organizing network systems.
[0003] Existing synchronization techniques include the average calculation scheme and the weighted calculation scheme. However, the average calculation scheme has a slow convergence speed, requiring more iterations for the network to converge, which affects the node's entry time and the network's resilience. While the weighted calculation scheme has the advantage of fast convergence speed, in real-world networks, the actual connectivity of nodes is constantly changing. To implement the weighted calculation scheme, nodes in the network need to continuously count the number of neighboring nodes they interact with and broadcast this data to their neighbors in real time. Therefore, the implementation is difficult and costly, making it impractical. Summary of the Invention
[0004] The main objective of this invention is to provide an alternating update cluster network synchronization method, apparatus, device, and storage medium, aiming to solve the technical problems of slow convergence speed of the average calculation method in the existing synchronization scheme, which leads to the network needing more iterations to achieve synchronization convergence, affecting the node's entry time and resulting in poor network resilience; and the high difficulty and cost of implementing the weight calculation method.
[0005] In a first aspect, the present invention provides an alternating update cluster network mutual synchronization method, the alternating update cluster network mutual synchronization method comprising the following steps:
[0006] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, update the clock of the first node of all sub-network clusters in the first M iterations.
[0007] Starting from the M+1th iteration, update all non-cluster head nodes in all subnet clusters;
[0008] After updating the non-cluster head node N times, the clock of the head node is readjusted, and the non-cluster head nodes are updated again until the preset number of initial synchronization times is reached.
[0009] Optionally, when obtaining the current scenario of the clustered network, and the current scenario is a network initialization phase scenario, updating the clock of the first node of all sub-network clusters in the first M iterations includes:
[0010] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase, obtain the local clock adjustment amount of each cluster head node.
[0011] The clock of the first node of all subnets is updated in the first M iterations based on the local clock adjustment amount. During the update process, the updated first node interacts with other first nodes of the subnet, but the updated first node does not interact with ordinary nodes in the subnet.
[0012] Optionally, when obtaining the current scenario of the clustered network, if the current scenario is a network initialization phase scenario, obtaining the local clock adjustment amount of each cluster leader node includes:
[0013] To obtain the current scenario of the clustered network, when the current scenario is the network initialization phase, the local clock adjustment amount of each cluster leader node is obtained using the following formula:
[0014]
[0015] Where ΔT1 is the local clock adjustment amount, h_n is the number of cluster head nodes adjacent to the current cluster head node to be updated, and Δt h_1 Let Δt be the clock offset between cluster head node h_1 and the new cluster head node to be updated. h_2 Δt represents the clock offset between cluster head node h_2 and the new cluster head node to be updated. h_n This represents the clock offset between the cluster head node h_n and the new cluster head node to be updated.
[0016] Optionally, updating all non-cluster head nodes in all subnet clusters starting from the M+1th iteration includes:
[0017] Obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters;
[0018] Based on the clock adjustment amount of the non-cluster head node, all non-cluster head nodes in the subnet clusters are updated starting from the M+1th iteration.
[0019] Optionally, obtaining the clock adjustment amount of non-cluster head nodes in all subnet clusters includes:
[0020] The clock adjustment amount for non-cluster head nodes in all subnet clusters is obtained using the following formula:
[0021]
[0022] Where ΔT2 is the clock adjustment amount of the non-cluster head node to be updated, n is the number of non-cluster head nodes adjacent to the non-cluster head node to be updated, and Δt h Δt represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. sn_1Δt represents the clock offset between the non-cluster head adjacent node sn_1 within the subnet and the currently pending update non-cluster head node. sn_n This represents the clock offset between the non-cluster head adjacent node sn_n within the subnet and the currently pending update non-cluster head node.
[0023] Optionally, the step of readjusting the clock of the first node and updating the non-cluster first nodes after updating the non-cluster first nodes N times, until a preset number of initial synchronizations is reached, includes:
[0024] When the current scenario is a sporadic node joining the network, the communication status between the sporadic nodes and the cluster nodes is obtained;
[0025] Based on the communication situation, clustered network synchronization is determined for the scattered nodes.
[0026] Optionally, determining to perform clustered network synchronization on the scattered nodes based on the communication situation includes:
[0027] The current communication network is determined based on the communication situation, and the corresponding target clustering algorithm is selected based on the current communication network.
[0028] The communication status is communicated to the head node of the subnet to which the scattered node belongs, as well as to other nodes in the current cluster, according to the target clustering algorithm.
[0029] After determining the target cluster head node of the scattered nodes, the target cluster head node in all subnets is updated starting from the M+1th iteration.
[0030] Secondly, to achieve the above objectives, the present invention also proposes an alternating update cluster network synchronization device, the alternating update cluster network synchronization device comprising:
[0031] The clock update module is used to obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, it updates the clock of the first node of all sub-network clusters in the first M iterations.
[0032] The node update module is used to update all non-cluster head nodes in all subnet clusters starting from the M+1th iteration;
[0033] The synchronization module is used to readjust the clock of the first node and update the non-cluster first node again after updating the non-cluster first node N times, until the preset number of initial synchronization times is reached.
[0034] Thirdly, to achieve the above objectives, the present invention also proposes an alternating update cluster network synchronization device, the alternating update cluster network synchronization device comprising: a memory, a processor, and an alternating update cluster network synchronization program stored in the memory and executable on the processor, the alternating update cluster network synchronization program being configured to implement the steps of the alternating update cluster network synchronization method described above.
[0035] Fourthly, to achieve the above objectives, the present invention also proposes a storage medium storing an alternating update cluster network synchronization program, wherein the alternating update cluster network synchronization program, when executed by a processor, implements the steps of the alternating update cluster network synchronization method described above.
[0036] The proposed alternating update cluster network mutual synchronization method obtains the current scenario of the cluster network. When the current scenario is the network initialization phase, it updates the clock of the first node of all sub-clusters in the first M iterations. Starting from the M+1th iteration, it updates the non-cluster first nodes in all sub-clusters. After updating the non-cluster first nodes N times, it readjusts the clock of the first node and updates the non-cluster first nodes again until the preset number of initialization synchronizations is reached. This reduces the complexity of the mutual synchronization scheme, improves the practicality of cluster network synchronization, increases the convergence speed of the global convergence of the network time of the cluster network, ensures the accuracy and stability of the alternating update cluster network mutual synchronization, and improves the speed and efficiency of the alternating update cluster network mutual synchronization. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention;
[0038] Figure 2 This is a flowchart illustrating the first embodiment of the alternating update cluster network synchronization method of the present invention;
[0039] Figure 3 This is a flowchart illustrating the second embodiment of the alternating update cluster network synchronization method of the present invention;
[0040] Figure 4 This is a flowchart illustrating the third embodiment of the alternating update cluster network synchronization method of the present invention;
[0041] Figure 5 This is a flowchart illustrating the fourth embodiment of the alternating update cluster network synchronization method of the present invention;
[0042] Figure 6 This is a flowchart illustrating the fifth embodiment of the alternating update cluster network synchronization method of the present invention;
[0043] Figure 7This is a functional block diagram of the first embodiment of the alternating update cluster network synchronization device of the present invention.
[0044] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0045] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0046] The solution of this invention mainly involves: obtaining the current scenario of the clustered network; when the current scenario is the network initialization phase, updating the clock of the first node of all sub-clusters in the first M iterations; starting from the M+1th iteration, updating the non-cluster first nodes in all sub-clusters; after updating the non-cluster first nodes N times, readjusting the clock of the first node and updating the non-cluster first nodes again, until the preset number of initialization synchronizations is reached. This reduces the complexity of the mutual synchronization scheme, improves the practicality of clustered network synchronization, increases the convergence speed of the global convergence of the network time of the clustered network, ensures the accuracy and stability of the alternating update of the clustered network mutual synchronization, and improves the speed and efficiency of the alternating update of the clustered network mutual synchronization. It solves the technical problems of slow convergence speed of the average calculation method in the existing synchronization scheme, which leads to the network needing more iterations to synchronize and converge, affecting the node entry time and resulting in poor network resilience; and the high difficulty and cost of implementing the weight calculation method.
[0047] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0048] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1The device structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0050] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating device, a network communication module, a user interface module, and an alternating update cluster network synchronization program.
[0051] The device of the present invention calls the alternating update cluster network synchronization program stored in the memory 1005 through the processor 1001, and performs the following operations:
[0052] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, update the clock of the first node of all sub-network clusters in the first M iterations.
[0053] Starting from the M+1th iteration, update all non-cluster head nodes in all subnet clusters;
[0054] After updating the non-cluster head node N times, the clock of the head node is readjusted, and the non-cluster head nodes are updated again until the preset number of initial synchronization times is reached.
[0055] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0056] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase, obtain the local clock adjustment amount of each cluster head node.
[0057] The clock of the first node of all subnets is updated in the first M iterations based on the local clock adjustment amount. During the update process, the updated first node interacts with other first nodes of the subnet, but the updated first node does not interact with ordinary nodes in the subnet.
[0058] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0059] To obtain the current scenario of the clustered network, when the current scenario is the network initialization phase, the local clock adjustment amount of each cluster leader node is obtained using the following formula:
[0060]
[0061] Where ΔT1 is the local clock adjustment amount, h_n is the number of cluster head nodes adjacent to the current cluster head node to be updated, and Δt h_1 Let Δt be the clock offset between cluster head node h_1 and the new cluster head node to be updated. h_2Δt represents the clock offset between cluster head node h_2 and the new cluster head node to be updated. h_n This represents the clock offset between the cluster head node h_n and the new cluster head node to be updated.
[0062] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0063] Obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters;
[0064] Based on the clock adjustment amount of the non-cluster head node, all non-cluster head nodes in the subnet clusters are updated starting from the M+1th iteration.
[0065] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0066] The clock adjustment amount for non-cluster head nodes in all subnet clusters is obtained using the following formula:
[0067]
[0068] Where ΔT2 is the clock adjustment amount of the non-cluster head node to be updated, n is the number of non-cluster head nodes adjacent to the non-cluster head node to be updated, and Δt h Δt represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. sn_1 Δt represents the clock offset between the non-cluster head adjacent node sn_1 within the subnet and the currently pending update non-cluster head node. sn_n This represents the clock offset between the non-cluster head adjacent node sn_n within the subnet and the currently pending update non-cluster head node.
[0069] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0070] When the current scenario is a sporadic node joining the network, the communication status between the sporadic nodes and the cluster nodes is obtained;
[0071] Based on the communication situation, clustered network synchronization is determined for the scattered nodes.
[0072] The device of the present invention, through processor 1001 calling the alternating update cluster network inter-synchronization program stored in memory 1005, also performs the following operations:
[0073] The current communication network is determined based on the communication situation, and the corresponding target clustering algorithm is selected based on the current communication network.
[0074] The communication status is communicated to the head node of the subnet to which the scattered node belongs, as well as to other nodes in the current cluster, according to the target clustering algorithm.
[0075] After determining the target cluster head node of the scattered nodes, the target cluster head node in all subnets is updated starting from the M+1th iteration.
[0076] This embodiment, through the above-described scheme, obtains the current scenario of the clustered network. When the current scenario is the network initialization phase, it updates the clock of the first node of all sub-clusters in the first M iterations; starting from the M+1th iteration, it updates the non-cluster first nodes in all sub-clusters; after updating the non-cluster first nodes N times, it readjusts the clock of the first node and updates the non-cluster first nodes again until the preset number of initialization synchronizations is reached. This reduces the complexity of the mutual synchronization scheme, improves the practicality of clustered network synchronization, increases the convergence speed of the global convergence of the network time of the clustered network, ensures the accuracy and stability of the alternating update of the clustered network mutual synchronization, and improves the speed and efficiency of the alternating update of the clustered network mutual synchronization.
[0077] Based on the above hardware structure, an embodiment of the alternating update cluster network mutual synchronization method of the present invention is proposed.
[0078] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the alternating update cluster network synchronization method of the present invention.
[0079] In the first embodiment, the alternating update cluster network synchronization method includes the following steps:
[0080] Step S10: Obtain the current scenario of the sub-cluster network. When the current scenario is the network initialization phase scenario, update the clock of the first node of all sub-network clusters in the first M iterations.
[0081] It should be noted that after obtaining the current scenario of the sub-cluster network, when the current scenario is the network initialization phase, the clock of the first node of the cluster can be iteratively updated, that is, the clock of the first node of all sub-clusters can be updated in the first M iterations.
[0082] Step S20: Starting from the M+1th iteration, update all non-cluster head nodes in all subnet clusters.
[0083] It should be understood that after updating the clock of the first node of all subnet clusters, all subnet clusters can be updated starting from the M+1th iteration.
[0084] Step S30: After updating the non-cluster head node N times, readjust the clock of the head node and update the non-cluster head node again until the preset number of initialization synchronizations is reached.
[0085] It is understandable that after updating the non-cluster head node N times, the clock of the cluster head node can be readjusted, and the non-cluster head nodes can be updated again until the preset number of initial synchronizations is reached.
[0086] In a specific implementation, after updating the non-cluster head nodes N times, the clock of the cluster head node can be adjusted, and then the non-cluster head nodes in all subnets can be updated starting from the M+1th iteration. This process is repeated alternately until the preset number of iterations is reached.
[0087] This embodiment, through the above-described scheme, obtains the current scenario of the clustered network. When the current scenario is the network initialization phase, it updates the clock of the first node of all sub-clusters in the first M iterations; starting from the M+1th iteration, it updates the non-cluster first nodes in all sub-clusters; after updating the non-cluster first nodes N times, it readjusts the clock of the first node and updates the non-cluster first nodes again until the preset number of initialization synchronizations is reached. This reduces the complexity of the mutual synchronization scheme, improves the practicality of clustered network synchronization, increases the convergence speed of the global convergence of the network time of the clustered network, ensures the accuracy and stability of the alternating update of the clustered network mutual synchronization, and improves the speed and efficiency of the alternating update of the clustered network mutual synchronization.
[0088] Furthermore, Figure 3 This is a flowchart illustrating the second embodiment of the alternating update cluster network synchronization method of the present invention, as shown below. Figure 3 As shown, based on the first embodiment, a second embodiment of the alternating update cluster network synchronization method of the present invention is proposed. In this embodiment, step S10 specifically includes the following steps:
[0089] Step S11: Obtain the current scenario of the cluster network. When the current scenario is the network initialization phase scenario, obtain the local clock adjustment amount of each cluster head node.
[0090] It should be noted that after obtaining the current scenario of the cluster network, different data synchronization strategies can be adopted according to the current scenario of the cluster network. When the current scenario is the network initialization phase, the local clock adjustment amount of each cluster node is obtained.
[0091] Step S12: Update the clock of the first node of all subnet clusters in the first M iterations according to the local clock adjustment amount. During the update process, the updated cluster head node interacts with other cluster head nodes. The updated cluster head node does not interact with ordinary nodes in the subnet.
[0092] It is understandable that in the first M iterations, the clocks of all subnet cluster head nodes are updated, and during the update process, the updated cluster head nodes only interact with information from other cluster head nodes and not with ordinary nodes within the subnet. The clocks of all subnet cluster head nodes can be updated according to the local clock adjustment amount.
[0093] Furthermore, step S12 specifically includes the following steps:
[0094] To obtain the current scenario of the clustered network, when the current scenario is the network initialization phase, the local clock adjustment amount of each cluster leader node is obtained using the following formula:
[0095]
[0096] Where ΔT1 is the local clock adjustment amount, h_n is the number of cluster head nodes adjacent to the current cluster head node to be updated, and Δt h_1 Let Δt be the clock offset between cluster head node h_1 and the new cluster head node to be updated. h_2 Δt represents the clock offset between cluster head node h_2 and the new cluster head node to be updated. h_n This represents the clock offset between the cluster head node h_n and the new cluster head node to be updated.
[0097] It should be understood that the adjustment amount of the local clock of each cluster head node is as shown in the above formula, and nodes h_1, h_2, ... h_n all belong to the cluster head node.
[0098] This embodiment, through the above scheme, obtains the current scenario of the clustered network. When the current scenario is the network initialization phase, it obtains the local clock adjustment amount of each cluster head node. Based on the local clock adjustment amount, it updates the clock of the head node of all sub-network clusters in the first M iterations. During the update process, the updated cluster head node interacts with other cluster head nodes. The updated cluster head node does not interact with ordinary nodes in the sub-network, which can reduce the complexity of the mutual synchronization scheme and improve the practicality of clustered network synchronization.
[0099] Furthermore, Figure 4 This is a flowchart illustrating the third embodiment of the alternating update cluster network synchronization method of the present invention, as shown below. Figure 4 As shown, based on the first embodiment, a third embodiment of the alternating update cluster network synchronization method of the present invention is proposed. In this embodiment, step S20 specifically includes the following steps:
[0100] Step S21: Obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters.
[0101] It should be noted that each non-cluster leader node in all subnets has a corresponding non-cluster leader node clock adjustment amount.
[0102] Furthermore, step S21 specifically includes the following steps:
[0103] The clock adjustment amount for non-cluster head nodes in all subnet clusters is obtained using the following formula:
[0104]
[0105] Where ΔT2 is the clock adjustment amount of the non-cluster head node to be updated, n is the number of non-cluster head nodes adjacent to the non-cluster head node to be updated, and Δt h Δt represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. sn_1 Δt represents the clock offset between the non-cluster head adjacent node sn_1 within the subnet and the currently pending update non-cluster head node. sn_n This represents the clock offset between the non-cluster head adjacent node sn_n within the subnet and the currently pending update non-cluster head node.
[0106] It should be understood that the adjustment amount of the node's local clock is as shown in the above formula, where node h is the cluster head node of the subnet to which the node is located, and nodes sn_1, sn_2, ..., sn_n are ordinary adjacent nodes in the subnet.
[0107] Step S22: Update all non-cluster head nodes in all subnets starting from the M+1th iteration according to the non-cluster head node clock adjustment amount.
[0108] It is understandable that, starting from the M+1th iteration, all non-cluster head nodes in the subnet are updated, and the node exchanges information with all adjacent nodes, including the cluster head node.
[0109] This embodiment, through the above scheme, obtains the clock adjustment amount of non-cluster head nodes in all sub-clusters; and updates all non-cluster head nodes in all sub-clusters starting from the M+1th iteration based on the clock adjustment amount of the non-cluster head nodes. This reduces the complexity of the mutual synchronization scheme, improves the practicality of cluster network synchronization, and increases the convergence speed of global network time convergence in the cluster network.
[0110] Furthermore, Figure 5 This is a flowchart illustrating the fourth embodiment of the alternating update cluster network synchronization method of the present invention, as shown below. Figure 5 As shown, based on the first embodiment, a fourth embodiment of the alternating update cluster network synchronization method of the present invention is proposed. In this embodiment, step S30 specifically includes the following steps:
[0111] Step S40: When the current scenario is a sporadic node joining the network scenario, obtain the communication status between the sporadic node and the cluster node.
[0112] It should be noted that when the current scenario is a sporadic node joining the network, the communication status between the current node of the sporadic node and the cluster node can be obtained.
[0113] Step S50: Based on the communication situation, determine to perform cluster network mutual synchronization on the scattered nodes.
[0114] It is understandable that the communication situation is used to determine the clustering and inter-synchronization of the scattered nodes.
[0115] This embodiment, through the above-described scheme, obtains the communication status between the scattered nodes and the cluster leader node when the current scenario is a scenario of scattered nodes joining the network; and determines to perform cluster network mutual synchronization on the scattered nodes based on the communication status. This reduces the complexity of the mutual synchronization scheme, improves the practicality of cluster network synchronization, increases the convergence speed of the global convergence of the network time of the cluster network, ensures the accuracy and stability of the alternating update of the cluster network mutual synchronization, and improves the speed and efficiency of the alternating update of the cluster network mutual synchronization.
[0116] Furthermore, Figure 6 This is a flowchart illustrating the fifth embodiment of the alternating update cluster network synchronization method of the present invention, as shown below. Figure 6 As shown, based on the fourth embodiment, a fifth embodiment of the alternating update cluster network synchronization method of the present invention is proposed. In this embodiment, step S50 specifically includes the following steps:
[0117] Step S51: Determine the current communication network based on the communication situation, and select the corresponding target clustering algorithm based on the current communication network.
[0118] It should be noted that the current communication network can be determined based on the communication situation, and then the corresponding target clustering algorithm can be selected based on the current communication network.
[0119] Step S52: Inform the head node of the subnet to which the scattered node belongs and other nodes in the current cluster of the communication status according to the target clustering algorithm.
[0120] It is understood that, according to the target clustering algorithm, the communication status can be communicated to the head node of the subnet to which the scattered node belongs, as well as to other nodes in the current cluster.
[0121] Step S53: After determining the target cluster head node of the scattered nodes, update the target cluster head node in all subnets starting from the M+1th iteration.
[0122] It should be understood that after determining the target cluster head node of the scattered nodes, the target cluster head node in all subnets can be updated starting from the M+1th iteration.
[0123] In practical implementation, in the scenario of sporadic node joining the network, for a network that has already been synchronized and converged, the synchronization steps when a new node needs to join the network are as follows:
[0124] 1) Based on the communication between the node and the cluster head node, and according to the clustering algorithm used by the network, inform the cluster head node of the subnet to which the node belongs, as well as other nodes in the cluster; (the clustering algorithm of the node is not the focus of this paper, and it is assumed that the network has this module)
[0125] 2) After determining its own cluster head node, the target cluster head node in all subnets is updated starting from the M+1th iteration.
[0126] This embodiment, through the above scheme, determines the current communication network based on the communication situation, selects the corresponding target clustering algorithm based on the current communication network, and informs the cluster head node of the subnet to which the sporadic node belongs and other nodes in the current cluster of the communication situation according to the target clustering algorithm. After determining the target cluster head node of the sporadic node, the target cluster head node in all subnet clusters is updated starting from the M+1th iteration. This reduces the complexity of the mutual synchronization scheme, improves the practicality of cluster network synchronization, increases the convergence speed of the global convergence of the network time of the cluster network, ensures the accuracy and stability of the alternating update of the cluster network mutual synchronization, and improves the speed and efficiency of the alternating update of the cluster network mutual synchronization.
[0127] Accordingly, the present invention further provides an alternating update cluster network synchronization device.
[0128] Reference Figure 7 , Figure 7 This is a functional block diagram of the first embodiment of the alternating update cluster network synchronization device of the present invention.
[0129] In a first embodiment of the alternating update cluster network synchronization device of the present invention, the alternating update cluster network synchronization device includes:
[0130] The clock update module 10 is used to obtain the current scenario of the sub-cluster network. When the current scenario is the network initialization phase scenario, it updates the clock of the first node of all sub-network clusters in the first M iterations.
[0131] The node update module 20 is used to update all non-cluster head nodes in all subnets starting from the M+1th iteration.
[0132] The synchronization module 30 is used to readjust the clock of the first node and update the non-cluster first node again after updating the non-cluster first node N times, until the preset number of initial synchronization times is reached.
[0133] The clock update module 10 is also used to obtain the current scenario of the cluster network. When the current scenario is the network initialization phase scenario, it obtains the local clock adjustment amount of each cluster head node. Based on the local clock adjustment amount, it updates the clock of the head node of all subnet clusters in the first M iterations. During the update process, the updated cluster head node interacts with other cluster head nodes. The updated cluster head node does not interact with ordinary nodes in the subnet.
[0134] The clock update module 10 is also used to obtain the current scenario of the cluster network. When the current scenario is the network initialization phase, the local clock adjustment amount of each cluster head node is obtained by the following formula:
[0135]
[0136] Where ΔT1 is the local clock adjustment amount, h_n is the number of cluster head nodes adjacent to the current cluster head node to be updated, and Δt h_1 Let Δt be the clock offset between cluster head node h_1 and the new cluster head node to be updated. h_2 Δt represents the clock offset between cluster head node h_2 and the new cluster head node to be updated. h_n This represents the clock offset between the cluster head node h_n and the new cluster head node to be updated.
[0137] The node update module 20 is also used to obtain the clock adjustment amount of non-cluster head nodes in all sub-network clusters; and update all non-cluster head nodes in all sub-network clusters starting from the M+1th iteration according to the non-cluster head node clock adjustment amount.
[0138] The clock update module 10 is also used to obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters using the following formula:
[0139]
[0140] Where ΔT2 is the clock adjustment amount of the non-cluster head node to be updated, n is the number of non-cluster head nodes adjacent to the non-cluster head node to be updated, and Δt h Δt represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. sn_1 Δt represents the clock offset between the non-cluster head adjacent node sn_1 within the subnet and the currently pending update non-cluster head node. sn_n This represents the clock offset between the non-cluster head adjacent node sn_n within the subnet and the currently pending update non-cluster head node.
[0141] The synchronization module 30 is also used to obtain the communication status between the scattered nodes and the cluster nodes when the current scenario is a scenario of scattered nodes joining the network; and to determine to perform cluster network mutual synchronization on the scattered nodes based on the communication status.
[0142] The synchronization module 30 is further configured to determine the current communication network based on the communication situation, select the corresponding target clustering algorithm based on the current communication network, inform the cluster head node of the subnet to which the sporadic node belongs and other nodes in the current cluster of the communication situation based on the target clustering algorithm, and update the target cluster head node in all subnet clusters starting from the M+1th iteration after determining the target cluster head node of the sporadic node.
[0143] The steps for implementing the various functional modules of the alternating update cluster network synchronization device can be referred to in the various embodiments of the alternating update cluster network synchronization method of the present invention, and will not be repeated here.
[0144] Furthermore, embodiments of the present invention also propose a storage medium storing an alternating update cluster network synchronization program, which, when executed by a processor, performs the following operations:
[0145] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, update the clock of the first node of all sub-network clusters in the first M iterations.
[0146] Starting from the M+1th iteration, update all non-cluster head nodes in all subnet clusters;
[0147] After updating the non-cluster head node N times, the clock of the head node is readjusted, and the non-cluster head nodes are updated again until the preset number of initial synchronization times is reached.
[0148] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0149] Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase, obtain the local clock adjustment amount of each cluster head node.
[0150] The clock of the first node of all subnets is updated in the first M iterations based on the local clock adjustment amount. During the update process, the updated first node interacts with other first nodes of the subnet, but the updated first node does not interact with ordinary nodes in the subnet.
[0151] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0152] To obtain the current scenario of the clustered network, when the current scenario is the network initialization phase, the local clock adjustment amount of each cluster leader node is obtained using the following formula:
[0153]
[0154] Where ΔT1 is the local clock adjustment amount, h_n is the number of cluster head nodes adjacent to the current cluster head node to be updated, and Δt h_1 Let Δt be the clock offset between cluster head node h_1 and the new cluster head node to be updated. h_2 Δt represents the clock offset between cluster head node h_2 and the new cluster head node to be updated. h_n This represents the clock offset between the cluster head node h_n and the new cluster head node to be updated.
[0155] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0156] Obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters;
[0157] Based on the clock adjustment amount of the non-cluster head node, all non-cluster head nodes in the subnet clusters are updated starting from the M+1th iteration.
[0158] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0159] The clock adjustment amount for non-cluster head nodes in all subnet clusters is obtained using the following formula:
[0160]
[0161] Where ΔT2 is the clock adjustment amount of the non-cluster head node to be updated, n is the number of non-cluster head nodes adjacent to the non-cluster head node to be updated, and Δt h Δt represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. sn_1 Δt represents the clock offset between the non-cluster head adjacent node sn_1 within the subnet and the currently pending update non-cluster head node. sn_n This represents the clock offset between the non-cluster head adjacent node sn_n within the subnet and the currently pending update non-cluster head node.
[0162] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0163] When the current scenario is a sporadic node joining the network, the communication status between the sporadic nodes and the cluster nodes is obtained;
[0164] Based on the communication situation, clustered network synchronization is determined for the scattered nodes.
[0165] Furthermore, when the alternating update cluster network synchronization program is executed by the processor, it also performs the following operations:
[0166] The current communication network is determined based on the communication situation, and the corresponding target clustering algorithm is selected based on the current communication network.
[0167] The communication status is communicated to the head node of the subnet to which the scattered node belongs, as well as to other nodes in the current cluster, according to the target clustering algorithm.
[0168] After determining the target cluster head node of the scattered nodes, the target cluster head node in all subnets is updated starting from the M+1th iteration.
[0169] Those skilled in the art will understand that all or part of the steps in the methods described above can be implemented by a program instructing related hardware. The program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0170] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0171] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0172] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for alternating update cluster network synchronization, characterized in that, The alternating update cluster network synchronization method includes: Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, update the clock of the first node of all sub-network clusters in the first M iterations. Starting from the M+1th iteration, update all non-cluster head nodes in all subnet clusters; After updating the non-cluster head node N times, the clock of the head node is readjusted, and the non-cluster head nodes are updated again until the preset number of initial synchronization times is reached; The step of updating the non-cluster head node N times, readjusting the clock of the head node, and updating the non-cluster head nodes again, until a preset number of initial synchronization attempts are reached, includes: When the current scenario is a sporadic node joining the network, the communication status between the sporadic nodes and the cluster nodes is obtained; Based on the communication situation, clustered network synchronization is determined for the scattered nodes.
2. The alternating update cluster network synchronization method as described in claim 1, characterized in that, The process of obtaining the current scenario of the sub-cluster network, when the current scenario is the network initialization phase, involves updating the clock of the first node of all sub-clusters in the first M iterations, including: Obtain the current scenario of the clustered network. When the current scenario is the network initialization phase, obtain the local clock adjustment amount of each cluster head node. The clock of the first node of all subnets is updated in the first M iterations based on the local clock adjustment amount. During the update process, the updated first node interacts with other first nodes of the subnet, but the updated first node does not interact with ordinary nodes in the subnet.
3. The alternating update cluster network synchronization method as described in claim 2, characterized in that, The process of obtaining the current scenario of the clustering network, when the current scenario is the network initialization phase, involves obtaining the local clock adjustment amount of each cluster leader node, including: To obtain the current scenario of the clustered network, when the current scenario is the network initialization phase, the local clock adjustment amount of each cluster leader node is obtained using the following formula: in, Adjustment amount for local clock, This represents the number of cluster head nodes adjacent to the current cluster head node to be updated. For cluster head node The clock offset between the current cluster head and the new node to be updated. Cluster head node The clock offset between the current cluster head and the new node to be updated. Cluster head node Clock offset between the current cluster head node and the new node to be updated.
4. The alternating update cluster network synchronization method as described in claim 1, characterized in that, The process of updating all non-cluster head nodes in all subnets starting from the M+1th iteration includes: Obtain the clock adjustment amount of non-cluster head nodes in all subnet clusters; Based on the clock adjustment amount of the non-cluster head node, all non-cluster head nodes in the subnet clusters are updated starting from the M+1th iteration.
5. The alternating update cluster network synchronization method as described in claim 4, characterized in that, The step of obtaining the clock adjustment amount of non-cluster head nodes in all subnet clusters includes: The clock adjustment amount for non-cluster head nodes in all subnet clusters is obtained using the following formula: in, This is the adjustment amount for the current non-cluster node clock that needs to be updated. This represents the number of non-cluster head nodes adjacent to the non-cluster head node currently awaiting update. This represents the clock skew between the cluster head node of this subnet and the non-cluster head node currently awaiting update. Non-cluster head adjacent nodes within the subnet The clock offset between the current non-cluster leader node and the node to be updated. Non-cluster head adjacent nodes within the subnet Clock skew between the current non-cluster leader node and the node to be updated.
6. The alternating update cluster network synchronization method as described in claim 1, characterized in that, The step of determining to perform clustered network synchronization on the scattered nodes based on the communication situation includes: The current communication network is determined based on the communication situation, and the corresponding target clustering algorithm is selected based on the current communication network. The communication status is communicated to the head node of the subnet to which the scattered node belongs, as well as to other nodes in the current cluster, according to the target clustering algorithm. After determining the target cluster head node of the scattered nodes, the target cluster head node in all subnets is updated starting from the M+1th iteration.
7. A synchronization device for alternating update cluster networks, characterized in that, The alternating update cluster network synchronization device includes: The clock update module is used to obtain the current scenario of the clustered network. When the current scenario is the network initialization phase scenario, it updates the clock of the first node of all sub-network clusters in the first M iterations. The node update module is used to update all non-cluster head nodes in all subnet clusters starting from the M+1th iteration; The synchronization module is used to readjust the clock of the first node and update the non-cluster first node again after updating the non-cluster first node N times, until the preset number of initial synchronization times is reached. The synchronization module is also used to obtain the communication status between the scattered nodes and the cluster nodes when the current scenario is a scenario of scattered nodes joining the network; and to determine to perform cluster network mutual synchronization on the scattered nodes based on the communication status.
8. A method for alternating update cluster network synchronization, characterized in that, The alternating update cluster network synchronization device includes: a memory, a processor, and an alternating update cluster network synchronization program stored in the memory and executable on the processor, wherein the alternating update cluster network synchronization program is configured to implement the steps of the alternating update cluster network synchronization method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores an alternating update cluster network synchronization program, which, when executed by a processor, implements the steps of the alternating update cluster network synchronization method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Wireless sensor network based micropower meter reading system and device
CN109949559A