Master device election method of ad hoc network

Through the method of dynamically electing master equipment with weight, the problem of artificial intervention and instability of IoT devices in the election of master equipment in large-scale networking is solved, and the flexibility, stability and security of networking is improved.

CN119729694APending Publication Date: 2025-03-28HUNAN KAIHONG ZHIGU DIGITAL IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411806756.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When existing IoT devices are networking on a large scale, human intervention is required during the election of the main device, which can easily lead to abnormal device networking, and the data interaction is large and bandwidth occupies. The main device election switching may occur, which increases the networking time and instability, and plain text transmission is susceptible to interference from malicious nodes.

Method used

The method of dynamically electing the master device with weights is adopted. After the device is powered on, the weight information is obtained and the list of untrusted devices is initialized. It enters the pre-election stage, and random delay time is generated to monitor other device information, judge its status and conduct multi-stage elections, reduce the amount of broadcast data, improve the probability of optimal equipment election, and enhance network stability and security.

Benefits of technology

There is no need to pre-configure, which increases network flexibility, reduces the amount of broadcast data during large-scale equipment elections, increases the probability of electing the best equipment, increases network stability and security, and reduces interference from malicious equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729694A_ABST
    Figure CN119729694A_ABST
Patent Text Reader

Abstract

The invention provides a main device election method for an ad hoc network, and the method is characterized in that the method comprises the steps: obtaining first weight information elected by a current first device after the current first device is powered on, and initializing an untrusted device list at the same time; s2, starting to generate preset delay time, monitoring and storing cluster information of multiple devices received by the current first device within the preset delay time, and after the preset delay time is over, judging whether second device data in one of three states of an election stage, a decision stage and a confirmed stage exists in the cluster information or not; and if the second equipment data in the confirmed stage exists, taking the second equipment as the master equipment, and taking the current first equipment as the slave equipment to perform connection networking. And aiming at equipment networking with a certain operational capability, malicious equipment interference in an equipment election process is reduced through verification and signature of an equipment certificate chain and an untrusted equipment list, and the networking security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent collaborative communications, and in particular to the field of wireless communications. Background Art

[0002] With the growth of existing IoT devices, the interconnection between devices has become particularly important. Currently, common device network topologies are generally based on ad-hoc or mesh networks. When it comes to large-scale networking, it is generally necessary to build a multi-layer network topology to manage networking devices, which uses a star network approach. At this time, the election of the master device is particularly important. Currently, common solutions for the election of the master device include pre-configured master devices, device interactive random number elections, or elections by judging priority.

[0003] In the related art, devices connected to the Internet of Things determine whether to eliminate the current devices through broadcast messages, and use the devices with high priority as the main devices according to the priority messages carried in the broadcast messages. Thus, the networking is completed. However, in the case of the actual pre-configuration of the main device in the above scheme, human intervention is required in the actual networking scenario. Once the main device fails and there is a problem with the configuration, it may cause the device networking to be abnormal. In addition, when the above devices are networked on a large scale by directly interacting with random numbers or judging priorities, a large amount of data interaction will be generated, occupying bandwidth. At the same time, due to the uncertainty of device startup, it is possible that the main device is constantly switching elections, thereby increasing the networking time and causing the networking to become unstable. Finally, in the above-mentioned device election process, the use of plain text transmission may receive data from malicious nodes, causing interference to the networking, a long networking time or networking failure. Summary of the invention

[0004] In order to overcome the above technical defects, the present application provides a method, storage medium and device for selecting a master device in an ad hoc network.

[0005] To achieve the above objectives, this application is implemented according to the following technical solutions:

[0006] In a first aspect, the present application provides a method for selecting a master device of an ad hoc network, which is applied to a star network, wherein the ad hoc network includes status information of multiple devices, and the status information of the multiple devices includes a pre-election stage, an election stage, a decision stage, and a confirmed stage, including:

[0007] S1: Obtain the first weight information elected by the current first device after it is powered on, and initialize the list of untrusted devices at the same time;

[0008] The current first device enters the pre-election stage:

[0009] S2: Start generating a preset delay time, and within the preset delay time, monitor and save cluster information of multiple devices received by the current first device, wherein the cluster information of the multiple devices includes status information of the multiple devices;

