A device networking method, electronic device, and computer-readable storage medium

By optimizing the authentication path using a tree or star topology in the soft bus communication architecture, the problem of low networking efficiency in large-scale local area networks is solved, achieving efficient and low-power device networking, adapting to dynamic network changes, and improving authentication success rate and resource utilization.

CN120956555BActive Publication Date: 2026-01-30HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511444111.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-01-30
Estimated Expiration
2045-10-10

AI Technical Summary

Technical Problem

In the existing soft bus communication architecture, when the number of devices in the local area network exceeds a certain threshold, the efficiency of authentication networking is significantly reduced. Resource contention conflicts lead to packet processing delays and network latency accumulation, resulting in a decrease in authentication success rate and making it difficult to meet the high-efficiency interconnection needs of industrial scenarios.

Method used

By employing a tree-like or star-like network topology, the target authentication device can be identified by acquiring local area network information, thereby reducing the number of authentication attempts, optimizing the authentication path, and achieving efficient networking results.

Benefits of technology

Improve networking efficiency and authentication success rate, support more device access, reduce broadcast domain and encryption/decryption computation, adapt to changes in network scale and business scenarios, and ensure high efficiency and resource conservation in the networking process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956555B_ABST
    Figure CN120956555B_ABST
Patent Text Reader

Abstract

This application provides a device networking method, an electronic device, and a computer-readable storage medium. The method can be applied to a first electronic device. A first communication system may include multiple electronic devices on the same local area network, and these multiple electronic devices may include the first electronic device. The first electronic device can acquire a first networking model, which can be confirmed based on information from the first communication system. The information from the first communication system may include one or more of the following: the frequency of changes of electronic devices within the first communication system, and the application scenario of the first communication system. Based on the first networking model, the first electronic device determines one or more target authentication devices from among the multiple electronic devices. The first electronic device can authenticate with one or more target authentication devices. After successful authentication, the first electronic device establishes a communication connection with one or more target authentication devices, thereby effectively improving the efficiency and success rate of networking.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, and in particular to a device networking method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] With the continuous expansion of the types and quantities of electronic devices, the rapid popularization of collaborative office scenarios and the intelligentization of life scenarios, the efficient interconnection demand between electronic devices is increasingly urgent. Soft bus is a communication architecture that can realize the interconnection of multiple electronic devices at the software level.

[0003] In the existing soft bus communication architecture, the electronic device needs to authenticate with other electronic devices one by one after accessing the local area network, so as to realize networking.

[0004] When the number of devices supporting the above-mentioned soft bus communication architecture in the local area network exceeds the first threshold, the efficiency of soft bus authentication networking will be significantly reduced. And with the further expansion of the device scale, resource competition conflicts are easily caused in the authentication process, resulting in data packet processing delay or network latency accumulation, and thus causing authentication timeout and success rate decline and other problems. SUMMARY

[0005] The present application provides a device networking method, an electronic device and a computer readable storage medium. The above-mentioned method can be applied to a first electronic device, a first communication system can include multiple electronic devices in the same local area network, and the multiple electronic devices can include the first electronic device. The first electronic device can obtain a first networking model, the first networking model can be confirmed based on the information of the first communication system, and the information of the first communication system can include one or more of the following: the change frequency of the electronic device in the first communication system, the application scenario of the first communication system, the first networking model is different, and the target authentication device corresponding to the first electronic device can be different; the first electronic device determines one or more target authentication devices from the multiple electronic devices based on the first networking model; the first electronic device can authenticate with one or more target authentication devices; after authentication, the first electronic device and one or more target authentication devices establish a communication connection, thereby effectively improving the networking efficiency and the success rate of networking authentication.

[0006] In a first aspect, the present application provides a device networking method, applied to a first electronic device, a first communication system including a plurality of electronic devices in a same local area network, the plurality of electronic devices including the first electronic device, the method comprising: the first electronic device obtaining a first networking model, the first networking model being determined based on information of the first communication system, the information of the first communication system including one or more of the following: a change frequency of the electronic devices in the first communication system, an application scenario of the first communication system, the first networking model being different, and a target authentication device corresponding to the first electronic device being different; the first electronic device determining one or more target authentication devices from the plurality of electronic devices based on the first networking model; the first electronic device performing authentication with the one or more target authentication devices; and after the authentication is passed, the first electronic device establishing a communication connection with the one or more target authentication devices.

[0007] Implementing the method provided by the first aspect, the first electronic device can determine the networking model in advance according to the information of the communication system such as the change frequency of the devices in the local area network and the application scenario, and then determine the target devices to be authenticated according to the networking model, so as to effectively reduce the number of authentication and complete the networking of the plurality of electronic devices, thereby effectively improving the networking efficiency and the success rate of networking authentication. It can be understood that under the same hardware conditions, more electronic devices can be supported to access the communication system for networking, realizing adaptive expansion of network size and business scenarios, and having high efficiency and resource saving effect.

[0008] In combination with the first aspect, in some embodiments, the first networking model includes a tree model or a star model; in the tree model, the target authentication device is a parent node and / or a child node of the first electronic device; in the star model, the plurality of electronic devices include a center node and a non-center node, the first electronic device is the center node and the target authentication device is the non-center node, or the first electronic device is the non-center node and the target authentication device is the center node.

[0009] Implementing the method provided by the above embodiments, the first electronic device can reduce the authentication range from all electronic devices in the local area network (i.e. all global nodes) to "necessary adjacent nodes", so that the broadcast domain, the number of handshakes and the encryption and decryption operation amount are simultaneously reduced, and efficient networking effect is realized.

[0010] In some embodiments, when the first networking model is the tree model, the method further comprises: the first electronic device respectively acquiring parameter information of the plurality of electronic devices; and the first electronic device determining one or more target authentication devices from the plurality of electronic devices based on the first networking model, specifically comprising: the first electronic device determining a first authentication path relationship based on the tree model and the parameter information of the plurality of electronic devices, the first authentication path relationship being used to indicate parent nodes and / or child nodes of the plurality of electronic devices; and the first electronic device determining the target authentication devices from the plurality of electronic devices based on the first authentication path relationship.

[0011] The method provided by the above embodiments can be used to, when the first networking model is the tree model, acquire parameter information of other electronic devices in the global area network by the first electronic device, and then calculate a "parent-child" authentication path relationship (i.e., the first electronic device can calculate a tree structure) based on a tree rule, so as to determine the target authentication devices based on the tree structure. In this way, the authentication range can be reduced from full connection to single-hop adjacency, and the number of broadcast messages and handshakes increases linearly with the topology depth rather than quadratically, thereby achieving efficient and low-consumption authentication networking effect.

[0012] In some embodiments, the one or more target authentication devices comprise a first target authentication device and a second target authentication device, and the first electronic device performs authentication with the one or more target authentication devices, specifically comprising: the first electronic device performing authentication with the first target authentication device first, and then performing authentication with the second target authentication device; and the method further comprises: after the first electronic device performs authentication with the second target authentication device, the first electronic device synchronizes parameter information of the second target authentication device to the first target authentication device.

[0013] The method provided by the above embodiments can be used to, when the first networking model is the tree model, acquire parameter information of other electronic devices in the global area network by the first electronic device, and then calculate a "parent-child" authentication path relationship (i.e., the first electronic device can calculate a tree structure) based on a tree rule, so as to determine the target authentication devices based on the tree structure. In this way, the authentication range can be reduced from full connection to single-hop adjacency, and the number of broadcast messages and handshakes increases linearly with the topology depth rather than quadratically, thereby achieving efficient and low-consumption authentication networking effect.

[0014] In some embodiments, the one or more target authentication devices are parent nodes of the first electronic device, and after the first electronic device authenticates with the one or more target authentication devices, the method further comprises: the first electronic device receiving parameter information of a second electronic device synchronized by the one or more target authentication devices, the second electronic device and the first electronic device being child nodes of the one or more target authentication devices; and the first electronic device establishing a communication connection with the second electronic device based on the parameter information of the second electronic device.

[0015] When the first electronic device is a child node of the target authentication devices, the first electronic device can receive parameter information of a sibling node (e.g., the second electronic device) synchronized by the target authentication devices, and then establish a communication connection with the second electronic device based on the parameter information, thereby completing network formation. This approach enables real-time acquisition of parameter information of a sibling node without additional detection, reduces the number of network-wide broadcasts, avoids collisions and retries caused by concurrent handshakes, improves the success rate of a single authentication, and achieves efficient network formation.

[0016] In some embodiments, the method further comprises: if a plurality of electronic devices in the first communication system are changed, the first electronic device determining a second authentication path relationship based on the first network formation model and parameter information of the plurality of electronic devices in the first communication system after the change, the second authentication path relationship being used to indicate parent nodes and / or child nodes of the plurality of electronic devices after the change; the first electronic device determining one or more to-be-judged authentication devices from the plurality of electronic devices after the change based on the second authentication path relationship; if the first electronic device does not save parameter information of the to-be-judged authentication devices, the first electronic device authenticating with the to-be-judged authentication devices and establishing a communication connection with the to-be-judged authentication devices; and if the first electronic device has saved the parameter information of the to-be-judged authentication devices, the first electronic device determining that authentication with the to-be-judged authentication devices has been completed.

[0017] When a device in the first communication system is changed (e.g., a device is added or a device is offline), the first electronic device can recompute a second authentication path relationship (i.e., recompute a tree structure) based on the tree model and parameter information of the plurality of electronic devices in the first communication system after the change, and only perform authentication network formation on to-be-judged authentication devices for which parameter information is not saved, while devices for which parameter information is saved do not need to repeat authentication network formation. Thus, a full authentication is not triggered when the network topology changes, which significantly reduces broadcast storms and the number of handshakes, and compresses the authentication range to a single point of added / changed nodes, so that the communication system can still quickly complete re-authentication network formation in device hot-plugging, fault replacement, and other device change scenarios.

[0018] With reference to the first aspect, in some embodiments, when the first networking model comprises the star model, the first electronic device determines one or more target authentication devices from the plurality of electronic devices based on the first networking model, specifically comprising: the first electronic device confirms the center node in the first communication system; if the first electronic device is the center node, the first electronic device confirms that the electronic devices other than the first electronic device in the plurality of electronic devices are the target authentication devices; if the first electronic device is the non-center node, the first electronic device confirms that the center node is the target authentication device.

[0019] The method provided by the above-mentioned embodiments can complete the screening of the target authentication device only once for the center node confirmation when the first networking model is the star model: if the first electronic device is the center node, all non-center nodes in the network are taken as the target authentication device at one time; if the first electronic device is the non-center node, only the unique center node is taken as the target authentication device. Thus, the number of authentication is reduced from O(n²) to O(n−1), the broadcast domain is limited to the center-edge single-hop range, the air interface collision and retry probability are significantly reduced; the center node can centrally schedule the authentication order to avoid the collision caused by the multi-node handshake, and the one-time authentication success rate is improved; the non-center node only needs to maintain a single secure channel with the center, and the memory and state machine overheads are minimized; when the topology changes, only the center identity needs to be confirmed again and the single-point link needs to be updated, the fast re-convergence is realized, and the efficient, low-consumption and easy-maintenance networking effect is achieved.

[0020] With reference to the first aspect, in some embodiments, when the first electronic device confirms the center node in the first communication system, specifically comprising: the first electronic device determines the center node from the plurality of electronic devices based on the first networking model and the performance parameters of the plurality of electronic devices.

[0021] The method provided by the above-mentioned embodiments takes the performance parameters as the basis for selecting the center node of the first communication system, which can automatically select the node with the optimal and most stable comprehensive performance to serve as the center in the global area network, avoids the single-point performance bottleneck caused by manual designation; the center node has sufficient capacity to bear more concurrent authentication sessions and subsequent data aggregation tasks, reduces the authentication failure and business time delay caused by the overload of the center; the parameterized election process does not need additional manual configuration, and only needs to recalculate the parameters when the network size changes to dynamically switch the center, realizes the self-optimization and self-recovery networking effect, and improves the overall throughput and reliability of the system.

[0022] With reference to the first aspect, in some embodiments, if the first electronic device is the center node, after the first electronic device authenticates with the one or more target authentication devices, the method further includes: the first electronic device sending parameter information of the one or more target authentication devices that pass the authentication to the non-center node.

[0023] Implementing the method provided by the above embodiments, the first electronic device as the center node can send the parameter information of the authenticated electronic devices to all non-center nodes after completing the authentication, so that the non-center nodes can obtain the latest parameter information of all electronic devices in the network without initiating independent detection or secondary handshake, thereby saving the overhead of repeated broadcasting and parallel authentication, significantly reducing air traffic and CPU occupation, shortening the overall convergence time of the network, avoiding authentication conflicts or repeated chain establishment caused by asynchronous information, and improving the authentication efficiency and accuracy of subsequent data forwarding under the star structure.

