Search

CN-121984828-A - Main node election method of multi-node network, multi-node network and electronic equipment

CN121984828ACN 121984828 ACN121984828 ACN 121984828ACN-121984828-A

Abstract

The application provides a master node election method of a multi-node network, the multi-node network and electronic equipment, and relates to the technical field of wireless communication. The method comprises the steps of broadcasting an election instruction containing a grading calculation rule to the whole network if a current main node judges that a preset election triggering condition is met, receiving grading response data which are returned by each node and comprise node identifications and energy consumption grading values, wherein the energy consumption grading values are grading values calculated by each node based on the grading calculation rule according to an energy consumption parameter set of each node, the energy consumption parameter set comprises residual battery power, historical energy consumption rate and data load, sequencing all nodes according to all the energy consumption grading values to determine new main nodes, and generating and broadcasting election result data containing the node identifications of the new main nodes to trigger the network to switch master roles and slave roles and synchronize with the network according to the grading response data. The scheme can solve the problems of unbalanced energy consumption and insufficient adaptability, so as to effectively prolong the service life of the network and improve the reliability of the network.

Inventors

  • WANG ZHICHENG
  • LU CHAOJUN
  • WANG HUAI

Assignees

  • 安徽容知日新科技股份有限公司

Dates

Publication Date
20260505
Application Date
20260121

Claims (10)

  1. 1. A master election method for a multi-node network, the method being applied to a current master node of the multi-node network, the method comprising the steps of: if the current main node judges that the preset election triggering condition is met, broadcasting an election instruction containing a scoring calculation rule to the whole network; Receiving scoring response data returned by each node in response to the election instruction, wherein the scoring response data comprises node identification and energy consumption scoring values, the energy consumption scoring values are scoring values calculated by each node based on the scoring calculation rule according to an energy consumption parameter set of each node, and the energy consumption parameter set comprises residual battery power, historical energy consumption rate and data load; Sorting all nodes according to the energy consumption scoring values in all the received scoring response data to determine new master nodes; And generating and broadcasting election result data containing the node identification of the new master node so as to trigger the network to perform master-slave role switching and network synchronization according to the election result data.
  2. 2. The method of claim 1, wherein the preset election trigger condition comprises at least one of a periodic trigger condition or an incident trigger condition.
  3. 3. The method of claim 2, wherein the event-based triggering condition includes triggering an election when a current host node residual power is below a first threshold, a current host node network performance indicator is degraded, and the current host node detects a hardware anomaly of its own.
  4. 4. The method of claim 1, wherein the Score calculation rule has a formula score=w 1 ×B+W 2 ×(1/R)+W 3 × (1/L), wherein Score is an energy consumption Score value, B is a percentage of the remaining battery power, R is a historical energy consumption rate, L is a data load, W 1 、W 2 and W 3 are preset weight coefficients, and W 1 +W 2 +W 3 =1.
  5. 5. The method of claim 4, wherein the configuration of W 1 、W 2 and W 3 comprises configuration W 1 >W 2 ≥W 3 for an industrial monitoring scenario and configuration W 1 >W 2 =W 3 for a smart home scenario.
  6. 6. The method of claim 1, wherein the step of ordering all nodes according to the energy consumption score values in all the received score response data to determine a new master node comprises: And sequencing all the received scoring response data according to the energy consumption scoring values from high to low, and selecting the node with the highest energy consumption scoring value as a new principal node.
  7. 7. The method of claim 6 wherein the scoring response data further includes a node cumulative operating time, and wherein when determining a new master node, if there are multiple nodes having the same highest energy consumption scoring value, selecting the node with the longest cumulative operating time from the multiple nodes as the new master node.
  8. 8. A master election method for a multi-node network, applied to any slave node of the multi-node network, the method comprising the steps of: receiving an election instruction broadcasted from a current main node, wherein the election instruction is broadcasted to the whole network and comprises a scoring calculation rule when the current main node judges that a preset election triggering condition is met; calculating an energy consumption score value of the node according to an energy consumption parameter set based on the score calculation rule, wherein the energy consumption parameter set comprises the residual battery capacity, the historical energy consumption rate and the data load; Generating scoring response data containing node identifiers and energy consumption scoring values of the nodes, and sending the scoring response data to the current main node so that the current main node can determine a new main node according to all received scoring response data, and generating and broadcasting election result data containing the node identifiers of the new main node; and receiving and responding to the election result data to complete network access and synchronization to the new master node.
  9. 9. A multi-node network comprising a current master node and a plurality of slave nodes, wherein: The current master node is configured to broadcast an election instruction containing a grading calculation rule to the whole network if the current master node meets a preset election triggering condition, receive grading response data returned by the current master node and each slave node in response to the election instruction, sort all nodes according to energy consumption grading values in all the received grading response data to determine a new master node, and generate and broadcast election result data containing node identifications of the new master node; The slave node is configured to receive the election instruction, calculate an energy consumption scoring value of the slave node according to an energy consumption parameter set based on the scoring calculation rule, wherein the energy consumption parameter set comprises residual battery power, historical energy consumption rate and data load; wherein the current master node and the slave node are further configured to perform master-slave role switching and network synchronization in response to the election result data.
  10. 10. An electronic device, comprising: A memory for storing one or more programs; A processor; The method of any of claims 1-8 is implemented when the one or more programs are executed by the processor.

