Equipment networking method and system, intelligent terminal and computer readable storage medium
By determining the networking stage and node selection method according to the number of devices, and dividing device groups, the problems of device networking flexibility and poor communication effects in the existing technology are solved, and flexible and efficient device networking is achieved.
Patent Information
- Application Number
- CN202410880215.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-27
AI Technical Summary
When networking equipment in the prior art, a central device is directly selected to network with other peripheral devices, and a preset fixed communication method is used without considering the actual scenario, resulting in poor networking flexibility and poor data communication effects.
Determine the device networking stage according to the number of devices to be networked, and then determine the convergence node selection method, group leader node selection method and device communication method, divide multiple device groups, and perform data synchronization through the group leader node and convergence node to achieve Flexible device networking.
It improves the flexibility of equipment networking and the data communication effect after networking, and adapts to the equipment networking needs of different scales and scenarios.
Smart Images

Figure CN118714010A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device networking method, system, intelligent terminal and computer-readable storage medium. Background Art
[0002] With the development of science and technology, communication technology has also gradually developed, and users have higher and higher requirements for communication between devices. In the field of communication technology, especially the field of Internet of Things communication technology, communication and data transmission between devices are usually achieved based on device networking.
[0003] In the related art, when networking devices, a one-to-many networking form is usually adopted, that is, a central device is selected to network with multiple surrounding devices through a preset fixed communication method to achieve device networking. The problem with the related art is that a central device is directly selected to network with other surrounding devices, and a preset fixed communication method is adopted without considering the actual scenario, which is not conducive to improving the flexibility of device networking and the data communication effect after networking.
[0004] Therefore, relevant technologies still need to be improved and developed. Summary of the invention
[0005] The main purpose of this application is to provide a device networking method, system, intelligent terminal and computer-readable storage medium, aiming to solve the technical problem in the related technology of directly selecting a central device to network with other surrounding devices and using a preset fixed communication method without considering the actual scenario, which is not conducive to improving the flexibility of device networking and the data communication effect after networking.
[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a device networking method, wherein the device networking method comprises:
[0007] Acquire networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked;
[0008] Determine the device networking stage according to the number of the above-mentioned devices to be networked;
[0009] Determine a method for selecting a convergence node according to the networking stage of the above-mentioned equipment, and determine at least one convergence node device from the above-mentioned devices to be networked based on the above-mentioned convergence node selection method;
[0010] According to the Internet Protocol addresses, other devices to be networked except the aggregation node devices are divided to obtain multiple device groups;
[0011] Determine the leader node selection method according to the above-mentioned device networking stage, and determine the leader node device and member node devices corresponding to each of the above-mentioned device groups based on the above-mentioned leader node selection method, wherein the member node devices in a device group include all the devices to be networked in the device group except the above-mentioned leader node device;
[0012] The device communication mode is determined according to the above-mentioned device networking stage, and the device networking is performed according to the above-mentioned device communication mode, the above-mentioned member node devices, the above-mentioned group leader node devices and the above-mentioned aggregation node devices.
[0013] A second aspect of the present application provides a device networking system, wherein the device networking system comprises:
[0014] An information acquisition module, used to acquire networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked;
[0015] A networking stage determination module, used to determine the device networking stage according to the number of the above-mentioned devices to be networked;
[0016] A convergence node selection module, used to determine a convergence node selection method according to the networking stage of the above-mentioned equipment, and determine at least one convergence node device from the above-mentioned devices to be networked based on the above-mentioned convergence node selection method;
[0017] A group division module, used to divide other devices to be networked except the above-mentioned aggregation node device according to the above-mentioned Internet Protocol addresses to obtain multiple device groups;
[0018] A device division module, used to determine a leader node selection method according to the above-mentioned device networking stage, and determine the leader node device and member node device corresponding to each of the above-mentioned device groups based on the above-mentioned leader node selection method, wherein the member node device in a device group includes all the devices to be networked in the device group except the above-mentioned leader node device;
[0019] The networking module is used to determine the device communication mode according to the above-mentioned device networking stage, and to perform device networking according to the above-mentioned device communication mode, the above-mentioned member node devices, the above-mentioned group leader node devices and the above-mentioned aggregation node devices.
[0020] A third aspect of the present application provides a smart terminal, which includes a memory, a processor, and a device networking program stored in the memory and executable on the processor. When the device networking program is executed by the processor, any step of the device networking method is implemented.
[0021] A fourth aspect of the present application provides a computer-readable storage medium, on which a device networking program is stored. When the device networking program is executed by a processor, any step of the device networking method is implemented.
[0022] As can be seen from the above, in the present application scheme, networking reference information is obtained, wherein the above networking reference information includes the number of devices to be networked, and the Internet Protocol address of each of the above devices to be networked; the device networking stage is determined according to the number of the above devices to be networked; the aggregation node selection method is determined according to the above device networking stage, and at least one aggregation node device is determined from the above devices to be networked based on the above aggregation node selection method; according to the above Internet Protocol addresses, other devices to be networked except the above aggregation node devices are divided to obtain multiple device groups; according to the above device networking stage, the group leader node selection method is determined, and the group leader node device and member node device corresponding to each of the above device groups are respectively determined based on the above group leader node selection method, wherein the member node devices in a device group include all devices to be networked in the device group except the above group leader node device; according to the above device networking stage, the device communication method is determined, and device networking is performed according to the above device communication method, the above member node devices, the above group leader node device and the above aggregation node device.
[0023] Compared with the prior art, the present application does not select a central device from the devices to be networked to adopt a preset fixed communication method for networking. Instead, the device networking stage is determined according to the number of devices to be networked, and then the corresponding aggregation node selection method, group leader node selection method and device communication method are determined based on the device networking stage. In different device networking stages, the aggregation node device is determined according to the corresponding aggregation node selection method, and the other devices to be networked except the aggregation node device are divided into multiple device groups, and then the group leader node device and member node device of each device group are determined. The device networking is performed based on the group leader node device and member node device of the multiple device groups determined by the division, the aggregation node device and the device communication method of the current device networking stage. In this way, the device networking can be carried out according to the actual scenario, which is conducive to improving the flexibility of the device networking and the data communication effect after networking. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0025] Figure 1This is a community soft bus networking diagram provided by an embodiment of the present application;
[0026] Figure 2 It is a flow chart of a device networking method provided in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of a logical network topology provided in an embodiment of the present application;
[0028] Figure 4 It is a network physical link topology diagram corresponding to the first networking stage provided in an embodiment of the present application;
[0029] Figure 5 It is a network physical link topology diagram corresponding to the second networking stage provided in an embodiment of the present application;
[0030] Figure 6 It is a schematic diagram of a logic model provided in an embodiment of the present application;
[0031] Figure 7 It is a logic diagram of a soft bus subsystem provided in an embodiment of the present application;
[0032] Figure 8 This is a schematic diagram of a module plug-in implementation provided by an embodiment of the present application;
[0033] Fig. 9 This is a schematic diagram of interaction between key modules of a large-scale network provided by an embodiment of the present application;
[0034] Fig.10 This is a schematic diagram of a device discovery scenario provided by an embodiment of the present application;
[0035] Fig.11 This is a schematic diagram of a device broadcast message content provided by an embodiment of the present application;
[0036] Fig.12 This is a schematic diagram of different broadcast frequencies of a device provided in an embodiment of the present application;
[0037] Fig.13 This is a schematic diagram of device authentication within a broadcast domain provided by an embodiment of the present application;
[0038] Fig.14 It is an initial soft bus networking diagram provided by an embodiment of the present application;
[0039] Fig.15 It is a schematic diagram of a process of information synchronization of a master device provided in an embodiment of the present application;
[0040] Fig.16 This is a schematic diagram of a scenario for reporting and sending device information provided by an embodiment of the present application;
[0041] Fig.17 This is a schematic diagram of a device heartbeat connection provided in an embodiment of the present application;
[0042] Fig.18 This is a logical diagram of a node election module provided in an embodiment of the present application;
[0043] Fig.19 This is a schematic diagram of a message structure in an election process provided by an embodiment of the present application;
[0044] Fig. 20 This is a schematic diagram of a node broadcast scenario provided in an embodiment of the present application;
[0045] Fig.21 It is a post-election node network topology diagram provided by an embodiment of the present application;
[0046] Fig. 22 This is a schematic diagram of processing the death of a convergence node provided in an embodiment of the present application;
[0047] Fig.23 This is a schematic diagram of processing the death of a group leader node provided in an embodiment of the present application;
[0048] Fig.24 It is a schematic diagram of component modules of a device networking system provided in an embodiment of the present application;
[0049] Fig.25 It is a block diagram of the internal structure principle of a smart terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0051] Currently, users have increasingly higher requirements for communication between devices. In the field of communication technology, communication and data transmission between devices can be achieved based on device networking.
[0052] In the related art, when networking devices, a one-to-many networking form is usually adopted, that is, a central device is selected to network with multiple surrounding devices through a preset fixed communication method to achieve device networking. The problem with the related art is that a central device is directly selected to network with other surrounding devices, and a preset fixed communication method is adopted without considering the actual scenario, which is not conducive to improving the flexibility of device networking and the data communication effect after networking.
[0053] In scenarios with a large number of devices (e.g. 100 or more), such as drone clusters, data interconnection between devices needs to be achieved on the end side, that is, data is not transmitted to the server (cloud) but transmitted between devices. In scenarios with large amounts of data, end-cloud interconnection is a common processing method, but when the amount of data is small, communication is concentrated on the end side. Interconnection of devices will achieve higher efficiency.
[0054] Figure 1 This is a community soft bus networking diagram provided by an embodiment of the present application, wherein information such as "192.168.1.2" represents an IP address, which will not be described in detail below. Figure 1 As shown in the figure, in one application scenario, for the on-site communication scenario, networking can be based on the community soft bus, the communication protocol uses TCP / IP and BLE, and the devices rely on broadcasting to discover each other. The overall networking form is one-to-many networking (one central device and multiple surrounding devices). Among them, the IP broadcast protocol uses the coap protocol, and the broadcast can discover devices in the same network segment (less than or equal to 254 devices); Bluetooth can discover a few devices in the near field. However, this solution cannot meet the end-side communication needs in large-scale scenarios.
[0055] In a large-scale networking scenario, if all devices are in the same broadcast domain, communication interference between devices and device management become particularly complicated. In an embodiment of the present application, a device networking method can be provided, which can be specifically applied in a soft bus subsystem. Specifically, by analyzing the business scenario, the soft bus subsystem will adopt a hierarchical and graded approach to manage large-scale networking. Large-scale devices are divided into a certain number of small-scale groups, and the aggregation node synchronizes the information between different groups to complete the discovery of networking and data transmission between large-scale devices.
[0056] The basic communication link is composed of Ad-hoc communication module and Ethernet. After accessing the Ad-hoc communication module through the RJ-45 interface, the soft bus subsystem will work on the self-organizing network built by the module. The Ad-hoc module will build a mobile self-organizing network, and the terminal devices can move arbitrarily within the network while maintaining communication. Each terminal will assume the functions of routing and host. As a host, it will provide data communication functions for the soft bus subsystem; as a router, the terminal will provide forwarding functions for data packets to maintain group network connectivity. Ethernet communication is mainly used to maintain communication between group master nodes. Since a large amount of data needs to be exchanged between master nodes, Ethernet provides guarantees for master node communication with high bandwidth and high reliability.
[0057] Specifically, in the scheme of the present application, networking reference information is obtained, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked; the device networking stage is determined according to the number of the devices to be networked; the aggregation node selection method is determined according to the device networking stage, and at least one aggregation node device is determined from the devices to be networked based on the aggregation node selection method; according to the Internet Protocol addresses, other devices to be networked except the aggregation node devices are divided to obtain multiple device groups; according to the device networking stage, the leader node selection method is determined, and the leader node device and member node device corresponding to each of the device groups are determined based on the leader node selection method, wherein the member node devices in a device group include all devices to be networked in the device group except the leader node device; according to the device networking stage, the device communication method is determined, and device networking is performed according to the device communication method, the member node devices, the leader node device and the aggregation node device.
[0058] Compared with the prior art, the present application scheme does not select a central device from the devices to be networked to adopt a preset fixed communication method for networking. Instead, the device networking stage is determined according to the number of devices to be networked, and then the corresponding aggregation node selection method, group leader node selection method and device communication method are determined based on the device networking stage. In different device networking stages, the aggregation node device is determined according to the corresponding aggregation node selection method, and the other devices to be networked except the aggregation node device are divided into multiple device groups, and then the group leader node device and member node device of each device group are determined. The device networking is performed based on the group leader node device and member node device of the multiple device groups determined by the division, the aggregation node device and the device communication method of the current device networking stage. In this way, the device networking can be performed according to the actual scenario, which is conducive to improving the flexibility of the device networking. In addition, communication is performed based on each device group, and the corresponding information is synchronized to the aggregation node device through the group leader node device of each device group, which is conducive to improving the communication effect and device transmission effect after networking.
[0059] like Figure 2 As shown, the embodiment of the present application provides a device networking method. Specifically, the method includes the following steps:
[0060] Step S100, obtaining networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked.
[0061] The networking reference information is information required in the device networking process, specifically related information of the device to be networked, which can be obtained by collecting information of the device to be networked, or by receiving information uploaded by the device to be networked.
[0062] Specifically, the above networking reference information specifically reflects the current networking scenario, and the device networking control is performed based on the above networking reference information, and the corresponding networking method can be selected in full combination with the current networking scenario. In an embodiment of the present application, the above networking reference information includes the number of devices to be networked, and the Internet Protocol (IP) address of each of the above devices to be networked. In actual application, the above devices to be networked may also include other information, such as device ID, device type and other device information. Specifically, the above device information may also be referred to during the device networking process. For example, when performing group division, the division may also be combined with the device type, and devices of the same type may be divided into the same group, which is not specifically limited here.
[0063] Step S200, determining the device networking stage according to the number of the devices to be networked.
[0064] Among them, the above-mentioned device networking stage is determined according to the networking scale, and the networking scale can be represented by the number of devices to be networked. Therefore, in the embodiment of the present application, the device networking stage is directly determined according to the number of devices to be networked.
[0065] Specifically, the device networking stage is determined according to the number of the devices to be networked, including:
[0066] If the number of the devices to be networked is not greater than the preset stage judgment threshold, the device networking stage is determined to be the first networking stage;
[0067] If the number of the devices to be networked is greater than a preset stage judgment threshold, the device networking stage is determined to be the second networking stage.
[0068] Among them, the above-mentioned stage judgment threshold is a pre-set device threshold for dividing the networking scale and thus the networking stage. Specifically, the stage judgment threshold can be pre-set according to actual needs, or can be adjusted in real time according to actual needs, and no specific limitation is made here.
[0069] It should be noted that, in this application, a stage judgment threshold is set, and the first networking stage and the second networking stage are divided accordingly. However, in actual application, multiple stage judgment thresholds can be set in a step-by-step manner, and multiple networking stages can be determined according to the multiple stage judgment thresholds. For example, the first networking stage, the second networking stage, and the third networking stage are determined according to the first stage judgment threshold and the second stage judgment threshold.
[0070] It should be further explained that in different networking stages, in addition to the different numbers of devices to be networked, there may be other differences and other specific requirements, such as the total number of devices discovered by a single device within a preset time, etc. Therefore, the corresponding networking stage can also be determined in combination with other factors.
[0071] In one application scenario, there are three networking stages, and device networking is performed based on soft bus devices, which implement functions such as discovery, connection, networking, dynamic update of device information, and secure transmission.
[0072] Specifically, the networking capability of the soft bus devices in Phase 1 is enhanced, supporting networking of no less than 100 devices. Discovery: In large-scale (no less than 100 devices, software simulation device verification, no less than 20 physical device nodes) device node scenarios, a single device discovers no less than 80% of the total number of devices within 250 seconds, and a single device discovers no less than 90% of the total number of devices within 350 seconds. Connection: In large-scale (no less than 100 devices, software simulation device verification, no less than 20 physical device nodes) device node scenarios, the probability that a single device establishes a connection with another device in less than 25 seconds is more than 95%, the probability that the message transmission delay after the connection is established is less than the physical link delay increased by 50ms is more than 95%, the probability that the disconnection time is less than 15 seconds is more than 95%, and the connection success rate is not less than 90%. Networking: In large-scale (no less than 100 devices, software simulation device verification, no less than 20 physical device nodes) device node scenarios, the probability that a single device takes less than 30 seconds to network with other devices is more than 95%, and the probability that it takes less than 20 seconds to disconnect the network is more than 95%. A single device enters and leaves the network 1,000 times, and the networking success rate is not less than 90%, and the disconnection success rate is not less than 90%. Dynamic update of device information: In large-scale (no less than 100 devices, software simulation device verification, no less than 20 physical device nodes) device node scenarios, through heartbeat keep-alive, the probability that a single device detects that another device is offline for less than 30 seconds is more than 95%, and the probability that it is less than 50 seconds is more than 99%; the probability that the device information update notification time is less than 50 seconds is more than 95%, and the probability that it is less than 80 seconds is more than 99%, and the device information update notification success rate is not less than 95%. Secure transmission: In large-scale (no less than 100 devices, software simulation device verification, no less than 20 physical device nodes) device node scenarios, implement unified management of secure transmission technology, achieve secure transmission of large-scale device data, support at least one transmission encryption and decryption algorithm, and provide this capability as an option.
[0073] Phase II soft bus device networking capability is enhanced, supporting networking of no less than 200 devices. Comprehensive performance and stability optimization for phase I indicators. New scenarios such as high packet loss, low bandwidth, and high latency for uncertain networks are added to achieve discovery, connection, networking, and transmission of soft buses. Discovery and connection: Supports link discovery and connection for uncertain networks. When discovering uncertain networks, supports discovery capabilities for at least 100 devices (software simulation device verification, no less than 20 physical device nodes), and the probability of a single device discovering other devices in less than 500s is more than 80%, and the number of discovered devices is no less than 80%. Networking: Supports networking scenarios of at least 100 devices (software simulation device verification, no less than 20 physical device nodes), the probability of other devices taking less than 60s to network is more than 80%, the probability of disconnecting the network takes less than 40s is more than 80%, a single device enters and leaves the network 1,000 times, the networking success rate is not less than 85%, and the disconnection success rate is not less than 90%. Transmission: In a transmission scenario that supports at least 100 devices (software simulation device verification, with no less than 20 physical device nodes), the probability that a single device takes less than 40 seconds to establish a connection with another device is more than 80%, the probability that the connection is disconnected in less than 30 seconds is more than 80%, and the connection success rate is not less than 80%.
[0074] Phase III: The networking capability of soft bus devices is enhanced, supporting networking of no less than 1,000 devices. Comprehensive performance and stability optimization for the indicators of Phase II. New concurrent authentication: large-scale (no less than 1,000 devices, software simulation device verification, no less than 300 physical device nodes) efficient concurrent authentication control to avoid system overload caused by a large number of devices authenticating at the same time. The system memory usage of the authentication process does not exceed 150M, and the CPU usage does not exceed 20%. Cross-group networking: support a single device to belong to more than 2 groups. Balance device discovery time and system load, keep alive (online / offline status detection) sensitivity and bandwidth consumption. Transmission indicator monitoring: provide link performance monitoring interface. Heartbeat mechanism: design a connectionless networking heartbeat mechanism to replace the original TCP connection-oriented networking state maintenance mechanism to reduce system consumption; in large-scale (no less than 300 physical device nodes) device node scenarios, under normal network connection conditions, the number of disconnections of a single device within 48 hours is no more than 10 times, and the success rate of re-online after disconnection is not less than 90%. The security capability of the soft bus is enhanced, and the design implements interfaces that are compatible with and integrate at least two related authentication methods and encryption algorithms, and supports flexible configuration of authentication methods and encryption algorithms.
[0075] It should be noted that in the embodiment of the present application, the networking process of the first networking stage can be used for the above-mentioned stage one, and the networking process of the second networking stage can be used for the above-mentioned stages two and three.
[0076] Step S300: determining a method for selecting a convergence node according to the device networking stage, and determining at least one convergence node device from the devices to be networked based on the convergence node selection method.
[0077] In the embodiment of the present application, different aggregation node selection methods can be pre-set for different device networking stages to determine the corresponding aggregation node devices.
[0078] Specifically, the networking reference information also includes performance information of each of the above-mentioned devices to be networked;
[0079] The above-mentioned method of determining the aggregation node selection method according to the above-mentioned device networking stage, and determining at least one aggregation node device from the above-mentioned devices to be networked based on the above-mentioned aggregation node selection method, includes:
[0080] If the device networking stage is the first networking stage, determining the aggregation node selection method is to select a preset device, and selecting at least one preset aggregation node device from the devices to be networked;
[0081] If the device networking stage is the second networking stage, the aggregation node selection method is determined to be election, and at least one aggregation node device is elected from the devices to be networked according to the performance information of each of the devices to be networked.
[0082] Among them, the above performance information is used to indicate the central processing unit (CPU) performance and / or graphics processing unit (GPU) performance of the device to be networked, and can also indicate other performance, such as memory size, etc., which is not specifically limited here.
[0083] In the embodiment of the present application, in the first networking stage, the number of devices to be networked is small, and a preset device can be directly selected as an aggregation node device. In the second networking stage, an election is performed based on the performance of the devices to be networked, so that devices with better performance are used as aggregation node devices, thereby improving the processing capacity of the aggregation node and thus improving the processing capacity of the entire network. Among them, the Paxos algorithm, Raft algorithm, etc. can be used during the election, and other election algorithms can also be used, which are not specifically limited here.
[0084] It should be noted that when selecting an aggregation node device, one main aggregation node device and one or more backup aggregation node devices can be selected. The backup aggregation node device can realize the corresponding functions of the main aggregation node device when the main aggregation node device cannot be used normally (for example, damaged, offline, etc.). Among them, the above-mentioned backup aggregation node devices can be pre-set, that is, a fixed device with relatively stable performance and not easy to be damaged is pre-set as the aggregation node device. No matter in which networking stage, the backup aggregation node device is not obtained through election.
[0085] Step S400: According to the Internet Protocol addresses, the other devices to be networked except the aggregation node device are divided to obtain a plurality of device groups.
[0086] In the embodiment of the present application, the devices to be networked are divided according to the Internet Protocol addresses (ie, IP addresses) to obtain multiple device groups, wherein each device group includes one or more devices to be networked.
[0087] Specifically, the other devices to be networked except the above-mentioned aggregation node device are divided according to the above-mentioned Internet Protocol address to obtain multiple device groups, including:
[0088] Obtain multiple Internet Protocol address blocks;
[0089] For other devices to be networked except the above-mentioned aggregation node devices, the devices to be networked whose corresponding Internet Protocol addresses belong to the same Internet Protocol address segment are divided into the same device group to obtain a plurality of divided device groups.
[0090] Among them, the above-mentioned Internet Protocol address segment is an IP address segment used to divide device groups. The above-mentioned Internet Protocol address segment can be pre-set by the user, input in real time or adjusted according to actual needs, and is not specifically limited here.
[0091] It should be noted that in the process of dividing device groups, the division can also be based on or combined with other indicators, such as division based on device type, and the corresponding Internet Protocol addresses belonging to the same Internet Protocol address segment and the same device type to be networked devices are divided into the same device group to obtain better device management effects for the device group. No specific limitation is made here.
[0092] Step S500, determine the leader node selection method according to the above-mentioned device networking stage, and determine the leader node device and member node device corresponding to each of the above-mentioned device groups based on the above-mentioned leader node selection method, wherein the member node device in a device group includes all the devices to be networked in the device group except the above-mentioned leader node device.
[0093] It should be noted that for any device group, if there is only one device to be networked in the device group, the device to be networked will be used as the group leader node device, and the member node devices in the device group are empty. However, in the subsequent process, if a new device to be networked is added, the new device to be networked will be divided according to the actual situation and may be added to the device group as a member node device.
[0094] Specifically, the networking reference information also includes performance information of each of the above-mentioned devices to be networked;
[0095] The above-mentioned method of selecting a leader node is determined according to the above-mentioned device networking stage, and the leader node device and the member node device corresponding to each of the above-mentioned device groups are determined based on the above-mentioned method of selecting a leader node, including:
[0096] If the device networking stage is the first networking stage, the leader node selection method is determined to be selecting a preset device, and for each device group, at least one preset leader node device is selected from the device group, and the devices to be networked in the device group other than the leader node device are used as member node devices of the device group;
[0097] If the above-mentioned device networking stage is the second networking stage, then the above-mentioned group leader node selection method is determined to be election. For each device group, at least one group leader node device is selected and determined based on the performance information of each of the above-mentioned devices to be networked in the above-mentioned device group, and the devices to be networked in the above-mentioned device group except the above-mentioned group leader node device are used as member node devices of the above-mentioned device group.
[0098] It should be noted that the selection process of the group leader node device can refer to the selection process of the aggregation node device, but the group leader node device is used to obtain the corresponding information of the member node devices in the corresponding device group and aggregate it to the aggregation node device, that is, data is transmitted between the aggregation node device and the group leader node device, but the aggregation node device does not transmit data with the member node devices.
[0099] Specifically, the above performance information is used to indicate the performance of the central processing unit and / or the performance of the graphics processing unit of the device to be networked, and can also indicate other performance, such as memory size, etc., which are not specifically limited here. In the first networking stage, the number of devices to be networked is small, and the preset device can be directly selected as the leader node device. In the second networking stage, an election is carried out based on the performance of the devices to be networked, so that the device with better performance is used as the leader node device, the processing capacity of the leader node is improved, and thus the processing capacity of the entire network is improved. Among them, the Paxos algorithm, Raft algorithm, etc. can be used in the election, and other election algorithms can also be used, which are not specifically limited here.
[0100] It should be noted that when selecting a leader node device, one main leader node device and one or more backup leader node devices can be selected. The backup leader node device can realize the corresponding functions of the main leader node device when the main leader node device cannot be used normally (for example, damaged, offline, etc.). Among them, the above-mentioned backup leader node devices can be pre-set, that is, a fixed device with relatively stable performance and not easy to be damaged is pre-set as the leader node device. No matter in which networking stage, the backup leader node device is not obtained through election.
[0101] Step S600, determining the device communication mode according to the device networking stage, and performing device networking according to the device communication mode, the member node devices, the group leader node devices and the aggregation node devices.
[0102] Among them, the device communication mode at different device networking stages can be pre-set and adjusted according to the corresponding networking scale and / or actual scenario, and is not specifically limited here.
[0103] Specifically, the device communication mode is determined according to the device networking stage, and the device networking is performed according to the device communication mode, the member node device, the group leader node device and the aggregation node device, including:
[0104] If the device networking stage is the first networking stage, the device communication mode is determined to be the first communication mode based on the Internet Protocol address, and the member node devices in a device group are controlled to communicate and connect with the corresponding group leader node device through the first communication mode, and each of the group leader node devices is communicated and connected with the aggregation node device through a routing device to realize device networking;
[0105] If the above-mentioned device networking stage is the second networking stage, then the above-mentioned device communication mode is determined to be the second communication mode based on the Ad-hoc communication module, and the above-mentioned member node devices in a device group are controlled to communicate and connect with the corresponding group leader node device through the above-mentioned second communication mode, and each of the above-mentioned group leader node devices is communicated and connected with the above-mentioned aggregation node through a routing device to realize device networking.
[0106] The first communication method based on the Internet Protocol address is specifically a communication method that uses traditional IP communication methods such as WIFI to simulate a large group. The second communication method based on the Ad-hoc communication module is specifically a communication method that uses the Ad-hoc communication module to establish a self-organizing network within the device group, and all communications within the group are completed by the module. The routing device can be a switch, a router, etc., which is not specifically limited here.
[0107] Figure 3 is a schematic diagram of a logical network topology provided in an embodiment of the present application, such as Figure 3 As shown, in the embodiment of the present application, division into two device groups is taken as an example for specific description. Figure 3 In the figure, S1, S2, S3 and S4 are member node devices, A and B are group leader node devices, and C is a convergence node device. The convergence node is responsible for receiving group information from different group leader nodes and sending each group information to each group leader. The group leader node is responsible for monitoring and discovering the devices in this group, reporting the group information aggregation, receiving and storing the information sent by the convergence node. The member nodes are used to monitor and discover the devices in this group, and can be triggered to obtain all network device information from the group leader node.
[0108] Figure 4 is a network physical link topology diagram corresponding to the first networking stage provided in an embodiment of the present application, Figure 4 In the example, S1, S2, S3 and S4 are member node devices, A and B are group leader node devices, and C is a convergence node device. In the embodiment of the present application, large-scale networking is implemented in stages according to demand, and the number of nodes is gradually expanded. In the first networking stage, traditional IP communication methods such as WIFI are used to simulate a large group solution, such as Figure 4 As shown, member node devices (such as Figure 4 S1) in the figure can be connected to the leader AP (i.e., leader node device A) through a router, and the leader node device can achieve cross-segment communication by configuring a routing table or accessing a multi-layer switch.
[0109] Figure 5 It is a network physical link topology diagram corresponding to the second networking stage provided in the embodiment of the present application. In the second networking stage, the Ad-hoc module is used to implement the overall networking solution. Figure 5 It is a simple illustration of the hierarchical network in large-scale networking. Figure 5 In the example of dividing the entire large-scale networking equipment into two groups for management, a specific explanation is given. In each device group, an Ad-hoc communication module is used to establish a self-organizing network, and the communication between all member node devices in the group is completed by the module. Each group has an additional Ad-hoc module (i.e., the group leader node device). This module is not connected to an external development board, and acts as a link transfer point on the ground to communicate with the aerial device Ad-hoc module (i.e., the aggregation node device). The ground station accesses the ground Ad-hoc module through routing to obtain aerial group information. Among them, Figure 5 The "eth" in the above code represents data communication based on Ethernet (EtherNet).
[0110] Further, after determining the device communication mode according to the device networking stage, and performing device networking according to the device communication mode, the member node devices, the group leader node devices and the aggregation node devices, the method further includes:
[0111] If a new device to be networked is detected, the networking reference information is updated based on the new device to be networked;
[0112] Determine an updated device networking stage based on the number of devices to be networked in the updated networking reference information;
[0113] If the device networking stage after the update is the same as the device networking stage before the update, determine the target device group corresponding to the new device to be networked, and use the new device to be networked as a member node device in the target device group to perform device networking;
[0114] If the device networking stage after the update is different from the device networking stage before the update, then based on the updated device networking stage, redefine the aggregation node device, device group, leader node device, member node device and device communication mode, and re-perform the device networking.
[0115] Specifically, after a new device to be networked is detected, the number of devices to be networked and the Internet Protocol addresses of the devices to be networked may be updated, and the newly detected device to be networked may be added to the device network to obtain a better networking effect.
[0116] It should be noted that each time a device to be networked is added, re-networking can be performed to obtain a better networking effect. Alternatively, when adding a device to be networked, re-networking is not performed, and the device to be networked is only added to a suitable device group, or a new device group is constructed for it, so that the consumption of computing resources in the networking process can be reduced.
[0117] As can be seen from the above, in the device networking method provided by the embodiment of the present application, a central device is not selected from the devices to be networked to adopt a preset fixed communication method for networking. Instead, the device networking stage is determined according to the number of devices to be networked, and then the corresponding aggregation node selection method, group leader node selection method and device communication method are determined based on the device networking stage. In different device networking stages, the aggregation node device is determined according to the corresponding aggregation node selection method, and the other devices to be networked except the aggregation node device are divided into multiple device groups, and then the group leader node device and member node device of each device group are determined. The device networking is performed based on the group leader node device and member node device of the multiple device groups determined by the division, the aggregation node device and the device communication method of the current device networking stage. In this way, the device networking can be performed according to the actual scenario, which is conducive to improving the flexibility of the device networking and the data communication effect after networking.
[0118] It should be noted that in the embodiments of the present application, the aggregation node device refers to a device that serves as an aggregation node, the group leader node device refers to a device that serves as a group leader node, and the member node device refers to a device that serves as a member node. Therefore, in actual application scenarios, the aggregation node and the aggregation node device can refer to the same meaning, the group leader node, and so on, and no further details will be given.
[0119] In the embodiment of the present application, the above-mentioned device networking method is also described in detail based on a specific application scenario. Specifically, in an application scenario, the software implementation of the above-mentioned device networking method relies on the Openharomny driver framework interface, process communication framework, security subsystem, WIFI, Bluetooth and other link framework interfaces. The specific networking details are implemented based on the communication module (WIFI & Ad-hoc self-organizing network) selected by the hardware solution. Figure 6 This is a logical model diagram provided by the embodiment of the present application. In the embodiment of the present application, the soft bus subsystem adopts a modular design, and manages different functions in modules. The subsystem operation adopts an event queue mechanism to uniformly perform operation scheduling and event processing of different modules. Figure 7 It is a logic diagram of a soft bus subsystem provided in an embodiment of the present application. Specifically, the soft bus subsystem includes modules such as discovery, connection, networking, transmission, and decision center. The core goal of the discovery module is to discover devices in the near-field network. The connection management module is responsible for establishing communication connections between devices, shielding the differences between different communication technologies, and realizing the isolation of system capability differences on different platforms. The soft bus networking module is responsible for device authentication, online and offline management, node information synchronization management, heartbeat maintenance, etc. Transmission management provides soft bus transmission capabilities for upper-layer services, and is a transmission capability framework based on four models: messages, bytes, streams, and files. It shields the differences in the underlying links upward, optimizes the hardware and software integration downward, and maximizes the use of communication link resources. Figure 6 Neutralization Figure 7In the specification, DFX stands for the design for non-functional attributes of the product, which mainly involves the performance monitoring and log management functions of the product in this embodiment; API stands for application programming interface; IPC stands for process communication, and RPC stands for remote procedure call. MicROS stands for micro-robot operating system, which belongs to the upper-layer business of the soft bus. In actual use, other operating systems required by users can also be used without specific limitation. FillP stands for a reliable streaming transmission protocol designed for large-block data transmission, which is optimized compared with the traditional TCP protocol in high-latency and high-packet loss scenarios. Gap stands for Generic Access Profile, which defines the roles, centers and peripherals of Bluetooth devices, and controls their connections and broadcast data. GATT is a Service framework defined by Attribute Protocol. This framework defines the format and procedures of Services and their Characteristics. The procedures define characteristics including discovery, reading, writing, notification, indication and configuration broadcast. TCP stands for Transmission Control Protocol (TCP); UDP is a protocol that works at the transport layer in the Open Systems Interconnection (OSI) model. It uses IP as the underlying protocol and provides a protocol for applications to send messages to other programs with minimal protocol mechanisms. FEC stands for Forward Error Correction technology. Hichain is part of the security subsystem in the openHarmony system, mainly involving authentication and encryption algorithms between devices. Coap (Constrained Application Protocol) is a lightweight communication protocol designed for devices in constrained environments (such as sensors, actuators, etc.). It is used to communicate in low-bandwidth, high-latency and unstable networks and is an important communication protocol in the Internet of Things. BLE stands for Bluetooth Low Energy, a wireless technology that supports Bluetooth protocol 4.0 or higher. Adhoc (mobile self-organizing network) is a network that combines mobile communications and computer networks. It is a type of mobile computer network. User terminals can move freely within the network and maintain communication. Socket represents the intermediate software abstraction layer for communication between the application layer and the TCP / IP protocol family, that is, a set of unified software interfaces for communication. P2P (peer to peer) refers to a form of communication in which two devices directly connect and transmit data.
[0120] Figure 8This is a schematic diagram of a module plug-in implementation provided by an embodiment of the present application. Specifically, the soft bus subsystem is designed with the design goal of high cohesion and low coupling. Considering the compatibility and scalability during future upgrades, the internal modules of the soft bus can be designed with a plug-in concept. In the discovery, connection, networking and transmission modules, different physical links, protocols and authentication algorithms are managed in a plug-in mode to achieve dynamic configuration upgrade management. Figure 8 As shown, the present application embodiment takes the discovery module as an example for specific description. Plug-in coding is a coding method that decouples the upper-layer functional framework and the lower-layer protocol by specifying a unified interface. Figure 8 The figure shows the plug-in structure of the soft bus discovery module. Figure 8 As shown in the figure, if a new transmission protocol or transmission medium needs to be added, such as the Near Link protocol, only the adaptation implementation under the unified interface needs to be implemented, and the discovery framework function does not need to be modified. Among them, the coap protocol (The Constrained Application Protocol) is a computer protocol applied to the Internet of Things and based on the REST architecture. BLE stands for Bluetooth Low Energy, and Near Link is a new generation of short-range wireless connection technology.
[0121] The link management module is mainly used to manage the status of all communication links between devices, such as link bandwidth, latency, load, etc. It provides a query interface to the upper layer and is responsible for the maintenance and update of link information to the lower layer.
[0122] The transmission module aims to service-oriented communication capabilities and provide the upper layer with optimal data transmission services based on current software and hardware capabilities, network status and business needs.
[0123] In large-scale device networking scenarios, the entire communication network will be divided into different broadcast domains for management, and networking groups will be divided according to the broadcast domains.
[0124] Topology information synchronization is responsible for synchronizing device information between different broadcast domains, and the networking ledger manages the network topology and networking device information. Network status management interacts with the authentication mechanism to maintain the device's online and offline status.
[0125] Fig. 9 This is a schematic diagram of interaction of key modules of a large-scale networking provided by an embodiment of the present application. Specifically, the physical link of the large-scale networking is an IP link. Fig. 9 In the event triggering mechanism, the interaction between network management and network card monitoring, the interaction between network management and heartbeat mechanism, and the interaction between link management and heartbeat mechanism are event triggering mechanisms, not direct calls.
[0126] The device management module mainly manages the discovery and synchronization information and provides upper-layer services. The node election module is responsible for determining the main node of the networking group (such as the leader node device) through an independent broadcast algorithm. The information synchronization module is mainly responsible for information synchronization in the device networking group. Devices are divided into main devices and sub-devices. The main device is responsible for synchronizing topology information and forwarding messages across networking groups. The synchronized data is mainly cross-group trusted device information and network topology. The transmission module adds an authentication connection integration interface to reduce device connections and solve the networking triggering problem in large-scale scenarios when services use transmission capabilities. The authentication management module is mainly responsible for interacting with the security module to perform device authentication processes and session key management. The heartbeat mechanism is mainly for link-level heartbeat keepalive for devices, providing reasonable heartbeat strategy adjustment in large-scale networking scenarios. Link management is divided into link selection and device link management. Link selection and transmission interaction provide the best link connection information. Device link management provides link monitoring for each networking device. In large-scale networking scenarios, the link is relatively simple and only contains IP. In network management, the network status and information of different nodes are mainly recorded. The module implementation is mainly divided into two parts: network state machine and event management. The information ledger is divided into local information ledger and distributed information ledger. The distributed information ledger mainly stores the trusted device information of the network, and the local information ledger stores the local communication information.
[0127] Fig.10 : is a schematic diagram of a device discovery scenario provided by an embodiment of the present application, wherein S1, S2, S3 and S4 are member node devices, A and B are group leader node devices, and C is an aggregation node device in a two-layer aggregation scenario. Fig.10 As shown, first, devices in the broadcast domain can discover each other within the group and discover each other between the group leader and group member devices through broadcasting or link status query. Afterwards, the group leader and the convergence point discover each other. Since the two cannot be discovered through broadcasting, the first stage uses preset information discovery, and the second or third stage uses unicast message interaction discovery. There is no need for cross-group nodes to discover each other. After device authentication is completed, the group leader synchronizes the node status within the group.
[0128] Fig.11 This is a schematic diagram of the content of a device broadcast message provided by an embodiment of the present application. Specifically, in order to balance the device communication load and the device discovery time, the frequency of sending broadcast messages during the device discovery process is managed. Fig.12 : is a schematic diagram of different broadcast frequencies of a device provided in an embodiment of the present application, wherein A is a group leader node device, and S0 to S3 are member node devices. Fig.12As shown in the figure, the frequency of devices sending broadcast messages is different at different stages of networking. When the device is started and a group is formed, it is in state 1, and the device broadcast frequency is high; when the group is built, it is in state 2, and the device broadcast frequency is low; when a new device joins, it will broadcast its own information in state 1 to quickly discover other devices and achieve rapid networking.
[0129] Fig.13 It is a schematic diagram of device authentication in a broadcast domain provided by an embodiment of the present application. Specifically, based on the self-discovery module, other device information is discovered and stored, and networking is performed based on the device unique identifier DeviceId or the device communication address (IP and port number, Bluetooth MAC address), etc. After networking, an encrypted transmission channel is established between devices. At present, all device authentication of the soft bus is carried out in the form of point-to-point authentication between devices, and the community's security Hichain mechanism is used. When the capacity of the networking device is large (for example, 1,000 units), the calculation, transmission, and key storage consumption of the authentication will be very large, so a more relaxed keep-alive strategy is adopted, and the keep-alive time is determined by evaluating the connection consumption and actual testing. At the same time, the key is not stored for a long time in a good network environment, and the time consumption of the authentication interaction is minimized. In the case of no transmission, the connection is disconnected. Authentication connection is performed again when transmission is required. Among them, the trusted devices corresponding to device C include A and B, the trusted devices corresponding to device A include C, S1, S2 and B, the trusted devices corresponding to device S1 include A, and the trusted devices corresponding to other device locks are similarly available, and no further description is given.
[0130] Fig.14 This is an initial soft bus networking diagram provided by an embodiment of the present application. Specifically, the network grouping is performed according to the link division broadcast domain (same network segment IP). Each group of networks is divided into a leader node (master node) and a member stage (slave stage), and each leader node can further form an upper-level network. The master node is responsible for the maintenance and storage of network topology information, and synchronizes information with its member nodes (slave nodes) as needed.
[0131] Fig.15It is a flow chart of information synchronization of a master device provided in an embodiment of the present application. Specifically, information synchronization is divided into two functions, reporting of slave device information and sending of master device information. Devices A and B with two identities have both reporting and sending capabilities. Specifically, device A is a master device relative to S1 and S2 in the device group, and device A is a slave device relative to the aggregation node device C, that is, the device has two identities. The same is true for device B, which will not be repeated here. A specific authentication mechanism can be developed for the information reported and sent, and adjusted to discover device information or authenticate device information. Since the basis for the division of soft bus networking groups is the broadcast domain, S1 and S3 cannot discover each other. Aggregation node device C and group leader node devices A and B are aggregated and sent, and a periodic synchronization strategy is adopted. It can ensure that the aggregation node and the master device node can perform networking monitoring of the entire group of devices in real time. The synchronization action is divided into full synchronization and incremental update. The full device information is synchronized in a long period to ensure accuracy; the short period adopts incremental update to reduce transmission overhead.
[0132] Fig.16 It is a scenario diagram of reporting and sending device information provided by an embodiment of the present application. The information synchronization between the leader node device and the member node device adopts a synchronization strategy that is different from that of the upper-level nodes. It is divided into request type and periodic type according to the scenario requirements. The request type is that after the member node (such as the S1 node) initiates a synchronization request to the leader node (A node), the leader node sends a single information. The periodicity is longer than the upper layer, and the synchronization cycle interval is lengthened. At this point, the device can discover devices across broadcast domains and communicate.
[0133] Fig.17 is a schematic diagram of a device heartbeat connection provided in an embodiment of the present application. Fig.17 In the figure, the heartbeat (1), (2) and (3) links are intra-domain connections (intra-group connections), and point-to-point heartbeat keepalive is used. Heartbeat (4) is a cross-domain heartbeat keepalive, and the trusted devices S2 are distinguished as cross-domain devices or intra-domain devices. The heartbeat keepalive of the cross-domain device requests the S3 node information from the intra-domain master node (group leader node) A for keepalive or with the help of the protocol layer keepalive capability. Heartbeat keepalive is an important mechanism for maintaining node status information synchronization. When frequent heartbeat keepalives are performed between large-scale devices, network air interface resources and device computing resources will be consumed. Therefore, it is necessary to design a balancing strategy for the heartbeat keepalive mechanism. The heartbeat keepalive mechanism balancing strategy is implemented by three methods: hierarchical management, reducing the size of keepalive packets, and adjusting the keepalive frequency according to the business.
[0134] Hierarchical management means that in large-scale networking scenarios, the heartbeat keep-alive method between groups is distinguished from the heartbeat keep-alive method within a group. The adjustment of the hierarchical strategy is completed based on the test of actual resource consumption. Within the group, the heartbeat keep-alive strategy can be summarized as regularly sending data packets to query the link status. When the data packet response does not meet expectations, the link is judged to be disconnected. At the same time, in order to reduce bandwidth occupancy, the heartbeat keep-alive data packet is transmitted through the UDP protocol. The UDP data packet header only occupies 8 bytes. In the same data packet size, more device status information can be carried. When the soft bus is performing data transmission services, the heartbeat keep-alive mechanism will automatically adjust the frequency of sending data packets to reduce bandwidth occupancy.
[0135] In order to enhance the flexibility and anti-destruction capability of the network, in the hierarchical networking implemented in stages, the dynamic change capability of the leader node device (master node) is set to ensure that the network structure has good self-recovery ability after the death of the node. Fig.18 This is a node election module logic diagram provided by the embodiment of the present application. Fig.18 As shown, in the embodiment of the present application, a node election module may be provided to elect a group leader node device and / or an aggregation node device. It should be noted that: Fig.18 The election algorithm shown in can be set and adjusted according to actual needs and is not specifically limited here.
[0136] In the embodiment of the present application, the election of the leader node device is taken as an example for specific description, and the selection process of the aggregation node device can refer to the election process of the leader node device. In a broadcast domain, the nodes are divided into three types: master node (leader node), master-slave node (standby leader node) and ordinary node (member node). Initially, all nodes have the same identity. The nodes of the first two roles are determined through message interaction and their information is synchronized to all devices in this group. When the master node is abnormal and cannot work, the master-slave node replaces the master node to maintain the network topology and re-elects new master-slave nodes.
[0137] The active and standby nodes always keep the same device information as the active node to quickly restore the network. After the active and standby nodes take over, they immediately synchronize information with their upper and lower nodes to ensure information accuracy. The aggregation node may be in the connection domain and cannot be discovered through broadcasting. The standby node is not generated by election but is prepared for pre-configuration.
[0138] Fig.19 is a schematic diagram of a message structure in an election process provided by an embodiment of the present application, Fig. 20 This is a schematic diagram of a node broadcast scenario provided in an embodiment of the present application. Fig.19 In the example, the election priority can be preset or determined according to the corresponding performance of the node device. The higher the performance, the higher the election priority. Fig. 20In the figure, A represents the master node (leader node), Ab represents the master and backup nodes, and S1 and S2 are slave nodes. All nodes broadcast to query the master node. If no master node exists, they will run for the master node. By processing the broadcast master node election message, the master node is calculated based on the set election rules. The election rules can refer to the DR / BDR election algorithm in the OSPF protocol, and refer to the broadcast interaction using random time interval differences. After the device becomes the master node, it broadcasts its own master node information to complete the unification of the master node information of the device.
[0139] Fig.21 is a post-election node network topology diagram provided by an embodiment of the present application, such as Fig.21 As shown, after the election is completed, C is the aggregation node device, and Cb is the backup aggregation node device corresponding to the aggregation node device. A and B are group leader node devices, and Ab and Bb are the backup group leader node devices corresponding to A and B respectively. S1 and Ab are member node devices corresponding to A, and Bb and S4 are member node devices corresponding to B. That is, the backup group leader node device corresponding to a group leader node device is determined from the member node devices corresponding to the group leader node.
[0140] Fig. 22 is a schematic diagram of processing the death of a convergence node provided in an embodiment of the present application. Fig. 22 The identity of each node in Fig.21 The same is true in the text, so I will not repeat it here. Fig. 22 As shown, after the standby aggregation node Cb detects that the aggregation node C is disconnected, Cb authenticates the original trusted device of C to restore the connection. The original trusted devices of C include A and B, and information synchronization is performed. A and B monitor Cb, and A and B actively report information, or Cb requests A and B to report data. The leader node B detects that the aggregation node C is disconnected, authenticates the standby aggregation node Cb, receives the message from Cb, switches the master device to Cb, and re-reports its own information.
[0141] Fig.23 This is a schematic diagram of processing the death of a group leader node provided in an embodiment of the present application. Fig.23 The identity of each node in Fig.21 Specifically, the aggregation node C detects that the leader node B is disconnected. After the backup leader node Bb detects that the leader node B is disconnected, it re-establishes the connection based on B's trusted device information, requests synchronization to the master, requests synchronization to the slave device, and restores the synchronization mechanism.
[0142] It should be noted that if the master node (aggregation node or group leader node) is disconnected and then restored, a confirmation interaction will be initiated. Configure the role of this node according to the existing master and backup status of the network.
[0143] like Fig.24As shown in , corresponding to the above-mentioned device networking method, the embodiment of the present application also provides a device networking system, and the above-mentioned device networking system includes:
[0144] The information acquisition module 2410 is used to acquire networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked;
[0145] A networking stage determination module 2420, configured to determine a device networking stage according to the number of devices to be networked;
[0146] The aggregation node selection module 2430 is used to determine the aggregation node selection method according to the above-mentioned device networking stage, and determine at least one aggregation node device from the above-mentioned devices to be networked based on the above-mentioned aggregation node selection method;
[0147] The group division module 2440 is used to divide the other devices to be networked except the above-mentioned aggregation node device according to the above-mentioned Internet Protocol addresses to obtain multiple device groups;
[0148] The device division module 2450 is used to determine the leader node selection method according to the device networking stage, and determine the leader node device and member node devices corresponding to each of the device groups based on the leader node selection method, wherein the member node devices in a device group include all the devices to be networked in the device group except the leader node device;
[0149] The networking module 2460 is used to determine the device communication mode according to the above-mentioned device networking stage, and perform device networking according to the above-mentioned device communication mode, the above-mentioned member node devices, the above-mentioned group leader node devices and the above-mentioned aggregation node devices.
[0150] In this way, the device networking stage is determined according to the number of devices to be networked, and then the corresponding aggregation node selection method, group leader node selection method and device communication method are determined based on the device networking stage. In different device networking stages, the aggregation node device is determined according to the corresponding aggregation node selection method, and the other devices to be networked except the aggregation node device are divided into multiple device groups, and then the group leader node device and member node device of each device group are determined. The device networking is performed based on the group leader node devices and member node devices of the multiple device groups determined by the division, the aggregation node device and the device communication method of the current device networking stage. In this way, the device networking can be performed according to the actual scenario, which is conducive to improving the flexibility of the device networking.
[0151] It should be noted that the specific structure and implementation of the above-mentioned device networking system and its various modules or units can refer to the corresponding description in the above-mentioned method embodiment, and will not be repeated here.
[0152] It should be noted that the division method of each module of the above-mentioned device networking system is not unique and is not specifically limited here.
[0153] Based on the above embodiments, the present application also provides a smart terminal, whose principle block diagram can be as follows: Fig.25 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a device networking program. The internal memory provides an environment for the operation of the operating system and the device networking program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the device networking program is executed by the processor, the steps of any of the above-mentioned device networking methods are implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0154] Those skilled in the art will understand that Fig.25 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the smart terminal to which the solution of the present application is applied. The specific smart terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0155] In one embodiment, a smart terminal is provided, which includes a memory, a processor, and a device networking program stored in the memory and executable on the processor. When the device networking program is executed by the processor, the steps of any one of the device networking methods provided in the embodiments of the present application are implemented.
[0156] An embodiment of the present application also provides a computer-readable storage medium, on which a device networking program is stored. When the device networking program is executed by a processor, the steps of any one of the device networking methods provided in the embodiment of the present application are implemented.
[0157] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0159] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0160] In the embodiments provided in the present application, it should be understood that the disclosed system / terminal device and method can be implemented in other ways. For example, the system / terminal device embodiments described above are only schematic, for example, the division of the above modules or units is only a logical function division, and in actual implementation, other division methods can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0161] If the above-mentioned integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
Claims
1. A device networking method, characterized in that: The method comprises: Acquire networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked; Determining the device networking stage according to the number of the devices to be networked; Determine a convergence node selection method according to the device networking stage, and determine at least one convergence node device from the devices to be networked based on the convergence node selection method; According to the Internet Protocol addresses, other devices to be networked except the aggregation node device are divided to obtain multiple device groups; Determine a leader node selection method according to the device networking stage, and determine the leader node device and member node devices corresponding to each of the device groups based on the leader node selection method, wherein the member node devices in a device group include all devices to be networked in the device group except the leader node device; The device communication mode is determined according to the device networking stage, and the device networking is performed according to the device communication mode, the member node devices, the group leader node devices and the aggregation node devices.
2. The device networking method according to claim 1, characterized in that: The step of determining the device networking stage according to the number of the devices to be networked includes: If the number of the devices to be networked is not greater than the preset stage judgment threshold, determining that the device networking stage is the first networking stage; If the number of the devices to be networked is greater than a preset stage judgment threshold, it is determined that the device networking stage is the second networking stage.
3. The device networking method according to claim 2, characterized in that: The networking reference information also includes performance information of each of the devices to be networked; The step of determining a convergence node selection method according to the device networking stage, and determining at least one convergence node device from the devices to be networked based on the convergence node selection method, includes: If the device networking stage is the first networking stage, determining that the aggregation node selection method is to select a preset device, and selecting at least one preset aggregation node device from the devices to be networked; If the device networking stage is the second networking stage, the aggregation node selection method is determined to be election, and at least one aggregation node device is elected from the devices to be networked according to the performance information of each device to be networked.
4. The device networking method according to claim 1, characterized in that: The method of dividing the other devices to be networked except the aggregation node device according to the Internet Protocol address to obtain multiple device groups includes: Obtain multiple Internet Protocol address blocks; For other devices to be networked except the aggregation node device, the devices to be networked whose corresponding Internet Protocol addresses belong to the same Internet Protocol address segment are divided into the same device group to obtain a plurality of divided device groups.
5. The device networking method according to claim 2, characterized in that: The networking reference information also includes performance information of each of the devices to be networked; The method of determining a leader node selection method according to the device networking stage, and determining a leader node device and a member node device corresponding to each device group based on the leader node selection method, includes: If the device networking stage is the first networking stage, determining that the leader node selection method is to select a preset device, for each device group, selecting at least one preset leader node device from the device group, and using the to-be-networked devices in the device group except the leader node device as member node devices of the device group; If the device networking stage is the second networking stage, the leader node selection method is determined to be election. For each device group, at least one leader node device is selected and determined based on the performance information of each of the devices to be networked in the device group, and the devices to be networked in the device group except the leader node device are used as member node devices of the device group.
6. The device networking method according to claim 1, characterized in that: The determining of the device communication mode according to the device networking stage, and performing device networking according to the device communication mode, the member node device, the group leader node device and the aggregation node device, includes: If the device networking stage is the first networking stage, determining that the device communication mode is a first communication mode based on an Internet Protocol address, controlling the member node devices in a device group to communicate and connect with the corresponding group leader node device through the first communication mode, and each group leader node device to communicate and connect with the aggregation node device through a routing device, so as to realize device networking; If the device networking stage is the second networking stage, the device communication mode is determined to be the second communication mode based on the Ad-hoc communication module, and the member node devices in a device group are controlled to communicate and connect with the corresponding group leader node device through the second communication mode. Each group leader node device is communicated and connected with the aggregation node through a routing device to realize device networking.
7. The device networking method according to any one of claims 1 to 6, characterized in that: After determining the device communication mode according to the device networking stage, and performing device networking according to the device communication mode, the member node device, the group leader node device and the aggregation node device, the method further includes: If a new device to be networked is detected, updating the networking reference information based on the new device to be networked; Determine an updated device networking stage based on the number of devices to be networked in the updated networking reference information; If the device networking stage after the update is the same as the device networking stage before the update, determining a target device group corresponding to the new device to be networked, and using the new device to be networked as a member node device in the target device group to perform device networking; If the device networking stage after the update is different from the device networking stage before the update, the aggregation node device, device group, leader node device, member node device and device communication mode are re-determined based on the updated device networking stage, and the device networking is re-performed.
8. A device networking system, characterized in that: The system comprises: An information acquisition module, used to acquire networking reference information, wherein the networking reference information includes the number of devices to be networked and the Internet Protocol address of each of the devices to be networked; A networking stage determination module, used to determine the device networking stage according to the number of devices to be networked; A convergence node selection module, used to determine a convergence node selection method according to the device networking stage, and determine at least one convergence node device from the devices to be networked based on the convergence node selection method; A group division module, used for dividing other devices to be networked except the aggregation node device according to the Internet Protocol address to obtain multiple device groups; A device division module, used to determine a leader node selection method according to the device networking stage, and determine the leader node device and member node device corresponding to each device group based on the leader node selection method, wherein the member node device in a device group includes all the devices to be networked in the device group except the leader node device; The networking module is used to determine the device communication mode according to the device networking stage, and perform device networking according to the device communication mode, the member node device, the group leader node device and the aggregation node device.
9. An intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and a device networking program stored in the memory and executable on the processor. When the device networking program is executed by the processor, the steps of the device networking method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a device networking program, and when the device networking program is executed by the processor, the steps of the device networking method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Internet of Things data transmission method and Internet of Things
CN102932751A
Network management method and device
CN115550957A
Equipment discovery method and system, terminal equipment and chip system
CN116033368A
Network topology structure acquisition method, device, equipment and medium
CN116389280A
Cited By
Intelligent terminal of multi-modular interconnection scene fusion station area
CN118869370A
Internet of Things networking method and system based on star flash technology and open source gap system
CN119484267A
Master node election method and system based on OpenHarmony distributed networking
CN120979873A