[0024] With reference to the first aspect, in some embodiments, if the first electronic device is the non-center node, after the first electronic device authenticates with the one or more target authentication devices, the method further includes: receiving parameter information of a third electronic device in the plurality of electronic devices sent by the target authentication device, the third electronic device, the first electronic device, and the target authentication device being different; and the first electronic device establishing a communication connection with the third electronic device based on the parameter information of the third electronic device.

[0025] Implementing the method provided by the above embodiments, the first electronic device as the non-center node can receive the parameter information of other authenticated electronic devices (such as the third electronic device) in the local area network sent by the center node after completing the authentication, so that the first electronic device can directly obtain the trusted identity and connection information of the third electronic device without initiating detection or handshake again, and establish a communication connection with the third electronic device based thereon; thereby saving the repeated authentication process of the third electronic device, reducing the broadcast message and encryption and decryption operations, reducing the overall handshake delay and air collision probability, and ensuring the consistency and security of link establishment between non-center nodes, and improving the efficiency of multi-node parallel access under the star structure.

[0026] With reference to the first aspect, in some embodiments, if the first electronic device is the center node, the method further includes: if the plurality of electronic devices in the first communication system have changed, the first electronic device sends parameter information of the plurality of electronic devices in the first communication system that have changed to the non-center node.

[0027] When the first electronic device is the center node, if the first electronic device detects that a device in the local area network is added or offline, the first electronic device packages and pushes the updated network device parameter information to all non-center nodes, so that the non-center nodes can obtain the latest member list synchronously without initiating detection again. In this way, the polling and repeated authentication are omitted, the broadcast storm and the number of handshakes are reduced, the convergence time after the topology changes is shortened, the consistency of the center-edge device list is ensured, the non-center node establishes an incorrect link due to information lag is avoided, and the stability and expansion efficiency of the star network in a dynamic environment are improved.

[0028] In combination with the first aspect, in some embodiments, the information of the first communication system includes a change frequency of the electronic devices in the first communication system, and the first electronic device acquires the first networking model, specifically including: when the change frequency of the electronic devices in the first communication system is less than a first threshold, the first electronic device confirms that the first networking model is the tree model; and when the change frequency of the electronic devices in the first communication system is greater than or equal to the first threshold, the first electronic device confirms that the first networking model is the star model.

[0029] The method provided by the above embodiments is implemented, and the change frequency of the electronic devices in the communication system is used as a detection index to switch the networking model of the electronic devices in the communication system to the tree model or the star model, so that the network form is self-adapted with stability: when the change frequency is less than a first threshold, the first electronic device directly selects the tree model, and the authentication object is limited to parent-child nodes; and when the change frequency is greater than or equal to the first threshold, the star model is automatically switched, and the target authentication device is a center node or all non-center nodes. In this way, the same code can be seamlessly switched between “steady state” and “dynamic state” without manual intervention, the advantages of the tree model and the star model are considered, real-time matching of the networking mode and the network dynamic characteristics is realized, and the overall authentication efficiency, link stability and expansion flexibility are improved.

[0030] In combination with the first aspect, in some embodiments, before the first electronic device acquires the first networking model, the first electronic device adopts the star model, the first networking model is the tree model, and the method further includes: before the first electronic device acquires the first networking model, if the first electronic device is the center node and detects that the change frequency of the electronic devices in the first communication system is less than a first threshold, the first electronic device is switched to the first networking model, and a first notification is sent to the non-center node, where the first notification is used to trigger the non-center node to switch from the star model to the tree model; and before the first electronic device acquires the first networking model, if the first electronic device is the non-center node, the first electronic device is switched from the star model to the first networking model after receiving the first notification.

[0031] The method provided by the above-mentioned embodiment is implemented, a star model is uniformly adopted in an initial stage of the network, full-network authentication can be quickly completed and a centralized channel can be established, and early handshake complexity is reduced. When the center node detects that the device change frequency is lower than a first threshold, a first notification is actively issued, and the full network is guided to be smoothly switched to a tree model, and the authentication link is simplified to a parent-child single hop. In this way, the system takes into account both "fast start" and "stable saving": the star model is used to ensure a high success rate in a turbulent period, and the tree model is used to reduce delay and resource occupation in a stable period. In addition, the switching instruction is sent by the center, and each node does not need to detect separately, so that loop or repeated authentication caused by mixed use of models is avoided, the network form is adaptively migrated according to network stability, and the overall convergence speed, link efficiency and expansion flexibility are improved.

[0032] In combination with the first aspect, in some embodiments, before the first electronic device acquires the first networking model, the first electronic device adopts the tree model, the first networking model is the star model, and the method further includes: before the first electronic device acquires the first networking model, if the first electronic device is a root node and detects that the device change frequency in the first communication system is greater than or equal to a first threshold, the first electronic device is switched to the first networking model, and a second notification is sent to a non-root node in the plurality of electronic devices, the second notification being used to trigger the non-root node to switch from the tree model to the first networking model; and before the first electronic device acquires the first networking model, if the first electronic device is the non-root node, the first electronic device is switched from the tree model to the first networking model after receiving the second notification.

[0033] The method provided by the above-mentioned embodiment is implemented, the system initially runs in the tree model, the authentication path is short and the overhead is low; when the root node detects that the device change frequency is greater than or equal to a first threshold, a second notification can be issued, the full network is synchronously switched to the star model, and authentication traffic is quickly converged to the center node, so that handshake failure and retransmission caused by a multi-hop path in a frequent online and offline scene are avoided. This mechanism enables the network to maintain a tree low delay in a "stable state" and to be switched to a star high robustness in a "turbulent state" by one key, the switching instruction is sent by the root node, loop or repeated authentication caused by mixed use of models is avoided, the form is adaptively migrated according to stability, and the convergence speed, link reliability and expansion flexibility are improved.

[0034] In combination with the first aspect, in some embodiments, the first communication system includes a fourth electronic device, and the first electronic device performs authentication with the one or more target authentication devices, specifically including: receiving an authentication request sent by the fourth electronic device; and if the one or more target authentication devices include the fourth electronic device, the first electronic device performs authentication with the fourth electronic device.

[0035] The method provided by the above embodiment is implemented, the fourth electronic device initiatively initiates an authentication request, and the first electronic device responds to the authentication request and enters an authentication process only when the request source belongs to the determined list of target authentication devices. In this way, the first electronic device can perform pre-filtering on the request source, avoid performing redundant handshakes with irrelevant devices, reduce air interface conflicts and CPU occupation, and improve overall authentication efficiency and resource utilization.

[0036] With reference to the first aspect, in some embodiments, the method further includes: if the one or more target authentication devices do not include the fourth electronic device, the first electronic device rejects the authentication request of the fourth electronic device.

[0037] The method provided by the above embodiment is implemented, and after receiving the authentication request of the fourth electronic device, if the device is not listed as a target authentication device in the current networking model, the first electronic device can reject the authentication request of the fourth electronic device and no longer enter a subsequent authentication process. For example, when the networking models used by the first electronic device and the fourth electronic device are different, the first electronic device may be listed as a target authentication device by the fourth electronic device, while the fourth electronic device is not a target authentication device determined by the first electronic device. At this time, the first electronic device can reject the authentication request. In this way, illegal or invalid nodes cannot consume system resources, and the CPU and memory overheads of the central node decrease linearly with the number of invalid requests; at the same time, the air interface broadcast and collision probability are reduced, the transmission success rate of valid authentication messages is improved, and a more efficient and safer networking effect is achieved.

[0038] With reference to the first aspect, in some embodiments, the frequency of changes of the electronic devices in the first communication system is the sum of the frequency of newly added devices in the first communication system and the frequency of devices going offline in the first communication system.

[0039] With reference to the first aspect, in some embodiments, the method further includes: if the authentication success rate in the first communication system is less than a first success rate, the first electronic device reduces the value of the first threshold.

[0040] The method provided by the above embodiment is implemented, and when the authentication success rate of the first communication system is lower than a target service success rate (i.e., the first success rate), the first electronic device can automatically reduce the value of the first threshold, so as to trigger a networking model switching or reduce the range of target authentication devices in advance. This negative feedback mechanism can reduce the number of authentication objects at an early stage when network quality deteriorates and devices frequently go online and offline, resulting in handshake failures, reduce invalid interactions and air interface conflicts, and enable the remaining nodes to have a higher authentication success probability; at the same time, after the threshold is reduced, the central node can converge to a stable topology more quickly, avoid resource waste and business interruption caused by continuous retries, achieve network self-optimization and self-recovery, and improve the robustness and availability of overall networking.

[0041] In some embodiments of the first aspect, the parameter information comprises one or more of the following: identification information, geographical location of the device, production subsystem to which the device belongs, security level of the device, performance parameter.

[0042] In some embodiments of the first aspect, the identification information comprises one or more of the following: device ID, device name, device Internet Protocol (IP) address, port number.

[0043] In some embodiments of the first aspect, the performance parameter comprises one or more of the following: throughput rate, network delay, signal strength, bandwidth capacity, protocol support type, computing resource, storage capacity, power endurance, historical communication stability index.

[0044] In some embodiments of the first aspect, the first electronic device obtains the first networking model, specifically comprising: the first electronic device determines the first networking model based on information of the first communication system.

[0045] The method provided by the above embodiments can be used to enable the first electronic device to determine the first networking model by self-computation. In other embodiments, the first electronic device can also determine the first networking model based on a notification sent by another electronic device.

[0046] In a second aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the method described in the first aspect and any possible implementation manner of the first aspect.

[0047] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method described in the first aspect and any possible implementation manner of the first aspect.

[0048] In a fourth aspect, the present application provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the method described in the first aspect and any possible implementation manner of the first aspect.

[0049] It can be understood that the electronic device provided by the second aspect, the computer storage medium provided by the third aspect, and the computer program product provided by the fourth aspect are all used to execute the method provided by the present application. Therefore, the beneficial effects that can be achieved thereby can refer to the beneficial effects in the corresponding method, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS

[0050] Figure 1 is a networking model adopted by a soft bus communication architecture provided by the embodiments of the present application.

[0051] Figure 2 An exemplary application diagram of a full mesh model in a coal mine scenario is shown.

[0052] Figure 3 An exemplary application diagram of a full mesh model in a coal mine scenario is shown.

[0053] Figure 4 A brief variation diagram of a networking model provided by an embodiment of the present application is shown.

[0054] Figure 5 A tree model diagram provided by an embodiment of the present application is shown.

[0055] Figure 6 A device networking process diagram based on a tree model provided by an embodiment of the present application is shown.

[0056] Figure 7 A diagram of device networking in a coal mine scenario using the above tree model provided by an embodiment of the present application is shown.

[0057] Figure 8 A diagram of a star model provided by an embodiment of the present application is shown.

[0058] Figure 9 A device networking process diagram based on a star model provided by an embodiment of the present application is shown.

[0059] Figure 10 A diagram of a method for confirming a center node of a star model by a large model A provided by an embodiment of the present application is shown.

[0060] Figure 11 A diagram of device networking in a coal mine scenario using the above star model provided by an embodiment of the present application is shown.

[0061] Figure 12 A networking model switching process diagram provided by an embodiment of the present application is shown.

[0062] Figures 13A-13B An exemplary diagram of model migration in a set of coal mine scenarios is shown.

[0063] Figures 14A-14B An exemplary diagram of model migration in a set of unmanned vehicle scenarios is shown.

[0064] Figure 15 A diagram of self-learning and updating of a model migration threshold provided by an embodiment of the present application is shown.

[0065] Figure 16An example shows a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be clearly and completely described in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort are within the protection scope of the present application.

[0067] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to be a limitation of the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an,” and “the” are intended to include plural forms as well, unless the context clearly indicates otherwise. The terms “first,” “second,” and the like are used only to describe the objects, and cannot be understood as indicating relative importance or implying that the indicated technical features are limited to a specific number. Thus, the features defined with “first,” “second” can explicitly or implicitly include one or more of the features. “First” and “second” are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first object and the second object are used to distinguish different objects, and are not used to describe a specific order of the objects.

[0068] In the description of the embodiments of the present application, the meaning of “a plurality of” is two or more, unless otherwise specified. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.

[0069] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or aspect described in the embodiments of the present application as “exemplary” or “for example” should not be construed as being more preferred or advantageous than other embodiments or aspects. In fact, the use of the words “exemplary” or “for example” is intended to present concepts in a concrete manner.

[0070] The term “and / or” in the present application is only used to describe the association relationship of the associated objects, and means that there can be three relationships. For example, A and / or B can represent three cases of A alone, A and B together, and B alone.