[0010] S3: after the preset delay time ends, determine whether there is second device data in the cluster information that is in one of the three states of the election stage, the decision stage, and the confirmed stage; wherein the second device data includes second weight information elected by the second device itself, the second weight information is greater than the first weight information, and there is a preset difference between the second weight information and the first weight information, and the second device is not in the untrusted device list;

[0011] S4: If there is second device data in the confirmed stage, the second device is used as the master device and the current first device is used as the slave device to connect and network;

[0012] If there is no second device data in the confirmed stage, and there is second device data in the election stage or the decision stage, step S2 is executed.

[0013] Optionally, the step S2 includes:

[0014] After the preset delay time ends, if the cluster information does not contain any second device data in one of the three states of the election stage, the decision stage, and the confirmed stage;

[0015] Then the current first device sends a query command to the second device and enters a response waiting state;

[0016] If a response message returned by the second device is received within the preset response waiting time;

[0017] The second device is used as the master device, and the current first device is used as the slave device to connect and form a network.

[0018] Optionally, after entering the response waiting step, the method further includes:

[0019] If within the preset response waiting time, no response information returned by the second device is received, or data of a third device is received; wherein the third device data includes third weight information selected by the third device itself; and the third weight information is less than the first weight information;

[0020] Then the current first device enters the election phase:

[0021] The current first device broadcasts and sends its own device information, and enters a preset election delay phase;

[0022] Determine whether there is second device data in one of the three states of election stage, decision stage, and confirmed stage in the received broadcast information during the preset election delay stage;

[0023] If yes, confirming the status of the second device;

[0024] If the status of the second device is confirmed, performing a signature verification operation on the current first device;

[0025] If the signature verification of the first device is successful, the second device is used as the master device, and the current first device is used as the slave device to establish a network connection;

[0026] If the signature verification of the first device fails, the current first device is stored in the untrusted list.

[0027] Optionally, after the step of confirming the status of the second device if any, the step further includes:

[0028] If the state of the second device is the election or decision stage, the current first device is returned to the pre-election stage and step S2 is executed.

[0029] Optionally, after the step of determining whether there is second device data in one of the three states of an election stage, a decision stage, and a confirmed stage in the received cluster information during the election delay stage, the step further includes:

[0030] If, after the preset election delay period ends, the received broadcast information does not contain the second device data;

[0031] Then enter the decision-making stage.

[0032] Optionally, entering the decision-making stage includes:

[0033] The current first device enters the decision-making stage:

[0034] The current first device broadcasts its own device information within a preset interval, and adds a sending count to the own device information, wherein the sending count is used for multiple devices other than the current first device to calculate the preset delay time;

[0035] Determine whether there is data of a second device in one of the election stage and the decision stage in the broadcast information currently received by the first device;

[0036] If yes, the current first device stops broadcasting and returns to the pre-election stage to execute step S2;

[0037] If not, then enter the confirmed stage:

[0038] The current first device is confirmed as a master device, and the multiple devices are used as slave devices for networking.

[0039] In a second aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement a master device election method for a self-organizing network as described in any one of the first aspects.

[0040] In a third aspect, the present application provides a computer-readable storage medium, wherein the readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement a master device election method for a self-organizing network as described in any one of the first aspects.

[0041] This application has the following beneficial effects:

[0042] Through the technical solution of this application, the weight is used to dynamically elect the master device without pre-configuration, which increases the flexibility of the network. Compared with the method of directly interacting with random numbers or generating master devices by priority judgment, this solution reduces the amount of broadcast data in the large-scale device election process through delayed monitoring and multi-stage election, and increases the probability of electing the best device when multiple devices are powered on in an unordered manner, thereby increasing the stability of the network. And for the networking of devices with certain computing capabilities, through the device certificate chain verification and the list of untrusted devices, the interference of malicious devices in the device election process is reduced, and the security of the network is increased.

[0043] In addition to the above-described purposes, features and advantages, the present application also has other purposes, features and advantages. The present application will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0045] Figure 1 It is a flow chart of a method for electing a master device in a self-organizing network provided by the present application. DETAILED DESCRIPTION

[0046] The embodiments of the present application are described in detail below with reference to the accompanying drawings; however, the present application can be implemented in many different ways as defined and covered by the claims.