Description

Main node election method of multi-node network, multi-node network and electronic equipment Technical Field The present application relates to the field of wireless communications technologies, and in particular, to a master node election method of a multi-node network, and an electronic device. Background In a wireless sensor network, the ZigBee protocol is widely used by virtue of its low power consumption, low cost and outstanding characteristics of self-organization, and its typical star topology is composed of a core master node (coordinator) and a plurality of slave nodes (sensor nodes). The master node takes on core tasks such as network management, data aggregation, external communication and the like, and the slave node is mainly responsible for environmental data acquisition and uploading data to the master node. Aiming at the configuration and election modes of the master node in the ZigBee star network, the prior proposal mainly adopts two representative schemes, namely, a fixed master node mode is adopted in the first category, namely, the role of the master node is fixed after the initial deployment of the network is completed, all core tasks are born for a long time, and the second category is dynamic election based on simple rules such as signal intensity or random extraction. However, in the process of implementing the present application, the inventor finds that whether the master node is a fixed master node or a simple random election logic, the situation that the master node rapidly runs out of energy due to continuous high load in the network operation and the energy of most slave nodes is not effectively utilized easily occurs, so that the life cycle of the network is shortened. Moreover, the election logics cannot be adapted to the requirements of node energy dynamic attenuation and network load real-time change, so that the network is difficult to maintain the optimal performance state in actual operation. Therefore, a main node election scheme capable of realizing dynamic balance is needed to solve the problems of unbalanced energy consumption and insufficient adaptability in the prior art, so as to effectively prolong the service life of the network and improve the reliability of the network. Disclosure of Invention The application aims to provide a master node election method of a multi-node network, the multi-node network and electronic equipment, which can solve the problems of unbalanced energy consumption and insufficient adaptability in the prior art, so as to effectively prolong the service life of the network and improve the reliability of the network. The application is realized in the following way: In a first aspect, the present application provides a method for electing a master node of a multi-node network, applied to a current master node of the multi-node network, the method comprising the step of broadcasting an election instruction comprising a scoring calculation rule to the whole network if the current master node determines that a preset election trigger condition is satisfied. And receiving grading response data returned by each node in response to the election instruction, wherein the grading response data comprises node identification and energy consumption grading values, the energy consumption grading values are grading values calculated by each node according to an energy consumption parameter set of each node based on grading calculation rules, and the energy consumption parameter set comprises residual battery power, historical energy consumption rate and data load. And sequencing all nodes according to the energy consumption scoring values in all the received scoring response data to determine a new master node. And generating and broadcasting election result data containing the node identification of the new master node so as to trigger the network to perform master-slave role switching and network synchronization according to the election result data. Based on the foregoing, in some implementations of the application, the preset election trigger condition includes at least one of a periodic trigger condition or an event trigger condition. Based on the foregoing, in some implementation manners of the present application, the event trigger condition includes triggering election when any one of a current main node residual capacity is lower than a first threshold value, a current main node network performance index is degraded, and the current main node detects own hardware abnormality. Based on the foregoing, in some implementations of the application, the Score calculation rule has a formula score=w 1×B+W2×(1/R)+W3 × (1/L), where Score is the energy consumption Score, B is the percentage of the remaining battery power, R is the historical energy consumption rate, L is the data load, W 1、W2 and W 3 are preset weight coefficients, and W 1+W2+W3 =1. Based on the foregoing, in some implementations of the application, the configuration of W 1、W2 and W 3 in