[0071] With the continuous expansion of the category and quantity of electronic devices, the rapid popularization of collaborative office scenarios, and the intelligentization of life scenarios, the efficient interconnection demand between electronic devices is increasingly urgent. Soft bus is a communication architecture that can realize the interconnection of multiple electronic devices at the software level. It can be understood that the bus provides a transmission channel for the flow of information between various parts of the system. The traditional hardware bus is just such a unified transmission channel that connects each hardware module in the electronic device, enabling data to flow orderly within the electronic device. The above-mentioned soft bus borrows the design concept of the traditional hardware bus and uses software to build a virtual bus between various distributed electronic devices, realizing orderly communication between electronic devices. Specifically, the above-mentioned soft bus takes standardized software protocols, distributed programming interfaces, and system-level capabilities as the core, and through unified device discovery, identity authentication, link optimization, and resource scheduling mechanisms, it enables cross-device, cross-protocol, and cross-system data interaction to be presented to the application layer as a user experience like local call. For example, the above-mentioned soft bus architecture can be embedded in the operating system in the form of an application programming interface (API). As long as the same soft bus architecture is used between different electronic devices, for example, electronic device A and electronic device B in the same local area network use the same soft bus architecture, electronic device A can call the system-level API to automatically network with electronic device B, and then can directly call the hardware resources of the above-mentioned electronic device B through the soft bus to complete the business.

[0072] It can be understood that the prerequisite for electronic devices to realize device interconnection through the above-mentioned soft bus communication framework is to complete device networking. In the above-mentioned soft bus architecture, device networking refers to the process of establishing physical connections between multiple independently running electronic devices through wired or wireless communication methods, and completing identity mutual recognition, topology discovery, and parameter negotiation based on a pre-set protocol, so that each device in the same local area network forms a logically integrated system that can work collaboratively.

[0073] Figure 1 is a networking model adopted by a soft bus communication architecture provided by an embodiment of the present application, used to indicate the trust relationship and connection order formed by each electronic device before actual business data transmission.

[0074] As Figure 1As shown in the prior soft bus communication architecture, after an electronic device accesses a local area network, it needs to perform two-by-two authentication with other electronic devices in the same local area network one by one. This design logic is derived from the fact that, in a consumer scenario (such as a home scenario), the electronic device is mainly served by an ordinary personal user. This means that, in the above-mentioned consumer scenario, the electronic device can be in an open local area network environment or a semi-open local area network environment. At this time, the initial trust relationship between electronic devices is uncontrollable and unknown, and needs to rely on dynamic authentication to establish interconnection. In other words, only when the electronic device confirms the trustworthiness of the opposite end device through two-way authentication, can the electronic device determine whether to establish a soft bus-based data connection with the opposite end device. Therefore, this authentication model is also called a full mesh model. It can be deduced that when there are n electronic devices in the same local area network that support the above-mentioned soft bus communication architecture, the total number of two-by-two authentication performed by these electronic devices is n x (n-1) = n²-n times. Therefore, when the number of devices in the local area network that support the above-mentioned soft bus communication architecture exceeds the first number, the total number of two-by-two authentication can increase in a square level with the increase of the number of devices (i.e. )magnitude, thereby significantly reducing the efficiency of soft bus authentication networking. Moreover, as the device scale further expands, resource competition conflicts are easily triggered in the authentication process, leading to data packet processing delay or network latency accumulation, and thus causing authentication timeout and success rate decline and other problems.

[0075] Figure 2 With Figure 3 respectively show the application schematic diagram of the full mesh model in a typical scenario: Figure 2 For a local area network A in a coal mine scenario, it can include electronic devices such as a belt conveyor, a coal mining machine, a heading machine, a hydraulic support 1, and a hydraulic support 2. Figure 3 For a local area network B in a unmanned aerial vehicle scenario, it can access electronic devices such as unmanned aerial vehicle 1 to unmanned aerial vehicle 5. It can be understood that, in the coal mine scenario as shown in Figure 2 and the unmanned aerial vehicle scenario as shown in Figure 3 , if the number of devices in the local area network is greater than the above-mentioned first number, it is difficult to establish stable and reliable communication connection between electronic devices in the case of using the above-mentioned full mesh authentication model, and ultimately cannot meet the core business requirements of device collaborative work in an industrial scenario. Among them, in different scenarios, the specific value of the above-mentioned first threshold can be different, and the specific value of the above-mentioned first number can be determined by the developer in advance according to the scenario.

[0076] For example, in a coal mine scenario, if the total number of electronic devices (such as mine terminal devices, including electronic devices such as coal mining machines, tunneling machines, multiple hydraulic supports, and belt conveyors) working in the same local area network (for example, in a unified tunnel) at the same time exceeds a first number (for example, 20), a large number of handshake requests generated by the mutual authentication between electronic devices can cause a sharp rise in network latency. For example, state synchronization data packets between hydraulic supports and coal mining machines cannot be delivered in time due to network congestion, causing the support action to be out of sync with the mining process, directly threatening the safety of the operation. At the same time, some low-power devices (such as sensor devices in the same local area network) may be quickly depleted of power due to frequent participation in high-complexity authentication operations, making it impossible to maintain normal communication and further disrupting the collaborative control link between devices.

[0077] For example, in an unmanned aerial vehicle scenario, when the size of the cluster exceeds a first number (for example, 15 unmanned aerial vehicles), a large number of encrypted handshake requests initiated by multiple unmanned aerial vehicles at the same time can cause the on-board processor to overload, for example, the lead unmanned aerial vehicle cannot complete the networking authentication with other unmanned aerial vehicles in the formation within the predetermined time, resulting in the failure of the transmission of cluster scheduling instructions, and ultimately causing the unmanned aerial vehicles to be unable to maintain a safe distance and collaborative path planning. In addition, network jitter can cause some unmanned aerial vehicles to time out, causing them to be disconnected from the formation control network (i.e., the local area network of other unmanned aerial vehicles in the formation), and thus unable to receive task allocation instructions, ultimately causing the overall task (such as large-area inspection or logistics transportation) to be unable to be completed on schedule.

[0078] In view of this, the embodiments of the present application propose a device networking method, an electronic device, and a computer readable storage medium. In the above device networking method, the electronic devices should all support the same soft bus communication architecture. The above device networking method can be applied to a first electronic device, and a first communication system can include multiple electronic devices in the same local area network, and the multiple electronic devices can include the first electronic device. Specifically, the first electronic device can obtain a first networking model, the first networking model can be determined based on information of the first communication system, and the information of the first communication system can include one or more of the following: the change frequency of the electronic devices in the first communication system, the application scenario of the first communication system, the first networking model is different, and the target authentication device corresponding to the first electronic device can be different; the first electronic device determines one or more target authentication devices from the multiple electronic devices based on the first networking model; the first electronic device can authenticate with the one or more target authentication devices; after authentication, the first electronic device establishes a communication connection with the one or more target authentication devices. It can be understood that the first communication system is the communication system in which the first electronic device is located, and the first networking model is the networking model adopted by the first electronic device.

[0079] Through the device networking method, the electronic devices can adopt an adaptive network topology or networking model according to different business scenarios in different industries to perform authentication networking, so as to improve the networking efficiency and the success rate of authentication networking. In addition, through the device networking method, the electronic devices can automatically identify business requirements and dynamically switch the networking model in a mixed deployment environment across industries and scenarios, so as to ensure that the large-scale electronic device authentication networking process has the characteristics of low delay, low overhead and high reliability, thereby effectively supporting real-time collaboration and stable operation of business in industrial scenarios such as industrial control and UAV formation.

[0080] It can be understood that device networking refers to devices forming a network. In the device networking method, the electronic devices need to complete authentication first, and can establish a communication connection only after the authentication is passed. The establishment of the communication connection indicates that the networking is successful. The device networking method provided in the embodiments of the present application mainly optimizes the device authentication link.

[0081] As shown in Figure 4 In the embodiments of the present application, the networking model adopted by the electronic devices is changed from the full mesh model to a first networking model, including but not limited to the tree model and the star model. The following will be introduced respectively.

[0082] Tree model

[0083] Figure 5 is a schematic diagram of a tree model provided in the embodiments of the present application.

[0084] As shown in Figure 5 The tree model can organize a plurality of electronic devices (such as electronic devices 11-17) in a local area network as a logical tree structure, such as a complete binary tree structure. In the tree structure, the electronic devices can be divided into parent nodes and child nodes according to the hierarchical relationship: the root node is connected with the directly connected child nodes (up to two) as the top parent node, and the remaining non-root nodes except the root node can be further divided into intermediate parent nodes and leaf nodes, wherein the intermediate parent nodes and the directly connected child nodes (up to two) also form a connection, thereby forming a hierarchical authentication topology. Among them, Figure 5 The number in the center of the circle node is used to represent the serial number of the node. For example, Figure 5 Suppose that the electronic devices 11-17 correspond to Figure 5The electronic device 11 can be the root node of the tree structure, and be the parent node of the electronic device 12 and the electronic device 13, and the electronic device 12 and the electronic device 13 can be the child nodes of the electronic device 11. The electronic device 12 is the parent node of the electronic device 14 and the electronic device 15, and the electronic device 14 and the electronic device 15 can be the child nodes of the electronic device 12. The electronic device 13 is the parent node of the electronic device 16 and the electronic device 17, and the electronic device 16 and the electronic device 17 can be the child nodes of the electronic device 13. The electronic device 14 to the electronic device 17 are at the bottom layer of the complete binary tree and do not have corresponding child nodes.

[0085] In the tree model, any parent node only establishes an authentication connection with its direct child node (i.e., bidirectional authentication between the parent node and the child node), and the authentication information of the child node can be relayed to the root node or the upper parent node through the parent node, thereby realizing the mutual communication of the authentication information between all nodes in the complete binary tree. That is, in the tree model, the target authentication device of the electronic device is the parent node and / or the child node of the electronic device.

[0086] Figure 6 FIG. 1 is a schematic diagram of a device networking process based on a tree model provided by an embodiment of the present application. The following describes how the electronic device adopts the tree model to perform device networking. Figure 6

[0087] S101, the electronic device can be connected to a local area network.

[0088] Specifically, the electronic device can be connected to the corresponding local area network according to the broadcast domain in which the electronic device is located. For example, for the tree structure shown in FIG. 1, the electronic device 11 can be connected to the local area network 1, the electronic device 12 can be connected to the local area network 2, the electronic device 13 can be connected to the local area network 3, the electronic device 14 can be connected to the local area network 4, the electronic device 15 can be connected to the local area network 5, the electronic device 16 can be connected to the local area network 6, and the electronic device 17 can be connected to the local area network 7. Figure 5 ​As shown in the electronic device in the middle, the electronic device 11 to the electronic device 17 are all located in the broadcast domain of the local area network A, and the electronic device 11 to the electronic device 17 can be connected to the local area network A respectively. The embodiment of the present application does not specially limit the connection mode of the electronic device to the local area network, which can be Ethernet connection, wireless fidelity (Wi-Fi) connection or other connection modes. Optionally, the local area network (such as the local area network A) can use user datagram protocol / internet protocol (UDP / IP) as the communication protocol of the local area network. The local area network can also use other communication protocols such as transmission control protocol / internet protocol (UDP / IP) as the communication protocol of the local area network, and the embodiment of the present application does not specially limit the communication protocol of the local area network.

[0089] When the electronic device is connected to the local area network, the router of the local area network or the dynamic host configuration protocol (DHCP) server in the local area network can automatically allocate the network configuration parameters in the local area network to the electronic device connected to the local area network. The network configuration parameters include but are not limited to IP address, subnet mask, gateway, etc. For example, the electronic device 11 to the electronic device 17 can be automatically allocated IP addresses 192.168.1.1 to 192.168.1.7 after being connected to the local area network A. In addition to the IP address, the electronic device can also use the device identifier (ID) to uniquely identify the device identity. The device ID can be in the form of device serial number (DSN), universally unique identifier (UUID), media access control address (MAC), etc. The embodiment of the present application does not specially limit the presentation form of the device ID in the device networking method.

[0090] S102, the electronic device can discover the surrounding devices and obtain the device information of the surrounding devices.

[0091] The surrounding device can refer to other electronic devices accessing the same local area network. The process of discovering the surrounding device is the process of device discovery based on the soft bus communication architecture. Specifically, the electronic device can implement device discovery in the local area network by using a constrained application protocol (CoAP). At this time, the electronic device and its surrounding device both need to have the CoAP communication capability, that is, two electronic devices capable of device discovery need to support the same protocol (such as the CoAP protocol). The following describes step S102 based on the CoAP protocol for device discovery between the electronic device 11 and the electronic device 12. The device discovery between other electronic devices in the local area network can refer to the following process, which will not be described hereinafter.