[0047] The applicant of the present application has found in actual work that there is a self-selection method for the central node of the Internet of Things, that is, multiple Internet of Things devices connected to the Internet of Things send broadcast messages carrying the priority of the device, so that the Internet of Things device with high priority is used as the main device, and other physical network devices with low priority are eliminated and used as slave devices for group connection and networking. However, in the first actual networking scenario, the above scheme requires human intervention when pre-configuring the main device, and then once the main device fails or there is a problem with the configuration, it may cause abnormal device networking. In addition, the above physical network devices will generate a large amount of data interaction and occupy bandwidth when networking on a large scale by directly interacting with random numbers or judging priorities. At the same time, due to the uncertainty of device startup, it is possible to cause the main device to keep switching elections, thereby increasing the networking time and causing the networking to become unstable. Finally, in the above process of the main device, since the broadcast message is transmitted in plain text, this may receive data from malicious nodes, causing the networking to be disturbed, the networking time is long or the networking fails. To this end, the applicant proposes a method for electing a master device in a self-organizing network. The method mainly involves obtaining information such as running memory after the device is powered on, determining its election weight to be selected as the master device, and initializing an untrusted list. The device then enters the pre-election stage, at which time a random delay is generated. During this delay period, the device monitors and saves other device information (device information includes device weight, IP / MAC, certificate, etc.). After the delay, the status of other saved device information (device status information generally includes pre-election stage, election stage, decision stage, and confirmed stage) is judged to determine whether there are other high-weight devices that are in a confirmed state and are not on the untrusted list. If so, the device is used as the master device and the current device is used as the slave device to establish a network connection. If no other devices in a confirmed state and not on the untrusted list are received, the next step is performed. Each step requires judging whether other high-weight device information in a confirmed state and not on the untrusted list is received, and then promptly stopping the process of determining the current device as the main device. Without the need for human intervention, the amount of data interaction is greatly reduced, reducing the time required for networking. At the same time, the untrusted device list is used to exclude the data of malicious nodes, so that the networking process will not be disturbed, reducing the networking time or the networking success.

[0048] like Figure 1 As shown, the present application proposes a method for selecting a master device of an ad hoc network, which is applied to a star network. The ad hoc network includes status information of multiple devices, and the status information of the multiple devices includes a pre-election stage, an election stage, a decision stage, and a confirmed stage, specifically including:

[0049] Step S1: obtaining the first weight information elected by the current first device after it is powered on, and simultaneously initializing a list of untrusted devices;

[0050] The master device election method of the self-organizing network of the present application is mainly used in the scenario of forming a star network. Moreover, the self-organizing network includes multiple devices, and the status of each device is different, but generally in one of the following four states in the order of processing number, namely, pre-election stage, election stage, decision stage, and confirmed stage.

[0051] The current first device is any device to be networked in the Internet of Things. After the current first device is powered on, the first weight information of the current first device's own election is calculated through the running memory, device communication link, and device power supply method. The first weight information is generally used to determine the weight information of the current first device that can be elected as the main device. Specifically, if the current first device has a larger running memory, a better device communication link, and a more diverse device power supply method, the value of the first weight information of the current first device will generally be higher.

[0052] When obtaining the first weight information, the untrusted list is also initialized.

[0053] The untrusted list is a list of individuals, organizations, devices, IP addresses, websites, etc. that are identified as potentially risky, unreliable, or not meeting specific trust standards. It is a tool for security management, risk control, or resource allocation decisions. Through this untrusted list, the security of the device that needs to be networked can be judged when networking. If it is not on the untrusted list, it can be connected to the network. If it is, it means that the device node is a malicious node, so the device is discarded and not networked.

[0054] After initializing the untrusted list, the current first device enters the pre-election stage, which is as follows:

[0055] Step S2: Start generating a preset delay time, and within the preset delay time, monitor and save cluster information of multiple devices received by the current first device, wherein the cluster information of the multiple devices includes status information of the multiple devices;

[0056] Step S3: after the preset delay time ends, determine whether there is second device data in one of the three states of the election stage, the decision stage, and the confirmed stage in the cluster information; wherein the second device data includes second weight information elected by the second device itself, the second weight information is greater than the first weight information, and there is a preset difference between the second weight information and the first weight information, and the second device is not in the untrusted device list;

