A method and device for network access
By using broadcast authentication request messages in the network, electronic devices exchange authentication information within the network, solving the problems of limited device connection quantity and increased power consumption, and realizing a low-power and high-efficiency networking method.
Patent Information
- Application Number
- CN202111232794.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2026-04-03
- Estimated Expiration
- 2041-10-22
AI Technical Summary
In existing technologies, electronic devices have limited short-range communication capabilities when networking, resulting in a limited number of connected devices, increased power consumption, poor user experience, and a high connection failure rate.
By broadcasting device authentication request messages, electronic devices exchange authentication information within the network, joining the network without establishing a connection. This method saves connection resources and reduces power consumption, and device authentication is performed using the device's public key and UDID.
It reduces device power consumption, decreases connection failure rate, improves user experience, and avoids the problem of connection resource exhaustion.
Smart Images

Figure CN116017310B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a network access method and device. Background Technology
[0002] With the development of the smart ecosystem, distributed networking is required among electronic devices. Due to the limited short-range communication capabilities of each electronic device, multi-hop discovery and heterogeneous networking are achieved through a combination of capabilities such as Ethernet (ETH), Wireless Fidelity (Wi-Fi), and Bluetooth (BT).
[0003] Once different electronic devices are detected through scanning, they can connect via methods such as BitTorrent or Ethereum. They then exchange authentication information to establish a trust relationship and complete device authentication. In other words, electronic devices must connect and authenticate before joining a network. However, regardless of the connection method, the number of devices that can connect is relatively limited. Furthermore, as the number of connected devices increases, the power consumption of the electronic devices also increases, significantly reducing their usage time and resulting in a poor user experience. Summary of the Invention
[0004] This application provides a network access method and device to save connection resources and avoid connection failures due to too many connected devices.
[0005] In a first aspect, this application provides a network access method, the method comprising: a first electronic device broadcasting a device authentication request message, the device authentication request message being used to authenticate with at least one device in a first network; then, the first electronic device receiving a feedback message sent by a second electronic device, the second electronic device being a device in the first network, the feedback message being used to confirm that the first electronic device has joined the first network.
[0006] Using the above technical solution, electronic devices can exchange authentication information with other electronic devices in the network via broadcast, thereby joining the network. This eliminates the need to establish a connection with existing network devices. Broadcasting conserves connection resources and avoids connection failures caused by too many connected devices. Furthermore, broadcasting consumes less power than establishing a connection, thus reducing overall power consumption.
[0007] In one possible design, the device authentication request message includes the unique device identifier UDID of the first electronic device and the device public key of the first electronic device.
[0008] Through the above technical solution, electronic devices can broadcast their own UDID and device public key to other electronic devices in the network. After receiving the broadcast message, the electronic devices in the network can respond with their own device information and exchange authentication information with the electronic devices that want to join the network in order to complete device authentication and enable the new electronic devices to join the network.
[0009] In one possible design, the feedback message includes the UDID of the second electronic device and the device public key of the second electronic device.
[0010] Through the above technical solution, electronic devices within the network can send their own device information back to the broadcasting electronic device so as to exchange authentication information to complete device authentication and enable new electronic devices to join the network.
[0011] In one possible design, the method further includes: establishing a connection between a first electronic device and a second electronic device; encrypting the data to be transmitted by the first electronic device and sending the encrypted data to the second electronic device.
[0012] With the above technical solution, after the first electronic device joins the network, if it needs to transmit data, it needs to establish a connection with other electronic devices in the network, negotiate a data transmission channel, and then transmit the data. Because device authentication is performed using a broadcast method, connection resources are saved, and connection failures can be avoided when a device needs to connect and transmit data.
[0013] In one possible design, the first electronic device encrypts the data to be transmitted by: the first electronic device encrypting a session-assigned random number using the device public key of the second electronic device to obtain a session-level key; and the first electronic device encrypting the data to be transmitted using the session-level key.
[0014] By using the above technical solutions, electronic devices can encrypt the data to be transmitted using session-level keys, thereby improving the security of data transmission.
[0015] In one possible design, the method further includes: when the first electronic device meets preset conditions, the first electronic device broadcasts a first message, which includes a Do Not Disturb flag and is used to synchronize device information with other electronic devices; the first electronic device receives N messages and replies with M messages, where M and N are both positive integers, M... <N。
[0016] It should be understood that the first message can be a heartbeat packet, which is used to synchronize information with other devices to maintain online status within the device network.
[0017] Using the above technical solution, electronic devices can carry a Do Not Disturb flag in their broadcasts, allowing other devices to know the device's status information. When a device is in Do Not Disturb mode, the frequency of replying to messages can be reduced, thereby lowering power consumption.
[0018] In one possible design, the preset conditions include at least one of the following: load is greater than a first preset threshold; screen is off; battery level is less than a second preset threshold; preparing to exit the network; switching between primary and backup devices.
[0019] The above technical solution is more suitable for busy, screen-off, low-battery, and network-off devices. It can avoid the problem of high power consumption caused by frequent response to wake-up processing tasks, which prevents the device from sleeping when it is desired.
[0020] In one possible design, the first network also includes a third electronic device, which serves as the central device of the first network. The method further includes: after the first electronic device joins the first network, the central device of the first network, the third electronic device...
[0021] With the above technical solution, when a new electronic device joins the network, it is not necessary to re-elect the central node, thus avoiding frequent changes to the control relationships within the network.
[0022] In one possible design, the method further includes: if the first electronic device exits the first network after a preset time, then the central device of the first network is the third electronic device.
[0023] The above technical solution eliminates the need for re-election of the central node when an electronic device leaves the network, allowing for frequent changes to the control relationships within the network. Compared to existing technologies that require re-election of the central node whenever the number of electronic devices in the network changes, this approach reduces power consumption and avoids complex logical issues.
[0024] In one possible design, the first electronic device is located in the second network, and the method further includes: after the first electronic device joins the first network, determining a new central device among the devices included in the first network and the second network.
[0025] With the above technical solution, when subnets are merged, a new central node can be elected in the new merged network so that electronic devices in the network can be managed according to the new management relationship.
[0026] In one possible design, determining a new central device from among the devices included in the first and second networks includes: determining the new central device based on the device type, communication capabilities, and power supply capabilities of the devices included in the first and second networks.
[0027] The above technical solution allows for the determination of the central node within the merged network based on the device type, communication capabilities, and power supply capabilities of the electronic equipment. This enables the formation of a low-energy, high-efficiency distributed network under the control of the new central node.
[0028] In one possible design, a new central device is determined based on the device types, communication capabilities, and power capabilities of the devices included in the first and second networks, including:
[0029] Based on the device type, communication capability, and power supply capability of the devices included in the first network and the second network, a score is determined for each device included in the first network and the second network; the device with the highest score is designated as the new central device.
[0030] The above technical solution can score the electronic devices in the network and then select the electronic device with the highest score as the central node, thereby avoiding the problems of high power consumption and complex logic caused by frequent replacement of the central node.
[0031] In a second aspect, this application provides an electronic device, the electronic device including a transceiver; one or more processors; one or more memories; one or more sensors; multiple applications; and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs including instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the first aspect and any possible design of the first aspect.
[0032] Thirdly, this application also provides an electronic device comprising modules / units for performing the first aspect or any possible design method of the first aspect; these modules / units may be implemented in hardware or by executing corresponding software in hardware.
[0033] Fourthly, this application also provides a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the first aspect and any possible design of the first aspect.
[0034] Fifthly, an embodiment of this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the method of the first aspect of this application and any possible design of the first aspect.
[0035] For the various aspects of the second to fifth aspects mentioned above, and the technical effects that each aspect may achieve, please refer to the above description of the technical effects that the various possible solutions for the first aspect may achieve, which will not be repeated here. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the distributed networking architecture provided in an embodiment of this application;
[0037] Figure 2 A schematic diagram of a network module division provided for an embodiment of this application;
[0038] Figure 3 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0039] Figure 4 A flowchart of a network access method provided in an embodiment of this application;
[0040] Figure 5 This application provides a schematic diagram of the message format for an authentication request message;
[0041] Figure 6 A flowchart of a data transmission method provided in an embodiment of this application;
[0042] Figure 7 A schematic diagram of a heartbeat packet provided for an embodiment of this application;
[0043] Figure 8A This is a schematic diagram of an extended broadcast structure provided in an embodiment of this application;
[0044] Figure 8B A schematic diagram of the data structure for an extended broadcast payload provided in an embodiment of this application;
[0045] Figure 9A This application provides a schematic diagram of a node joining the network.
[0046] Figure 9B This application provides a schematic diagram of a node leaving the network.
[0047] Figure 9C A schematic diagram of subnet merging provided in an embodiment of this application;
[0048] Figure 9D A schematic diagram of subnet splitting provided in an embodiment of this application;
[0049] Figure 9E A schematic diagram of subnet splitting provided in an embodiment of this application;
[0050] Figure 10This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0052] Currently, electronic devices typically join a network by establishing a connection with other devices in the network using short-range communication technologies such as Bluetooth, thereby completing device authentication and joining the network. For example, if network 1 includes a mobile phone, a router, and a laptop, and a Bluetooth speaker wants to join network 1, the speaker can establish a Bluetooth connection with the mobile phone, exchange authentication information, and then join network 1. However, because short-range communication technologies have a limited number of connected devices, if more devices want to join network 1, connection failures may occur. Furthermore, the more connections, the higher the power consumption of the devices, resulting in a poor user experience.
[0053] In view of this, this application provides a network access method in which an electronic device interacts with devices in the network via broadcast to exchange authentication information, thereby joining the network. This means that joining the network does not require establishing a connection with any devices within the network. Broadcasting saves connection resources and avoids connection failures due to too many connected devices. Furthermore, broadcasting consumes less power than connecting, thus reducing power consumption. For example, if network 1 includes a mobile phone, a router, and a laptop, and a Bluetooth speaker wants to join network 1, the Bluetooth speaker can broadcast its device information. Devices in network 1, such as the mobile phone, can also broadcast their device information. The mobile phone can receive the broadcast message from the Bluetooth speaker, and the Bluetooth speaker can also receive the broadcast message from the mobile phone, allowing both the mobile phone and the Bluetooth speaker to be discovered. Next, the Bluetooth speaker can broadcast a device authentication request message, which can carry its own unique device identifier (UDID) and public key. When the mobile phone receives the broadcast message, it can send its own UDID and device public key back to the Bluetooth speaker. In this way, the Bluetooth speaker can complete the authentication request with the mobile phone and join the network where the mobile phone is located.
[0054] The following section will first explain some of the terms used in the embodiments of this application so that those skilled in the art can understand them.
[0055] 1) Bluetooth: A wireless technology that supports short-range communication between devices, enabling wireless information exchange between numerous devices, including mobile phones, wireless headsets, laptops, and related peripherals. Bluetooth technology effectively simplifies communication between mobile communication terminal devices and between devices and the Internet, making data transmission faster and more efficient, thus paving the way for wireless communication.
[0056] 2) Wireless Fidelity Peer-to-Peer (Wi-Fi P2P): Also known as Wireless Local Area Networks (WLAN) Direct or Wi-Fi Direct, it's a protocol suite within the Wi-Fi family that allows devices to easily connect to each other without the need for an intermediary wireless access point. Its applications range from web browsing and file transfer to simultaneous communication with multiple devices, fully leveraging the speed advantages of Wi-Fi. Devices compliant with this standard can easily interconnect, even those from different manufacturers.
[0057] 3) Heartbeat packet: A command word that periodically informs the other party of its status between two electronic devices. It is sent at certain time intervals, similar to a heartbeat.
[0058] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0059] It should be noted that the network access method of this application embodiment is applicable to distributed network architectures. Furthermore, this method can be applied between multiple different electronic devices. Exemplarily, the electronic devices can be mobile phones, tablets, wearable devices (e.g., watches, bracelets, smart helmets, smart glasses, etc.), in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc., and this application embodiment does not limit the scope. The electronic devices involved in this application embodiment can be foldable electronic devices, such as foldable mobile phones, foldable tablets, etc., and this application does not limit the scope. Furthermore, exemplary embodiments of the electronic devices include, but are not limited to, carrying... Harmony Or electronic devices with other operating systems.
[0060] like Figure 1 The diagram shown is a schematic of a distributed network architecture. Figure 1 The schematic diagram shown in (a) is a star-shaped network architecture. In this architecture, node A1 is the master node (or central node), and nodes B1, C1, D1, E1, F1, and G1 are child nodes. Figure 1 The schematic diagram shown in (b) is a tree-shaped network diagram. In it, A2 is the master node, B2 and C2 are child nodes (also called routing nodes), D2 and E2 are child nodes of B2 (or leaf nodes), and F2 is a child node of C2.
[0061] It should be understood that Figure 1 This is merely an illustrative example; the structure of a distributed network may also be other structures, and this application does not limit it.
[0062] Figure 2 The diagram shown is a schematic representation of a network module division according to an embodiment of this application. Figure 2 As shown, the system may specifically include a business application (APP) 21, a networking service module 22, a network hub module 23, and a driver and chip interface module 24. The networking service module 22 provides network scanning, network status query and reporting, storage of network node and device peripheral attributes and statuses, and control and channel allocation for the central node. The network hub module 23 provides the ability for devices to converge and form a hybrid heterogeneous network, and manages the network state machine and network records. The driver and chip interface module 24 is used for channel status management, detection, heartbeat, and link resource management.
[0063] The application scenarios of this application are described below. For example... Figure 3 The diagram shown is an application scenario illustration provided by an embodiment of this application. (See attached image.) Figure 3 As shown, this application scenario uses electronic devices in a home setting as an example. For instance, multiple electronic devices can be connected to the router, such as a user's mobile phone, Bluetooth headset, tablet, Bluetooth speaker, television, soy milk maker, and range hood. Electronic devices located in different areas can also be connected to form subnets within this distributed network. For example, the television, speakers, and water dispenser in the living room can form subnet 1, while the speakers in the dining room can be connected to a robot vacuum cleaner and a laptop to form subnet 2.
[0064] In some embodiments, electronic devices can discover other electronic devices via Wi-Fi, Bluetooth, etc., and then exchange their UDIDs and device public keys with the discovered electronic devices through broadcasting to complete device authentication and join the network. Compared to joining the network via BT or Wi-Fi, this reduces power consumption. It should be noted that this application is not limited to broadcasting; for example, information can be exchanged with other electronic devices via unicast, multicast, or broadcast.
[0065] When electronic devices need to transmit data, a data transmission channel can be established. For example, different electronic devices can establish a data transmission channel through connection methods such as Wi-Fi, Wireless Fidelity-peer to peer (Wi-Fi P2P), or Huawei Magneto Link (HML). Then, the different electronic devices can encrypt the data to be transmitted using device keys, and then transmit the data through the established data transmission channel. When the peer device receives the encrypted data, it can decrypt the encrypted data, thus completing the data transmission process.
[0066] The following describes the method of this application embodiment using two electronic devices, such as a mobile phone and a tablet computer, as an example. Figure 4 The diagram shown is a flowchart of a network access method provided in an embodiment of this application. (See attached diagram.) Figure 4 As shown, the method may include the following steps:
[0067] S401: Mobile broadcast device discovery request message.
[0068] The device discovery request message may include information such as the phone's connectivity capabilities (e.g., whether it supports 5G, Wi-Fi P2P, ETH, etc.), Bluetooth name, and the phone's UDID.
[0069] In some embodiments, the device discovery request message can be a message broadcast by the mobile phone via BitTorrent or Wi-Fi. For example, when the mobile phone turns on BitTorrent, it can scan for nearby devices that have BitTorrent enabled and display a list of connectable BitTorrent devices on the phone. Another example is that the mobile phone can search for other electronic devices on the same local area network as itself.
[0070] S402: The mobile phone receives the first feedback message sent by the tablet computer.
[0071] Since the device discovery request message is broadcast by the mobile phone, multiple electronic devices will receive this broadcast message. If an electronic device receiving the broadcast message finds that the information carried in the broadcast message matches its own device settings, it will send a first feedback message to the mobile phone. This first feedback message may carry its own device information, such as the tablet's identification information and capability information. It should be noted that there may be at least one device sending the feedback message to the mobile phone; this application uses only one, namely a tablet computer, as an example.
[0072] Optionally, before S401 is executed, the tablet can configure its own device information, such as Bluetooth name, account information, and connectivity capabilities (whether it supports 5G connectivity, etc.). The tablet can then broadcast this configured device information, i.e., publish service information. When the tablet receives a device discovery request message, if the information broadcast by the phone matches the device information it needs (e.g., the phone supports 5G and the tablet needs a 5G-enabled device), the tablet can respond to the phone's device discovery request message and send a first feedback message back to the phone.
[0073] S403: Mobile broadcast device authentication request message.
[0074] The device authentication request message may carry the device's UDID and public key, i.e., the mobile phone's UDID and public key. For example, the message format of the authentication request message broadcast by the mobile phone can be found in [reference needed]. Figure 5 As shown, Figure 5 The authentication data may include the device's UDID and device public key.
[0075] S404: The tablet computer sends a second feedback message to the phone.
[0076] The second feedback message may include the tablet's device UDID and device public key. In some embodiments, after the mobile phone broadcasts a device authentication request message, the tablet can receive the device authentication request message broadcast by the mobile phone, and then send its own device UDID and device public key to the mobile phone in order to authenticate the device with the mobile phone, establish a device-level trust relationship, and join the network.
[0077] In some embodiments, the mobile phone and tablet computer can respectively store the UDID and public key of the peer device for subsequent encryption and decryption of the data to be transmitted.
[0078] Through the above steps, the mobile phone can authenticate with the tablet computer via broadcast, meaning the two electronic devices can exchange authentication information and establish a trust relationship without a direct connection. Since the power consumption required to establish a connection is higher than that required for broadcasting, the method in this embodiment reduces power consumption compared to joining a network via a connection. Furthermore, as the number of connected devices increases, the failure rate also increases, and connections may even fail to be established. Broadcasting conserves connection resources, preventing them from being quickly exhausted and causing connection failures.
[0079] Optionally, after S404, i.e., after the devices join the network, if data needs to be transmitted between devices, a data transmission channel needs to be established between the devices, and then the data is transmitted through the established data transmission channel. For example, Figure 6 The diagram shown is a flowchart of a data transmission method provided in an embodiment of this application. (See also...) Figure 6 As shown, the method may include the following steps:
[0080] S601: Establishes a data transmission channel between mobile phones and tablet computers.
[0081] In some embodiments, a Wi-Fi P2P connection, a Wi-Fi connection, or an HML connection can be established between the mobile phone and the tablet computer, that is, a Wi-Fi P2P data transmission channel, a Wi-Fi data transmission channel, or an HML data transmission channel can be established.
[0082] It should be understood that when establishing a data transmission channel between two devices, both devices must simultaneously support data connectivity. For example, when a mobile phone and a tablet establish a Wi-Fi P2P connection, both the phone and the tablet need to support Wi-Fi P2P connectivity; otherwise, a Wi-Fi P2P data transmission channel cannot be established.
[0083] S602: Mobile phones and tablets negotiate data transmission protocols.
[0084] In some embodiments, after a data transmission channel is established between a mobile phone and a tablet, a data transmission protocol can be negotiated, such as negotiating the device roles for data transmission, the data transmission frequency (i.e., using 5G / 2.4G), etc. For example, when both the mobile phone and the tablet support Wi-Fi P2P transmission, they can negotiate which device acts as the group owner (GO) and which device acts as the group user (or general client, GC) during data transmission.
[0085] Optionally, after the mobile phone and tablet computer have negotiated the data transmission protocol, the mobile phone can send a notification message to the tablet computer to notify it that the data transmission channel has been established.
[0086] S603: The mobile phone encrypts the data to be transmitted and sends the encrypted data to the tablet computer.
[0087] In some embodiments, the mobile phone can use the public key of the tablet computer stored in its own memory to encrypt the random number generated in this session to generate a session-level key, then use the session-level key to encrypt the data to be transmitted, and finally transmit the data to be transmitted using the session-level key to the tablet computer.
[0088] S604: The tablet computer decrypts the received data.
[0089] In some embodiments, after a tablet receives data sent by a mobile phone, it can use its own device public key to decrypt a random number to obtain a random number, and then use the random number to decrypt the data to be transmitted, thereby obtaining the data sent by the mobile phone.
[0090] Through the above steps, the mobile phone can encrypt the data to be transmitted, and then the remote device can decrypt the encrypted data using the stored device-level key, thereby improving the security of data transmission.
[0091] Optionally, to maintain communication between electronic devices, they can send heartbeat packets to maintain a trust relationship. Currently, in a distributed networking architecture, heartbeat packets are generally sent in the following two ways:
[0092] The first method is for the child node to request synchronization of information from the master node, that is, the child node sends a heartbeat packet to the master node.
[0093] The second method is for the master node to periodically send synchronization information to the child nodes, that is, the master node sends heartbeat packets to the child nodes.
[0094] For ease of description, the way the master node sends synchronization information to the child node can be called "push", that is, pushing synchronization information, and the way the child node requests synchronization information from the master node can be called "poll".
[0095] In this embodiment, the decision to send a heartbeat packet, the duration of the heartbeat, and how to send it can be determined by considering factors such as device information, device status, and network topology. For example,... Figure 7 The diagram shows a heartbeat packet. The synchronization information is the 21-byte synchronization data shown in the diagram.
[0096] In some embodiments, the master node sends heartbeat packets to the child nodes based on the topology results. Figure 1Taking the network topology shown as an example, in a star network topology, the master node sends heartbeat packets to the slave nodes in a push manner; in a tree network topology, the master node sends heartbeat packets to the routing nodes in a push manner, and the routing nodes then send the heartbeat packets to the leaf nodes. As a possible implementation, the sequence seq identification information can be carried in the heartbeat packets. When a slave node finds that the seq identifications of the received heartbeat packets are the same, it can discard the redundant heartbeat packets to avoid broadcast storms.
[0097] As another possible implementation, the do-not-disturb identification information can be carried in the heartbeat packets. For example, when the identification information is 1, it indicates that the device is in the do-not-disturb state; when the identification information is 0, it indicates that the device is in the non-do-not-disturb state. Exemplarily, the triggering conditions for the device to enter the do-not-disturb state can include the following: Case 1: The device is busy and has a high load (for example, the load is above 70%); Case 2: The screen is off; Case 3: The battery level is low (for example, the remaining battery level is below 30%); Case 4: Preparing to exit the network; Case 5: If it is the master node, there is a master-slave node switch. When the device meets at least one of the above situations, the do-not-disturb identification can be carried in the heartbeat packets, and the heartbeat packets are multicast to the devices within the network to inform the devices within the network that the reply message frequency may be reduced or no reply messages will be sent. When the devices within the network receive the heartbeat packets, they can know that the device is in the do-not-disturb state through the identification information carried in the heartbeat packets. When the device is in the do-not-disturb state, if n heartbeat packets are received, m (m < n) heartbeat packets can be replied in a push manner, that is, the response push request frequency is reduced to lower the power consumption. When the service requires, the status information of the device is synchronized through the poll method to reduce the power consumption.
[0098] It should be understood that the devices within the network can also periodically obtain the status information of the devices through the poll method. For example, the status information of other devices can be obtained every 1 minute to determine whether other devices are in the do-not-disturb state.
[0099] Correspondingly, the triggering conditions for the device to recover from the do-not-disturb state to the normal state can include the following: Case 1: The load is reduced; Case 2: The screen is on; Case 3: The battery level is restored; Case 4: Joining the network. When the device meets at least one of the above situations, it can recover from the do-not-disturb state to the normal state. At this time, the do-not-disturb identification information of the heartbeat packets can be modified to 0 and multicast to other nodes within the network in a push manner, thus entering the normal state. Of course, when the device recovers from the do-not-disturb state to the normal state, if the status information of the device needs to be synchronized, the status information of the device can also be obtained through the poll method.
[0100] In this embodiment, device information can be synchronized by combining push and poll, which saves more power compared to the existing technology that uses only push or poll. Furthermore, it is more suitable for busy, screen-off, low-power, and network-off devices, avoiding frequent wake-up processing tasks that prevent devices from sleeping when desired, thus increasing the load and causing high power consumption.
[0101] Optionally, when the heartbeat packet needs to carry a lot of information, Bluetooth 5.0's Extended Broadcast can be used to broadcast the heartbeat packet, thereby synchronizing more device information with the peer device. For example... Figure 8A The diagram shown is a schematic representation of an extended broadcast implementation provided in an embodiment of this application. Figure 8A In the diagram shown, the Bluetooth broadcast header is located in the least significant bit, occupying 16 bits, while the payload is located in the most significant bit.
[0102] Figure 8B The diagram shows the data structure of the extended broadcast payload. (See attached diagram.) Figure 8B As shown, it can include four parts: Extended Header Length, AdvMode, Extended Header, and AdvData. The Extended Header Length is 6 bits, AdvMode is 2 bits, the Extended Header is 0-63 bytes, and AdvData is 0-254 bytes.
[0103] Furthermore, in a distributed network, each node can elect a central node as the highest-level node, with all other nodes acting as child nodes. Under the current scheme, when a node joins or leaves the network—that is, when a new device connects to the network or a device disconnects—a new central node election must be conducted. This causes the device management relationships within the network to constantly change, resulting in high power consumption and complex logic.
[0104] Based on this, in some embodiments of this application, the central node is not changed when the child node enters / exits the network, so as to avoid the situation of re-election of the central node and thus avoid frequent changes in the control relationship.
[0105] For example, such as Figure 8A As shown, assuming the current network topology is... Figure 9AAs shown in (a), the current network consists of nodes B and C. Node C is the central node, and node B is a child node of node C. If child node A wants to join the current network, it can send an authentication request message to node B to complete device authentication and join the network. According to current solutions, a new central node is usually elected from among nodes A, B, and C. However, in this embodiment, when node A requests to join the network, the central node does not need to be changed. That is, after node A joins the current network, the central node remains node C. For example, after child node A completes its network entry, see [reference needed]. Figure 9A As shown in (b) of the diagram.
[0106] For example, suppose the current network consists of a mobile phone and a router, with the router as the central node C and the mobile phone as the access node B. If a Bluetooth speaker, acting as access node C, wants to join the network, it can broadcast an authentication request message. Upon receiving this message, the mobile phone can exchange device information with the Bluetooth speaker to establish a device-level trust relationship and join the network. After the Bluetooth speaker joins the network, the router remains the central node, and the speaker is managed by the mobile phone.
[0107] like Figure 9B As shown, assuming the current network topology is... Figure 9B As shown in (a), the central node is node C, and nodes A and B are child nodes in the current network. When child node A leaves the network as an outgoing node, the current network can change, for example... Figure 9B As shown in (b), the current network can be changed from a network consisting of nodes A, B, and C to a network consisting of nodes B and C.
[0108] In other embodiments, a re-election of the central node may be performed. For example, the triggering conditions for a central node re-election may include the following:
[0109] 1. When power capacity is <= 30%, a re-election will be conducted within the current network.
[0110] 2: When merging subnets, a new election of the central node is performed.
[0111] When subnets in a distributed network are merged, a new central node can be re-elected from the two central nodes of the two subnets. For example, as shown... Figure 9CAs shown, assume subnets include subnet 1 and subnet 2. Subnet 1 includes nodes C and B, and subnet 2 includes nodes A and D. Node C is the central node of subnet 1, and node D is the central node of subnet 2. If subnets 1 and 2 are to be merged, node A can send an authentication request message to node B to join subnet 1. At this point, a new central node can be elected from central nodes D and C, for example, node C can be chosen as the new central node. The merged network can be seen in [reference needed]. Figure 9C As shown in (b) above. Of course, the central node of the merged network can also be elected from among the nodes other than central node D and central node C, without any specific restrictions.
[0112] One possible implementation is to select devices with fixed locations, low power consumption, and relatively abundant read-only memory (ROM) and random access memory (RAM) resources as central nodes. For example, device information can be scored, such as based on device type, communication capabilities, and power supply capabilities. For instance, the device score = device type + communication capabilities + power supply capabilities. If these parameters are identical, the devices are sorted by their network access time, and the device with the longest network access time is selected as the central node. The device score can be calculated using the above formula, and then the central node is selected based on the score result; for example, a device with a high score can be selected as the new central node.
[0113] The equipment type, communication capabilities, and power supply capabilities are shown in Tables 1, 2, and 3 below, respectively.
[0114] Table 1
[0115] Equipment type Preset values mobile phones, tablets 500 In-vehicle infotainment system, large screen 500 Smartwatches, speakers with screens 300 Speakers, Router 300 Bracelet, sports watch 0 IoT lights, switches, and sensors 0
[0116] It should be understood that the preset values shown in Table 1 are the corresponding values for different device types. For example, when the device is a mobile phone, the device type value can be 500.
[0117] Table 2
[0118] communication capability Preset values Wi-Fi: Wide coverage, flexible integration 300 Local Area Network (LAN): High Bandwidth 300 Bluetooth Low Energy (BLE): Unlimited access support 100 Classic Bluetooth BR: Point-to-point 0 USB: Point-to-point 0 other 0
[0119] It should be understood that the preset values shown in Table 2 are the values corresponding to different communication capabilities. For example, when the device's communication capability is Wi-Fi, the communication capability value can be 300.
[0120] Table 3
[0121] Power Capacity Preset values Power supply: Large screen, router, speaker, car infotainment system, smart lights, smart switches 500 Battery powered: mobile phones, tablets 80, power consumption decreases by 10 for every 10% drop in power. Battery powered and power-sensitive: watches, battery-powered security locks 20, power consumption decreases by 10 for every 10% power loss.
[0122] It should be understood that the preset values shown in Table 3 are the values corresponding to different power capabilities. For example, when the device is powered by a battery, the power capability value can be 80.
[0123] It should be understood that the above tables are merely illustrative, and this application does not specifically limit the type of equipment, its communication capabilities, power supply capabilities, or their corresponding preset values. For example, in Table 2, high-bandwidth communication capabilities are not limited to local area networks, and in Table 3, equipment powered by a power supply can also be other types of equipment.
[0124] As another possible implementation, the priority of devices as central nodes may differ in different scenarios. For example, in a home scenario, the priority is router > speaker > large screen > PC > mobile phone, meaning that in a home scenario, the router is preferred as the central node; in a travel scenario, the priority is in-vehicle system > PC > mobile phone > smartwatch, meaning that in a travel scenario, the in-vehicle system is preferred as the central node.
[0125] like Figure 9D As shown, assuming the current network topology is... Figure 9D The network topology diagram shown in (a) illustrates this. When nodes A and D want to leave the current network, they can split the subnetwork, that is, split the current network into subnetwork 1 consisting of nodes B and C, and subnetwork 2 consisting of nodes A and D, for example... Figure 9D As shown in (b) of the diagram.
[0126] As one possible implementation, when splitting a subnet, devices with shared relationships can be sent out of the network together. For example, such as... Figure 9E As shown, assuming the current network topology is... Figure 9E The diagram in (a) shows a relationship between nodes D and C. For example, node D is a headset and node C is a mobile phone. The phone and headset are paired and share data. When the subnet formed by nodes A and D wants to be separated from the current network, the devices with the sharing relationship can be separated as well. Figure 9E As shown in (b), the split network can include network 1 and network 2. Network 1 includes node A, and network 2 includes nodes B, C, and D. It should be understood that devices with a sharing relationship refer to at least two devices sharing the same Wi-Fi or Bluetooth connection.
[0127] The methods provided in the embodiments of this application above are described from the perspective of an electronic device as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0128] like Figure 10 As shown, other embodiments of this application disclose an electronic device. See also... Figure 10 As shown, the device 1000 includes: a transceiver 1001, one or more processors 1002, one or more memories 1003, and one or more computer programs 1004 (not shown in the figure). The above devices can be connected through one or more communication buses 1005.
[0129] The memory 1003 stores one or more computer programs, the one or more computer programs including instructions; the processor 1002 calls the instructions stored in the memory 1003, so that the device 1000 can perform the method of the above embodiments.
[0130] In this embodiment, the processor 1002 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment can be directly implemented by the hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules may reside in the memory 1003. The processor 1002 reads the program instructions from the memory 1003 and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0131] In this embodiment, the memory 1003 can be non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it can be volatile memory, such as RAM. The memory can also be any other medium capable of carrying or storing desired program code in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. The memory in this embodiment can also be a circuit or any other device capable of implementing storage functions, used to store instructions and / or data.
[0132] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0133] Based on the above embodiments, this application also provides a computer storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the method provided in the above embodiments.
[0134] This application also provides a computer program product, including instructions that, when run on a computer, cause the computer to execute the methods provided in the above embodiments.
[0135] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
Claims
1. A method for network access, characterized in that, include: The first electronic device broadcasts a discovery request message; The first electronic device receives a first feedback message from the second electronic device, the first feedback message being used to indicate that the information carried in the discovery request message matches the device information of the second electronic device; The first electronic device broadcasts a device authentication request message, which is used to authenticate with at least one device in the first network. The first electronic device receives a second feedback message sent by the second electronic device, the second electronic device being located in the first network, and the second feedback message is used to confirm that the first electronic device has joined the first network. When the first electronic device meets the preset conditions, the first electronic device broadcasts a first message, which includes a do-not-disturb flag and is used to synchronize device information with other electronic devices. The first electronic device receives N messages and replies with M messages, where M and N are both positive integers, and M... <N。 2. The method as described in claim 1, characterized in that, The device authentication request message includes the unique device identifier UDID of the first electronic device and the device public key of the first electronic device.
3. The method as described in claim 1 or 2, characterized in that, The second feedback message includes the UDID of the second electronic device and the device public key of the second electronic device.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: The first electronic device establishes a connection with the second electronic device; The first electronic device encrypts the data to be transmitted and sends the encrypted data to the second electronic device.
5. The method as described in claim 4, characterized in that, The first electronic device encrypts the data to be transmitted, including: The first electronic device uses the device public key of the second electronic device to encrypt the random number assigned in the session to obtain the session-level key; The first electronic device uses the session-level key to encrypt the data to be transmitted.
6. The method as described in claim 1, characterized in that, The preset conditions include at least one of the following conditions: The load exceeds the first set threshold; Screen off state; The battery level is below the second preset threshold; Preparing to disconnect from the network; Switching between primary and backup equipment.
7. The method as described in claim 1, characterized in that, The first network also includes a third electronic device, which is the central device of the first network; The method further includes: When the first electronic device joins the first network, the central device of the first network is the third electronic device.
8. The method as described in claim 7, characterized in that, The method further includes: If the first electronic device exits the first network after a preset time, then the central device of the first network is the third electronic device.
9. The method as described in claim 1, characterized in that, The first electronic device is located in the second network, and the method further includes: After the first electronic device joins the first network, a new central device is determined from the devices included in the first network and the second network.
10. The method as described in claim 9, characterized in that, A new central device is identified from the devices included in the first network and the second network, including: Based on the device type, communication capability, and power supply capability of the devices included in the first and second networks, a new central device is determined.
11. The method as described in claim 10, characterized in that, Based on the device types, communication capabilities, and power capabilities of the devices included in the first and second networks, a new central device is determined, including: The score for each device in the first network and the second network is determined based on the device type, communication capability, and power supply capability of the devices included in the first network and the second network. The device with the highest score will be designated as the new central device.
12. An electronic device, characterized in that, The electronic device includes a transceiver; one or more processors; one or more memories; and one or more computer programs. The one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 11.
13. A computer-readable storage medium storing instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Network addressing method, device and apparatus
CN107948339A
Equipment network access method and device, network device and storage medium
CN110740460A