[0092] Specifically, the CoAP protocol can support device discovery through a broadcast communication mode. For example, after accessing the local area network A, the electronic device 11 can send a device discovery broadcast message in the broadcast domain of the local area network. The device discovery broadcast message can carry one or more of the following device information of the electronic device 11: device ID, device name, device type, IP address, and the like. In some implementations, after accessing the local area network A, the electronic device 11 can periodically send the device discovery broadcast message. In some implementations, the electronic device 11 can also send the device discovery broadcast message only after detecting a first user operation. For example, there is a first application on the electronic device 11, and the electronic device 11 sends the device discovery broadcast message to the electronic device 12 only after detecting a user operation of starting the device discovery function in the first application. The present application does not specially limit how the electronic device initiates device discovery after accessing the local area network.

[0093] It can be understood that the device information can also include parameters corresponding to different scenes according to different scenes. Taking the coal mine scene as an example, the device type can include a coal mining machine, a hydraulic support, a scraper conveyor, a heading machine, a belt conveyor, a gas detector, a camera, an intelligent mine lamp, an explosion-proof mobile phone, and the like. It can be understood that the device type can be pre-set by a developer.

[0094] In addition, the device information can further include a geographic location identifier of the electronic device 11. For example, the geographic location identifier can include one or more of the following: a mine area identifier (e.g., a mine area number) to which the electronic device 11 belongs, a coal mine tunnel (e.g., a tunnel number) in which the electronic device 11 is located, and a working face area in which the electronic device 11 is located. The device information can further include a coal mine subsystem to which the electronic device 11 belongs. The coal mine subsystem refers to a functional module obtained by subdividing a whole system of coal mine production, safety, management, etc. Each coal mine subsystem can focus on the implementation of a specific function and cooperate with each other to ensure normal production and management activities of the coal mine. The coal mine subsystems include, but are not limited to, a coal mining subsystem, a tunneling subsystem, a transportation subsystem, a gas detection subsystem, a carbon monoxide detection subsystem, a carbon monoxide detection subsystem, a power supply subsystem, a drainage subsystem, and a ventilation subsystem. It can be understood that the geographic location identifier (e.g., a mine area number, a tunnel number, a working face area, etc.) and the coal mine subsystem related data (e.g., a coal mining subsystem, a transportation subsystem, a safety monitoring subsystem, etc.) are all example data generated based on a coal mine scenario. However, it should be noted that the data associated with the scenario that can be included in the message of the actual device discovery multicast is not limited to the two types. The specific content can be flexibly extended according to the type of the scenario, the actual business requirements in the scenario, the characteristics of the production environment, the management mode, and the technical application direction, etc. The specific fields of the device information carried in the message of the multicast are not specially limited in the embodiments of the present application.

[0095] After accessing the local area network A, the electronic device 12 can determine whether to respond to the device discovery broadcast after receiving the message of the device discovery broadcast. In the above example, since the network environment under the mine can be unstable, the electronic device 12 can evaluate the network environment by detecting the state of the network interface, measuring the network signal strength and bandwidth, and the like. For example, when it is detected that the network bandwidth is lower than a first value or the signal strength is lower than a second value, the electronic device 12 can determine that the current network environment is not good, and then does not respond to the device discovery broadcast to avoid further increasing the network burden; on the contrary, if the electronic device 12 determines that the current network environment is good (i.e., the electronic device 12 does not detect that the network bandwidth is lower than the first value or the signal strength is lower than the second value), the electronic device 12 can respond to the device discovery broadcast. Without being limited to the above manner, the electronic device can also determine whether to respond to the device discovery broadcast based on the working state of the device itself (such as whether it is in a maintenance mode or a fault state) and / or a security policy, and the like. The present embodiment does not specially limit how the electronic device (such as the electronic device 12) that receives the device discovery broadcast determines whether to respond to the device discovery broadcast. If it is determined that it can respond, the electronic device 12 can unicast a discovery response message to the electronic device 11 based on the IP address of the electronic device 11 in the device discovery broadcast in response to the device discovery broadcast. Similarly, the discovery response message can also carry the device ID, device name, device type, IP address, and the like. The specific fields can refer to the fields involved in the broadcast message sent by the electronic device 11. In addition, the discovery response message can also carry device state information and the like. The device state information can include the running state of the device (such as normal operation, fault shutdown, maintenance mode, standby state, and the like), real-time detected data (such as the current gas concentration value of the gas detector), and the communication connection state of the device (such as the connection stability signal strength, packet loss rate, and the like). The present embodiment does not specially limit what data is included in the discovery response message. After receiving the discovery response message, the electronic device 11 can discover the electronic device 12 and obtain the device information of the electronic device 12 through the discovery response message. At this time, the electronic device 12 can also be referred to as a discovered device. Similarly, the electronic device 11 can also obtain the device information of other surrounding devices in the broadcast domain of the local area network A through the above process. The device information can include the parameter information of the device.

[0096] Not limited to the above process, the electronic device can also carry only basic device information (such as only carrying the identification information of the electronic device) in the message of the device discovery broadcast and the discovery response message, and exchange more detailed device information after the electronic device 11 receives the discovery response message. For example, the message of the device discovery broadcast and the discovery response message only carry the ID and / or device name of the device. After receiving the discovery response message, the electronic device 11 can send a first message, which can include more detailed device information, such as one or more of the following: the device type, IP address, and the geographical location identifier, the production subsystem of the device, and the like. Not limited to the above-mentioned device information fields, the first message can also include more or less device information fields, and the embodiments of the present application do not make special limitations thereon. In response to the first message, the electronic device 12 can return a second message, and the device information fields involved in the second message can refer to the device information fields contained in the first message, and the embodiments of the present application do not make special limitations thereon.

[0097] The embodiments of the present application do not make special limitations on what link the electronic devices obtain the device information of the discovered device in the device discovery process.

[0098] In some embodiments, the electronic device can confirm that the networking model to be run is the tree model by querying the locally stored networking model identifier.

[0099] In some embodiments, the electronic device can confirm that the networking model to be run is the tree model by querying the locally stored networking model identifier.

[0100] In some embodiments, the electronic device can confirm that the running networking model is the tree model based on an application scenario. In one implementation, the electronic device can be internally provided with a first mapping table, which can be used to record the correspondence between the application scenario and the meaning of the networking model. Then, the electronic device can query the first mapping table according to the application scenario, so as to determine the networking model to be enabled. For example, the electronic device can query the first mapping table according to the coal mine scenario, so as to confirm that the tree model is enabled as the networking model. Optionally, the electronic device can determine the application scenario based on user input. For example, the user can select the application scenario of the electronic device in advance, and then the electronic device can obtain the application scenario selected by the user (i.e., user input) and confirm that the networking model is the tree model accordingly. Optionally, the electronic device can determine the application scenario based on the device information of the electronic device itself and the surrounding devices. Specifically, the electronic device can determine the application scenario based on a neural network large model (e.g., large model A), wherein the neural network large model (e.g., large model A) can take the device information of multiple electronic devices as input and take the application scenarios of the multiple electronic devices as output. The device information of the multiple electronic devices input into the neural network large model includes but is not limited to the device types of the multiple electronic devices, and the present application does not make special limitations on the input of the neural network large model. In another implementation, the electronic device can also directly confirm that the running networking model is the tree model through a neural network large model (e.g., large model B); in other words, the neural network large model (e.g., large model B) can take the device information of multiple electronic devices as input and take the networking model to be run by the multiple electronic devices as output.

[0101] In some embodiments, the electronic device can determine the tree model as the networking model according to the device change in the local area network. Specifically, the electronic device can periodically collect and record the online events and offline events of each device in the local area network, and take the sum of the number of newly added devices and the number of offline devices in a unit time as the stability quantitative index of the local area network, where the sum of the number of newly added devices and the number of offline devices in a unit time is also referred to as a first device change parameter of the local area network. That is, the change frequency of the electronic device in the communication system is the sum of the frequency of newly added devices in the first communication system and the frequency of devices offline in the first communication system. When the first device change parameter is less than a first threshold, it means that the local area network is relatively stable and there is no frequent device change. At this time, the electronic device can determine that the tree model can be used as the networking model based on the device change that the first device change parameter is less than the first threshold. The device change can include newly added devices and devices offline. The newly added device refers to a device change that is newly discovered by the electronic device in the current unit time and is not recorded in the local device list before. Similarly, the device offline refers to a device change that exists in the last unit time but is not found or not answered in the current unit time. The number of devices in the two device changes can be calculated by difference based on the device survival table maintained locally, so as to objectively reflect the actual change of the members in the local area network.

[0102] The following takes a coal mining machine as an example of the electronic device for determining the networking model. The coal mining machine can collect the responses of all discovered devices in the working face through broadcast detection packets every 10 seconds, compare the current unit time survival list with the record of the last unit time: if 1 tunneling machine is newly discovered in the current unit time and 1 hydraulic support is offline at the same time, the number of newly added devices is 1, the number of offline devices is 1, and the first device change parameter is 2. When the first threshold is 5, 2 is less than 5, which indicates that the members in the local area network do not change frequently, and the network is in a stable state. The coal mining machine can determine that the tree model can be used as the networking model accordingly.

