A node device management method and system
By pre-determining the inherited master node device in the ad hoc network and changing identities when necessary, the problem of time taking for the new master node to be elected after the master node is offline is solved, and group management efficiency is improved.
Patent Information
- Application Number
- CN202210488523.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-05-06
AI Technical Summary
In an ad hoc network, when the master node device is offline, the process of determining the new master node device takes a long time, resulting in low efficiency in group node device management.
The master node device determines the third node device that inherits the master node identity before going offline, and converts it into the master node when it is detected or the predetermined time to shorten the master node replacement time.
It significantly shortens the time for electing new master nodes in the group and improves the management efficiency of node equipment.
Smart Images

Figure CN117062259B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and in particular to a node device management method and system. Background Art
[0002] With the continuous development of communication technology, ad hoc networks (AONs) are gaining increasing attention. A AON is a network formed by a group of electronic devices with both terminal and routing functions connected via wireless links. Such a network can include multiple groups, each of which is connected via a protocol specific to the AON. These electronic devices are referred to as node devices within the group.
[0003] In a group, nodes can be divided into master nodes and non-master nodes. Correspondingly, node devices can be divided into master and non-master devices. Each node device will meet at an agreed time and channel to implement functions such as clock calibration, surrounding network environment awareness, device discovery, and node election. Taking clock calibration as an example, non-master nodes will use the master node's time as an anchor point to calibrate their own time, thereby synchronizing the time of all node devices in the group.
[0004] In related technologies, when a master node device in a group goes offline, some non-master node devices automatically become temporary master nodes. The device that serves as a temporary master node is called a temporary master node device. This means that there may be multiple temporary master node devices in the group. These devices need to gradually converge by comparing their priorities until only one remains as the new master node for the group.
[0005] However, the process of determining a new master node takes a long time, resulting in low management efficiency of node devices in the group. Summary of the Invention
[0006] The embodiments of the present application provide a node device management method and system, which can shorten the time taken by a group to determine a new master node after the current master node goes offline, thereby improving the management efficiency of the node devices in the group.
[0007] In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions.
[0008] In a first aspect, a node device management method is provided, which is applied to a group formed based on a self-organizing network protocol, wherein the group includes a first node device and multiple second node devices. The first node device is the master node of the group, and the second node device is the synchronization node of the group. The method includes: the first node device determines a third node device in the second node device based on the synchronization frame published by each second node device, and the third node device is used to inherit the master node identity of the first node device. The first node device publishes a synchronization frame including information about the third node device, wherein the information about the third node device includes the address of the third node device and the abdication time. After the third node device receives the synchronization frame including the information about the third node device, if it detects that the first node device is offline before the abdication time, it is converted to the master node. If the first node device is not detected to be offline before the abdication time, the third node device is converted to the master node at the abdication time, and correspondingly, the first node device abandons the master node identity at the abdication time.
[0009] Based on this solution, the first node in the group, acting as the master node, will identify a third node to inherit the master node status before going offline. Upon detecting the first node's offline status, or at the abdication time determined by the first node, the third node will transition to the group's master node. This significantly reduces the time it takes for each node in the group to elect a new master node after the master node goes offline, improving group management efficiency.
[0010] In one possible design, the first node device determines the third node device in the second node device based on the synchronization frames issued by each second node device, including: the first node device calculates the priority of each second node device based on the synchronization frames issued by each second node device. The greater the priority, the greater the probability that the corresponding node device will become the master node. The first node device determines the third node device in the second node device based on the priority of each second node device. Based on this solution, the priority of the node device can reflect the probability that the corresponding node device will become the master node. The first node device determines the third node device that inherits the master node identity based on the priority of each second node device, which is conducive to reducing the replacement frequency of the master node and improving the management efficiency of the node devices in the group.
[0011] In one possible design, a first node device determines a third node device from among the second node devices based on the priorities of each second node device. This includes the first node device selecting the second node device with the highest priority as the third node device. Based on this scheme, the priority level can represent the propensity and probability of the corresponding node device becoming the master node. Selecting the second node device with the highest priority as the third node device by the first node device reduces the frequency of master node replacement and improves the management efficiency of node devices in the group.
[0012] In one possible design, a first node device determines a third node device from among the second node devices based on the priorities of the second node devices. This includes randomly selecting the third node device from among the second node devices whose priorities exceed a preset threshold. Based on this solution, the first node device selects the third node device from among the second node devices with higher priorities, which helps reduce the frequency of master node replacement and improves the management efficiency of node devices in the group.
[0013] In one possible design, the synchronization frame published by the second node device includes the master node tendency and a random factor of the corresponding node device. The first node device calculates the priority of each second node device based on the synchronization frame published by each second node device, including: the first node device calculates the priority of each second node device based on the master node tendency and the random factor in the synchronization frame published by each second node device. Based on this solution, the first node device can calculate the priority of the corresponding node device based on the data in the synchronization frame published by each second node device. The obtained priority can better reflect the tendency and probability of the corresponding node device becoming the master node.
[0014] In one possible design, the priority of the second node device can be calculated by the following formula: P = S × 2 4 +K. P is the priority of the second node device, S is the master node tendency of the second node device, and K is the random factor of the second node device. Based on this scheme, the calculated priority can better reflect the tendency and probability of the corresponding node device becoming the master node.
[0015] In one possible design, the method further includes: before the first node device determines the third node device, the inheritance information indicator bit in the synchronization frame published is 0. After the first node device determines the third node device, the inheritance information indicator bit in the synchronization frame published is 1. Based on this solution, each node device in the group can directly determine whether the synchronization frame includes the third node device information based on the inheritance information indicator bit in the synchronization frame.
[0016] In one possible design, the method further includes: before the first node device determines the third node device, the inheritance information in the synchronization frame published is a null value. After the first node device determines the third node device, the inheritance information in the synchronization frame published is the address of the third node device and the abdication time. Based on this solution, each node device in the group can determine the address and abdication time of the third node device based on the inheritance information in the synchronization frame.
[0017] In one possible design, the method further includes: when the third node device does not receive a synchronization frame with an updated master node timestamp for n consecutive discovery windows, determining that the first node device is offline, where n is an integer greater than or equal to 3. Based on this solution, the third node device can relatively promptly learn whether the first node device is offline, thereby determining when to transition to the master node itself.
[0018] The second aspect is applied to a group formed based on a self-organizing network protocol, wherein the group includes a first node device and multiple second node devices. The first node device is the master node of the group, and the second node device is the synchronization node of the group. The first node device is used to determine the third node device in the second node device based on the synchronization frame issued by each second node device, and the third node device is used to inherit the master node identity of the first node device. The first node device is also used to publish a synchronization frame including information about the third node device, wherein the information about the third node device includes the address of the third node device and the abdication time. The third node device is used to convert to the master node after receiving the synchronization frame including the information about the third node device if the first node device is detected to be offline before the abdication time. If the first node device is not detected to be offline before the abdication time, the third node device is converted to the master node at the abdication time, and correspondingly, the first node device is also used to give up the master node identity at the abdication time.
[0019] In a third aspect, a computer-readable storage medium is provided, which includes a first computer instruction and a second computer instruction. When the first computer instruction is run, the steps performed by the first node device in the node device management method of any one of the first aspects are executed. When the second computer instruction is run, the steps performed by the third node device in the node device management method of any one of the first aspects are executed.
[0020] In a fourth aspect, a computer program product is provided, which includes a first instruction and a second instruction. When the computer program product is run on a computer, the computer can execute the steps executed by the first node device in the node device management method of any one of the first aspects according to the first instruction, and can execute the steps executed by the third node device in the node device management method of any one of the first aspects according to the second instruction.
[0021] It should be understood that the technical solutions provided in the above-mentioned second, third and fourth aspects, and their technical features can all correspond to the node device management method provided in the first aspect and its possible design, so the beneficial effects that can be achieved are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flow chart of a method for electing a master node in a group;
[0023] Figure 2 A schematic diagram of a group;
[0024] Figure 3 A flowchart of a node device management method provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of a third node device receiving a synchronization frame provided in an embodiment of the present application;
[0026] Figure 5 A flowchart of another node device management method provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of a node device management system provided in an embodiment of the present application;
[0028] Figure 7 A flowchart of another node device management method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In the embodiments of the present application, the terms "first," "second," and "third" are used to distinguish different objects rather than to define a specific order. In addition, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0030] In order to facilitate understanding of the embodiments of the present application, the technical terms in the present application are first explained below.
[0031] Self-organizing network: A network formed by a group of electronic devices with both terminal and routing functions connected by wireless links.
[0032] Group: Multiple electronic devices are connected to form a group through self-organizing network protocols.
[0033] Node device: An electronic device in a group, which can be a mobile phone, computer, tablet, watch or other terminal device. The nodes in the group can be divided into master nodes (Master), synchronous nodes (Sync) and non-synchronous nodes (Non-Sync). In other words, the roles that the electronic devices in the group can play include the above-mentioned master nodes, synchronous nodes and non-synchronous nodes. Correspondingly, the electronic devices in the group can be divided into master node devices, synchronous node devices and non-synchronous node devices. In addition, the nodes in the group can also include temporary master nodes, and correspondingly, the electronic devices in the group can also include temporary master node devices.
[0034] Synchronization frame: a piece of data that carries synchronization timestamp, master node timestamp, transmitting node information, and master node device information. Among them, the higher the priority of the node device, the greater the probability that the node device will become the master node when the master node is elected in the group. Some node devices in the group will send synchronization frames on the agreed channel at the agreed time to achieve clock correction, surrounding network environment perception, device discovery, node election and other functions. In the embodiment of the present application, the synchronization frame also carries other information, please refer to the following Table 1 and the relevant description of Table 1 for details.
[0035] Discovery Window: The time and channel resources during which node devices in a group periodically meet. During the discovery window, the master node in the group issues synchronization frames, synchronized node devices listen and issue synchronization frames, and asynchronous node devices listen to synchronization frames, thereby achieving clock synchronization among node devices in the group. A discovery window period consists of a discovery window and a discovery window interval.
[0036] Master Node: The logical center of the group. During the group's initialization phase, the master node is responsible for allocating fixed communication resources, such as addresses and heartbeat resources, to other node devices in the group. During the group's network maintenance phase, the master node is responsible for issuing synchronization frames at the beginning of the discovery window and receiving requests from other node devices to join the group.
[0037] Sync Node: Responsible for listening for and publishing sync frames within the discovery window. Upon hearing a sync frame, a sync node updates its local master node information based on the master node information in the sync frame. The sync node then modifies some of the information in the sync frame and republishes it.
[0038] Asynchronous node: responsible for listening to synchronization frames within the discovery window and does not need to publish synchronization frames.
[0039] In conjunction with the above technical terms, the application background of this application is introduced below. For the convenience of explanation, in the embodiments of this application, master nodes, synchronization nodes, and temporary master nodes can be used to indicate the role or identity of a device in a group, and can also be used to indicate devices that serve as corresponding roles or identities. The master node device is used to indicate the device that serves as the master node, the synchronization node device is used to indicate the device that serves as the synchronization node, and the temporary master node is used to indicate the device that serves as the temporary master node.
[0040] In the initial stage of group establishment, the node device that establishes the group will automatically become the master node of the group and be converted into a master node device.
[0041] In order to synchronize the time of each node device in the group, the non-master node devices in the group will use the time of the master node device as an anchor point and periodically correct their own time.
[0042] After a group is established, the network topology of the group will change over time, and the roles of each node device in the group may also change.
[0043] For example, if nodes that are too far apart become disconnected, the original group may split into multiple subgroups. Since there was only one master node in the original group, it can only be in one of the subgroups after the split. Therefore, the remaining subgroups will need to elect a new master node.
[0044] For example, if a master node device in a group goes offline due to a low battery, the group will also need to elect a new master node. A master node device going offline in a group means that the master node device no longer serves as the group's master node. Examples of this include a master node device relinquishing its master node status or shutting down due to a low battery.
[0045] The following is an introduction to the group's method of electing a master node. Figure 1 , is a flow chart of a method for electing a master node in a group. Figure 1 As shown, the method includes S101-S104. In the embodiment of the present application, S104 includes S104a and S104b.
[0046] S101. After a non-master node device in a group receives a synchronization frame with a master node timestamp of t1, if it does not receive a synchronization frame with a master node timestamp later than t1 in three consecutive discovery windows, the non-master node device is converted to a temporary master node.
[0047] The above-mentioned non-master node devices include synchronous node devices and asynchronous node devices.
[0048] The master node timestamp is the data stored in the synchronization frame, which is used to indicate the time when the timestamp in the synchronization frame is sent from the master node device. The timestamp in the synchronization frame is the time of the master node device that can serve as the anchor point.
[0049] In a group, if a non-master node device does not receive a synchronization frame that updates the master node timestamp for three consecutive discovery windows, it indicates that the master node device in the group has gone offline, and the non-master node device will automatically be converted to a temporary master node.
[0050] It is understandable that when the master node device in the group goes offline, there may be multiple non-master node devices that simultaneously meet the conditions in S101 above, resulting in multiple temporary master nodes appearing in the group at the same time.
[0051] Please refer to Figure 2 , is a schematic diagram of a group. Figure 2As shown, the group includes node device 1, node device 2, node device 3, node device 4, node device 5 and node device 6. Node device 1 is the master node, node device 2, node device 4 and node device 5 are synchronous nodes, and node device 3 and node device 6 are asynchronous nodes.
[0052] As an example, node device 1 goes offline after publishing the synchronization frame F1 in the discovery window T1, and the master node timestamp in F1 is t1. Node device 2 receives the synchronization frame F1 within the above-mentioned discovery window T1, and modifies the timestamp (Timestamp) and other information of the originating device in the synchronization frame F1 to generate a synchronization frame F2. Similarly, node device 4 can generate a synchronization frame F3 based on the synchronization frame F1, and node device 5 can generate a synchronization frame F4 based on the synchronization frame F1. It should be noted that the master node timestamp in the synchronization frames F2, F3, and F4 is still t1, and Timestamp refers to the timestamp in the synchronization frame, that is, the time of the above-mentioned master node device that can serve as an anchor point.
[0053] The process of generating synchronization frames by node devices 2, 4, and 5 can all occur before the time corresponding to discovery window T2. Discovery window T2 is a discovery window that follows discovery window T1 and is adjacent to discovery window T1. Subsequent discovery windows can be referred to as T3, T4, T5, and so on.
[0054] During discovery window T2, node devices 2, 4, and 5 will not receive synchronization frames with a master node timestamp later than t1. Node device 2 issues synchronization frame F2, node device 4 issues synchronization frame F3, and node device 5 issues synchronization frame F4. Node device 3 receives synchronization frame F2 issued by node device 2 and synchronization frame F3 issued by node device 4. Node device 6 receives synchronization frame F3 issued by node device 4 and synchronization frame F4 issued by node device 5.
[0055] In the discovery window T3, node device 2, node device 3, node device 4, node device 5 and node device 6 will not receive a synchronization frame whose master node timestamp is later than the above t1.
[0056] In the discovery window T4, node device 2, node device 3, node device 4, node device 5 and node device 6 will not receive a synchronization frame whose master node timestamp is later than the above t1.
[0057] It is understandable that node devices 2, 4, and 5 do not receive synchronization frames with a master node timestamp later than t1 within discovery windows T2, T3, and T4, while node devices 3 and 6 do not receive synchronization frames with a master node timestamp later than t1 within discovery windows T3 and T4. Therefore, node devices 2, 4, and 5 meet the conditions in S101 and become temporary master nodes.
[0058] To synchronize the time of all nodes in the group, there is only one master node in the group. Therefore, multiple temporary master nodes need to converge to one temporary master node to serve as the new master node of the group.
[0059] For ease of explanation, the following takes temporary master node device A and temporary master node device B as examples to introduce the convergence process of the temporary master node.
[0060] S102: The temporary master node device A receives the synchronization frame F of the temporary master node device B. b When the synchronization frame F b The node tendency and random factor in the calculation of the priority P of the temporary master node device B b .
[0061] The master preference characterizes a node's propensity to act as a master node and is provided by the device's application and network layers. The random factor is a random number. Both the master preference and the random factor are stored in the synchronization frame published by the node.
[0062] The temporary master node device A can be configured according to the synchronization frame F b The priority of the temporary master node device B is calculated based on the node tendency, random factor and the preset priority calculation formula.
[0063] S103, temporary master node device A compares its own priority P a Priority P with temporary master node device B b If P a Less than P b , execute S104a. If P a Greater than P b , execute S104b.
[0064] The temporary master node device A can read its own priority from the storage area of the device, or calculate its own priority based on its own node tendency, random factors and a preset priority calculation formula.
[0065] S104a: The temporary master node device A is converted to a non-master node.
[0066] S104b. The temporary master node device A maintains the temporary master node identity.
[0067] That is, when its priority is lower than that of the other party, temporary master node device A will automatically convert to a non-master node. In this way, the temporary master node devices in the group will gradually converge by comparing their priorities until only one temporary master node device remains as the new master node of the group.
[0068] It is understandable that when there are a large number of temporary master node devices in a group, the convergence process is time-consuming. The presence of multiple temporary master node devices in the group for a long time results in low group management efficiency.
[0069] In order to solve the above problems, an embodiment of the present application provides a node device management method, which can shorten the time for a group to elect a master node and improve the management efficiency of the group.
[0070] It should be noted that in the node device management method provided in the embodiment of the present application, the synchronization frames issued by the master node device and the synchronization node device are the same as those in the above Figure 1 and Figure 2 The synchronization frames in the related descriptions are not the same.
[0071] Please refer to Table 1 below, which is a synchronization frame provided in an embodiment of the present application.
[0072]
[0073] Table 1
[0074] To avoid ambiguity in translation, the following translations are provided: Frame Control; Protocol Version; Frame Type; Reserve; MasterCluster; Inherit Valid; Address; Cluster ID; Trans Address; Timestamp; Slice ID; Frame ID; Slot ID; Time; Node Information; Master Preference; Random Factor; Master Information; Master Address; Master-Master Preference; Master-Random Factor; Hop Count; Master Sync Beacon Transmission Time; Inherit Information; Next Master; Valid Time; Frame Check Sequence.
[0075] As can be seen from Table 1 above, the synchronization frame provided in the embodiment of the present application is 21 bytes. Bit 5 of byte 2 is the primary group indicator, which can store information indicating whether the group corresponding to the synchronization frame is the primary group. For example, if the data stored in the primary group indicator is 1, the group corresponding to the synchronization frame is the primary group; if the data stored in the primary group indicator is 0, the group corresponding to the synchronization frame is the secondary group.
[0076] Among them, whether a group is a master group is determined by whether the master node device when the group is established is still in the group. For example, if node device A establishes group 1, node device A will automatically become the master node of group 1. In other words, node device A is the master node device when group 1 is established. As time goes by and the node devices in group 1 move, the network topology of group 1 will change, such as group 1 splits into group 2 and group 3. Node device A is in group 2 and is the master node of group 2; there is no master node in group 3 or a new master node has been elected. Then group 2 is the master group, and the data stored in the master group indicator bit is 1; group 1 is the auxiliary group, and the data stored in the master group indicator bit is 0.
[0077] If the master node device at the time of group establishment is within the current group, the data stored in the master group indicator bit in the synchronization frames issued by each node device in the current group is 1, and the current group is the master group. If the master node device at the time of group establishment is not within the current group, the data stored in the master group indicator bit in the synchronization frames issued by each node device in the current group is 0, and the current group is the slave group.
[0078] In the synchronization frame shown in Table 1, bit 6 of byte 2 is the inheritance information indicator bit. This bit stores information indicating whether inheritance information exists in the corresponding synchronization frame. For example, when the inheritance information indicator bit is 1, it indicates that inheritance information exists in the corresponding synchronization frame; when the inheritance information indicator bit is 0, it indicates that inheritance information does not exist in the corresponding synchronization frame. The inheritance information indicates the address of the inheriting node and the abdication time.
[0079] When the current master node goes offline, the successor node becomes the master node. The successor node is determined by the current master node. For example, the master node can determine the successor node by comparing the priorities of its perceived synchronization nodes. For example, the current master node can select the synchronization node with the highest priority as the successor node. The successor node address is the network address of the successor node and occupies 4 bits.
[0080] It should be noted that, since asynchronous node devices do not issue synchronization frames, only synchronous node devices can become successor nodes.
[0081] The abdication time indicates when the successor node will be converted to the master node. In other words, the successor node will be converted to the master node at the time indicated by the abdication time.
[0082] As shown in Table 1, in a synchronization frame, the inheritance information is stored in bytes 17, 18, and 19. Bits 0 to 3 of byte 17 can store the inheritance node address. Bits 4 to 7 of byte 17, bytes 18, and 19 can store the abdication time.
[0083] Byte 1 can store the version of the network protocol, the frame type of the synchronization frame, etc.
[0084] Byte 3 may store the group identifier.
[0085] Byte 4 can store the originating address. The originating address refers to the address of the node device that issues the synchronization frame. For example, if the synchronization frame is issued by node device A, byte 4 can store the network address of node device A.
[0086] Bytes 5, 6, and 7 can store a timestamp. The timestamp can include an 11-bit slice identifier, a 5-bit frame identifier, a 2-bit timeslot identifier, and a 2-bit time. In this embodiment of the present application, the timestamp has an accuracy of milliseconds (ms), which covers approximately 1049 seconds.
[0087] It should be noted that the above Figure 1 and Figure 2 The master node timestamp in the relevant description is the timestamp stored in byte 5, byte 6, and byte 7. After receiving the synchronization frame, the non-master node devices in the group will synchronize the local time according to the time in the timestamp.
[0088] Byte 8 can store the master node preference and random factor. It should be noted that Byte 8 stores the master node preference and random factor of the originating device, that is, the master node preference and random factor of the node device that issues the synchronization frame. As mentioned above, the master node preference is used to indicate the propensity of the corresponding node device to serve as the master node.
[0089] In an embodiment of the present application, the value range of the master node tendency can be [0,15]. The greater the master node tendency, the greater the tendency of the corresponding node device to serve as the master node, and the smaller the master node tendency, the smaller the tendency of the corresponding node device to serve as the master node. The size of the master node tendency can be set independently by the corresponding node device. For example, a node device with a power level greater than a first preset threshold can be set to a larger master node tendency, and a node device with a power level less than a second preset threshold can be set to a smaller master node tendency. The first preset threshold and the second preset threshold can be set according to actual needs. As an example, the first preset threshold can be 80%, and the second preset threshold can be 30%.
[0090] In addition, after a node device changes its master node preference, it cannot be changed again within the 240-day discovery window. Node devices cannot change their priority within the discovery window.
[0091] The random factor has a value range of [0, 15] and is randomly refreshed every preset time period, where the preset time period can be 60 seconds.
[0092] The master node tendency and random factor can be used to calculate the priority of the corresponding node device. For example, if the master node tendency in the synchronization frame issued by node device 1 is S and the random factor is K, the priority P of node device 1 can be:
[0093] P=S×2 4 +K formula (1).
[0094] Master node information may be stored in bytes 9 to 16. The master node information may include a master node address occupying 4 bytes, a master node-master node preference occupying 4 bits, a master node-random factor occupying 4 bits, a hop count occupying 4 bits, and a master node synchronization frame sending time occupying 2.5 bytes.
[0095] The master node address indicates the network address of the master node device. The master node-master node tendency indicates the current master node device's tendency to continue serving as the master node. Its function and value range are the same as those for the master node tendency described above and are not further described here. The value range and refresh interval for the master node-random factor can be the same as those for the random factor described above and are not further described here.
[0096] The hop count indicates the number of hops from the node device issuing the synchronization frame to the master node device. For example, master node device A issues synchronization frame 1, and the hop count in synchronization frame 1 is 0. Node device B receives synchronization frame 1 and issues synchronization frame 2 based on synchronization frame 1. The hop count in synchronization frame 2 is 1. Node device C receives synchronization frame 2 and issues synchronization frame 3 based on synchronization frame 2. The hop count in synchronization frame 3 is 1.
[0097] The master node synchronization frame transmission time indicates the time when the timestamp in the corresponding synchronization frame was sent from the master node device. Its expanded format is the same as the timestamp and is not further described here. It should be noted that in the synchronization frame issued by the master node device, the master node synchronization frame transmission time and the timestamp are exactly the same; in the synchronization frame issued by the synchronization node device, the timestamp is later than the master node synchronization frame transmission time.
[0098] It should be noted that, for the synchronization frames shown in Table 1, the abdication time must be within 120 seconds after the timestamp, otherwise it is an invalid value. For example, the time in the timestamp is T s , the abdication time is T e , then T e -T s When it is less than 120s, T e It is a valid value, otherwise T e In addition, if the abdication time is the same as the master node synchronization frame transmission time, it means that the master node device has not set the abdication time or the set abdication time is invalid.
[0099] Bytes 20 and 21 may store a frame check sequence corresponding to the synchronization frame.
[0100] Based on the above introduction to the synchronization frame provided in the embodiment of the present application, the node device management method provided in the embodiment of the present application is described below, taking a group including a first node device and a second node device as an example. The first node device is the current master node of the group, and the second node device is the synchronization node in the group. The first node device and the second node device are connected to form a group based on a communication connection using a self-organizing network protocol.
[0101] See also Figure 3 , is a flow chart of a node device management method provided by an embodiment of the present application. Figure 3 As shown, the method includes S301-S303.
[0102] S301: A first node device determines a third node device among the second node devices according to synchronization frames issued by each second node device. The third node device is used to inherit the master node identity of the first node device.
[0103] In an embodiment of the present application, a first node device may select the node device with the highest priority among the second node devices it can perceive as a third node device that inherits the master node identity of the first node device. The third node device is the successor node. In other words, the master node may select the node device with the highest priority among the synchronization nodes it can perceive as the successor node.
[0104] The structure of the synchronization frame issued by the second node device can refer to the above Table 1 and the related description of Table 1, that is, it can include the master node tendency of the corresponding node device, the random factor, etc. The first node device can calculate the priority of the corresponding node device based on the master node tendency and the random factor in the synchronization frame and the above formula (1).
[0105] In addition, after the first node device becomes the master node of the group, the above S301 may be executed regularly to timely update the successor node according to the status of each node device in the group.
[0106] S302: The first node device issues a synchronization frame including information about the third node device, wherein the information about the third node device includes an address of the third node device and abdication time.
[0107] The address of the third node device is the network address of the third node device, and the abdication time is the time when the third node device is converted into the master node.
[0108] In this embodiment of the present application, the third node device information is the inherited information in Table 1, and the address of the third node device is the inherited node address in Table 1. After the first node device determines the third node device, it can obtain the address of the third node device based on the synchronization frame published by the third node device. The address of the third node device can be stored in the address field of the synchronization frame published by the third node device. The abdication time can be determined by the first node device based on user input.
[0109] After the first node device issues a synchronization frame including information about the third node device, it may go offline before the abdication time or at the abdication time.
[0110] S303: After receiving the synchronization frame including the third node device information, if the third node device detects that the first node device is offline before the abdication time, the third node device becomes the master node. If the first node device is not detected to be offline before the abdication time, the third node device becomes the master node at the abdication time. Correspondingly, the first node device relinquishes its master node status at the abdication time.
[0111] It should be noted that, when the third node device does not receive a synchronization frame including an updated master node timestamp for n consecutive discovery windows, it can be determined that the first node device has gone offline.
[0112] For example, after receiving a synchronization frame transmitted at time t1 by the master node, if the synchronization frames received by the third node device in n consecutive discovery windows meet a first preset condition, the first node device may determine that the first node device has gone offline. The first preset condition is that the master node synchronization frame transmission time is earlier than or equal to t1.
[0113] For example, the above process is described by taking n=3 as an example. Figure 4 , is a schematic diagram of a third node device receiving a synchronization frame provided by an embodiment of the present application. Figure 4 As shown, after receiving the synchronization frame with the master node synchronization frame transmission time t1, the third node device receives synchronization frame X in discovery window 1. The master node synchronization frame transmission time in synchronization frame X is t2. The third node device receives synchronization frame Y in discovery window 2. The master node synchronization frame transmission time in synchronization frame Y is t3. The third node device receives synchronization frame Z in discovery window 3. The master node synchronization frame transmission time in synchronization frame Z is t4. If t2 is less than or equal to t1, t3 is less than or equal to t1, and t4 is less than or equal to t1, the third node device can confirm that the first node device has gone offline.
[0114] The time when the third node device confirms that the first node device is offline is t5, and the abdication time is t6. If t5 is less than t6, that is, the third node device detects that the first node device is offline before the abdication time, then the third node device can be directly converted to the master node. If the third node device does not detect that the first node device is offline before the abdication time, the third node device will be converted to the master node at the abdication time, and correspondingly, the first node device will give up the master node identity at the abdication time. In this way, when the current master node of the group, that is, the first node device is online, the third node device used to inherit the master node is determined, which can shorten the time taken for the group to determine a new master node after the current master node goes offline, thereby improving the management efficiency of the node devices in the group.
[0115] The above S301-S303 introduces the overall process of the node device management solution provided by the embodiment of the present application. Among them, the process of the first node device determining the third node device in the second node device in S301 may include the following S501-S503.
[0116] Please refer to Figure 5 , is a flow chart of another node device management method provided in an embodiment of the present application. Figure 5 As shown, the method includes S501-S503.
[0117] S501: A first node device obtains a synchronization frame issued by each second node device.
[0118] In the discovery window, the second node device will issue a synchronization frame, and the first node device can receive the synchronization frame issued by each second node device. The structure of the synchronization frame can refer to the synchronization frame shown in Table 1, which will not be repeated here.
[0119] S502: The first node device determines the priority of each second node device according to the synchronization frame of each second node device.
[0120] Exemplarily, the first node device may calculate the priority of each second node device according to the above formula (1), the master node tendency in the synchronization frame issued by each second node device, and the random factor.
[0121] S503: The first node device determines a third node device according to the priorities of the second node devices.
[0122] In some implementations, the first node device may use the second node device with the highest priority as the third node device, which is beneficial for reducing the frequency of replacing the master node of the group and improving the stability of the group.
[0123] In other embodiments, the first node device may randomly select a third node device from the second node devices whose priorities are greater than a third preset threshold.
[0124] The third preset threshold may be a fixed value, which is determined by the first node device according to user input.
[0125] The third preset threshold value may also be a variable value, determined by the priority of each second node device. For example, the third preset threshold value may divide the priority of each second node device into two parts, where the number of second node devices with a priority greater than or equal to the third preset threshold value accounts for 20% of the total number of second node devices, and the number of second node devices with a priority less than the third preset threshold value accounts for 80% of the total number of second node devices. It should be noted that the 20% and 80% values here are merely exemplary and do not limit this application to these values.
[0126] The first node device in the group may periodically execute the above S501-S503 to timely update the third node device according to the status of each node in the group.
[0127] It is understood that before the first node device determines the third node device, the succession information indicator bit in the synchronization frame issued by the first node device is 0, indicating that the first node device has not yet set a successor node. After the first node device determines the third node device, the succession information indicator bit in the synchronization frame issued by the first node device is 1, indicating that the first node device has now set a successor node.
[0128] In addition, before the first node device determines the third node device, the byte storing the inheritance information in the synchronization frame issued by the first node device is a null value or an invalid value. After the first node device determines the third node device, the byte storing the inheritance information in the synchronization frame issued by the first node device contains the address of the third node device and the abdication time. The abdication time can be determined by the first node device based on user input. The address of the third node device can be obtained from the address field in the synchronization frame corresponding to the second node device.
[0129] The above describes the node device management method provided by the embodiment of the present application. It is understandable that, in combination with the above description, the node device management method provided by the embodiment of the present application can shorten the time it takes for the group to determine a new master node after the current master node goes offline, thereby improving the management efficiency of the node devices in the group.
[0130] This application embodiment also provides a node device management system. Figure 6 , is a schematic diagram of a node device management system. Figure 6 As shown, the system may include a first node device and a second node device, and the first node device and the second node device are connected to form a group based on a self-organizing network protocol.
[0131] The first node device is used to determine a third node device among the second node devices according to the synchronization frames issued by each second node device, and the third node device is used to inherit the master node identity of the first node device.
[0132] The first node device is further configured to issue a synchronization frame including information about a third node device, wherein the information about the third node device includes an address of the third node device and abdication time.
[0133] The third node device is configured to, upon receiving a synchronization frame including the successor node information, transition to the master node if it detects that the first node device is offline before the abdication time. Otherwise, it transitions to the master node at the abdication time. Accordingly, the first node device is also configured to relinquish its master node status at the abdication time.
[0134] For a detailed introduction to the first node device, the second node device, and the synchronization frame, reference may be made to the description of the node device management method described above, which will not be repeated here.
[0135] In some embodiments, after a group is established, the group may split into multiple subgroups as node devices within the group move. After a group splits, since the original group only has one master node device, the master node device can only be in one of the subgroups after the split. Therefore, the remaining subgroups, except for the master node, need to elect a new master node.
[0136] For example, group A can be split into group B, group C, and group D. The master node device in group A is the first node device. After the group splits, the first node device is in group B, and groups C and D need to elect a new master node.
[0137] In this embodiment of the present application, if the first node device does not issue a synchronization frame including the third node device information before the group splits, group C will elect the fourth node device as the master node through the above steps S101-S104. Group D will elect the fifth node device as the master node through the above steps S101-S104.
[0138] In the node device management method provided in the embodiment of the present application, in the synchronization frames issued by the fourth node device and the fifth node device, the primary group indicator bit is 0, indicating that the corresponding group is a secondary group. In the synchronization frame issued by the first node device, the primary group indicator bit is 1, indicating that the corresponding group is a primary group.
[0139] The clocks of each subgroup may drift, resulting in inconsistent discovery windows for each subgroup, hindering the re-convergence of the subgroups. For example, the clocks of Groups C and D may drift relative to Group B, preventing Groups C and D from joining Group B.
[0140] In order to solve this problem, the present application embodiment provides another node device management method. Figure 7 , which is another node device management method provided by an embodiment of the present application. Taking group C as an example, the method includes S701-S703. Among them, S703 includes S703a and S703b.
[0141] S701: The fourth node device listens to a discovery window period every preset time period.
[0142] The discovery window period is the sum of the time interval between two consecutive discovery windows and the time corresponding to the discovery window. The preset time period may be 10 seconds.
[0143] like Figure 4 As shown in Figure 1, a discovery window period is equal to the time corresponding to discovery window 1 plus the time between discovery windows 1 and 2. A synchronization node listens for one discovery window period to avoid being unable to detect synchronization frames from other groups due to clock drift, thereby increasing the probability of discovering other groups.
[0144] S702: In response to receiving a first synchronization frame containing master node information different from its own, the fourth node device determines whether the master group indicator bit in the first synchronization frame is 1. If so, execute S703a; if not, execute S703b.
[0145] S703a: The fourth node device abandons the master node identity and sends a join request to the node device that issues the first synchronization frame.
[0146] S703b: When the priority of the node device that issues the first synchronization frame is greater than its own priority, the fourth node device abandons its master node identity and sends a join request to the node device that issues the first synchronization frame. When the priority of the node device that issues the first synchronization frame is less than its own priority, the fourth node device maintains its master node identity.
[0147] For example, the master node of a secondary group listens for an entire discovery window every 10 seconds. Upon hearing a synchronization frame from the primary group, it sends a join request to the primary group. Upon hearing a synchronization frame from a secondary group with a higher priority than itself, it sends a join request to that secondary group. Upon hearing a synchronization frame from a secondary group with a lower priority than itself, it maintains its master status. This helps accelerate group convergence and improves its efficiency.
[0148] An embodiment of the present application also provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on a terminal device, the terminal device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
[0149] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.
[0150] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the methods in the above-mentioned method embodiments.
[0151] The functions, actions, operations, steps, etc. in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that can be integrated with one or more media. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0152] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.
Claims
1. A node device management method, characterized in that: Applicable to a group formed based on a self-organizing network protocol, the group comprising a first node device and a plurality of second node devices; The first node device is a master node of the group, and the second node device is a synchronization node of the group; the method includes: The first node device determines a third node device in the second node device according to the synchronization frames issued by each of the second node devices, where the third node device is used to inherit the master node identity of the first node device; The first node device publishes a synchronization frame including information of a third node device, wherein the information of the third node device includes an address and abdication time of the third node device; After the third node device receives the synchronization frame including the information of the third node device, if the first node device is detected to be offline before the abdication time, it is converted into the master node; if the first node device is not detected to be offline before the abdication time, the third node device is converted into the master node at the abdication time, and correspondingly, the first node device gives up the master node identity at the abdication time.
2. The method according to claim 1, characterized in that The first node device determines a third node device in the second node device according to the synchronization frames issued by each of the second node devices, including: The first node device calculates the priority of each second node device according to the synchronization frame issued by each second node device; the greater the priority, the greater the probability that the corresponding node device becomes the master node; The first node device determines the third node device among the second node devices according to the priorities of the second node devices.
3. The method according to claim 2, characterized in that The first node device determines the third node device among the second node devices according to the priority of each of the second node devices, including: The first node device uses the second node device with the highest priority as the third node device.
4. The method according to claim 2, characterized in that The first node device determines a third node device among the second node devices according to the priorities of the second node devices, including: The first node device randomly selects the third node device from the second node devices whose priorities are higher than a preset threshold.
5. The method according to any one of claims 2 to 4, characterized in that The synchronization frame issued by the second node device includes the master node tendency of the corresponding node device and a random factor; The first node device calculates the priority of each second node device according to the synchronization frame issued by each second node device, including: The first node device calculates the priority of each second node device according to the master node tendency and the random factor in the synchronization frame issued by each second node device.
6. The method according to claim 5, characterized in that The priority of the second node device is calculated by the following formula: P=S×2 4 +K; wherein P is the priority of the second node device, S is the master node tendency of the second node device, and K is the random factor of the second node device.
7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Before the first node device determines the third node device, the inheritance information indication bit in the synchronization frame issued is 0; After the first node device determines the third node device, the inheritance information indicator bit in the published synchronization frame is 1.
8. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Before the first node device determines the third node device, the inheritance information in the synchronization frame issued is a null value; After the first node device determines the third node device, the inherited information in the published synchronization frame is the address and abdication time of the third node device.
9. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The third node device determines that the first node device is offline when no synchronization frame with an updated master node timestamp is received in n consecutive discovery windows, where n is an integer greater than or equal to 3.
10. A node device management system, characterized in that: Applicable to a group formed based on a self-organizing network protocol, the group includes a first node device and multiple second node devices; the first node device is a master node of the group, and the second node device is a synchronization node of the group; The first node device is used to determine a third node device in the second node device according to the synchronization frame issued by each second node device, and the third node device is used to inherit the master node identity of the first node device; The first node device is further configured to publish a synchronization frame including information about a third node device, wherein the information about the third node device includes an address and abdication time of the third node device; The third node device is used to, after receiving a synchronization frame including information of the third node device, convert to a master node if the first node device is detected to be offline before the abdication time; if the first node device is not detected to be offline before the abdication time, the third node device is converted to a master node at the abdication time, and correspondingly, the first node device is also used to give up the master node identity at the abdication time.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a first computer instruction and a second computer instruction. When the first computer instruction is run, the steps performed by the first node device in the node device management method as described in any one of claims 1-9 are executed. When the second computer instruction is run, the steps performed by the third node device in the node device management method as described in any one of claims 1-9 are executed.
12. A computer program product, characterized in that The computer program product includes a first instruction and a second instruction. When the computer program product is run on a computer, the computer executes the steps performed by the first node device in the node device management method as described in any one of claims 1 to 9 according to the first instruction, and the computer executes the steps performed by the third node device in the node device management method as described in any one of claims 1 to 9 according to the second instruction.
Citation Information
Patent Citations
Satellite cluster self-organization networking method based on master-slave heterogeneous data transmission module
CN102202425A
Method and device for determining master node in ad hoc network and storage medium
CN112911520A