[0057] If there is second device data in the confirmed stage, the second device is used as the master device and the current first device is used as the slave device to connect and network;

[0058] If there is no second device data in the confirmed stage, and there is second device data in the election stage or the decision stage, step S2 is executed.

[0059] The purpose of generating a preset delay time is mainly to monitor and save the cluster information of multiple devices received by the current first device within the delay time period. The cluster information generally includes the status information of multiple devices, namely, the four different stages of the pre-election stage, the election stage, the decision stage, and the confirmed stage. This is done for the judgment of the networking later. By judging the status of other devices, it is helpful to reduce the time consumption of networking. The cluster information also includes the election weight information of other devices, as well as related information such as IP / MAC, certificate, and whether it is on the list of untrusted devices. The preset delay time can be set by yourself, and this article does not make specific restrictions on this. However, in order to reduce the time consumption of networking, the preset delay time should not be too long. For example, the preset delay time should not exceed twenty seconds.

[0060] Step S3: after the preset delay time ends, determine whether there is second device data in one of the three states of the election stage, the decision stage, and the confirmed stage in the cluster information; wherein the second device data includes second weight information elected by the second device itself, the second weight information is greater than the first weight information, and there is a preset difference between the second weight information and the first weight information, and the second device is not in the untrusted device list;

[0061] If there is second device data in the confirmed stage, the second device is used as the master device and the current first device is used as the slave device to connect and network;

[0062] If there is no second device data in the confirmed stage, and there is second device data in the election stage or the decision stage, step S2 is executed.

[0063] After the preset delay time ends, it is necessary to judge the multiple device cluster information saved by the current first device, that is, to judge whether there is a second device data in one of the three states: election stage, decision stage, and confirmed stage. The second device data in the three states mentioned above is confirmed here, generally including the second weight information of the second device itself. Since the present application is to elect a device with a higher weight to be networked as the main device, the second weight information is greater than the first weight information, and there is a preset difference with the first weight information. The specific range of the preset difference is not specifically limited in this article, but since there are multiple devices and the difference in weight is large, in order to distinguish, the difference range is set to be larger. At the same time, in order to avoid data damage by malicious nodes during the networking process, it is necessary to ensure that the second device is not in the list of untrusted devices.

[0064] Step S4: If there is second device data in the confirmed stage, the second device is used as the master device and the current first device is used as the slave device to connect and network;

[0065] If there is no second device data in the confirmed stage, and there is second device data in the election stage or the decision stage, step S2 is executed.

[0066] After the above judgment, if there is second device data in the confirmed stage in the above cluster information, it means that the second weight information elected by the second device itself is higher than the first weight information of the current first device, as well as the weight information elected by other devices themselves. At this time, the second device has been confirmed as the master device, and the current first device is directly switched to a slave device to connect to the network.

[0067] If the above cluster information does not contain the second device data in the confirmed stage, but contains the second device data in the election stage and decision stage, it means that the second weight information elected by the second device itself is higher than the first weight information of the current first device, as well as the weight information elected by other devices themselves. At this time, the second device is about to be confirmed as the master device, and the current first device does not need to confirm the master device. At this time, the current first device enters a new preset delay time, waiting for the second device to be confirmed by the master device decision, and then changes the state of the second device to the confirmed stage. After the current first device monitors and saves the information that the second device has changed to the confirmed state, it switches the current first device to a slave device to connect to the network. This is done to avoid unnecessary operations by the current first device when other devices with higher weights than the current first device appear during the process of the current first device confirming the master device, thereby reducing data transmission and time consumption in the network.

[0068] If after the preset delay time, there is neither the second device data in the confirmed stage nor the second device data in the election stage or decision stage, sometimes due to the communication problem of the device, the second device data in the election stage, decision stage, and confirmed stage may be missed when monitoring and saving the cluster messages of multiple devices. In order to avoid such a situation, the current first device sends a second device query command and enters the response waiting stage. The second device query command is used to confirm whether there is the second device data in the election stage, decision stage, and confirmed stage in the multiple devices at this time. After the current first device sends the second device query command, it enters the response waiting stage.