[0103] It can be understood that the electronic device can determine whether to use the tree model as the networking model according to the device change in the local area network, because the electronic device can calculate and generate a spanning tree for multiple electronic devices in the local area network based on the tree model (such as Figure 5The spanning tree can assign relatively fixed authentication paths to each node. If the network members frequently change, the spanning tree needs to be recalculated repeatedly, which significantly increases CPU occupation and algorithm time consumption. Such overhead will quickly offset the hierarchical authentication benefits brought by the tree model in a high-topology-change scenario. Conversely, if the network members are stable for a long time, the tree structure calculation and parent-child node confirmation need to be performed only once or at a very low frequency, so that the subsequent continuous hierarchical authentication efficiency is obtained at a limited calculation cost. Therefore, "low topology change" can be used as a prerequisite criterion for selecting the tree model.

[0104] It can be understood that, in an implementation manner, as long as all electronic devices locally run the same set of deterministic algorithms and the inputs of the algorithms (such as the inputs of the large model A or the large model B) are completely consistent, the networking model results calculated by each electronic device in the local area network can also be consistent. In another implementation manner, the above-mentioned judgment logic can also be executed by one electronic device (for example, the only one electronic device with computing resources) in the local area network, and the obtained networking model result is sent to all other electronic devices in the local area network in the form of a broadcast message, so that the other electronic devices in the local area network can directly use the networking model without repeated operation. That is, the electronic device (such as the first electronic device) can actively determine the networking model (such as the first networking model) based on the information of the communication system (such as the first communication system), but can also passively learn which networking model to use from other electronic devices. The embodiments of the present application do not specially limit how the electronic device specifically obtains the networking model.

[0105] In S104, the electronic device can generate a tree structure based on the device information of each device in the same local area network. The electronic device actually confirms the following tree structure based on the networking model (such as the tree model) and the parameter information of the plurality of electronic devices in the communication system, and then confirms the target authentication device based on the tree structure. The tree structure is also referred to as the first authentication path, and the first authentication path is used to indicate the parent node and / or child node of the plurality of electronic devices in the first communication system.

[0106] Specifically, in an implementation manner, the electronic device can generate the tree structure based on the IP addresses or device IDs of the electronic devices in the local area network. Specifically, taking Figure 5 as an example, it is assumed that in Figure 5 , the IP addresses of the electronic devices 11-17 are 192.168.1.1-192.168.1.7 respectively. When the electronic device (such as the electronic device 11) obtains the other electronic devices (such as the electronic devices 12-17) discovered in the local area network, the electronic device 11 can determine the tree structure based on the IP addresses of the electronic devices 12-17. Figure 5Electronic devices 12 to 17 in the network can then extract the fourth byte of the IP address of each electronic device in the local area network (i.e., X in 192.168.1.X above) as the sorting key and sort them in ascending order of value, with the smallest sequence number becoming the root node (e.g., ...). Figure 5 Node 1 is the first node in the tree, the second smallest node is the root's child node (nodes 2 and 3), and the remaining nodes are selected according to the formula for a complete binary tree. Nodes are attached sequentially (e.g., nodes 4 and 5 can be attached to node 2, and nodes 6 and 7 can be attached to node 3). The 'x' above can be used to identify the ordered device number. In this way, electronic devices can quickly construct a logical tree topology, and all devices in the network can obtain a consistent tree structure without interaction, just like... Figure 5 The hierarchical structure formed by electronic devices 11 to 13 corresponding to nodes 1 to 3, electronic devices 14 to 15 corresponding to nodes 4 to 5, and electronic devices 16 to 17 corresponding to nodes 6 to 7, naturally forms a clear tree hierarchy by means of the sorting of the fourth byte of the IP address of each electronic device and the rules of a complete binary tree.

[0107] Specifically, in another implementation, the electronic devices can generate the aforementioned tree structure based on the performance parameters of each electronic device. These performance parameters include at least one of the following or a weighted combination thereof: throughput, network latency, signal strength, bandwidth capacity, computing resources, storage capacity, power consumption, and historical communication stability indicators. The electronic devices can normalize these performance parameters and arrange them in descending order of value, so that higher-performing devices have smaller numbers and are closer to the root node, while lower-performing devices have larger numbers, progressing downwards. Furthermore, the electronic devices can also employ similar methods... The formula completes the mounting, thereby prioritizing high-throughput, high-reliability, or high-energy-redundancy devices for relay and authentication while ensuring determinism, reducing multi-hop latency and topology reconfiguration frequency. Similarly, the 'x' mentioned above can be used to identify the device number after sorting. The parameter information mentioned in this document includes at least one or more of the following: identification information, geographical location of the device, production subsystem to which the device belongs, device security level, and performance parameters. The identification information mentioned in this document includes at least one or more of the following: device ID, device name, device Internet Protocol (IP) address, and port number. The performance parameters mentioned in this document include at least one or more of the following: throughput, network latency, signal strength, bandwidth capacity, protocol support type, computing resources, storage capacity, power endurance, and historical communication stability indicators.

[0108] S105. Electronic devices can identify target authentication devices based on the generated tree structure.

[0109] In step S104, the electronic device can generate, for example Figure 5The tree structure is shown. Specifically, the electronic device can first calculate , left(x) = 2x and right(x) = 2x + 1, where parent(x) indicates the parent node of the node in the ordering table, left(x) indicates the left child node of the node in the ordering table, and right(x) indicates the right child node of the node in the ordering table. If the electronic device itself is the root node of the tree structure (i.e., x = 1), the electronic device can only set the left child node and the right child node as the target authentication device, otherwise the electronic device can set all existing parent nodes and / or child nodes (including the left child node and the right child node) as the target authentication device. It can be understood that in the tree structure generated after the step S104, the electronic device can not have two child nodes (such as node 4 to node 7 in Figure 5 ).

[0110] Subsequently, the electronic device can read a preset authentication direction flag bit. The flag bit indicates that the authentication direction can be that the parent node initiates authentication to the child node first, or the child node initiates authentication to the parent node first. Without being limited to the above authentication direction flag bit, the embodiments of the present application do not specially limit how the electronic device specifically identifies the authentication direction.

[0111] It can be understood that the reason why the electronic device needs to generate the tree structure in the step S104 is to determine its parent node and child node, and then determine the target authentication device, therefore, optionally, the electronic device can store the generated tree structure; optionally, the electronic device can also only record the parent node and the child node determined based on the tree structure.

[0112] S106, the electronic device can perform authentication with the target authentication device.

[0113] The electronic device can send an authentication request to the target authentication device determined based on the authentication direction, based on the IP address in the discovery response message sent by the target authentication device. The authentication request can carry the device ID, device name, device type, IP address, and digital certificate of the electronic device. It can be understood that if the electronic device is the mine terminal device (for example, the electronic device 11 is a coal mining machine, which belongs to the mine terminal device), the digital certificate of the electronic device can be issued by the mine certificate authority. Optionally, since the electronic device is the mine terminal device, the authentication request message can also carry the geographic location identifier of the electronic device. For example, the geographic location identifier can include one or more of the following: the mine area identifier (such as the mine area number) to which the electronic device belongs, the coal mine tunnel (such as the tunnel number) in which the electronic device is located, and the working face area in which the electronic device is located. Optionally, the authentication request message can also carry the coal mine subsystem to which the electronic device belongs. The coal mine subsystem refers to a functional module obtained by subdividing the overall system of coal mine production, safety, management, etc. Each coal mine subsystem can focus on the implementation of specific functions, and cooperate with each other to ensure the normal production and management activities of the coal mine. The coal mine subsystems include but are not limited to a coal mining subsystem, a tunneling subsystem, a transportation subsystem, a gas detection subsystem, a carbon monoxide detection subsystem, a carbon monoxide detection subsystem, a power supply subsystem, a drainage subsystem, and a ventilation subsystem. It can be understood that the geographic location identifier (such as the mine area number, the tunnel number, the working face area, etc.) and the coal mine subsystem related data (such as the coal mining system, the transportation system, the safety monitoring system, etc.) are all example data generated based on the coal mine scene. However, it should be noted that the data associated with the scene that can be included in the actual authentication request message is not limited to these two types - the specific content can be flexibly expanded according to the actual business needs of the coal mine, the characteristics of the production environment, the management mode, and the technical application direction, etc. The embodiments of the present application do not make special limitations on this.

[0114] After receiving the authentication request, the target authentication device can verify the signature, validity period, issuing authority, and other information of the digital certificate of the electronic device to confirm whether the identity of the electronic device is legitimate. If the target authentication device confirms that the identity of the electronic device is legitimate, the target authentication device can return an authentication result message to the electronic device. The authentication result message can carry an authentication result identifier (such as authentication success) and authentication information of the target authentication device, and the authentication information of the target authentication device includes but is not limited to the device ID, device name, device type, IP address, and digital certificate of the target authentication device. It can be understood that the fields of the authentication information of the target authentication device included in the authentication result message correspond one-to-one to the fields of the authentication information of the electronic device included in the authentication request message. For example, if the authentication request message includes a geographic location identifier of the electronic device, the authentication result message should also include a geographic location identifier of the target authentication device.

[0115] After receiving the authentication result message, the electronic device can also verify the signature, validity period, issuing authority, and other information of the digital certificate of the target authentication device to confirm whether the identity of the target authentication device is legitimate. If the electronic device confirms that the identity of the target authentication device is legitimate, the electronic device can return a confirmation message to the target authentication device, thereby completing the mutual authentication between the electronic device and the target authentication device. It can be understood that the confirmation message can carry an authentication result identifier (such as authentication success).

[0116] After the authentication is completed, the electronic device and the target authentication device can be trusted devices in the local area network, and thus the electronic device and the target authentication device can add the authenticated electronic device to their own trusted device lists, respectively. It can be understood that after the electronic devices complete the device discovery and device authentication process, they can establish a data connection and exchange subsequent service data.

[0117] Specifically, the authentication process can be implemented based on the CoAP protocol. Without being limited to the CoAP protocol, the electronic device can also use other protocols to perform the device authentication process, and the embodiments of the present application do not make special limitations on this. It can be understood that no matter what protocol the electronic device actually selects to implement the device discovery and device authentication functions, the underlying layer is to complete the corresponding operation steps by calling the standardized API interface provided by the operating system or communication framework.

[0118] S107, the electronic device can send the device information of the newly authenticated target authentication device to the authenticated parent node and / or child node.

[0119] After completing the above authentication, the electronic device can send a list of trusted devices to its already authenticated parent and / or child nodes (including left and right child nodes). This list can include device information of trusted electronic devices, including but not limited to device ID, IP address, and port number. The newly authenticated electronic device is included in this list. Upon receiving the trusted list, the already authenticated parent and / or child nodes can update their locally stored trusted device list to the received list. That is, when the one or more target authentication devices include a first target authentication device and a second target authentication device, the first electronic device authenticating with the one or more target authentication devices can mean that the first electronic device first authenticates with the first target authentication device and then with the second target authentication device. Subsequently, after the first electronic device authenticates with the second target authentication device, the first electronic device can synchronize the parameter information of the second target authentication device to the first target authentication device. Figure 5 For example, when the above-mentioned electronic devices are Figure 5 When electronic device 12 is in use, and electronic device 12 and electronic device 15 have already completed authentication, after successful authentication, electronic device 12 can synchronize the device information (including parameter information) of electronic device 15 to electronic device 14. Similarly, electronic device 15 will also receive the parameter information of electronic device 14 synchronized by electronic device 12, which is equivalent to electronic device 12 synchronizing its local trusted list to electronic device 15, including electronic device 14. Subsequently, electronic device 14 and electronic device 15 can establish a communication connection.

[0120] After the update is completed, the aforementioned certified parent nodes and / or child nodes can also send the locally updated list of trusted devices to their respective parent nodes and / or child nodes. This allows the device information of newly certified target devices located anywhere in the local area network to be quickly disseminated to the global area network, ensuring that all nodes maintain a consistent list of trusted devices.

[0121] That is, it can be understood that the electronic device (such as the first electronic device) can also be a child node of other electronic devices, that is, the one or more target authentication devices are parent nodes of the first electronic device, and after the first electronic device performs authentication with the one or more target authentication devices, the first electronic device receives parameter information of a second electronic device synchronized by the one or more target authentication devices, and the second electronic device and the first electronic device are child nodes of the one or more target authentication devices; and the first electronic device establishes a communication connection with the second electronic device based on the parameter information of the second electronic device. In the above example, the electronic device 12 as the electronic device (that is, the first electronic device) can also receive parameter information of the electronic device 13 synchronized by the electronic device 11, and then establish a communication connection with the electronic device 13 based on the parameter information.

[0122] It can be understood that the step S107 can also be understood as that after the electronic device detects that the parameter information of the trusted device stored locally changes, the parameter information of the trusted device is synchronized according to the authentication direction.

[0123] S108, the electronic device detects that there is a device change in the local area network, and jumps to execute step S102.

[0124] The electronic device can send a heartbeat broadcast to the local area network at a first frequency, and the heartbeat broadcast message can include the device ID of the electronic device and the digest hash of the current all authenticated device list.

[0125] After the surrounding device receives the heartbeat broadcast, the surrounding device can return a unicast heartbeat response in response to the heartbeat broadcast, and the heartbeat response message can also include the digest hash of the surrounding device. After receiving the heartbeat response message, the electronic device can compare the digest hash in the heartbeat response message with the locally stored digest hash, and then the electronic device can confirm whether there is a device change in the local area network. If the electronic device detects that the digest hash in the heartbeat response message is different from the locally stored digest hash, the electronic device can determine that there is a device addition / device offline in the local area network, and immediately trigger step S102 to re-perform device discovery and generate a network topology structure (such as a tree structure corresponding to the tree model) corresponding to the network topology structure.

[0126] In addition, the electronic device can detect whether a unicast heartbeat response message sent by a device in the authenticated device list is received after each time the heartbeat broadcast is sent. If no heartbeat response message returned by a surrounding device is received for two consecutive periods, the electronic device can determine that the surrounding device is offline, and can also trigger step S102 to re-perform device discovery and generate a network topology structure (such as the tree structure).

[0127] In other words, if the plurality of electronic devices in the first communication system are changed, the electronic device can determine a second authentication path relationship based on the networking model and parameter information of the plurality of electronic devices after the change in the communication system, the second authentication path relationship being used to indicate parent nodes and / or child nodes of the plurality of electronic devices after the change; the electronic device determines one or more to-be-judged authentication devices from the plurality of electronic devices after the change based on the second authentication path relationship; if the first electronic device does not save parameter information of the to-be-judged authentication device, the first electronic device performs authentication with the to-be-judged authentication device and establishes a communication connection with the to-be-judged authentication device (for example, the to-be-judged authentication device is a newly added electronic device, and authentication is performed with the to-be-judged authentication device and a communication connection is established); if the first electronic device has saved the parameter information of the to-be-judged authentication device, the first electronic device determines that the authentication with the to-be-judged authentication device is completed.

[0128] It can be understood that because of the step S108, the tree model is more suitable for a local area network with a long-term stable network topology, because the steps S102-S108 are re-executed as soon as a device change is detected. The long-term stable local area network refers to a local area network in which the first device change parameter is less than the first threshold in the first time, that is, there is no frequent device change in the local area network at this time.

[0129] The tree model is not limited to the structure of the full binary tree as shown in Figure 5 , but can also be a random binary tree, or even a ternary tree, a quad tree, and the like, which are not specially limited in the embodiments of the present application.

[0130] It can be understood that for a miner terminal device in a coal mine scene, when the full mesh model is used for device networking, the connections that need to be established between the miner terminal devices in the authentication process can be as shown in Figure 2 . For the same batch of miner terminal devices, when the tree model is used for device networking, the connections that need to be established between the miner terminal devices in the authentication process can be as shown in Figure 7 . By comparing Figure 2 and Figure 7 , it can be seen that by adjusting the networking model in the device networking process, the number of connections and authentications of each device in the device networking process can be simplified from n-1 times in Figure 2 to at most 3 times, so that the number of connections and authentications in the entire network can be reduced from n 2 to 3n. It can be understood that when n is greater than 4, the tree model can effectively reduce the number of connections between devices in the network, thereby greatly improving the efficiency of device networking.

[0131] The tree model has a requirement for the stability of the network topology itself. Figure 8 is a schematic diagram of a star model provided by an embodiment of the present application. It can be understood that the star model can be applied to a communication system with less stable network topology. In other words, if the electronic device detects that the first device change parameter in the communication system is greater than or equal to the first threshold value, the electronic device is not suitable to use the tree model, and the electronic device can use the star model.

[0132] Star model

[0133] As shown in Figure 8 , the star model can organize a plurality of electronic devices (such as electronic device 21 to electronic device 26) in the local area network into a centralized structure: one of the electronic devices can serve as a center node (such as electronic device 21 in Figure 8 ), and the remaining electronic devices can serve as non-center nodes (such as electronic device 22 to electronic device 26 in Figure 8 ). The non-center nodes only establish direct authentication connections with the center node, and the non-center nodes do not need to authenticate each other (for example, electronic device 22 to electronic device 26 do not establish any authentication relationship with each other). That is, the plurality of electronic devices in the communication system (such as the first communication system) can be center nodes and non-center nodes, the first electronic device is the center node, and the target authentication device is the non-center node, or the first electronic device is the non-center node, and the target authentication device is the center node.

[0134] In the star model, Figure 8 the number in the center of the circular node is used to represent the serial number of the node. This design makes the authentication link of the entire system still effective through the center node as long as the center node remains stable even if the network topology changes dynamically (such as some non-center nodes frequently join / exit, connection interruption), thereby reducing the dependence on the stability of the entire network topology, and being more suitable for a communication environment with variable topology.

[0135] Figure 9 is a device networking process schematic diagram based on the star model provided by an embodiment of the present application. The device networking process when using the star model is similar to the process shown in Figure 6 .

[0136] S201, the electronic device can be connected to the local area network.

[0137] S202, the electronic device can discover surrounding devices and obtain device information of the surrounding devices.

[0138] S203, the electronic device can confirm that the networking model to be run is the star model.

[0139] In some embodiments, when the electronic device reads that the networking model state is "2", the electronic device can determine that the networking model to be run is the star model.

[0140] In some embodiments, the electronic device can also determine that the networking model to be run is the star model based on an application scenario. For example, the electronic device can determine that the application scenario is a UAV scene, and then determine that the networking model to be run is the star model. Optionally, the electronic device can determine the application scenario to be a UAV scene based on user input or device information of the electronic device (such as the device type of the electronic device). It can be understood that the application scenarios suitable for using the star model as the networking model include application scenarios with high dynamic network topology and frequent link interruption, such as the above-mentioned UAV scene, vehicle formation scene, and temporary ad hoc network for emergency rescue. The above-mentioned application scenarios with high dynamic network topology and frequent link interruption will be described below by taking the above-mentioned UAV scene as an example. Specifically, in the UAV scene, the wireless signal coverage range of the center node constitutes a dynamic broadcast domain; the non-center nodes (including other UAVs or ground terminals) continuously enter and exit the broadcast domain during flight. When the non-center node is located within the signal coverage range of the current center node, it automatically establishes a link with the center node and joins the corresponding local area network; once its spatial position exceeds the coverage range, the link is disconnected and a new adjacent broadcast domain is searched, and then the non-center node accesses the new center node, thereby causing the network membership and physical topology to change frequently with the displacement of the aircraft, forming an application environment with unstable network topology structure.

[0141] In some embodiments, the electronic device can also directly determine that the networking model to be run is the star model according to the device change in the local area network. For example, when the electronic device detects that the first device change parameter is greater than or equal to the first threshold, it means that the local area network is not stable and there is frequent device change. Therefore, the electronic device can determine to use the star model when detecting the above-mentioned situation.

[0142] S204, the electronic device can generate a star structure based on the device information of each device in the same local area network.

[0143] It can be understood that the key to the electronic device generating the star structure is to determine the center node of the star structure in the same local area network. That is, when the star model is used, the electronic device determines the target authentication device from a plurality of electronic devices, and first determines the center node of the communication system. Once the center node is determined, the remaining electronic devices are non-center nodes of the star structure. The center node of the star structure can satisfy the following characteristics:

[0144] 1) Always-on - The central node should always be in the broadcast domain of the local area network throughout the life cycle of the star model running, and cannot disappear due to movement, hibernation or power failure.

[0145] 2) Performance leading - The central node can have the highest comprehensive performance score, including CPU computing power, available memory, throughput bandwidth and low-latency processing capability, to support concurrent authentication, centralized forwarding and real-time control of all non-central nodes in the group.

[0146] 3) High fault tolerance - The central node can be built-in with a self-recovery mechanism to prevent global network authentication interruption due to central node paralysis.

[0147] It can be understood that the electronic device can be provided with a configuration item, which can be used to indicate whether the electronic device belongs to the central node or the non-central node device in the local area network. For example, if the configuration item is set to 1, it means that the electronic device belongs to the central node, and if it is set to 0, it means that the electronic device belongs to the non-central node.

[0148] In an implementation manner, the configuration item can be set by the developer in advance. In the step S202, the electronic device can also obtain the configuration item of the surrounding device when obtaining the device information of the surrounding device, and then confirm which electronic device in the local area network is the central node of the star structure by giving the obtained configuration item.

[0149] In another implementation manner, the electronic device can elect the central node device of the local area network based on the star model and the performance parameters of the electronic devices accessing the local area network. It can be understood that the electronic devices can exchange their respective performance parameters after the device discovery. The performance parameters include but are not limited to throughput rate, network delay, signal strength, bandwidth capacity, protocol support type, computing resource (such as CPU / memory / storage performance), storage capacity, power endurance capability and historical communication stability index, etc. It can be understood that the stronger the performance of the electronic device, the more likely it will be elected as the central node when the electronic devices in the local area network adopt the star model for device networking. For example, in the Figure 8 , the electronic device 21 can be the central node in the star model, which is determined based on the performance parameters of the plurality of devices (i.e. the electronic devices 21-26) in the local area network.

[0150] Optionally, the electronic device can use a built-in neural network large model (such as a deep learning model, a large language model or other artificial intelligence models) to realize the intelligent election of the central node. Figure 10is a schematic diagram of a method for confirming a center node of a star model by a large model A provided in the present application. Specifically, the electronic device can be built-in with a large model A, which can comprehensively evaluate and determine the device most suitable for serving as a center node in the local area network based on the performance parameters of each electronic device in the local area network. For example, as shown in Figure 10 as shown in Figure 8 For example, as shown in the local area network in , the electronic device (such as electronic device 21 or electronic device 22) can collect the performance parameters of all devices (such as electronic device 21-electronic device 26) in the local area network after authentication and input them into the large model A; the large model A can directly output the center node of the star structure as electronic device 21 after comprehensively comparing the throughput rate, network delay, signal strength, bandwidth capacity and other parameters of each electronic device. Since each electronic device in the same local area network has obtained a consistent dataset of performance parameters, and calls the same large model A for inference, the election results of the root node device obtained by each electronic device must be the same, so that the unified, rapid and intelligent determination of the root node device can be realized without manual adjustment.

[0151] Optionally, the electronic device can also determine the above-mentioned center node by a preset election rule. For example, the developer can pre-assign weights to the parameters in the performance parameters such as throughput rate, network delay, signal strength, etc., and the electronic device can substitute the values of the performance parameters of each electronic device in the global area network maintained locally into the weighted sum to obtain the score of the electronic device, and directly take the highest score device as the center node of the star structure after arranging in descending order according to the score. Similarly, as long as all electronic devices use the same weight setting and sorting logic, the election results of the above-mentioned center node must be consistent, and the present application does not limit the specific form and parameter combination of the above-mentioned election rule.

[0152] It can be understood that if the center node of the star structure is determined by election, the electronic device can update the stored configuration items of each electronic device in the local area network after election. For example, if the configuration items of each electronic device before election can be default configuration items (such as all set to “0” corresponding to non-center nodes or all set to “null”), the electronic device can modify the information of the configuration items of each electronic device stored locally after election, such as setting the configuration item of the center node corresponding to the electronic device elected to “1” and setting the configuration item of the non-center node corresponding to the electronic device to “0”. In some implementations, after the above-mentioned election, the electronic device can not store the configuration items of each electronic device locally, but directly store the center node of the above-mentioned star structure, for example, store the device ID of the center node (the above-mentioned electronic device 21) obtained by election.

[0153] It can be understood that the electronic device can reselect the center node of the star structure at a set period, and refresh the configuration item in time after the role of the electronic device is changed: the newly elected electronic device is set as the center node of the star structure, and the original center node device is synchronized to be a non-center node device. The electronic device can also establish the center node of the star structure only once at the first calculation, and then permanently lock and no longer update. The application does not make special restrictions on the election refresh strategy and frequency.

[0154] S205, the electronic device can confirm the target authentication device based on the star structure.

[0155] If the electronic device is a center node, the target authentication device of the electronic device is other electronic devices discovered in the local area network, that is, the target authentication device of the center node is all non-center nodes.

[0156] If the electronic device is a non-center node, the target authentication device of the electronic device can be the center node of the star structure confirmed in the step S204.

[0157] It can be understood that the authentication process between the devices involved in this paper is two-by-two authentication, and which one of the two electronic devices currently issues an authentication request does not affect the two electronic devices as the target authentication device of each other. In other words, as long as the connection between the two electronic devices is established and the authentication process is performed in the authentication process, the two electronic devices can be each other's target authentication device.

[0158] S206, the electronic device can authenticate with the target authentication device.

[0159] In the above authentication process, the authentication process between devices can be initiated by the center node first, or by the non-center node first, and the embodiments of the application do not make special restrictions.

[0160] S207, if the electronic device is a center node, the electronic device can synchronize the device information of the newly authenticated target authentication device to other authenticated non-center nodes.

[0161] The above other authenticated non-center nodes refer to non-center node devices that have been authenticated with the center node before step S207. It can be understood that the device information of the above newly authenticated target authentication device can be the device information exchanged between the electronic devices in step S206 (including the above parameter information). Specifically, if the above electronic device is a center node, the electronic device can traverse the local trusted device list, and thus send the device information of the above newly authenticated target authentication device to each authenticated non-center node in the trusted device list.

[0162] S208, if the electronic device is the center node, after detecting that there is a device change in the local area network, the electronic device can synchronize the device information of each device in the updated local area network to other authenticated non-center nodes.

[0163] The above-mentioned device change in the local area network means that the plurality of electronic devices in the communication system have changed. Similar to step S207, the electronic device can also traverse the locally stored trusted device list, and thus send the above-mentioned device information of each device in the updated local area network to each authenticated non-center node in the trusted device list.

[0164] The specific implementation details in the above steps S201-S208 can be referred to the related description of Figure 6 , which will not be repeated here. In the above method, corresponding to the above-mentioned step S207, if the electronic device is not the center node (i.e., the electronic device is the non-center node), after the authentication between the electronic device and one or more target authentication devices, the electronic device can also receive the parameter information of a third electronic device in the plurality of electronic devices sent by the target authentication device, and the third electronic device, the electronic device, and the target authentication device are all different. For example, in Figure 8 , the electronic device refers to the electronic device 22, and then the electronic device 22 can receive the parameter information of the electronic device 23 (i.e., the above-mentioned third electronic device) synchronized by the electronic device 21 after the authentication with the electronic device 21; subsequently, the electronic device can establish a communication connection with the third electronic device based on the parameter information of the third electronic device.

[0165] It can be understood that for the electronic devices (such as the unmanned aerial vehicles 1-5) in the unmanned aerial vehicle scenario, when the above-mentioned full mesh model is used for device networking, the connections needed to be established between the above-mentioned electronic devices (such as the unmanned aerial vehicles 1-5) in the authentication process can be as shown in Figure 3 . And for the same batch of electronic devices (such as the unmanned aerial vehicles 1-5), when the above-mentioned star model is used for device networking, the connections needed to be established between the above-mentioned electronic devices (such as the unmanned aerial vehicles 1-5) in the authentication process can be as shown in Figure 11 . By comparing Figure 3 and Figure 11 , it can be seen that by adjusting the networking model in the device networking process, the number of connections and authentications of each device in the above-mentioned device networking process can be simplified from n-1 times in Figure 3 to 1 time, so that the number of connections and authentications in the entire network can be reduced from n 2 -n to n-1. It can be understood that the use of the above-mentioned star model can effectively reduce the number of connections between devices in the network, thereby greatly improving the efficiency of device networking.

[0166] It can be understood that, compared with the tree model, the star model can reduce the wiring complexity and the initial authentication times by means of fewer physical or logical connections, but its security and stability are not as good as the tree model. Specifically, in the star model, the center node must continuously maintain the bidirectional session state with all non-center nodes, and bear the centralized signature, forwarding and auditing functions. Once the computing, storage or bandwidth resources of the center node appear bottleneck, or are subjected to targeted attacks, the whole network will be in an unrecoverable communication interruption. The tree model can disperse the authentication load and trust anchor through multiple parent nodes, and a single point failure only affects the subtree with the node as the root, and can quickly complete path switching through the upper layer nodes. Therefore, in the scene where the performance of the center node is limited or the security level is general, the systematic risk of the star model is significantly higher than that of the tree model.

[0167] In some embodiments, only the tree model or only the star model can be run in the electronic device.