[0069] If the response information returned by the second device is received within the preset response waiting time, and if the second device in the returned response information is in the confirmed stage, it means that the second device has been confirmed as the master device of the network at this time. At this time, the second device is used as the master device and the current first device is used as the slave device to connect to the network. If the second device in the returned response information is in the election or decision-making stage, it means that the second device is waiting for the master device to confirm. At this time, the master device confirmation operation of the current first device is stopped, a new delay is started, and step S2 is executed. After waiting for the status of the second device to be confirmed, the second device is used as the master device and the current first device is used as the slave device to connect to the network.

[0070] It should be noted that the preset response waiting time is not specifically limited in this article, but in order to ensure the efficiency of networking, the time generally set should not be too long, generally speaking, it should be less than the preset delay time.

[0071] If the response message returned by the second device is not received within the preset response waiting time, or the third device data is received, and the third device data includes the third weight information elected by the third device itself, and the third weight information is less than the first weight information, it means that at this time, the first weight information of the current first device may be the highest, and then enter the election stage:

[0072] After entering the election phase, the current first device broadcasts its own device information and enters the preset election delay phase. The first device's own device information generally includes data such as the device public key certificate, device information, and the device's own election weight information. Except for the public key certificate, other data is encrypted by the private key.

[0073] The purpose of setting a preset election delay stage is to confirm whether there is data of a second device in one of the three states, namely, the election stage, the decision stage, or the confirmed stage, in the broadcast information received by the current first device during the election delay period; if there is, the state of the second device is confirmed based on the second device data. If the state of the second device is confirmed, the signature verification operation is performed on the current first device. If the signature verification of the first device passes, the second device is used as the master device, and the current first device is switched to the slave device for networking connection. If the signature verification fails, the current first device is stored in the list of untrusted devices, and a data shielding time is set. During this time, the data of the device is directly discarded after being received. This is done to reduce the time spent in the device networking process.

[0074] If within the preset election delay period, the status of the second device is in the election or decision-making stage, it means that the second device is waiting for confirmation from the master device. At this time, the master device confirmation operation of the current first device is stopped, and the process returns to the pre-election stage. Step S2 is executed, and after the status of the second device is confirmed, the second device is used as the master device and the current first device is used as the slave device to connect and form a network.

[0075] It should be noted that the preset election delay phase is not specifically limited in this article, but it should be confirmed that the sum of the preset election delay phase and the preset response waiting time must be less than the preset delay time of the pre-election phase.

[0076] If, in the preset election delay phase, the received broadcast information does not include the second device data in the election phase, the decision phase, or the confirmed phase, the current first device enters the decision phase.

[0077] The first device currently enters the decision-making stage:

[0078] The current first device broadcasts its own device information within a preset interval, and adds a sending count to its own device information. The sending count is mainly used to calculate the delay time for multiple devices other than the current first device. In order to improve the efficiency of confirming the current first device as the main device, when the current first device sends its own device information, the maximum number of packets is set, thereby limiting the number of packets broadcasted by the first device each time, which is conducive to reducing

[0079] At this time, since the current first device will also receive broadcast information from other devices, it is also necessary to judge the received broadcast information to determine whether there is a second device data in one of the two states, the election stage and the decision stage, in the received broadcast message. If so, the current first device stops broadcasting and returns to the pre-election stage, executes step S2, waits for the status of the second device to be confirmed, and then uses the second device as the master device and the current first device as the slave device to connect to the network.

[0080] After the current first device is confirmed as the master device, other devices are switched to slave devices to connect to the network.

[0081] If a device that has completed networking receives data from other devices in the decision-making stage again, it will verify the signature and compare it with the main device connected at this time. If the weight of the other device is higher than the currently connected main device, it will wait for the decision-making stage to be completed, switch to the new device, and connect to the network.

[0082] The technical solution of this application uses weights to dynamically elect the master device without pre-configuration, which increases the flexibility of the network. Compared with the method of directly interacting with random numbers or generating master devices by priority judgment, this solution reduces the amount of broadcast data in the large-scale device election process through delayed monitoring and multi-stage elections, and increases the probability of electing the best device when multiple devices are powered on in an unordered manner, thereby increasing the stability of the network. And for the networking of devices with certain computing capabilities, through the device certificate chain verification and the list of untrusted devices, the interference of malicious devices in the device election process is reduced, and the security of the network is increased.