[0168] However, in actual application scenarios, there are scenarios where the network topology changes between stable and unstable. For example, in the early stage of device networking, the network topology can be unstable; in the later stage of device networking, the network topology can gradually tend to be stable. During the above process, fixed use of one networking model cannot meet the business demand, so in other embodiments, the electronic device can store the above two networking models. Among them, what networking model to use can also be determined based on the information of the communication system (including the change frequency of the electronic device in the communication system). Therefore, in one implementation, when the change frequency of the electronic device in the communication system is less than a first threshold, the electronic device can confirm that the networking model is the tree model; when the change frequency of the electronic device in the communication system is greater than or equal to the first threshold, the electronic device can confirm that the networking model is the star model. Therefore, in the above method, the electronic device can also migrate between the tree model and the star model according to the device state in the communication system.

[0169] Figure 12 is a networking model switching process diagram provided by an embodiment of the present application.

[0170] As shown in Figure 12 , the communication system can include a master node A, a non-master node B, a non-master node C, and a non-master node D (i.e. a subsequent network entry node) connected to the local area network. Among them, the master node can refer to the root node in the tree structure or the center node in the star structure, and correspondingly, the non-master node can refer to the non-root node in the tree structure or the non-center node in the star structure.

[0171] Specifically, the master node A, the non-master node B, and the non-master node C can be connected to the same local area network, and the master node A, the non-master node B, and the non-master node C can perform the networking process in a tree model (also referred to as networking according to a tree topology networking process), that is, steps S101-S108. It can be understood that the master node A can calculate the number of node changes in real time. For example, if other nodes are offline from the local area network, the master node A can record one node change; for another example, if a device is added to the local area network, the master node A can also record one node change. If the master node A detects that the number of node changes is greater than or equal to a first threshold value within a period T, it means that there is frequent device change in the local area network, and at this time, the master node A can switch the networking model from the tree model to the star model. Specifically, the master node A can realize the switching of the networking model by resetting the networking model state bit. Moreover, the master node A can notify the non-master node B and the non-master node C to switch the networking model to the star model. For example, the master node A can send a first notification to the non-master node B and the non-master node C, and the first notification can carry an identifier of the updated star model, such as a networking model sequence number corresponding to the star model. After receiving the first notification, the non-master node B and the non-master node C can determine the networking model based on the identifier of the networking model in the first notification. The present application does not limit the specific implementation of the master node A in the model switching notification.

[0172] After that, the non-master node D can be connected to the local area network, and then network according to the tree topology networking process. It can be understood that since the non-master node D is an electronic device connected to the local area network later, the non-master node D actually networks according to the preset networking model (that is, the tree model). For example, if the non-master node D networks according to the tree topology networking process, and determines that the non-master node B and the non-master node C are target authentication devices (that is, the non-master node B and the non-master node C are child nodes of the non-master node D), the non-master node D can initiate an authentication request to the non-master node B and the non-master node C, respectively, and the authentication request can carry an identifier of the networking model currently used by the non-master node D. Taking the non-master node B as an example, after receiving the authentication request, the non-master node B can obtain the networking model used by the non-master node D from the authentication request, and compare it with the networking model used by the non-master node B. If they are consistent, the non-master node B continues to perform the subsequent authentication process; if they are not consistent, for example Figure 12In the case shown, the non-primary node B has switched the networking model to the star model, while the non-primary node D still uses the tree model. In this case, the non-primary node B can return an authentication response message to the non-primary node D, which can carry an authentication result identifier and an identifier of the networking model used by the non-primary node B. That is, the authentication response message can be used to feed back the currently used networking model. The authentication result identifier is used to indicate authentication success or authentication failure. Optionally, if the authentication result is authentication failure, the authentication result identifier can also carry an identifier of the authentication failure reason, such as an authentication failure reason code. Similarly, the non-primary node C can also return an authentication response message to the non-primary node D. Meanwhile, the primary node A as the center node can initiate networking with the non-primary node D in the star topology. The non-primary node D can authenticate the primary node A and successfully network with the primary node A. It can be understood that after the primary node A and the non-primary node D successfully network, the primary node A can actually synchronize the device information of the non-primary node D to the non-primary node B and the non-primary node C. Similarly, the device information of each device in the local area network saved locally by the primary node A also needs to be synchronized to the non-primary node D (this step is not shown in Figure 12

[0173] It can be understood that in the above process, the primary node A can continuously calculate the number of node changes. If the primary node A detects that the number of node changes is less than a first threshold value within a period T, it means that there is no frequent device change in the local area network. At this time, considering the stability of the communication system, the primary node A can switch the networking model from the star model to the tree model. Similarly, the primary node A can send a second notification to the non-primary node B, the non-primary node C, and the non-primary node D, respectively. The first notification can carry an identifier of the tree model. After receiving the second notification, each non-primary node and the primary node can regenerate the tree structure. It can be understood that at this time, since the primary node A, the non-primary node B, the non-primary node C, and the non-primary node D are all trusted devices, there is no need to continue to perform the subsequent authentication steps.

[0174] ​In other words, in one case, before the electronic device acquires the first networking model, if the electronic device adopts the star model, the first networking model is the tree model. Then, before the electronic device acquires the first networking model, if the electronic device is the center node and detects that the change frequency of the electronic devices in the communication system is less than the first threshold, the electronic device switches to the first networking model and sends a first notification to the non-center node, the first notification being used to trigger the non-center node to switch from the star model to the tree model; before the electronic device acquires the first networking model, if the electronic device is the non-center node and receives the first notification, the electronic device switches from the star model to the first networking model.

[0175] In another case, before the electronic device acquires the first networking model, the electronic device adopts the tree model, the first networking model is the star model, and the method further comprises: before the electronic device acquires the first networking model, if the electronic device is the root node and detects that the change frequency of the electronic devices in the communication system is greater than or equal to the first threshold, the electronic device switches to the first networking model and sends a second notification to the non-root node, the second notification being used to trigger the non-root node to switch from the tree model to the star model; before the electronic device acquires the first networking model, if the electronic device is the non-root node and receives the second notification, the electronic device switches from the tree model to the first networking model.

[0176] It can be understood that, in the above Figure 12 , the electronic device can also refuse the authentication request initiated by other electronic devices based on the fact that the counterpart is not the target authentication device of the electronic device. In other words, in the example presented in Figure 12 , before the non-master node D switches the networking model, the non-master node B and the non-master node C are the target authentication devices of the non-master node D, and for the non-master node B or the non-master node C, after the networking model is switched to the star model, the target authentication devices of the two nodes are changed to the master node A, so the non-master node B and the non-master node C can refuse the authentication request because the non-master node D is not included in the target authentication devices determined by the non-master node B and the non-master node C. In other words, the communication system can also include a fourth electronic device, and then the electronic device can receive an authentication request sent by the fourth electronic device; if one or more target authentication devices of the electronic device include the fourth electronic device, the electronic device performs authentication with the fourth electronic device. If the one or more target authentication devices do not include the fourth electronic device, the electronic device can refuse the authentication request of the fourth electronic device. It can be understood that returning an authentication response message with a failed authentication result identifier is also one of the forms of the electronic device refusing the authentication request.

[0177] Figures 13A-13B An exemplary diagram illustrating model migration in a coal mine scenario is provided. In this scenario, during the initial deployment of new coal mine roadway equipment, equipment debugging, adjustments, and deployment changes are frequent, with equipment often being added to or taken offline. Therefore, in this coal mine scenario, the frequency of node changes (i.e., the number of node changes divided by the period) can be greater than or equal to the aforementioned first threshold. In this stage (i.e., the initial deployment stage of new coal mine roadway equipment), if... Figure 13A As shown, the communication system can adopt a star topology to ensure rapid device authentication and network access. After the deployment and commissioning of the aforementioned coal mine roadway equipment is completed, the equipment deployment remains basically unchanged during normal production. At this time, the frequency of node changes within the communication system can be less than the aforementioned first threshold. Therefore, during the completion phase of the coal mine roadway equipment deployment and commissioning, if... Figure 13B As shown, the communication system can adopt the above tree model to improve the networking speed after each power-off maintenance and power-on, thereby improving work efficiency.

[0178] Figures 14A-14B This example illustrates a model migration diagram in a drone scenario. In the initial stage of a drone swarm, drones gradually approach and join the swarm. During this period, device changes are frequent, as shown in the diagram. Figure 14A As shown, the communication system of the aforementioned drones can first use a star topology to quickly form groups. After the groups are successfully formed, when performing the same performances or services for a period of time, the group arrangement is fixed, as follows: Figure 14B As shown, the communication system containing the aforementioned drones can modify its network model to a tree-like model. When drone swarm performances or business changes require re-arrangement, the communication system can also modify its network model back to the star-like model.

[0179] Understandably, communication systems migrate their networking models based on the application scenarios of the aforementioned device networking methods, thereby more efficiently matching the corresponding application scenarios and further improving work efficiency.

[0180] Understandably, the value of the aforementioned first threshold may need to be adjusted and modified due to factors such as environmental changes, equipment aging and replacement. Therefore, in this embodiment, the electronic device can also modify the value of the aforementioned first threshold based on the system service success rate. Here, the aforementioned system service success rate refers to the success rate of device authentication. Figure 15 This is a schematic diagram of a self-learning update model migration threshold provided in an embodiment of this application. The aforementioned model migration threshold is the same as the first threshold mentioned above.

[0181] Specifically, such as Figure 15As shown, the electronic device can be provided with a model migration threshold (i.e., the first threshold described above), and the initial value of the model migration threshold can be determined by the R&D personnel according to experience. In addition, the electronic device can also be provided with a target system service success rate, which can also be determined by the R&D personnel according to experience. Then, in actual operation, the master node A can obtain the actual system service success rate. It can be understood that in the star model, all non-central nodes are authenticated with the central node (i.e., the master node A here), so the master node A can also directly obtain the system service success rate; but in the tree model, since the authentication process actually occurs between parent nodes and child nodes, the master node A cannot directly obtain the system service success rate. Therefore, in the tree model, the non-master node can report the number of successful and failed services of its own node to the master node at a certain frequency, so that the master node A can determine the global system service success rate at a certain frequency. Then, the master node A can compare the actual system service success rate with the target system service success rate. If the actual system service success rate is greater than or equal to the target system service success rate, the master node A can not adjust the model migration threshold. If the actual system service success rate is less than the target system service success rate, the master node A can adjust the model migration threshold. Specifically, the master node A can reduce the model migration threshold according to a fixed gradient until the actual system service success rate is greater than or equal to the target system service success rate.

[0182] Figure 16 An exemplary structure schematic diagram of the electronic device provided by the embodiments of the present application is shown. The electronic device can be various types of intelligent terminal devices, and the embodiments of the present application do not limit the specific type of the electronic device. For example, the electronic device can be a mobile phone, and can also be a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, etc.

[0183] As Figure 16As shown, the electronic device can include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, a sensor module 280, a key 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a SIM card interface 295, etc. The sensor module 280 can include at least one of a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.

[0184] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than those shown, or combine certain components, or split certain components, or different component arrangements. Figure 16 It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than those shown, or combine certain components, or split certain components, or different component arrangements. Figure 16 The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0185] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor, a modem processor, a graphics processor, an image signal processor, a controller, a memory, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor, etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors. In some embodiments, the electronic device can also include one or more processors 210.

[0186] Among them, the controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching instructions and executing instructions.

[0187] The memory in the processor 210 can also be provided for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can save instructions or data that the processor 210 has just used or repeatedly uses. If the processor 210 needs to use the instructions or data again, it can be directly called from the memory. Avoiding repeated access, reducing the waiting time of the processor 210, thus improving the efficiency of the electronic device.

[0188] The USB interface 230 is an interface in compliance with the USB standard specification, and can be used to connect a charger to charge the electronic device, or to transmit data between the electronic device and a peripheral device. It can also be used to connect a headset to play audio through the headset.

[0189] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0190] The charging management module 240 is used to receive charging input from the charger. The charging management module 240 can also supply power to the electronic device through the power management module 241 while charging the battery 242.

[0191] The power management module 241 is used to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to supply power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260, etc.

[0192] The wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor, etc. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 250 can provide solutions for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device. The modem processor can include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The wireless communication module 260 can provide solutions for wireless communication including WLAN (such as Wi-Fi network), Bluetooth, global navigation satellite system, frequency modulation, NFC, infrared technology, ultra wide band (UWB), etc. applied to the electronic device.

[0193] The electronic device can realize the display function through the GPU, the display screen 294, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs that execute instructions to generate or change display information.

[0194] A touch sensor can be disposed in the display 294. The touch sensor is used to detect a touch operation acting on or near it. The touch sensor can deliver the detected touch operation to the application processor to determine the touch event type. In turn, the electronic device can provide visual output related to the touch operation through the display 294. The electronic device can implement the display function through the GPU, the display 294, the touch sensor, and the application processor, etc.

[0195] The display 294 is used to display images, videos, etc. The display 294 includes a display panel.

[0196] The electronic device can implement the photographing function through the ISP, the camera 293, the video codec, the GPU, the display 294, and the application processor, etc. The camera 293 is used to capture still images or videos. The digital signal processor is used to process digital signals. The video codec is used to compress or decompress digital videos. The NPU is a neural-network (NN) computing processor, which quickly processes input information by drawing on the structure of biological neural networks, such as the transmission mode between human brain neurons, and can also constantly self-learn.

[0197] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement the data storage function. The internal memory 221 can be used to store one or more computer programs, which include instructions. The processor 210 can execute the above-mentioned instructions stored in the internal memory 221, so as to make the electronic device execute the device networking method provided in some embodiments of the present application, as well as various functional applications and data processing, etc.

[0198] The electronic device can implement the audio function through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, and the application processor, etc. For example, music playing, recording, etc.

[0199] The audio module 270 is used to convert digital audio information into analog audio signals, and is also used to convert analog audio input into digital audio signals. The audio module 270 can also be used to encode and decode audio signals. In some embodiments, the audio module 270 can be disposed in the processor 210, or part of the functions of the audio module 270 can be disposed in the processor 210.

[0200] The speaker 270A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals. The electronic device can listen to music or listen to a hands-free call through the speaker 270A.

[0201] The receiver 270B, also known as the "earpiece", is used to convert the audio electrical signal into the sound signal. When the electronic device answers the phone or voice message, the voice can be answered by placing the receiver 270B close to the human ear.

[0202] The microphone 270C, also known as the "microphone", "sound collector", is used to convert the sound signal into the electrical signal. When making a phone call or sending a voice message, the user can make a sound by placing the human mouth close to the microphone 270C, and input the sound signal into the microphone 270C. The electronic device can be provided with at least one microphone 270C. In other embodiments, the electronic device can be provided with two microphones 270C, in addition to collecting sound signals, it can also realize the noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 270C, which can realize the functions of collecting sound signals, noise reduction, identifying sound sources, realizing directional recording, etc.

[0203] The earphone interface 270D is used to connect the wired earphone. The earphone interface 270D can be a USB interface 230, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0204] The pressure sensor 280A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. The gyro sensor 280B is configured to determine a motion posture of the electronic device. The barometric sensor 280C is configured to measure atmospheric pressure. The magnetic sensor 280D includes a Hall sensor. The acceleration sensor 280E is configured to detect an acceleration of the electronic device in various directions (typically, three axes). The proximity sensor 280F is configured to measure a distance. The proximity light sensor 280G can include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The electronic device can use the proximity light sensor 280G to determine that there is no object near the electronic device. The ambient light sensor 280L is configured to sense an ambient light intensity. The fingerprint sensor 280H is configured to acquire a fingerprint. The temperature sensor 280J is configured to detect a temperature. The touch sensor 280K, which can also be referred to as a touch panel or a touch surface, can be disposed on the display 294. The touch sensor 280K and the display 294 can form a touch screen, which can also be referred to as a touch screen panel. The touch sensor 280K is configured to detect a touch operation applied thereto or in the vicinity thereof. The touch sensor 280K can transmit a detected touch operation to the application processor to determine a touch event type. A visual output related to the touch operation can be provided through the display 294. The bone conduction sensor 280M can acquire a vibration signal.

[0205] The keys 290 include a power key, a volume key, and the like. The keys 290 can be mechanical keys. Alternatively, the keys 290 can be touch keys. The electronic device can receive a key input and generate a key signal input related to user settings and function control of the electronic device.

[0206] The motor 291 can generate a vibration alert. The motor 291 can be used for a call vibration alert and for touch vibration feedback.

[0207] The indicator 292 can be an indicator light and can be used to indicate a charging state, a change in a battery level, and the like, or to indicate a message, a missed call, a notification, and the like.

[0208] The SIM card interface 295 is configured to connect a SIM card. The electronic device can interact with a network through the SIM card to implement a call and data communication, and the like. In some embodiments, the electronic device uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.

[0209] Those skilled in the art should be aware that, in the above one or more examples, the functions described in the embodiments of the present application can be implemented in hardware, software, firmware or any combination thereof. When implemented in software, the functions can be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium. The computer readable medium includes computer storage medium and communication medium, and the communication medium includes any medium that facilitates transfer of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general purpose or special purpose computer. The embodiments of the present application also provide a computer program product including a computer program, which can implement the steps of the above various method embodiments when the computer program is run on a processor.

[0210] The above detailed description of the embodiments of the present application has further detailed the purposes, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above is only a specific implementation of the embodiments of the present application, and is not used to limit the protection scope of the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A method for networking devices, the method comprising: The method is applied to a first electronic device, a first communication system includes a plurality of electronic devices in a same local area network, the plurality of electronic devices includes the first electronic device, and the method includes: The first electronic device acquires a first networking model, the first networking model is determined from a plurality of predefined networking authentication models based on information of the first communication system, the information of the first communication system includes a change frequency of electronic devices in the first communication system, and an application scenario of the first communication system, the change frequency of electronic devices in the first communication system is a sum of a frequency of newly added devices in the first communication system and a frequency of devices offline in the first communication system, the first networking model is different, and a target authentication device corresponding to the first electronic device is different; The first electronic device determines one or more target authentication devices from the plurality of electronic devices based on the first networking model; The first electronic device performs authentication with the one or more target authentication devices; After the authentication is passed, the first electronic device establishes a communication connection with the one or more target authentication devices.

2. The method of claim 1, wherein, The first networking model includes a tree model or a star model; In the tree model, the target authentication device is a parent node and / or a child node of the first electronic device; In the star model, the plurality of electronic devices include a center node and a non-center node, the first electronic device is the center node, and the target authentication device is the non-center node, or the first electronic device is the non-center node, and the target authentication device is only one, which is the center node.

3. The method of claim 2, wherein, When the first networking model is the tree model, the method further includes: The first electronic device respectively acquires parameter information of the plurality of electronic devices; The first electronic device determines one or more target authentication devices from the plurality of electronic devices based on the first networking model, specifically including: The first electronic device determines a first authentication path relationship based on the tree model and the parameter information of the plurality of electronic devices, the first authentication path relationship is used to indicate parent nodes and / or child nodes of the plurality of electronic devices; The first electronic device confirms the target authentication device from the plurality of electronic devices based on the first authentication path relationship.

4. The method of claim 3, wherein, The one or more target authentication devices include a first target authentication device and a second target authentication device; The first electronic device performs authentication with the one or more target authentication devices, specifically including: The first electronic device first performs authentication with the first target authentication device, and then performs authentication with the second target authentication device; The method further includes: After the first electronic device performs authentication with the second target authentication device, the first electronic device synchronizes parameter information of the second target authentication device to the first target authentication device.

5. The method of claim 3, wherein, The one or more target authentication devices are parent nodes of the first electronic device, and after the first electronic device performs authentication with the one or more target authentication devices, the method further includes: The first electronic device receives parameter information of a second electronic device synchronized with the one or more target authentication devices, the second electronic device and the first electronic device being child nodes of the one or more target authentication devices; The first electronic device establishes a communication connection with the second electronic device based on the parameter information of the second electronic device.

6. The method of claim 3, wherein, The method further comprises: If a plurality of electronic devices in the first communication system are changed, the first electronic device determines a second authentication path relationship based on the first networking model and parameter information of the plurality of electronic devices changed in the first communication system, the second authentication path relationship being used to indicate parent nodes and / or child nodes of the plurality of electronic devices changed; The first electronic device confirms one or more to-be-judged authentication devices from the plurality of electronic devices changed based on the second authentication path relationship; If the first electronic device does not save parameter information of the to-be-judged authentication device, the first electronic device performs authentication with the to-be-judged authentication device and establishes a communication connection with the to-be-judged authentication device; If the first electronic device has saved the parameter information of the to-be-judged authentication device, the first electronic device determines that the authentication with the to-be-judged authentication device is completed.

7. The method of claim 2, wherein, When the first networking model comprises the star model, the first electronic device determines one or more target authentication devices from the plurality of electronic devices based on the first networking model, specifically comprising: The first electronic device confirms the center node in the first communication system; If the first electronic device is the center node, the first electronic device confirms that an electronic device in the plurality of electronic devices except the first electronic device is the target authentication device; If the first electronic device is the non-center node, the first electronic device confirms that the center node is the target authentication device.

8. The method of claim 7, wherein, The first electronic device confirms the center node in the first communication system, specifically comprising: The first electronic device determines the center node from the plurality of electronic devices based on the first networking model and performance parameters of the plurality of electronic devices.

9. The method of claim 7, wherein, If the first electronic device is the center node, the method further comprises: The first electronic device sends parameter information of the one or more target authentication devices passed the authentication to the non-center node.

10. The method of claim 7, wherein, If the first electronic device is the non-center node, the method further comprises: Receiving parameter information of a third electronic device in the plurality of electronic devices sent by the target authentication device, the third electronic device, the first electronic device and the target authentication device being different; The first electronic device establishes a communication connection with the third electronic device based on the parameter information of the third electronic device.

11. The method of claim 7, wherein, If the first electronic device is the center node, the method further comprises: If a plurality of electronic devices in the first communication system changes, the first electronic device sends parameter information of the plurality of electronic devices in the first communication system to the non-central node.

12. The method of claim 2, wherein, The first electronic device acquires a first networking model, specifically comprising: When the frequency of changes of the electronic devices in the first communication system is less than a first threshold, the first electronic device confirms that the first networking model is the tree model; When the frequency of changes of the electronic devices in the first communication system is greater than or equal to the first threshold, the first electronic device confirms that the first networking model is the star model.

13. The method of claim 2, wherein, Before the first electronic device acquires the first networking model, the first electronic device adopts the star model, and the first networking model is the tree model, the method further comprises: Before the first electronic device acquires the first networking model, if the first electronic device is the central node, when the frequency of changes of the electronic devices in the first communication system is less than the first threshold, the first electronic device switches to the first networking model and sends a first notification to the non-central node, the first notification is used to trigger the non-central node to switch from the star model to the tree model; Before the first electronic device acquires the first networking model, if the first electronic device is the non-central node, after receiving the first notification, the first electronic device switches from the star model to the first networking model.

14. The method of claim 2, wherein, Before the first electronic device acquires the first networking model, the first electronic device adopts the tree model, and the first networking model is the star model, the method further comprises: Before the first electronic device acquires the first networking model, if the first electronic device is the root node, when the frequency of changes of the electronic devices in the first communication system is greater than or equal to the first threshold, the first electronic device switches to the first networking model and sends a second notification to the non-root node in the plurality of electronic devices, the second notification is used to trigger the non-root node to switch from the tree model to the star model; Before the first electronic device acquires the first networking model, if the first electronic device is the non-root node, after receiving the second notification, the first electronic device switches from the tree model to the first networking model.

15. The method according to any one of claims 1 to 14, characterized in that, The first communication system comprises a fourth electronic device, and the first electronic device authenticates with one or more target authentication devices, specifically comprising: Receiving an authentication request sent by the fourth electronic device; If the one or more target authentication devices include the fourth electronic device, the first electronic device authenticates with the fourth electronic device.

16. The method of claim 15, wherein, The method further comprises: If the one or more target authentication devices do not include the fourth electronic device, the first electronic device rejects the authentication request of the fourth electronic device.

17. The method according to any one of claims 12-14, characterized by, The method further comprises: If the authentication success rate in the first communication system is less than a first success rate, the first electronic device reduces the value of the first threshold.

18. The method of any one of claims 3-6, 9-11, wherein, The parameter information comprises one or more of the following: identification information, geographical location of the device, production subsystem to which the device belongs, security level of the device, and performance parameters.

19. The method of claim 18, wherein, The identification information comprises one or more of the following: a device ID, a device name, a device Internet Protocol (IP) address, and a port number.

20. The method of claim 18, wherein, The performance parameter comprises one or more of the following: a throughput rate, a network delay, a signal strength, a bandwidth capacity, a protocol support type, a computing resource, a storage capacity, a power endurance, and a historical communication stability index.

21. The method of claim 1, wherein, The first electronic device obtains a first networking model, specifically comprising: The first electronic device determines the first networking model based on information of the first communication system.

22. An electronic device, comprising: The computer program product comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and are configured to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, causing the method of any one of claims 1-21 to be performed.

23. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program product comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and are configured to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, causing the method of any one of claims 1-21 to be performed.

Citation Information

Patent Citations

  • Multi-device ad hoc network method, device, equipment and storage medium

    CN115941308A

  • Automatic generation method, model training method, device, equipment, medium and product

    CN119449622A