[0083] In some embodiments, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the point cloud data correction method provided in the first aspect.

[0084] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional blocks / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer-readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).

[0085] As is known to those of ordinary skill in the art, the term computer-readable storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.

[0086] Exemplarily, the computer-readable storage medium may be an internal storage unit of the network management device described in the foregoing embodiment, such as a hard disk or memory of the network management device. The computer-readable storage medium may also be an external storage device of the network management device, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the network management device.

[0087] In some embodiments, a device is provided, including a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the computer program and implement the point cloud data correction method provided in the first aspect of the present application when executing the computer program.

[0088] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0089] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for selecting a master device of an ad hoc network, applied to a star network, wherein the ad hoc network includes status information of multiple devices, wherein the status information of the multiple devices includes a pre-election stage, an election stage, a decision stage, and a confirmed stage, characterized in that: include: S1: Obtain the first weight information elected by the current first device after it is powered on, and initialize the list of untrusted devices at the same time; The current first device enters the pre-election stage: S2: Start generating a preset delay time, and within the preset delay time, monitor and save cluster information of multiple devices received by the current first device, wherein the cluster information of the multiple devices includes status information of the multiple devices; S3: after the preset delay time ends, determine whether there is second device data in the cluster information that is in one of the three states of the election stage, the decision stage, and the confirmed stage; wherein the second device data includes second weight information elected by the second device itself, the second weight information is greater than the first weight information, and there is a preset difference between the second weight information and the first weight information, and the second device is not in the untrusted device list; S4: If there is second device data in the confirmed stage, the second device is used as the master device and the current first device is used as the slave device to connect and network; If there is no second device data in the confirmed stage, and there is second device data in the election stage or the decision stage, step S2 is executed.

2. The method according to claim 1, characterized in that: The step S2 then comprises: After the preset delay time ends, if the cluster information does not contain any second device data in one of the three states of the election stage, the decision stage, and the confirmed stage; Then the current first device sends a query command to the second device and enters a response waiting state; If a response message returned by the second device is received within the preset response waiting time; The second device is used as the master device, and the current first device is used as the slave device to connect and form a network.

3. The method according to claim 2, characterized in that After entering the answer waiting step, the method further includes: If within the preset response waiting time, no response information returned by the second device is received, or data of a third device is received; wherein the third device data includes third weight information selected by the third device itself; and the third weight information is less than the first weight information; Then the current first device enters the election phase: The current first device broadcasts and sends its own device information, and enters a preset election delay phase; Determine whether there is second device data in one of the three states of election stage, decision stage, and confirmed stage in the received broadcast information during the preset election delay stage; If yes, confirming the status of the second device; If the status of the second device is confirmed, performing a signature verification operation on the current first device; If the signature verification of the first device is successful, the second device is used as the master device, and the current first device is used as the slave device to establish a network connection; If the signature verification of the first device fails, the current first device is stored in the untrusted list.

4. The method according to claim 3, characterized in that If yes, then the step of confirming the status of the second device also includes: If the state of the second device is the election or decision stage, the current first device is returned to the pre-election stage and step S2 is executed.

5. The method according to claim 3, characterized in that: After the step of determining whether there is second device data in one of the three states of the election stage, the decision stage, and the confirmed stage in the received cluster information during the election delay stage, the following step is further followed: If, after the preset election delay period ends, the received broadcast information does not contain the second device data; Then enter the decision-making stage.

6. The method according to claim 5, characterized in that The decision-making phase includes: The current first device enters the decision-making stage: The current first device broadcasts its own device information within a preset interval, and adds a sending count to the own device information, wherein the sending count is used for multiple devices other than the current first device to calculate the preset delay time; Determine whether there is data of a second device in one of the election stage, the decision stage, or the two states in the broadcast information currently received by the first device; If yes, the current first device stops broadcasting and returns to the pre-election stage to execute step S2; If not, then enter the confirmed stage: The current first device is confirmed as a master device, and the multiple devices are used as slave devices for networking.

7. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the master device election method of the self-organizing network as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the master device election method of the self-organizing network as described in any one of claims 1 to 6.