WO2023065887A1 - Network access method and device - Google Patents

Network access method and device Download PDF

Info

Publication number
WO2023065887A1
WO2023065887A1 PCT/CN2022/118254 CN2022118254W WO2023065887A1 WO 2023065887 A1 WO2023065887 A1 WO 2023065887A1 CN 2022118254 W CN2022118254 W CN 2022118254W WO 2023065887 A1 WO2023065887 A1 WO 2023065887A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
electronic device
node
devices
electronic
Prior art date
Application number
PCT/CN2022/118254
Other languages
French (fr)
Chinese (zh)
Inventor
周蓉
邱泽令
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023065887A1 publication Critical patent/WO2023065887A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • H04W12/069Authentication using certificates or pre-shared keys
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W60/00Affiliation to network, e.g. registration; Terminating affiliation with the network, e.g. de-registration

Definitions

  • the present application relates to the technical field of terminals, and in particular to a network access method and device.
  • the present application provides a network access method and equipment, which are used to save connection resources and avoid connection failures caused by too many equipment connections.
  • the present application provides a network access method, which includes: a first electronic device broadcasts a device authentication request message, and the device authentication request message is used to perform device authentication with at least one device in the first group network; then, the first electronic device An electronic device receives a feedback message sent by a second electronic device, the second electronic device is a device in the first network, and the feedback message is used to confirm that the first electronic device joins the first network.
  • the electronic device can exchange authentication information with the electronic device in the network in the form of broadcast, so as to join the network, that is, there is no need to establish a connection with the electronic device in the network, and the broadcast method can save connection resources and avoid Too many devices are connected and the connection fails.
  • broadcasting consumes less power than connections, which can reduce power consumption.
  • the device authentication request message includes a unique device identifier UDID of the first electronic device and a device public key of the first electronic device.
  • the electronic device can broadcast its own UDID and device public key to the electronic devices in the network, so that the electronic devices in the network can feed back their own device information and those to join the network after receiving the broadcast message.
  • the electronic devices exchange authentication information so as to complete device authentication and enable new electronic devices to join the networking.
  • the feedback message includes the UDID of the second electronic device and the device public key of the second electronic device.
  • the electronic devices in the network can feed back their own device information to the broadcasting electronic devices, so that the authentication information can be exchanged to complete the device authentication, so that new electronic devices can join the network.
  • 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 .
  • the first electronic device joins the network, if data transmission is to be performed, it needs to establish a connection with the electronic device in the network, negotiate a data transmission channel, and then perform data transmission. Since device authentication is performed in a broadcast manner during device authentication, connection resources are saved, and when a device needs to connect to transmit data, the problem of device connection failure can be avoided.
  • the first electronic device encrypts the data to be transmitted, including: the first electronic device encrypts the random number assigned by the session with the device public key of the second electronic device to obtain a session-level secret key; An electronic device encrypts data to be transmitted using a session-level key.
  • the electronic device uses the session-level key to encrypt the data to be transmitted, which can improve the security of data transmission.
  • the method further includes: when the first electronic device meets the preset condition, the first electronic device broadcasts a first message, the first message includes a Do Not Disturb logo, and the first message is used to communicate with other Electronic devices synchronize device information; the first electronic device receives N messages and replies with M messages, where M and N are both positive integers, and M ⁇ N.
  • the first message may be a heartbeat packet, that is, it is used to synchronize information with other devices so as to keep the devices online within the network.
  • the electronic device can carry the Do Not Disturb sign in the broadcast, so that other devices can know the status information of the device.
  • the frequency of replying messages can be reduced to reduce power consumption.
  • the preset conditions include at least one of the following conditions: the load is greater than the first set threshold; the screen is off; the power is less than the second set threshold; ready to exit the network; Switching of standby equipment.
  • the first network further includes a third electronic device, and the third electronic device is a 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 is the third electronic device.
  • the method further includes: if the first electronic device withdraws from the first network after a preset period of time, the central device of the first network is the third electronic device.
  • the first electronic device is located in the second network, and the method further includes: after the first electronic device joins the first network, among the devices included in the first network and the second network, Identify the new central device.
  • the central node when the subnets are merged, the central node can be re-elected in the merged new network, so as to control the electronic devices in the network according to the new management and control relationship.
  • determining a new central device among the devices included in the first network and the second network includes: according to the device type of the equipment included in the first network and the second network, and the communication of the device Capabilities and power capabilities of the devices to determine new central devices.
  • the central node in the merged network can be determined according to the equipment type, communication capability and power supply capability of the electronic equipment, which can form a low-energy and high-efficiency distributed network under the control of the new central node.
  • a new central device is determined according to the device type, communication capability of the device, and power supply capability of the device included in the first network and the second network, including:
  • the electronic devices in the network can be scored, and then the electronic device with the highest scoring value can be selected as the central node, thereby avoiding the problems of high power consumption and complex logic caused by frequent replacement of the central node.
  • the present application provides an electronic device, which includes a transceiver; one or more processors; one or more memories; one or more sensors; ; wherein said one or more computer programs are stored in said one or more memories, said one or more computer programs comprising instructions, and when said instructions are called for execution by said one or more processors,
  • the electronic device is made to execute the above-mentioned first aspect and the method of any possible design of the first aspect.
  • the present application also provides an electronic device, the electronic device includes modules/units that execute the first aspect or any possible design method of the first aspect; these modules/units can be implemented by hardware, or can be The corresponding software implementation is executed by hardware.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on an electronic device, the electronic device executes the first aspect and its The method of any possible design in the first aspect.
  • the present application also provides a computer program product, which, when the computer program product is run on the electronic device, enables the electronic device to execute the first aspect of the embodiment of the present application and any possible design of the first aspect. method.
  • FIG. 1 is a schematic diagram of a network architecture of a distributed networking provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of module division of a networking provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 4 is a flow chart of a network access method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a message format of an authentication request message provided by an embodiment of the present application.
  • FIG. 6 is a flow chart of a data transmission method provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a message of a heartbeat packet provided by an embodiment of the present application.
  • FIG. 8A is a schematic structural diagram of an extended broadcast provided by an embodiment of the present application.
  • FIG. 8B is a schematic diagram of a data structure of an extended broadcast payload provided by an embodiment of the present application.
  • FIG. 9A is a schematic diagram of node network access provided by an embodiment of the present application.
  • FIG. 9B is a schematic diagram of a node going out of the network provided by the embodiment of the present application.
  • FIG. 9C is a schematic diagram of subnet merging provided by the embodiment of the present application.
  • FIG. 9D is a schematic diagram of subnet splitting provided by an embodiment of the present application.
  • FIG. 9E is a schematic diagram of subnet splitting provided by the embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the way for an electronic device to join a network is usually to establish a connection with a device in the network through a short-distance communication technology such as Bluetooth, and then complete device authentication and join the network.
  • a short-distance communication technology such as Bluetooth
  • the Bluetooth speaker wants to join the network 1
  • the Bluetooth speaker can establish a Bluetooth connection with the mobile phone, exchange authentication information, and then join the network 1 .
  • Due to the limited number of devices connected by the short-distance communication technology if more devices want to join the network 1, the connection may fail. Moreover, the more the number of connections, the higher the power consumption of the device, making the user experience poor.
  • the embodiment of the present application provides a network access method.
  • the electronic device exchanges authentication information with the devices in the network by broadcasting, and then joins the network, that is, there is no need to establish a connection with the devices in the network. You can join the network.
  • the broadcast method can save connection resources and avoid connection failures caused by too many devices. Moreover, broadcasting consumes less power than connection, which can reduce power consumption. For example, if the network 1 includes mobile phones, routers, and laptops, if the Bluetooth speaker wants to join the network 1, the Bluetooth speaker can broadcast device information through broadcasting.
  • the devices in the network 1, such as The mobile phone can also broadcast device information, so that 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, so that the mobile phone and the Bluetooth speaker can be searched and found separately.
  • the Bluetooth speaker can broadcast a device authentication request message, which can carry its own unique device identifier (unique device identifier, UDID) and public key.
  • UDID unique device identifier
  • the mobile phone receives the broadcast message, it can send its own UDID and device public key The key is fed back to the Bluetooth speaker, so that the Bluetooth speaker can complete the authentication request with the mobile phone, and the Bluetooth speaker can join the network where the current mobile phone is located.
  • Bluetooth A radio technology that supports short-distance communication between devices, enabling wireless information exchange between many devices including mobile phones, wireless headsets, laptops, and related peripherals.
  • the use of "Bluetooth” technology can effectively simplify the communication between mobile communication terminal equipment, and can also successfully simplify the communication between equipment and the Internet, so that data transmission becomes faster and more efficient, and broadens the road for wireless communication.
  • Wireless fidelity point-to-point wireless fidelity-peer to peer, Wi-Fi P2P: also known as wireless local area networks (wireless local area networks, WLAN) direct connection or Wi-Fi Direct, is one of the Wi-Fi protocol clusters , so that devices can easily connect to each other without intermediary wireless access points. Its uses range from web browsing to file transfers and communicating with multiple devices simultaneously, taking full advantage of the speed of Wi-Fi. Devices conforming to this standard can be easily interconnected even if they come from different manufacturers.
  • Heartbeat packet a command word used to regularly notify the other party of its own status between two electronic devices, which is sent at a certain time interval, similar to heartbeat.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • the network access method in the embodiment of the present application is applicable to a distributed networking architecture.
  • the method can be applied between multiple different electronic devices.
  • the electronic device may be a mobile phone, a tablet computer, a wearable device (for example, a watch, a bracelet, a smart helmet, smart glasses, etc.), a vehicle device, an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR equipment, notebook computers, ultra-mobile personal computers (ultra-mobile personal computers, UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs), etc., are not limited in this embodiment of the present application.
  • the electronic device involved in the embodiment of the present application may be a foldable electronic device, such as a foldable mobile phone, a foldable tablet computer, etc., which is not limited in the present application.
  • exemplary embodiments of electronic devices include, but are not limited to, carrying Harmony Or electronic equipment with other operating systems.
  • FIG. 1 it is a schematic diagram of a network architecture of a distributed network.
  • the schematic diagram shown in (a) in FIG. 1 is a schematic diagram of a star-shaped networking architecture.
  • node A1 is the main node (or called: central node)
  • nodes B1, C1, D1, E1, F1, and G1 are sub-nodes.
  • the schematic diagram shown in (b) in FIG. 1 is a schematic diagram of a tree networking.
  • A2 is the master node
  • B2 and C2 are child nodes (also called: routing nodes)
  • D2 and E2 are child nodes (or also called: leaf nodes) of B2
  • F2 is a child node of C2.
  • FIG. 1 is only a schematic illustration, and the structure of the distributed networking may also be other structures, which are not limited in the present application.
  • FIG. 2 is a schematic diagram of module division of a networking provided by an embodiment of the present application. As shown in FIG. 2 , it may specifically include a business application program (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 is used to provide networking scanning, querying and reporting of networking status, storage of related attributes and statuses of networking nodes and device peripherals, and control and distribution channels of central nodes.
  • the network central module 23 is used to provide ad hoc network fusion between devices to form a hybrid heterogeneous network, and manage the network state machine and network records.
  • the driver and chip interface module 24 is used for channel state management, detection, heartbeat, and link resource management.
  • the application scenario takes an electronic device in a household scenario as an example.
  • multiple electronic devices can be connected to the router, such as a user's mobile phone, Bluetooth headset, tablet computer, Bluetooth speaker, TV, soybean milk machine, range hood, and the like.
  • electronic devices located in different regions may also be connected to form a subnet under the distributed networking.
  • the TV, speakers, and water dispenser in the living room can be connected to form subnet 1, and the speakers in the dining room can be connected to the sweeping robot and laptop to form subnet 2.
  • electronic devices can search and discover other electronic devices through Wi-Fi, Bluetooth, etc., and then exchange each other's UDID and device public key with the electronic devices discovered through broadcasting to complete device authentication Join the network. Compared with the way of joining the networking through BT or Wi-Fi and other connection methods, it can reduce power consumption. It should be noted that the present application is not limited to the broadcast form, for example, information may be exchanged with other electronic devices in the form of unicast, multicast, or broadcast.
  • a data transmission channel can be established.
  • different electronic devices can be connected through Wi-Fi, wireless fidelity-peer to peer (Wi-Fi P2P) or Huawei magneto link (HML) etc.
  • Wi-Fi P2P wireless fidelity-peer to peer
  • HML Huawei magneto link
  • the data to be transmitted can be encrypted by the device key between different electronic devices, and then the data can be transmitted through the established data transmission channel.
  • the peer device can decrypt the encrypted data to complete the data transmission process.
  • FIG. 4 it is a flow chart of a network access method provided by the embodiment of the present application. Referring to Figure 4, the method may include the following steps:
  • S401 The mobile phone broadcasts a device discovery request message.
  • the device discovery request message can carry the connection capability of the mobile phone (such as whether it supports 5G connection, Wi-Fi P2P connection, ETH connection, etc.), Bluetooth name, UDID of the mobile phone and other information.
  • the device discovery request message may be a message broadcast by the mobile phone through BT or Wi-Fi.
  • the mobile phone when it turns on BT, it can scan and find peripheral devices that have turned on BT, and display a list of connectable BT devices on the mobile phone.
  • the mobile phone can discover other electronic devices under the same local area network as its own device through searching.
  • S402 The mobile phone receives the first feedback message sent by the tablet computer.
  • the device discovery request message is broadcast by the mobile phone, multiple electronic devices will receive the broadcast message. If the electronic device that receives the broadcast message finds that the information carried in the broadcast message match, then send the first feedback message to the mobile phone.
  • the first feedback message may carry device information of the own device, such as identification information of the tablet computer, capability information of the tablet computer, and the like. It should be noted that there may be at least one device for feeding back messages to the mobile phone, and this application only takes one, that is, a tablet computer as an example for illustration.
  • the tablet computer can set its own device information, such as setting the Bluetooth name, account information, connection capability (whether it supports 5G connection, etc.), etc., and then the tablet computer can broadcast the set own device information, that is, Publish service information.
  • the tablet computer receives the device discovery request message, if the information broadcast by the mobile phone matches the device information it needs, for example, the mobile phone supports 5G capability, and the tablet computer needs a device that supports 5G capability, then the tablet computer can respond to the device discovery of the mobile phone The message is requested, and the first feedback message is replied to the mobile phone.
  • S403 The mobile phone broadcasts a device authentication request message.
  • the device authentication request message may carry the device's UDID and device public key, that is, the mobile phone's UDID and the mobile device's public key.
  • the message format of the authentication request message broadcast by the mobile phone may refer to FIG. 5
  • the authentication data in FIG. 5 may include the UDID of the device and the public key of the device.
  • S404 The tablet computer sends the second feedback message to the mobile phone.
  • the second feedback message may include the device UDID and the device public key of the tablet computer.
  • the tablet computer 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, so as to perform device authentication with the mobile phone and establish a device level trust relationship to join the networking.
  • the mobile phone and the tablet computer can store the UDID and the device public key of the peer device respectively, so as to encrypt and decrypt the data to be transmitted later.
  • the mobile phone can perform device authentication with the tablet computer through broadcasting, that is, the two electronic devices can exchange authentication information without connecting to complete the trust relationship between the devices. Since the power consumption required for establishing a connection is higher than the power consumption required for broadcasting, the method in this embodiment of the present application can reduce power consumption compared with the method of joining a networking through a connection. Moreover, as the number of device connections increases, the failure rate will also increase, and even the connection cannot be established. The broadcast method can save connection resources and avoid the rapid exhaustion of connection resources, resulting in the failure to connect.
  • FIG. 6 is a flowchart of a data transmission method provided by an embodiment of the present application. Referring to Figure 6, the method may include the following steps:
  • S601 Establish a data transmission channel between the mobile phone and the tablet computer.
  • a Wi-Fi P2P connection or 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 or a Wi-Fi data transmission channel or an HML data transmission channel can be established.
  • S602 Negotiate a data transmission protocol between the mobile phone and the tablet computer.
  • the data transmission protocol can be negotiated, such as negotiating the role of the device for data transmission, the frequency of data transmission (that is, using 5G/2.4G) and so on.
  • the data transmission protocol can be negotiated which device is the group manager (group owner, GO) and which device is the group user (or called: general terminal) during the data transmission process. ) (group client, GC).
  • the mobile phone may send a notification message to the tablet computer to notify the tablet computer that the data transmission channel has been established.
  • S603 The mobile phone encrypts the data to be transmitted, and sends the encrypted data to be transmitted to the tablet computer.
  • the mobile phone can use the public key of the tablet computer saved by itself to encrypt the random number generated in this session to generate a session-level key, and then use the session-level key to encrypt the data to be transmitted, and finally use the session-level key to encrypt the data to be transmitted.
  • the data to be transmitted encrypted by the level secret key is transmitted to the tablet computer.
  • the tablet computer after the tablet computer receives the data sent by the mobile phone, it can use the device public key of its own device to decrypt the random number to obtain the random number, and then use the random number to decrypt the data to be transmitted to obtain the data sent by the mobile phone.
  • the data After the tablet computer receives the data sent by the mobile phone, it can use the device public key of its own device to decrypt the random number to obtain the random number, and then use the random number to decrypt the data to be transmitted to obtain the data sent by the mobile phone. The data.
  • the mobile phone can encrypt the data to be transmitted, and then the peer device can use the stored device-level key to decrypt the encrypted data, which improves the security of data transmission.
  • heartbeat packets may be sent between two electronic devices to maintain a trust relationship.
  • heartbeat packets there are generally two ways to send heartbeat packets:
  • the first way the child node requests to synchronize the information of the master node, that is, the child node sends a heartbeat packet to the master node.
  • the way in which the master node sends synchronization information to the child nodes can be recorded as "push”, that is, to push the synchronization information, and the way in which the child nodes request synchronization information from the master node can be recorded as "poll”.
  • FIG. 7 it is a message schematic diagram of a heartbeat packet.
  • the synchronous information is the 21Byte synchronous data shown in the figure.
  • the master node sends a heartbeat packet to the child node according to the topology result, taking the network topology shown in Figure 1 as an example, in the star network topology, the master node sends the heartbeat packet to the child node through push; In the shape network topology, the master node sends a heartbeat packet to the routing node through push, and the routing node then sends the heartbeat packet to the leaf node.
  • the heartbeat packet may carry sequence seq identifier information, and when the child node finds that the seq identifiers of the received heartbeat packets are the same, redundant heartbeat packets may be discarded to avoid broadcast storms.
  • the Do Not Disturb identification information may be carried in the heartbeat packet.
  • the device entering the Do Not Disturb state may include the following trigger conditions: Situation 1: The device is busy and the load is too high (for example, the load is above 70%); Situation 2: The screen is off; Situation 3: The power is low (such as, The power remaining is less than 30%); Situation 4: Ready to exit the network; Situation 5: If it is the master node, there is a switchover between the master and backup nodes.
  • the device When at least one of the above situations occurs on the device, it can carry the Do Not Disturb logo in the heartbeat packet, and multicast the heartbeat packet to the devices in the network to inform the devices in the network that the frequency of replying messages may be reduced or not Reply message.
  • a device in the network receives the heartbeat packet, it can know that the device is in the Do Not Disturb state through the identification information carried in the heartbeat packet.
  • the device is in the Do Not Disturb state, if it receives n heartbeat packets, it can reply m (m ⁇ n) heartbeat packets by push, which reduces the frequency of responding to push requests and reduces power consumption.
  • the status information of the device is synchronized through poll to reduce power consumption.
  • the devices in the network can also periodically obtain the status information of the devices through polling.
  • the status information of other devices can be obtained every 1 minute to determine whether other devices are in the do-not-disturb state.
  • the recovery of the device from the do-not-disturb state to the normal state may include the following trigger conditions: case 1: load reduction; case 2: screen bright state; case 3: power recovery; case 4: join the network.
  • case 1 load reduction
  • case 2 screen bright state
  • case 3 power recovery
  • case 4 join the network.
  • the Do Not Disturb identification information of the heartbeat packet can be modified to 0, and multicast to the network in the form of push other nodes, thus entering the normal state.
  • the device returns to the normal state from the Do Not Disturb state if you need to synchronize the state information of the device, you can also obtain the state information of the device through poll.
  • device information can be synchronized through a combination of push and poll, which can save more power consumption than the single method of push or poll in the prior art. Moreover, it is friendly to busy, off-screen, low-power, and off-network devices, and can avoid frequent response wake-up processing tasks, resulting in inability to sleep when you want to sleep, and the load is pulled up, causing high power consumption.
  • the extended broadcast of Bluetooth 5.0 can be used to broadcast the heartbeat packet, so that more device information can be synchronized to the peer device.
  • FIG. 8A it is a schematic structural diagram of an extended broadcast provided by the embodiment of the present application.
  • the header information (header) of the Bluetooth broadcast is at the lowest bit, occupying 16 bits, and the payload (Payload) is at the highest bit.
  • FIG. 8B is a schematic diagram of the data structure of the payload of the extended broadcast. Referring to FIG. 8B, it can include four parts: Extended Header Length, AdvMode, Extended Header, and AdvData. Among them, Extended Header Length is 6bit, AdvMode is 2bit, Extended Header is 0-63 bytes, and AdvData is 0-254 bytes.
  • each node in the network can elect a central node as the highest-level node, and other nodes as child nodes.
  • the election of the central node must be re-elected, which will cause the device management and control relationship in the network to continue to occur Changes, resulting in high power consumption and complex logic problems.
  • the central node is not changed when the child node enters or exits the network, and re-election of the central node is avoided as much as possible, thereby avoiding frequent changes in the management and control relationship.
  • the current networking is as shown in (a) in FIG. 9A , that is, the current networking is a networking formed by nodes B and C.
  • node C is the central node
  • node B is the child node of node C.
  • the central node is usually re-elected among node A, node B, and node C.
  • the central node may not be changed. That is, after node A joins the current networking, the central node is still node C. For example, after sub-node A completes network access, refer to (b) in FIG. 9A .
  • the router is the central node C
  • the mobile phone is the access node B.
  • the Bluetooth speaker as the network access node C wants to join the current network, then the Bluetooth speaker can Broadcast an authentication request message.
  • the mobile phone can exchange device information with the Bluetooth speaker to complete the device-level trust relationship and join the network.
  • the router is still the central node, and the Bluetooth speaker is controlled by the mobile phone.
  • the current network is shown in (a) in Figure 9B
  • the central node is node C
  • node A and node B are the child nodes under the current network
  • the current networking can change, such as shown in (b) in Figure 9B, that is, the current networking can change from the networking of node A, node B and node C to the group consisting of node B and node C net.
  • the central node can be re-elected.
  • the trigger conditions for central node re-election may include the following conditions:
  • a new central node can be re-elected from the two central nodes of the two subnets as the new central node.
  • the subnet includes a subnet 1 and a subnet 2
  • the subnet 1 includes nodes C and B
  • the subnet 2 includes nodes A and D.
  • node C is the central node of subnet 1
  • node D is the central node of subnet 2. If subnet 1 and subnet 2 are to be merged, node A can send an authentication request message to node B to join network 1 .
  • a new central node can be re-elected from central node D and central node C, for example, the new central node is node C, and the merged network can be shown in (b) in FIG. 9C .
  • the central node of the merged network may also be elected from other nodes except the central node D and the central node C, which is not specifically limited.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • the device type, the communication capability and the power supply capability of the device can refer to the following Table 1, Table 2, and Table 3 respectively.
  • Equipment type default value mobile phone tablet 500 car machine, big screen 500 Smart watch, speaker with screen 300 speakers, routing 300 Bracelets, sports watches 0 IOT lights, switches, sensors 0
  • the preset values shown in Table 1 are corresponding values under different device types.
  • the value of the device type may be 500.
  • Wi-Fi wide coverage, flexible access 300
  • Local Area Network LAN High Bandwidth 300
  • Bluetooth Low Energy BLE unlimited support for access 100
  • Classic Bluetooth BR Point to Point 0
  • USB point-to-point 0 other 0
  • the preset values shown in Table 2 are values corresponding to different communication capabilities.
  • the value of the communication capability may be 300.
  • the preset values shown in Table 3 are values corresponding to different power capabilities.
  • the value of the power capability may be 80.
  • the above table is only a schematic illustration, and the present application does not specifically limit the device type, device communication capability, power supply capability, and corresponding preset values.
  • the high-bandwidth communication capability is not limited to the local area network, and the devices powered by power in Table 3 may also be other devices.
  • a device may have different priorities as a central node.
  • the current networking is a schematic networking diagram shown in (a) in FIG. 9D .
  • node A and node D want to quit the current network, they can split the subnet, that is, split the current network into subnet 1 composed of node B and node C and the subnet of node A and node D 2, as shown in (b) in Figure 9D, for example.
  • the devices with a sharing relationship can go out of the network together.
  • the current networking is a schematic diagram shown in (a) in FIG. 9E .
  • node D is a headset
  • node C is a mobile phone
  • the split network can include networking 1 and networking 2.
  • network 1 includes node A
  • network 2 includes node B, node C, and node D.
  • the devices having a sharing relationship refer to at least two devices sharing the same Wi-Fi or the same Bluetooth.
  • the method provided in the embodiments of the present application is introduced from the perspective of an electronic device serving as an execution subject.
  • the electronic device may include a hardware structure and/or a software module, and implement the above various functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • the electronic device 1000 includes: a transceiver 1001, one or more processors 1002; one or more memory 1003; and one or more computer programs 1004 (not shown in the figure), each of the above The devices may be connected by one or more communication buses 1005 .
  • one or more computer programs are stored in the memory 1003, and the one or more computer programs include instructions; the processor 1002 invokes the instructions stored in the memory 1003, so that the electronic device 1000 can perform the methods of the above-mentioned embodiments.
  • the processor 1002 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement Or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the software module may be located in the memory 1003, and the processor 1002 reads the program instructions in the memory 1003, and completes the steps of the above method in combination with its hardware.
  • the memory 1003 may be a non-volatile memory, such as a hard disk (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD), etc., and may also be a volatile memory (volatile memory), For example RAM.
  • the memory may also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory in the embodiment of the present application may also be a circuit or any other device capable of implementing a storage function, and is used for storing instructions and/or data.
  • the present application also provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a computer, the computer executes the method provided by the above embodiments.
  • Embodiments of the present application further provide a computer program product, including instructions, which, when run on a computer, cause the computer to execute the method provided in the above embodiments.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine such that execution of the instructions by the processor of the computer or other programmable data processing device produces a Means for the function specified in one or more steps of a flowchart and/or one or more blocks of a block diagram.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application provides a network access method and device, wherein the method can be applied to distributed networking. In the method, when a first electronic device wants to join in current networking, the first electronic device may broadcast a device authentication request message in a broadcasting manner, and if a device in the current networking receives the broadcast message, a feedback message can be sent to the first electronic device, such that the first electronic device can complete device authentication with a network in the current networking, and thus joins in the current networking. Device authentication is performed in a broadcast manner, such that connection resources can be saved, and the condition of unsuccessful connection caused by excessive device connection is avoided. Moreover, power consumption caused by broadcasting is less, and power consumption can be reduced.

Description

一种入网方法及设备A network access method and device
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年10月22日提交中国专利局、申请号为202111232794.0、申请名称为“一种入网方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111232794.0 and the application title "A Network Access Method and Device" submitted to the China Patent Office on October 22, 2021, the entire contents of which are incorporated in this application by reference.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种入网方法及设备。The present application relates to the technical field of terminals, and in particular to a network access method and device.
背景技术Background technique
随着智能生态的建设,电子设备之间需要进行分布式组网。由于每个电子设备的短距通信能力有限,需要通过以太网(ETH)、无线保真(wireless fidelity,Wi-Fi)、蓝牙(bluetooth,BT)等混合能力实现多跳发现和异构组网。With the construction of intelligent ecology, distributed networking among electronic devices is required. Due to the limited short-distance communication capability of each electronic device, it is necessary to realize multi-hop discovery and heterogeneous networking through mixed capabilities such as Ethernet (ETH), wireless fidelity (Wi-Fi), and Bluetooth (BT) .
当不同电子设备间扫描发现后,可通过BT、ETH等方式进行连接,然后交互认证信息建立设备间的信任关系完成设备的认证。也就是说,电子设备在加入组网时必须通过连接,然后认证才能加入组网,但是,不管是哪种连接方式,电子设备间可连接的设备数量都比较有限,而且,当连接的设备数量增多时,电子设备的功耗都会增大,使得电子设备的使用时长明显减短,用户体验不佳。When different electronic devices are scanned and discovered, they can be connected through BT, ETH, etc., and then exchange authentication information to establish a trust relationship between devices to complete device authentication. That is to say, when an electronic device joins the network, it must pass the connection and then be authenticated to join the network. However, no matter which connection method is used, the number of devices that can be connected between electronic devices is relatively limited. Moreover, when the number of connected devices When the number increases, the power consumption of the electronic device will increase, which will significantly shorten the use time of the electronic device and cause poor user experience.
发明内容Contents of the invention
本申请提供一种入网方法及设备,用以节省连接资源,避免由于设备连接过多导致连接不成功的情况。The present application provides a network access method and equipment, which are used to save connection resources and avoid connection failures caused by too many equipment connections.
第一方面,本申请提供一种入网方法,该方法包括:第一电子设备广播设备认证请求消息,该设备认证请求消息用于与第一组网内的至少一个设备进行设备认证;然后,第一电子设备接收第二电子设备发送的反馈消息,第二电子设备为第一组网中的设备,该反馈消息用于确认第一电子设备加入第一组网。In a first aspect, the present application provides a network access method, which includes: a first electronic device broadcasts a device authentication request message, and the device authentication request message is used to perform device authentication with at least one device in the first group network; then, the first electronic device An electronic device receives a feedback message sent by a second electronic device, the second electronic device is a device in the first network, and the feedback message is used to confirm that the first electronic device joins the first network.
通过上述技术方案,电子设备可以通过广播的形式与组网内的电子设备交互认证信息,从而加入组网,即无需与组网内的电子设备建立连接,广播的方式能够节约连接资源,避免由于设备连接过多导致连接不成功的问题。并且,广播相比于连接消耗的功耗更少,能够降低功耗。Through the above technical solution, the electronic device can exchange authentication information with the electronic device in the network in the form of broadcast, so as to join the network, that is, there is no need to establish a connection with the electronic device in the network, and the broadcast method can save connection resources and avoid Too many devices are connected and the connection fails. In addition, broadcasting consumes less power than connections, which can reduce power consumption.
在一种可能的设计中,设备认证请求消息包括第一电子设备的唯一设备标识符UDID和第一电子设备的设备公钥。In a possible design, the device authentication request message includes a unique device identifier UDID of the first electronic device and a device public key of the first electronic device.
通过上述技术方案,电子设备可以向组网内的电子设备广播自身的UDID和设备公钥,这样组网内的电子设备在接收到广播消息之后,能够反馈自身的设备信息与要加入组网的电子设备交互认证信息,以便完成设备认证,使得新的电子设备加入组网。Through the above technical solution, the electronic device can broadcast its own UDID and device public key to the electronic devices in the network, so that the electronic devices in the network can feed back their own device information and those to join the network after receiving the broadcast message. The electronic devices exchange authentication information so as to complete device authentication and enable new electronic devices to join the networking.
在一种可能的设计中,反馈消息包括第二电子设备的UDID和第二电子设备的设备公钥。In a possible design, the feedback message includes the UDID of the second electronic device and the device public key of the second electronic device.
通过上述技术方案,组网内的电子设备可向发出广播的电子设备反馈自身的设备信息,以便交互认证信息完成设备认证,使得新的电子设备加入组网。Through the above technical solution, the electronic devices in the network can feed back their own device information to the broadcasting electronic devices, so that the authentication information can be exchanged to complete the device authentication, so that new electronic devices can join the network.
在一种可能的设计中,所述方法还包括:第一电子设备与第二电子设备建立连接;第一电子设备对待传输的数据进行加密,并将加密后到的数据发送给第二电子设备。In a possible design, 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 .
通过上述技术方案,当第一电子设备加入组网之后,如果要进行数据传输,则需要与组网内的电子设备建立连接,协商数据传输通道,然后进行数据的传输。由于在设备认证时使用广播的方式进行的设备认证,节省了连接资源,当设备需要连接传输数据时,能够避免设备连接失败的问题。Through the above technical solution, after the first electronic device joins the network, if data transmission is to be performed, it needs to establish a connection with the electronic device in the network, negotiate a data transmission channel, and then perform data transmission. Since device authentication is performed in a broadcast manner during device authentication, connection resources are saved, and when a device needs to connect to transmit data, the problem of device connection failure can be avoided.
在一种可能的设计中,第一电子设备对待传输的数据进行加密,包括:第一电子设备利用第二电子设备的设备公钥对会话分配的随机数进行加密,得到会话级秘钥;第一电子设备利用会话级秘钥对待传输的数据进行加密。In a possible design, the first electronic device encrypts the data to be transmitted, including: the first electronic device encrypts the random number assigned by the session with the device public key of the second electronic device to obtain a session-level secret key; An electronic device encrypts data to be transmitted using a session-level key.
通过上述技术方案,电子设备利用会话级秘钥对待传输的数据进行加密,能够提高数据的传输安全性。Through the above technical solution, the electronic device uses the session-level key to encrypt the data to be transmitted, which can improve the security of data transmission.
在一种可能的设计中,所述方法还包括:当第一电子设备满足预设条件时,第一电子设备广播第一消息,该第一消息包括勿扰标识,第一消息用于与其它电子设备同步设备信息;第一电子设备接收到N条消息,并回复M条消息,所述M、N均为正整数,M<N。In a possible design, the method further includes: when the first electronic device meets the preset condition, the first electronic device broadcasts a first message, the first message includes a Do Not Disturb logo, and the first message is used to communicate with other Electronic devices synchronize device information; the first electronic device receives N messages and replies with M messages, where M and N are both positive integers, and M<N.
应理解,第一消息可以为心跳包,即用于与其它设备同步信息以维持设备组网内在线。It should be understood that the first message may be a heartbeat packet, that is, it is used to synchronize information with other devices so as to keep the devices online within the network.
通过上述技术方案,电子设备可以在广播中携带勿扰标识,这样其它的设备就可以知道设备的状态信息。当设备处于勿扰状态时,可以减少回复消息的频率,以降低功耗。Through the above technical solution, the electronic device can carry the Do Not Disturb sign in the broadcast, so that other devices can know the status information of the device. When the device is in the Do Not Disturb state, the frequency of replying messages can be reduced to reduce power consumption.
在一种可能的设计中,所述预设条件包括如下条件中的至少一项:负载大于第一设定阈值;灭屏状态;电量小于第二设定阈值;准备退出网络;主用设备与备用设备的切换。In a possible design, the preset conditions include at least one of the following conditions: the load is greater than the first set threshold; the screen is off; the power is less than the second set threshold; ready to exit the network; Switching of standby equipment.
通过上述技术方案,针对繁忙、灭屏、低电量、退网设备比较友好,能够避免频繁的响应唤醒处理任务,导致希望休眠时无法休眠,使得功耗较高的问题。Through the above technical solution, it is more friendly to busy, off-screen, low-battery, and disconnected devices, and can avoid frequent response wake-up processing tasks, resulting in the inability to sleep when it is desired to sleep, resulting in high power consumption.
在一种可能的设计中,第一组网内还包括第三电子设备,该第三电子设备为第一组网的中心设备。所述方法还包括:当第一电子设备加入第一组网后,第一组网的中心设备第三电子设备。In a possible design, the first network further includes a third electronic device, and the third electronic device is a 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 is the third electronic device.
通过上述技术方案,当有新的电子设备加入组网时,不需要重新选举中心节点,避免频繁更改组网内的管控关系。Through the above technical solution, when a new electronic device joins the network, there is no need to re-elect the central node, so as to avoid frequently changing the management and control relationship in the network.
在一种可能的设计中,所述方法还包括:若第一电子设备在预设时长后退出第一组网,则第一组网的中心设备为第三电子设备。In a possible design, the method further includes: if the first electronic device withdraws from the first network after a preset period of time, the central device of the first network is the third electronic device.
通过上述技术方案,当有电子设备退出组网时,不需要重新选举中心节点,能够频繁更改组网内的管控关系。相比于现有技术中只要组网内的电子设备数量发生变化就进行中心节点的重选举能够降低功耗,避免逻辑复杂的问题。Through the above technical solution, when an electronic device withdraws from the network, there is no need to re-elect the central node, and the management and control relationship in the network can be frequently changed. Compared with the prior art, as long as the number of electronic devices in the networking changes, re-election of the central node can reduce power consumption and avoid the problem of complex logic.
在一种可能的设计中,第一电子设备位于第二组网,所述方法还包括:当第一电子设备加入第一组网后,在第一组网和第二组网包括的设备中确定新的中心设备。In a 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, among the devices included in the first network and the second network, Identify the new central device.
通过上述技术方案,当子网进行合并时,可以在合并后的新的组网内重新选举中心节点,以便按照新的管控关系对组网内的电子设备进行管控。Through the above technical solution, when the subnets are merged, the central node can be re-elected in the merged new network, so as to control the electronic devices in the network according to the new management and control relationship.
在一种可能的设计中,在第一组网和第二组网包括的设备中确定新的中心设备,包括:根据第一组网和第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定新的中心设备。In a possible design, determining a new central device among the devices included in the first network and the second network includes: according to the device type of the equipment included in the first network and the second network, and the communication of the device Capabilities and power capabilities of the devices to determine new central devices.
通过上述技术方案,可以根据电子设备的设备类型、通信能力及电源能力确定合并后的组网内的中心节点,能够使得在新的中心节点的管控下形成低能耗高效的分布式组网。Through the above technical solution, the central node in the merged network can be determined according to the equipment type, communication capability and power supply capability of the electronic equipment, which can form a low-energy and high-efficiency distributed network under the control of the new central node.
在一种可能的设计中,根据第一组网和第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定新的中心设备,包括:In a possible design, a new central device is determined according to the device type, communication capability of the device, and power supply capability of the device included in the first network and the second network, including:
根据所述第一组网和所述第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定所述第一组网和所述第二组网包括的每一个设备的分值;将所述分值最高的设备作为所述新的中心设备。Determine each device included in the first network and the second network according to the device type, the communication capability of the device, and the power supply capability of the device included in the first network and the second network the score; use the device with the highest score as the new central device.
通过上述技术方案,可以对组网内的电子设备进行打分,然后选择打分值最高的电子设备作为中心节点,从而避免频繁更换中心节点导致功耗较高,逻辑复杂的问题。Through the above technical solution, the electronic devices in the network can be scored, and then the electronic device with the highest scoring value can be selected as the central node, thereby avoiding the problems of high power consumption and complex logic caused by frequent replacement of the central node.
第二方面,本申请提供一种电子设备,所述电子设备包括收发器;一个或多个处理器;一个或多个存储器;一个或多个传感器;多个应用;以及一个或多个计算机程序;其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行上述第一方面及其第一方面任一可能设计的方法。In a second aspect, the present application provides an electronic device, which includes a transceiver; one or more processors; one or more memories; one or more sensors; ; wherein said one or more computer programs are stored in said one or more memories, said one or more computer programs comprising instructions, and when said instructions are called for execution by said one or more processors, The electronic device is made to execute the above-mentioned first aspect and the method of any possible design of the first aspect.
第三方面,本申请还提供一种电子设备,该电子设备包括执行第一方面或者第一方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。In the third aspect, the present application also provides an electronic device, the electronic device includes modules/units that execute the first aspect or any possible design method of the first aspect; these modules/units can be implemented by hardware, or can be The corresponding software implementation is executed by hardware.
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在电子设备上运行时,使得所述电子设备执行第一方面及其第一方面任一可能设计的方法。In a fourth aspect, the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on an electronic device, the electronic device executes the first aspect and its The method of any possible design in the first aspect.
第五方面,本申请还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例第一方面及其第一方面任一可能设计的方法。In the fifth aspect, the present application also provides a computer program product, which, when the computer program product is run on the electronic device, enables the electronic device to execute the first aspect of the embodiment of the present application and any possible design of the first aspect. method.
上述第二方面至第五方面中的各个方面以及各个方面可能达到的技术效果请参照上述针对第一方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。For the various aspects and possible technical effects of the above-mentioned second to fifth aspects, please refer to the above description of the technical effects that can be achieved by various possible solutions in the first aspect, and will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的分布式组网的网络架构示意图;FIG. 1 is a schematic diagram of a network architecture of a distributed networking provided by an embodiment of the present application;
图2为本申请实施例提供的一种组网的模块划分示意图;FIG. 2 is a schematic diagram of module division of a networking provided by an embodiment of the present application;
图3为本申请实施例提供的一种应用场景示意图;FIG. 3 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图4为本申请实施例提供的一种入网方法流程图;FIG. 4 is a flow chart of a network access method provided by an embodiment of the present application;
图5本申请实施例提供的一种认证请求消息的消息格式示意图;FIG. 5 is a schematic diagram of a message format of an authentication request message provided by an embodiment of the present application;
图6为本申请实施例提供的一种数据传输方法流程图;FIG. 6 is a flow chart of a data transmission method provided by an embodiment of the present application;
图7为本申请实施例提供的一种心跳包的报文示意图;FIG. 7 is a schematic diagram of a message of a heartbeat packet provided by an embodiment of the present application;
图8A为本申请实施例提供的一种扩展广播的结构示意图;FIG. 8A is a schematic structural diagram of an extended broadcast provided by an embodiment of the present application;
图8B为本申请实施例提供的一种扩展广播的有效载荷的数据结构示意图;FIG. 8B is a schematic diagram of a data structure of an extended broadcast payload provided by an embodiment of the present application;
图9A为本申请实施例提供的一种节点入网示意图;FIG. 9A is a schematic diagram of node network access provided by an embodiment of the present application;
图9B为本申请实施例提供的一种节点出网示意图;FIG. 9B is a schematic diagram of a node going out of the network provided by the embodiment of the present application;
图9C为本申请实施例提供的一种子网合并示意图;FIG. 9C is a schematic diagram of subnet merging provided by the embodiment of the present application;
图9D为本申请实施例提供的一种子网拆分示意图;FIG. 9D is a schematic diagram of subnet splitting provided by an embodiment of the present application;
图9E为本申请实施例提供的一种子网拆分示意图;FIG. 9E is a schematic diagram of subnet splitting provided by the embodiment of the present application;
图10为本申请实施例提供的一种电子设备的结构示意图。FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请以下实施例中的附图,对本申请实施例中的技术方案进行详尽描述。The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the following embodiments of the present application.
目前,电子设备加入组网的方式通常是与组网中的设备通过蓝牙等短距离通信技术建立连接,进而完成设备认证加入组网。举个例子,比如组网1中包括手机、路由器、笔记本电脑三个设备,如果蓝牙音箱想要加入该组网1,则蓝牙音箱可与手机建立蓝牙连接,交互认证信息,进而加入组网1。由于短距离通信技术的设备连接数量有限,如果有更多的设备想要加入该组网1,可能会出现连接不成功的情况。并且,连接数量越多,设备的功耗也会增加,使得用户体验不佳。At present, the way for an electronic device to join a network is usually to establish a connection with a device in the network through a short-distance communication technology such as Bluetooth, and then complete device authentication and join the network. For example, if the network 1 includes mobile phones, routers, and laptops, if the Bluetooth speaker wants to join the network 1, the Bluetooth speaker can establish a Bluetooth connection with the mobile phone, exchange authentication information, and then join the network 1 . Due to the limited number of devices connected by the short-distance communication technology, if more devices want to join the network 1, the connection may fail. Moreover, the more the number of connections, the higher the power consumption of the device, making the user experience poor.
有鉴于此,本申请实施例提供一种入网方法,在该方法中,电子设备通过广播的方式与组网内的设备交互认证信息,进而加入组网,即无需与组网内的设备建立连接即可加入组网。广播的方式能够节省连接资源,避免由于设备连接过多导致连接不成功的情况。并且,广播相比于连接而言,消耗的功耗更少,能够降低功耗。举例来说,比如组网1中包括手机、路由器、笔记本电脑三个设备,如果蓝牙音箱想要加入该组网1,蓝牙音箱可以通过广播的方式广播设备信息,组网1中的设备,比如手机也可广播设备信息,这样手机可接收到蓝牙音箱的广播消息,蓝牙音箱也可接收到手机的广播消息,这样手机和蓝牙音箱可分别被搜索发现。接着,蓝牙音箱可广播设备认证请求消息,该消息中可携带自身的唯一设备标识符(unique device identifier,UDID)和公钥,当手机接收到该广播消息之后,可将自身的UDID和设备公钥反馈给蓝牙音箱,这样蓝牙音箱可与手机完成认证请求,蓝牙音箱可加入当前手机所在的组网内。In view of this, the embodiment of the present application provides a network access method. In this method, the electronic device exchanges authentication information with the devices in the network by broadcasting, and then joins the network, that is, there is no need to establish a connection with the devices in the network. You can join the network. The broadcast method can save connection resources and avoid connection failures caused by too many devices. Moreover, broadcasting consumes less power than connection, which can reduce power consumption. For example, if the network 1 includes mobile phones, routers, and laptops, if the Bluetooth speaker wants to join the network 1, the Bluetooth speaker can broadcast device information through broadcasting. The devices in the network 1, such as The mobile phone can also broadcast device information, so that 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, so that the mobile phone and the Bluetooth speaker can be searched and found separately. Then, the Bluetooth speaker can broadcast a device authentication request message, which can carry its own unique device identifier (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 The key is fed back to the Bluetooth speaker, so that the Bluetooth speaker can complete the authentication request with the mobile phone, and the Bluetooth speaker can join the network where the current mobile phone is located.
以下,首先对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。In the following, part of the terms used in the embodiments of the present application will be explained first, so as to facilitate the understanding of those skilled in the art.
1)蓝牙:一种支持设备短距离通信的无线电技术,能在包括移动电话、无线耳机、笔记本电脑、相关外设等众多设备之间进行无线信息交换。利用“蓝牙”技术,能够有效地简化移动通信终端设备之间的通信,也能够成功地简化设备与因特网之间的通信,从而使得数据传输变得更加迅速高效,为无线通信拓宽道路。1) Bluetooth: A radio technology that supports short-distance communication between devices, enabling wireless information exchange between many devices including mobile phones, wireless headsets, laptops, and related peripherals. The use of "Bluetooth" technology can effectively simplify the communication between mobile communication terminal equipment, and can also successfully simplify the communication between equipment and the Internet, so that data transmission becomes faster and more efficient, and broadens the road for wireless communication.
2)无线保真点对点(wireless fidelity-peer to peer,Wi-Fi P2P):又称为无线局域网(wireless local area networks,WLAN)直连或Wi-Fi Direct,是Wi-Fi协议簇中的一个,使设备之间能够轻松连接彼此而不再需要中介性质的无线接入点。其使用范围从网页浏览到文件传输,以及同时与多个设备进行通信,能够充分发挥Wi-Fi的速度优势。符合此标准的设备即使来自不同的生产厂商,亦可实现轻松互联。2) Wireless fidelity point-to-point (wireless fidelity-peer to peer, Wi-Fi P2P): also known as wireless local area networks (wireless local area networks, WLAN) direct connection or Wi-Fi Direct, is one of the Wi-Fi protocol clusters , so that devices can easily connect to each other without intermediary wireless access points. Its uses range from web browsing to file transfers and communicating with multiple devices simultaneously, taking full advantage of the speed of Wi-Fi. Devices conforming to this standard can be easily interconnected even if they come from different manufacturers.
3)心跳包:在两个电子设备之间定时通知对方自己状态的命令字,按照一定的时间间隔发送,类似于心跳。3) Heartbeat packet: a command word used to regularly notify the other party of its own status between two electronic devices, which is sent at a certain time interval, similar to heartbeat.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features.
需要说明的是,本申请实施例的入网方法可适用于分布式组网架构。并且,该方法可应用于多个不同的电子设备之间。示例性地,电子设备可以为手机、平板电脑、可穿戴设备(例如,手表、手环、智能头盔,智能眼镜等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile  personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等,本申请实施例不作限定。本申请实施例涉及到的电子设备可以是可折叠式电子设备,比如可折叠式手机,可折叠式平板电脑等,本申请对此不作限定。并且,电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2022118254-appb-000001
Harmony
Figure PCTCN2022118254-appb-000002
或者其它操作系统的电子设备。
It should be noted that the network access method in the embodiment of the present application is applicable to a distributed networking architecture. Moreover, the method can be applied between multiple different electronic devices. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a wearable device (for example, a watch, a bracelet, a smart helmet, smart glasses, etc.), a vehicle device, an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR equipment, notebook computers, ultra-mobile personal computers (ultra-mobile personal computers, UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs), etc., are not limited in this embodiment of the present application. The electronic device involved in the embodiment of the present application may be a foldable electronic device, such as a foldable mobile phone, a foldable tablet computer, etc., which is not limited in the present application. Also, exemplary embodiments of electronic devices include, but are not limited to, carrying
Figure PCTCN2022118254-appb-000001
Harmony
Figure PCTCN2022118254-appb-000002
Or electronic equipment with other operating systems.
如图1所示,为分布式组网的网络架构示意图。图1中的(a)所示示意图为一种星型的组网架构示意图。其中,A1节点为主节点(或者称为:中心节点),B1、C1、D1、E1、F1、G1节点为子节点。图1中的(b)所示示意图为一种树形组网示意图。其中,A2为主节点,B2、C2为子节点(也称为:路由节点),D2、E2为B2的子节点(或者也可以称为:叶子节点),F2为C2的子节点。As shown in FIG. 1 , it is a schematic diagram of a network architecture of a distributed network. The schematic diagram shown in (a) in FIG. 1 is a schematic diagram of a star-shaped networking architecture. Among them, node A1 is the main node (or called: central node), and nodes B1, C1, D1, E1, F1, and G1 are sub-nodes. The schematic diagram shown in (b) in FIG. 1 is a schematic diagram of a tree networking. Among them, A2 is the master node, B2 and C2 are child nodes (also called: routing nodes), D2 and E2 are child nodes (or also called: leaf nodes) of B2, and F2 is a child node of C2.
应理解,图1仅是一种示意性说明,分布式组网的结构也可能为其它的结构,本申请对此不作限定。It should be understood that FIG. 1 is only a schematic illustration, and the structure of the distributed networking may also be other structures, which are not limited in the present application.
图2所示为本申请实施例提供的一种组网的模块划分示意图。如图2所示,具体可包括业务应用程序(application,APP)21、组网服务模块22、网络中枢模块23、驱动和芯片接口模块24。其中,组网服务模块22用于提供组网扫描,组网状态查询与上报,组网节点与设备外设相关属性和状态的保存以及中心节点的控制和分配通道。网络中枢模块23用于提供设备间融合自组网形成混合异构组网,管理组网状态机和网络记录。驱动和芯片接口模块24用于通道的状态管理、探测以及心跳,链路资源管理。FIG. 2 is a schematic diagram of module division of a networking provided by an embodiment of the present application. As shown in FIG. 2 , it may specifically include a business application program (application, APP) 21 , a networking service module 22 , a network hub module 23 , and a driver and chip interface module 24 . Among them, the networking service module 22 is used to provide networking scanning, querying and reporting of networking status, storage of related attributes and statuses of networking nodes and device peripherals, and control and distribution channels of central nodes. The network central module 23 is used to provide ad hoc network fusion between devices to form a hybrid heterogeneous network, and manage the network state machine and network records. The driver and chip interface module 24 is used for channel state management, detection, heartbeat, and link resource management.
下面对本申请的应用场景进行介绍。如图3所示,为本申请实施例提供的一种应用场景示意图。参阅图3所示,该应用场景以家庭场景下的电子设备为例。示例性地,路由器下可连接多个电子设备,比如,用户的手机、蓝牙耳机、平板电脑、蓝牙音箱、电视、豆浆机、抽油烟机等。其中,位于不同区域的电子设备之间也可以连接组成该分布式组网下的子网。比如,客厅中的电视、音箱、饮水机连接可以组成子网1,餐厅的音箱可分别与扫地机器人、笔记本电脑连接组成子网2。The application scenario of this application is introduced below. As shown in FIG. 3 , it is a schematic diagram of an application scenario provided by the embodiment of the present application. Referring to FIG. 3 , the application scenario takes an electronic device in a household scenario as an example. Exemplarily, multiple electronic devices can be connected to the router, such as a user's mobile phone, Bluetooth headset, tablet computer, Bluetooth speaker, TV, soybean milk machine, range hood, and the like. Wherein, electronic devices located in different regions may also be connected to form a subnet under the distributed networking. For example, the TV, speakers, and water dispenser in the living room can be connected to form subnet 1, and the speakers in the dining room can be connected to the sweeping robot and laptop to form subnet 2.
在一些实施例中,电子设备之间可以通过Wi-Fi、蓝牙等搜索发现其他的电子设备,然后通过广播的形式与扫描发现到的电子设备交互彼此的UDID和设备公钥,完成设备的认证加入组网。相比于通过BT或者Wi-Fi等连接方式加入组网的方式,能够降低功耗。需要说明的是,本申请中并不限于广播形式,例如可以通过单播、组播、广播的形式与其它的电子设备交互信息。In some embodiments, electronic devices can search and discover other electronic devices through Wi-Fi, Bluetooth, etc., and then exchange each other's UDID and device public key with the electronic devices discovered through broadcasting to complete device authentication Join the network. Compared with the way of joining the networking through BT or Wi-Fi and other connection methods, it can reduce power consumption. It should be noted that the present application is not limited to the broadcast form, for example, information may be exchanged with other electronic devices in the form of unicast, multicast, or broadcast.
当电子设备之间需要传输数据时,可建立数据传输通道。示例性地,不同的电子设备之间可通过Wi-Fi、无线保真点对点(wireless fidelity-peer to peer,Wi-Fi P2P)或华为多链路直连(huawei magneto link,HML)等连接方式建立数据传输通道。接着,不同的电子设备之间可通过设备秘钥对要传输的数据进行加密,然后通过建立的数据传输通道传输数据。当对端设备接收到加密的数据之后,可对加密的数据进行解密,从而完成数据的传输过程。When data needs to be transmitted between electronic devices, a data transmission channel can be established. Exemplarily, different electronic devices can be connected through Wi-Fi, wireless fidelity-peer to peer (Wi-Fi P2P) or Huawei magneto link (HML) etc. Establish a data transmission channel. Then, the data to be transmitted can be encrypted by the device key between different electronic devices, and then the data can be transmitted through the established data transmission channel. After receiving the encrypted data, the peer device can decrypt the encrypted data to complete the data transmission process.
以下以两个电子设备,比如手机和平板电脑为例对本申请实施例的方法进行介绍。如图4所示,为本申请实施例提供的一种入网方法流程图,参阅图4所示,该方法可包括如下步骤:The method in this embodiment of the present application will be introduced below by taking two electronic devices, such as a mobile phone and a tablet computer, as examples. As shown in Figure 4, it is a flow chart of a network access method provided by the embodiment of the present application. Referring to Figure 4, the method may include the following steps:
S401:手机广播设备发现请求消息。S401: The mobile phone broadcasts a device discovery request message.
其中,设备发现请求消息中可携带手机的连接能力(比如是否支持5G连接、Wi-Fi P2P 连接、ETH连接等)、蓝牙名称、手机的UDID等信息。Among them, the device discovery request message can carry the connection capability of the mobile phone (such as whether it supports 5G connection, Wi-Fi P2P connection, ETH connection, etc.), Bluetooth name, UDID of the mobile phone and other information.
在一些实施例中,设备发现请求消息可以为手机通过BT或者Wi-Fi广播的消息。示例性的,当手机打开BT时,可扫描发现周边已经打开BT的设备,并在手机上显示可连接的BT设备列表。另一示例,手机可通过搜索发现与自身设备处于同一局域网下的其它电子设备。In some embodiments, the device discovery request message may be a message broadcast by the mobile phone through BT or Wi-Fi. Exemplarily, when the mobile phone turns on BT, it can scan and find peripheral devices that have turned on BT, and display a list of connectable BT devices on the mobile phone. In another example, the mobile phone can discover other electronic devices under the same local area network as its own device through searching.
S402:手机接收平板电脑发送的第一反馈消息。S402: The mobile phone receives the first feedback message sent by the tablet computer.
由于设备发现请求消息为手机广播出去的,因此,会有多个电子设备接收到该广播消息,此时接收到广播消息的电子设备如果发现广播消息中携带的信息与自身所设置的设备信息相匹配,则向手机发送第一反馈消息。其中,第一反馈消息中可携带自身设备的设备信息,比如平板电脑的标识信息、平板电脑的能力信息等。需要说明的是,向手机反馈消息的设备可包括至少一个,本申请中仅以一个,即平板电脑为例进行说明。Since the device discovery request message is broadcast by the mobile phone, multiple electronic devices will receive the broadcast message. If the electronic device that receives the broadcast message finds that the information carried in the broadcast message match, then send the first feedback message to the mobile phone. Wherein, the first feedback message may carry device information of the own device, such as identification information of the tablet computer, capability information of the tablet computer, and the like. It should be noted that there may be at least one device for feeding back messages to the mobile phone, and this application only takes one, that is, a tablet computer as an example for illustration.
可选的,在S401执行之前,平板电脑可设置自身设备信息,比如设置蓝牙名称、账号信息、连接能力(是否支持5G连接等)等,然后平板电脑可将设置的自身设备信息广播出去,即发布服务信息。当平板电脑接收到设备发现请求消息后,若手机广播的信息与自身所需的设备信息相匹配,比如手机支持5G能力,平板电脑需要支持5G能力的设备,则平板电脑可响应手机的设备发现请求消息,向手机回复第一反馈消息。Optionally, before S401 is executed, the tablet computer can set its own device information, such as setting the Bluetooth name, account information, connection capability (whether it supports 5G connection, etc.), etc., and then the tablet computer can broadcast the set own device information, that is, Publish service information. When the tablet computer receives the device discovery request message, if the information broadcast by the mobile phone matches the device information it needs, for example, the mobile phone supports 5G capability, and the tablet computer needs a device that supports 5G capability, then the tablet computer can respond to the device discovery of the mobile phone The message is requested, and the first feedback message is replied to the mobile phone.
S403:手机广播设备认证请求消息。S403: The mobile phone broadcasts a device authentication request message.
其中,设备认证请求消息中可携带设备的UDID和设备公钥,即手机的UDID和手机设备公钥。示例性地,手机广播的认证请求消息的消息格式可参阅图5所示,图5中的认证数据中可包括设备的UDID和设备公钥。Wherein, the device authentication request message may carry the device's UDID and device public key, that is, the mobile phone's UDID and the mobile device's public key. For example, the message format of the authentication request message broadcast by the mobile phone may refer to FIG. 5 , and the authentication data in FIG. 5 may include the UDID of the device and the public key of the device.
S404:平板电脑向手机发送第二反馈消息。S404: The tablet computer sends the second feedback message to the mobile phone.
其中,第二反馈消息可包括平板电脑的设备UDID和设备公钥。在一些实施例中,当手机广播设备认证请求消息后,平板电脑可接收到手机广播的设备认证请求消息,然后向手机发送自身的设备UDID和设备公钥,以便与手机进行设备认证,建立设备级的信任关系加入组网。Wherein, the second feedback message may include the device UDID and the device public key of the tablet computer. In some embodiments, after the mobile phone broadcasts the device authentication request message, the tablet computer 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, so as to perform device authentication with the mobile phone and establish a device level trust relationship to join the networking.
在一些实施例中,手机与平板电脑可分别保存对端设备的UDID和设备公钥,以便后续对待传输的数据进行加密和解密。In some embodiments, the mobile phone and the tablet computer can store the UDID and the device public key of the peer device respectively, so as to encrypt and decrypt the data to be transmitted later.
通过上述步骤,手机可通过广播的方式与平板电脑进行设备认证,即两个电子设备之间无需连接就可以交互认证信息完成设备之间的信任关系。由于建立连接所需的功耗高于广播所需的功耗,因此,本申请实施例的方法相比于通过连接加入组网的方法能够降低功耗。并且,随着设备连接数量的增加,失败率也会增加,甚至无法建立连接,而广播的方式能够节省连接资源,避免连接资源被快速耗尽,导致无法连接的情况发生。Through the above steps, the mobile phone can perform device authentication with the tablet computer through broadcasting, that is, the two electronic devices can exchange authentication information without connecting to complete the trust relationship between the devices. Since the power consumption required for establishing a connection is higher than the power consumption required for broadcasting, the method in this embodiment of the present application can reduce power consumption compared with the method of joining a networking through a connection. Moreover, as the number of device connections increases, the failure rate will also increase, and even the connection cannot be established. The broadcast method can save connection resources and avoid the rapid exhaustion of connection resources, resulting in the failure to connect.
可选的,在S404之后,即当设备加入组网之后,如果设备之间需要传输数据,则需要建立设备之间的数据传输通道,然后通过建立的数据传输通道传输数据。示例性地,图6所示为本申请实施例提供的一种数据传输方法流程图。参阅图6所示,该方法可包括如下步骤:Optionally, after S404, that is, after the devices join the networking, if the devices need to transmit data, it is necessary to establish a data transmission channel between the devices, and then transmit data through the established data transmission channel. Exemplarily, FIG. 6 is a flowchart of a data transmission method provided by an embodiment of the present application. Referring to Figure 6, the method may include the following steps:
S601:手机与平板电脑建立数据传输通道。S601: Establish a data transmission channel between the mobile phone and the tablet computer.
在一些实施例中,手机与平板电脑之间可建立Wi-Fi P2P连接或者Wi-Fi连接或者HML连接,即建立Wi-Fi P2P数据传输通道或者Wi-Fi数据传输通道或者HML数据传输通道。In some embodiments, a Wi-Fi P2P connection or 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 or a Wi-Fi data transmission channel or an HML data transmission channel can be established.
应理解,当两个设备之间建立数据传输通道时,需要确定两个设备同时支持数据连接 能力。比如,当手机与平板电脑建立Wi-Fi P2P连接时,手机和平板电脑都需要支持Wi-Fi P2P连接能力,否则无法建立Wi-Fi P2P的数据传输通道。It should be understood that when a data transmission channel is established between two devices, it needs to be determined that the two devices support data connection capabilities at the same time. For example, when a mobile phone establishes a Wi-Fi P2P connection with a tablet computer, both the mobile phone and the tablet computer need to support the Wi-Fi P2P connection capability, otherwise the Wi-Fi P2P data transmission channel cannot be established.
S602:手机与平板电脑协商数据传输协议。S602: Negotiate a data transmission protocol between the mobile phone and the tablet computer.
在一些实施例中,当手机与平板电脑建立数据传输通道之后,可协商数据传输协议,比如协商数据传输的设备角色、数据传输的频率(即使用5G/2.4G)等。示例性的,当手机和平板电脑都支持Wi-Fi P2P传输时,可协商数据传输过程中哪个设备作为组管理员(group owner,GO),哪个设备作为群组用户(或者称为:一般终端)(group client,GC)。In some embodiments, after the data transmission channel is established between the mobile phone and the tablet computer, the data transmission protocol can be negotiated, such as negotiating the role of the device for data transmission, the frequency of data transmission (that is, using 5G/2.4G) and so on. Exemplarily, when both the mobile phone and the tablet computer support Wi-Fi P2P transmission, it can be negotiated which device is the group manager (group owner, GO) and which device is the group user (or called: general terminal) during the data transmission process. ) (group client, GC).
可选的,当手机与平板电脑协商完数据传输协议之后,手机可向平板电脑发送通知消息,以通知平板电脑数据传输通道已建立完成。Optionally, after the mobile phone and the tablet computer have negotiated the data transmission protocol, the mobile phone may send a notification message to the tablet computer to notify the tablet computer that the data transmission channel has been established.
S603:手机对待传输的数据进行加密,并向平板电脑发送加密后的待传输的数据。S603: The mobile phone encrypts the data to be transmitted, and sends the encrypted data to be transmitted to the tablet computer.
在一些实施例中,手机可利用自身保存的平板电脑的公钥对本次会话生成的随机数进行加密,生成会话级秘钥,然后利用会话级秘钥加密待传输的数据,最后将利用会话级秘钥加密后的待传输数据传输给平板电脑。In some embodiments, the mobile phone can use the public key of the tablet computer saved by itself to encrypt the random number generated in this session to generate a session-level key, and then use the session-level key to encrypt the data to be transmitted, and finally use the session-level key to encrypt the data to be transmitted. The data to be transmitted encrypted by the level secret key is transmitted to the tablet computer.
S604:平板电脑对接收到的数据进行解密。S604: The tablet computer decrypts the received data.
在一些实施例中,当平板电脑接收到手机发送的数据之后,可利用自身设备的设备公钥对随机数进行解密,得到随机数,再利用随机数对待传输的数据进行解密,从而得到手机发送的数据。In some embodiments, after the tablet computer receives the data sent by the mobile phone, it can use the device public key of its own device to decrypt the random number to obtain the random number, and then use the random number to decrypt the data to be transmitted to obtain the data sent by the mobile phone. The data.
通过上述步骤,手机可对待传输的数据进行加密,然后对端设备可利用保存的设备级秘钥对加密数据进行解密,提高了数据传输的安全性。Through the above steps, the mobile phone can encrypt the data to be transmitted, and then the peer device can use the stored device-level key to decrypt the encrypted data, which improves the security of data transmission.
可选的,为了维持电子设备之间的通信,两个电子设备之间可发送心跳包,以维持信任关系。目前,在分布式组网架构下,心跳包的发送方式一般有如下两种方式:Optionally, in order to maintain communication between electronic devices, heartbeat packets may be sent between two electronic devices to maintain a trust relationship. At present, under the distributed networking architecture, there are generally two ways to send heartbeat packets:
第一种方式:子节点请求同步主节点的信息,即子节点向主节点发送心跳包。The first way: the child node requests to synchronize the information of the master node, that is, the child node sends a heartbeat packet to the master node.
第二种方式:主节点周期性地向子节点发送同步信息,即主节点向子节点发送心跳包。The second way: the master node periodically sends synchronization information to the child nodes, that is, the master node sends heartbeat packets to the child nodes.
为了描述方便,可将主节点向子节点发送同步信息的方式记为“push”,即推送同步信息,将子节点向主节点请求同步信息的方式记为“poll”。For the convenience of description, the way in which the master node sends synchronization information to the child nodes can be recorded as "push", that is, to push the synchronization information, and the way in which the child nodes request synchronization information from the master node can be recorded as "poll".
在本申请实施例中,可以结合设备信息、设备状态、网络拓扑等情况决定是否要发心跳包、发多长时间以及如何发心跳包。示例性的,如图7所示,为一种心跳包的报文示意图。其中,同步信息即为图中所示的21Byte的同步数据。In this embodiment of the application, it may be determined whether to send a heartbeat packet, how long to send it, and how to send it in combination with device information, device status, and network topology. Exemplarily, as shown in FIG. 7 , it is a message schematic diagram of a heartbeat packet. Wherein, the synchronous information is the 21Byte synchronous data shown in the figure.
在一些实施例中,主节点根据拓扑结果向子节点发送心跳包,以图1所示网络拓扑为例,在星型网络拓扑结构中,主节点通过push方式向子节点发送心跳包;在树形网络拓扑结构中,主节点通过push方式向路由节点发送心跳包,路由节点再向叶子节点发送心跳包。作为一种可能的实施方式,可以在心跳包中携带序列seq标识信息,当子节点发现接收到的心跳包的seq标识相同时,可丢弃多余的心跳包,避免广播风暴。In some embodiments, the master node sends a heartbeat packet to the child node according to the topology result, taking the network topology shown in Figure 1 as an example, in the star network topology, the master node sends the heartbeat packet to the child node through push; In the shape network topology, the master node sends a heartbeat packet to the routing node through push, and the routing node then sends the heartbeat packet to the leaf node. As a possible implementation manner, the heartbeat packet may carry sequence seq identifier information, and when the child node finds that the seq identifiers of the received heartbeat packets are the same, redundant heartbeat packets may be discarded to avoid broadcast storms.
作为另一种可能的实现方式,可以在心跳包中携带勿扰标识信息。比如,当标识信息为1时,表示设备处于勿扰状态;当标识信息为0时,表示设备处于非勿扰状态。示例性的,设备进入勿扰态可包括如下触发条件:情况1:设备繁忙,负载过高(比如,负载在70%以上);情况2:灭屏状态;情况3:电量较低(比如,电量剩余30%以下);情况4:准备退出网络;情况5:如果是主节点,出现主备节点切换。当设备出现上述情况中的至少一项时,可在心跳包中携带勿扰标识,并将心跳包组播给组网内的设备,告知组网内的设备可能会减少回复消息的频率或不回复消息。当组网内的设备接收到心跳包后,可通过 心跳包中携带的标识信息知道该设备处于勿扰状态。当设备处于勿扰状态时,如果接收到n条心跳包,则可以通过push的方式回复m(m<n)条心跳包,即减少响应push请求频次,降低功耗。当业务需要时,再通过poll的方式同步设备的状态信息,以降低功耗。As another possible implementation manner, the Do Not Disturb identification information may be carried in the heartbeat packet. For example, when the identification information is 1, it means that the device is in the Do Not Disturb state; when the identification information is 0, it means that the device is in the non-Do Not Disturb state. Exemplarily, the device entering the Do Not Disturb state may include the following trigger conditions: Situation 1: The device is busy and the load is too high (for example, the load is above 70%); Situation 2: The screen is off; Situation 3: The power is low (such as, The power remaining is less than 30%); Situation 4: Ready to exit the network; Situation 5: If it is the master node, there is a switchover between the master and backup nodes. When at least one of the above situations occurs on the device, it can carry the Do Not Disturb logo in the heartbeat packet, and multicast the heartbeat packet to the devices in the network to inform the devices in the network that the frequency of replying messages may be reduced or not Reply message. When a device in the network receives the heartbeat packet, it can know that the device is in the Do Not Disturb state through the identification information carried in the heartbeat packet. When the device is in the Do Not Disturb state, if it receives n heartbeat packets, it can reply m (m<n) heartbeat packets by push, which reduces the frequency of responding to push requests and reduces power consumption. When the business needs it, the status information of the device is synchronized through poll to reduce power consumption.
应理解,组网内的设备也可以通过poll的方式周期性的获取设备的状态信息,比如可以每隔1分钟获取一次其它设备的状态信息,确定其它设备是否为勿扰状态。It should be understood that the devices in the network can also periodically obtain the status information of the devices through polling. 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.
相应的,设备从勿扰态恢复为正常态可包括如下触发条件:情况1:负载降低;情况2:亮屏状态;情况3:电量恢复;情况4:加入网络。当设备出现上述几种情况中的至少一项时,可从勿扰态恢复为正常态,此时心跳包的勿扰标识信息可修改为0,并通过push的方式组播给组网内的其它节点,从而进入正常态。当然,当设备从勿扰态恢复为正常态后,如果需要同步设备的状态信息,也可以通过poll的方式获取设备的状态信息。Correspondingly, the recovery of the device from the do-not-disturb state to the normal state may include the following trigger conditions: case 1: load reduction; case 2: screen bright state; case 3: power recovery; case 4: join the network. When at least one of the above situations occurs on the device, it can return to the normal state from the Do Not Disturb state. At this time, the Do Not Disturb identification information of the heartbeat packet can be modified to 0, and multicast to the network in the form of push other nodes, thus entering the normal state. Of course, after the device returns to the normal state from the Do Not Disturb state, if you need to synchronize the state information of the device, you can also obtain the state information of the device through poll.
在本申请实施例中,可通过push和poll结合的方式同步设备的信息,相比于现有技术中通过push或poll单一的方式能够更节省功耗。并且,对于繁忙、灭屏、低电、退网设备比较友好,能够避免频繁的响应唤醒处理任务,导致希望休眠时无法休眠,负载被拉高,引发功耗高的问题。In the embodiment of the present application, device information can be synchronized through a combination of push and poll, which can save more power consumption than the single method of push or poll in the prior art. Moreover, it is friendly to busy, off-screen, low-power, and off-network devices, and can avoid frequent response wake-up processing tasks, resulting in inability to sleep when you want to sleep, and the load is pulled up, causing high power consumption.
可选的,当心跳包中需要携带比较多的信息时,可以使用蓝牙5.0的扩展广播来广播心跳包,从而可向对端设备同步更多的设备信息。如图8A所示,为本申请实施例提供的一种扩展广播的结构示意图。在图8A所示示意图中,蓝牙广播的头部信息(header)位于最低位,占16bit,有效载荷(Payload)位于最高位。Optionally, when the heartbeat packet needs to carry more information, the extended broadcast of Bluetooth 5.0 can be used to broadcast the heartbeat packet, so that more device information can be synchronized to the peer device. As shown in FIG. 8A , it is a schematic structural diagram of an extended broadcast provided by the embodiment of the present application. In the schematic diagram shown in FIG. 8A , the header information (header) of the Bluetooth broadcast is at the lowest bit, occupying 16 bits, and the payload (Payload) is at the highest bit.
图8B所示为扩展广播的有效载荷的数据结构示意图。参阅图8B所示,可包括扩展包头长度(Extended Header Length)、广播模式(AdvMode)、扩展包头(Extended Header)、广播数据(AdvData)四部分。其中,Extended Header Length为6bit,AdvMode为2bit,Extended Header为0~63位字节,AdvData为0~254位字节。FIG. 8B is a schematic diagram of the data structure of the payload of the extended broadcast. Referring to FIG. 8B, it can include four parts: Extended Header Length, AdvMode, Extended Header, and AdvData. Among them, Extended Header Length is 6bit, AdvMode is 2bit, Extended Header is 0-63 bytes, and AdvData is 0-254 bytes.
进一步的,由于在分布式组网中,组网中的各个节点可选举出一个中心节点作为最高级别的节点,其他的节点均作为子节点。按照目前的方案,当有节点加入/退出组网,即有新的设备连接加入网络或者有设备退出连接时,都要重新进行中心节点的选举,这样会使得组网内的设备管控关系不断发生变化,造成功耗较高,逻辑复杂的问题。Furthermore, in a distributed network, each node in the network can elect a central node as the highest-level node, and other nodes as child nodes. According to the current plan, when a node joins/exits the network, that is, when a new device connects to the network or a device exits the connection, the election of the central node must be re-elected, which will cause the device management and control relationship in the network to continue to occur Changes, resulting in high power consumption and complex logic problems.
基于此,本申请一些实施例中,在子节点入网/出网时不对中心节点进行变更,尽量避免出现中心节点重选举的情况,从而避免出现管控关系频繁变更的情况。Based on this, in some embodiments of the present application, the central node is not changed when the child node enters or exits the network, and re-election of the central node is avoided as much as possible, thereby avoiding frequent changes in the management and control relationship.
示例性地,如图8A所示,假设当前组网为图9A中的(a)所示,即当前组网为节点B和节点C构成的组网。其中,节点C为中心节点,节点B为节点C的子节点。此时,子节点A作为入网节点想要加入当前的组网,则可以向节点B发起认证请求消息,以完成与节点B的设备认证加入当前组网。按照目前的方案,通常会在节点A、节点B以及节点C中重新选举中心节点,而本申请实施例中,当节点A请求加入组网后,可不更改中心节点。即节点A加入当前组网后,中心节点依然为节点C,例如子节点A完成入网后可参阅图9A中的(b)所示。Exemplarily, as shown in FIG. 8A , it is assumed that the current networking is as shown in (a) in FIG. 9A , that is, the current networking is a networking formed by nodes B and C. Among them, node C is the central node, and node B is the child node of node C. At this time, if child node A, as a network access node, wants to join the current networking, it can send an authentication request message to node B, so as to complete the device authentication with node B and join the current networking. According to the current scheme, the central node is usually re-elected among node A, node B, and node C. However, in the embodiment of this application, when node A requests to join the network, the central node may not be changed. That is, after node A joins the current networking, the central node is still node C. For example, after sub-node A completes network access, refer to (b) in FIG. 9A .
举个例子,假设当前组网为手机和路由器组成的组网,路由器为中心节点C,手机为接入节点B,此时蓝牙音箱作为入网节点C想要加入当前的组网,则蓝牙音箱可广播认证请求消息,手机在接收到该认证请求消息后,可与蓝牙音箱交互设备信息,以完成设备级的信任关系加入组网。当蓝牙音箱加入当前组网后,路由器依然为中心节点,蓝牙音箱由手机进行管控。For example, assuming that the current network is composed of mobile phones and routers, the router is the central node C, and the mobile phone is the access node B. At this time, the Bluetooth speaker as the network access node C wants to join the current network, then the Bluetooth speaker can Broadcast an authentication request message. After receiving the authentication request message, the mobile phone can exchange device information with the Bluetooth speaker to complete the device-level trust relationship and join the network. When the Bluetooth speaker joins the current network, the router is still the central node, and the Bluetooth speaker is controlled by the mobile phone.
如图9B所示,假设当前组网为图9B中的(a)所示,中心节点为节点C,节点A和节点B作为当前组网下的子节点,当子节点A作为出网节点出网后,当前组网可发生变化,例如图9B中的(b)所示,即当前组网可从节点A、节点B和节点C组网的组网变为节点B和节点C组成的组网。As shown in Figure 9B, assume that the current network is shown in (a) in Figure 9B, the central node is node C, node A and node B are the child nodes under the current network, when child node A is the outgoing node After networking, the current networking can change, such as shown in (b) in Figure 9B, that is, the current networking can change from the networking of node A, node B and node C to the group consisting of node B and node C net.
在另一些实施例中,可以对中心节点进行重新选举。示例性地,中心节点重选举的触发条件可以包括如下条件:In other embodiments, the central node can be re-elected. Exemplarily, the trigger conditions for central node re-election may include the following conditions:
1:电源能力<=30%时在当前网络内重选举1: re-election in the current network when power capacity <= 30%
2:子网合并时进行中心节点的重选举2: Re-election of the central node when the subnet is merged
当分布式组网下的子网进行合并时,可以在两个子网的两个中心节点中重选举出新的中心节点作为新的中心节点。示例性地,如图9C所示,假设子网包括子网1和子网2,子网1中包括节点C和节点B,子网2中包括节点A和节点D。其中,节点C为子网1的中心节点,节点D为子网2的中心节点,如果要将子网1和子网2进行合并,则节点A可向节点B发起认证请求消息以加入组网1。此时,可在中心节点D和中心节点C中重选举出新的中心节点,比如新的中心节点为节点C,合并后的网络可参阅图9C中的(b)所示。当然,还可以在除中心节点D和中心节点C之外的其它节点中选举合并后的网络的中心节点,对此不作具体限定。When the subnets under the distributed networking are merged, a new central node can be re-elected from the two central nodes of the two subnets as the new central node. Exemplarily, as shown in FIG. 9C , it is assumed that the subnet includes a subnet 1 and a subnet 2, the subnet 1 includes nodes C and B, and the subnet 2 includes nodes A and D. Among them, node C is the central node of subnet 1, and node D is the central node of subnet 2. If subnet 1 and subnet 2 are to be merged, node A can send an authentication request message to node B to join network 1 . At this time, a new central node can be re-elected from central node D and central node C, for example, the new central node is node C, and the merged network can be shown in (b) in FIG. 9C . Certainly, the central node of the merged network may also be elected from other nodes except the central node D and the central node C, which is not specifically limited.
作为一种可能的实现方式,可以选择位置固定、对耗电不敏感、只读存储器(Read-Only Memory,ROM)和随机存储器(Random Access Memory,RAM)资源相对充足的设备作为中心节点。示例性的,可以针对设备信息进行打分,比如可以根据设备类型、设备的通信能力、电源能力对设备信息进行打分。示例性地,设备信息的打分值=设备类型+通信能力+电源能力。若上述几个参数完全相同,则按照入网时间对设备进行排序,选择入网时间最长的设备作为中心节点。通过上述公式,可计算得到设备的打分,然后基于设备的打分结果选择中心节点,比如可选择打分高的设备作为新的中心节点。As a possible implementation, you can choose a device with a fixed location, insensitive to power consumption, and relatively sufficient Read-Only Memory (ROM) and Random Access Memory (RAM) resources as the central node. Exemplarily, the device information can be scored, for example, the device information can be scored according to the device type, device communication capability, and power supply capability. Exemplarily, the scoring value of the device information=device type+communication capability+power supply capability. If the above parameters are exactly the same, the devices are sorted according to the network access time, and the device with the longest network access time is selected as the central node. Through the above formula, the score of the device can be calculated, and then the center node can be selected based on the score result of the device. For example, the device with the highest score can be selected as the new center node.
其中,设备类型、设备的通信能力、电源能力可分别参阅下述表1、表2、表3所示。Wherein, the device type, the communication capability and the power supply capability of the device can refer to the following Table 1, Table 2, and Table 3 respectively.
表1Table 1
设备类型Equipment type 预设数值default value
手机、平板电脑mobile phone, tablet 500500
车机、大屏car machine, big screen 500500
智能手表、带屏音箱Smart watch, speaker with screen 300300
音箱、路由speakers, routing 300300
手环、运动手表Bracelets, sports watches 00
IOT灯、开关、传感器IOT lights, switches, sensors 00
应理解,表1所示的预设数值即为不同设备类型下对应的取值,比如当设备为手机时,设备类型取值可以为500。It should be understood that the preset values shown in Table 1 are corresponding values under different device types. For example, when the device is a mobile phone, the value of the device type may be 500.
表2Table 2
通信能力Communication ability 预设数值default value
Wi-Fi:覆盖广、灵活加入Wi-Fi: wide coverage, flexible access 300300
局域网LAN:高带宽Local Area Network LAN: High Bandwidth 300300
低功耗蓝牙BLE:无限支持接入Bluetooth Low Energy BLE: unlimited support for access 100100
经典蓝牙BR:点对点Classic Bluetooth BR: Point to Point 00
USB:点对点USB: point-to-point 00
其它other 00
应理解,表2所示的预设数值即为不同通信能力对应的取值,比如当设备的通信能力为Wi-Fi时,通信能力的取值可以为300。It should be understood that the preset values shown in Table 2 are values corresponding to different communication capabilities. For example, when the communication capability of the device is Wi-Fi, the value of the communication capability may be 300.
表3table 3
电源能力power capacity 预设数值default value
电源供电:大屏,路由器,音箱,车机,智能灯,智能开关Power supply: large screen, router, speaker, car machine, smart light, smart switch 500500
电池供电:手机,平板电脑Battery Powered: Cell Phones, Tablets 80,每掉电10%功耗降1080, every 10% power-off reduces power consumption by 10
电池供电且功耗敏感:手表,电池供电的安全门锁Battery Powered and Power Sensitive: Watches, Battery Powered Security Door Locks 20,每掉电10%功耗降1020, every 10% power-off power consumption will be reduced by 10
应理解,表3所示的预设数值即为不同电源能力对应的取值,比如当设备的电源能力为电池供电时,电源能力的取值可以为80。It should be understood that the preset values shown in Table 3 are values corresponding to different power capabilities. For example, when the power capability of the device is powered by a battery, the value of the power capability may be 80.
应理解,上述表格仅是一种示意性说明,本申请中对于设备类型、设备的通信能力、电源能力以及分别对应的预设值等不作具体限定。例如,在表2中,高带宽的通信能力并不限于局域网,表3中通过电源供电的设备还可以为其它的设备等。It should be understood that the above table is only a schematic illustration, and the present application does not specifically limit the device type, device communication capability, power supply capability, and corresponding preset values. For example, in Table 2, the high-bandwidth communication capability is not limited to the local area network, and the devices powered by power in Table 3 may also be other devices.
作为另一种可能的实现方式,在不同的场景下设备作为中心节点的优先级可能不同。比如,在家庭场景中,路由>音箱>大屏>PC>手机,即家庭场景下,优选路由作为中心节点;出行场景中,车机>PC>手机>智能手表,即出行场景下,优选车机作为中心节点。As another possible implementation manner, in different scenarios, a device may have different priorities as a central node. For example, in the home scene, router > speaker > big screen > PC > mobile phone, that is, in the home scene, the preferred route is the central node; in the travel scene, car machine > PC > mobile phone > smart watch, that is, the car machine as the central node.
如图9D所示,假设当前组网为图9D中的(a)所示的组网示意图。当节点A和节点D想要退出当前组网时,可进行子网络的拆分,即将当前组网拆分为节点B和节点C组成的子网1以及节点A和节点D组网的子网2,例如图9D中的(b)所示。As shown in FIG. 9D , it is assumed that the current networking is a schematic networking diagram shown in (a) in FIG. 9D . When node A and node D want to quit the current network, they can split the subnet, that is, split the current network into subnet 1 composed of node B and node C and the subnet of node A and node D 2, as shown in (b) in Figure 9D, for example.
作为一种可能的实现方式,当进行子网络拆分时,对于有共享关系的设备可一起出网。示例性地,如图9E所示,假设当前组网为图9E中的(a)所示示意图。其中,节点D与节点C存在关联关系,比如节点D为耳机,节点C为手机,手机与耳机配对存在共享关系,当节点A和节点D组成的子网想要从当前组网中拆分出去时,可将有共享关系的设备一起拆分出去,例如图9E中的(b)所示,拆分之后的网络可包括组网1和组网2。其中,组网1中包括节点A,组网2中包括节点B、节点C和节点D。应理解,有共享关系的设备指的是共享同一Wi-Fi或同一蓝牙的至少两个设备。As a possible implementation, when the sub-network is split, the devices with a sharing relationship can go out of the network together. Exemplarily, as shown in FIG. 9E , it is assumed that the current networking is a schematic diagram shown in (a) in FIG. 9E . Among them, there is an association between node D and node C. For example, node D is a headset, node C is a mobile phone, and there is a sharing relationship between the mobile phone and the headset. When the subnet composed of node A and node D wants to be split from the current network , the devices with sharing relationship can be split together, for example, as shown in (b) in FIG. 9E , the split network can include networking 1 and networking 2. Wherein, network 1 includes node A, and network 2 includes node B, node C, and node D. It should be understood that the devices having a sharing relationship refer to at least two devices sharing the same Wi-Fi or the same Bluetooth.
上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the above-mentioned embodiments provided in the present application, the method provided in the embodiments of the present application is introduced from the perspective of an electronic device serving as an execution subject. In order to implement the various functions in the method provided by the above embodiments of the present application, the electronic device may include a hardware structure and/or a software module, and implement the above various functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
如图10所示,本申请另外一些实施例公开了一种电子设备。参阅图10所示,所述电子设备1000包括:收发器1001、一个或多个处理器1002;一个或多个存储器1003;以及一个或多个计算机程序1004(图中未示出),上述各器件可以通过一个或多个通信总线1005连接。As shown in FIG. 10 , some other embodiments of the present application disclose an electronic device. 10, the electronic device 1000 includes: a transceiver 1001, one or more processors 1002; one or more memory 1003; and one or more computer programs 1004 (not shown in the figure), each of the above The devices may be connected by one or more communication buses 1005 .
其中,存储器1003中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令;处理器1002调用存储器1003中存储的所述指令,使得电子设备1000可以上述实施例的方法。Wherein, one or more computer programs are stored in the memory 1003, and the one or more computer programs include instructions; the processor 1002 invokes the instructions stored in the memory 1003, so that the electronic device 1000 can perform the methods of the above-mentioned embodiments.
在本申请实施例中,处理器1002可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储器1003中,处理器1002读取存储器1003中的程序指令,结合其硬件完成上述方法的步骤。In this embodiment of the application, the processor 1002 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement Or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module may be located in the memory 1003, and the processor 1002 reads the program instructions in the memory 1003, and completes the steps of the above method in combination with its hardware.
在本申请实施例中,存储器1003可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如RAM。存储器还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储指令和/或数据。In the embodiment of the present application, the memory 1003 may be a non-volatile memory, such as a hard disk (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD), etc., and may also be a volatile memory (volatile memory), For example RAM. The memory may also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory in the embodiment of the present application may also be a circuit or any other device capable of implementing a storage function, and is used for storing instructions and/or data.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.
基于以上实施例,本申请还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被计算机执行时,使得所述计算机执行以上实施例提供的方法。Based on the above embodiments, the present application also provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a computer, the computer executes the method provided by the above embodiments.
本申请实施例中还提供一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行以上实施例提供的方法。Embodiments of the present application further provide a computer program product, including instructions, which, when run on a computer, cause the computer to execute the method provided in the above embodiments.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine such that execution of the instructions by the processor of the computer or other programmable data processing device produces a Means for the function specified in one or more steps of a flowchart and/or one or more blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

Claims (14)

  1. 一种入网方法,其特征在于,包括:A network access method, characterized in that, comprising:
    第一电子设备广播设备认证请求消息,所述设备认证请求消息用于与第一组网内的至少一个设备进行设备认证;The first electronic device broadcasts a device authentication request message, and the device authentication request message is used to perform device authentication with at least one device in the first network;
    所述第一电子设备接收第二电子设备发送的反馈消息,所述第二电子设备位于所述第一组网,所述反馈消息用于确认所述第一电子设备加入所述第一组网。The first electronic device receives a feedback message sent by a second electronic device, the second electronic device is located in the first network, and the feedback message is used to confirm that the first electronic device joins the first network .
  2. 如权利要求1所述的方法,其特征在于,所述设备认证请求消息包括所述第一电子设备的唯一设备标识符UDID和所述第一电子设备的设备公钥。The method according to claim 1, wherein the device authentication request message includes a unique device identifier (UDID) of the first electronic device and a device public key of the first electronic device.
  3. 如权利要求1或2所述的方法,其特征在于,所述反馈消息包括所述第二电子设备的UDID和所述第二电子设备的设备公钥。The method according to claim 1 or 2, wherein the feedback message includes the UDID of the second electronic device and the device public key of the second electronic device.
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    所述第一电子设备与所述第二电子设备建立连接;establishing a connection between the first electronic device and 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. 如权利要求4所述的方法,其特征在于,所述第一电子设备对待传输的数据进行加密,包括:The method according to claim 4, wherein said first electronic device encrypts the data to be transmitted, comprising:
    所述第一电子设备利用所述第二电子设备的设备公钥对会话分配的随机数进行加密,得到会话级秘钥;The first electronic device uses the device public key of the second electronic device to encrypt the random number assigned by the session to obtain a session-level secret key;
    所述第一电子设备利用所述会话级秘钥对所述待传输的数据进行加密。The first electronic device encrypts the data to be transmitted by using the session-level key.
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    当所述第一电子设备满足预设条件时,所述第一电子设备广播第一消息,所述第一消息包括勿扰标识,所述第一消息用于与其它电子设备同步设备信息;When the first electronic device meets the preset condition, the first electronic device broadcasts a first message, the first message includes a Do Not Disturb logo, and the first message is used to synchronize device information with other electronic devices;
    所述第一电子设备接收到N条消息,并回复M条消息,所述M、N均为正整数,且所述M<N。The first electronic device receives N messages and replies with M messages, both of M and N are positive integers, and M<N.
  7. 如权利要求6所述的方法,其特征在于,所述预设条件包括如下条件中的至少一项:The method according to claim 6, wherein the preset conditions include at least one of the following conditions:
    负载大于第一设定阈值;The load is greater than the first set threshold;
    灭屏状态;screen off state;
    电量小于第二设定阈值;The power is less than the second set threshold;
    准备退出网络;Prepare to exit the network;
    主用设备与备用设备的切换。Switching between active equipment and standby equipment.
  8. 如权利要求1所述的方法,其特征在于,所述第一组网内还包括第三电子设备,所述第三电子设备为所述第一组网的中心设备;The method according to claim 1, wherein the first network further includes a third electronic device, and the third electronic device is a central device of the first network;
    所述方法还包括:The method also includes:
    当所述第一电子设备加入所述第一组网后,所述第一组网的中心设备为所述第三电子设备。After the first electronic device joins the first network, the central device of the first network is the third electronic device.
  9. 如权利要求8所述的方法,其特征在于,所述方法还包括:The method of claim 8, further comprising:
    若所述第一电子设备在预设时长后退出所述第一组网,则所述第一组网的中心设备为所述第三电子设备。If the first electronic device withdraws from the first network after a preset period of time, the central device of the first network is the third electronic device.
  10. 如权利要求1所述的方法,其特征在于,所述第一电子设备位于第二组网,所述方 法还包括:The method according to claim 1, wherein the first electronic device is located in the second network, and the method further comprises:
    当所述第一电子设备加入所述第一组网后,在所述第一组网和所述第二组网包括的设备中确定新的中心设备。After the first electronic device joins the first network, a new central device is determined among devices included in the first network and the second network.
  11. 如权利要求10所述的方法,其特征在于,在所述第一组网和所述第二组网包括的设备中确定新的中心设备,包括:The method according to claim 10, wherein determining a new central device among the devices included in the first network and the second network comprises:
    根据所述第一组网和所述第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定新的中心设备。A new central device is determined according to the device types, communication capabilities of the devices, and power supply capabilities of the devices included in the first network and the second network.
  12. 如权利要求11所述的方法,其特征在于,根据所述第一组网和所述第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定新的中心设备,包括:The method according to claim 11, wherein a new central device is determined according to the device type, communication capability of the device, and power supply capability of the device included in the first network and the second network, include:
    根据所述第一组网和所述第二组网包括的设备的设备类型、设备的通信能力以及设备的电源能力,确定所述第一组网和所述第二组网包括的每一个设备的分值;Determine each device included in the first network and the second network according to the device type, the communication capability of the device, and the power supply capability of the device included in the first network and the second network score;
    将所述分值最高的设备作为所述新的中心设备。The device with the highest score is used as the new central device.
  13. 一种电子设备,其特征在于,所述电子设备包括收发器;一个或多个处理器;一个或多个存储器;以及一个或多个计算机程序;An electronic device, characterized in that the electronic device comprises a transceiver; one or more processors; one or more memories; and one or more computer programs;
    其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器调用执行时,使得所述电子设备执行如权利要求1至12任一项所述的方法。wherein said one or more computer programs are stored in said one or more memories, said one or more computer programs comprising instructions which, when invoked by said one or more processors for execution, cause The electronic device executes the method according to any one of claims 1-12.
  14. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1至12任一项所述的方法。A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, wherein when the instructions are run on an electronic device, the electronic device is made to execute any one of claims 1 to 12. the method described.
PCT/CN2022/118254 2021-10-22 2022-09-09 Network access method and device WO2023065887A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111232794.0 2021-10-22
CN202111232794.0A CN116017310A (en) 2021-10-22 2021-10-22 Network access method and device

Publications (1)

Publication Number Publication Date
WO2023065887A1 true WO2023065887A1 (en) 2023-04-27

Family

ID=86025366

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/118254 WO2023065887A1 (en) 2021-10-22 2022-09-09 Network access method and device

Country Status (2)

Country Link
CN (1) CN116017310A (en)
WO (1) WO2023065887A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100150063A1 (en) * 2008-12-15 2010-06-17 Industrial Technology Research Institute Method and system for a node to join a wireless ad-hoc network
CN107948339A (en) * 2016-10-12 2018-04-20 阿里巴巴集团控股有限公司 A kind of network addressing method, equipment and device
CN109246797A (en) * 2017-06-07 2019-01-18 阿里巴巴集团控股有限公司 A kind of method, apparatus, system and equipment connecting wireless network
CN110740460A (en) * 2019-10-25 2020-01-31 深圳创维数字技术有限公司 device network access method, device, network device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100150063A1 (en) * 2008-12-15 2010-06-17 Industrial Technology Research Institute Method and system for a node to join a wireless ad-hoc network
CN107948339A (en) * 2016-10-12 2018-04-20 阿里巴巴集团控股有限公司 A kind of network addressing method, equipment and device
CN109246797A (en) * 2017-06-07 2019-01-18 阿里巴巴集团控股有限公司 A kind of method, apparatus, system and equipment connecting wireless network
CN110740460A (en) * 2019-10-25 2020-01-31 深圳创维数字技术有限公司 device network access method, device, network device and storage medium

Also Published As

Publication number Publication date
CN116017310A (en) 2023-04-25

Similar Documents

Publication Publication Date Title
CN106454996B (en) Method and apparatus for low power consumption data transfer
JP4988937B2 (en) Communication method in wireless network
EP2519071B1 (en) Method and system for delegating group ownership in a wi-fi peer to peer network
EP3190832B1 (en) Method and device for joining neighbor awareness network cluster
US7882238B2 (en) Using bluetooth to establish ad-hoc connections between non-bluetooth wireless communication modules
CN108323246B (en) Networking method, chip and wireless network system
EP2993943B1 (en) Method and apparatus for performing wireless docking service
US10349253B2 (en) Method for transmitting and receiving data, and device therefor
US10149232B2 (en) Method for participating in nan cluster in wireless communication system and device therefor
EP3002975B1 (en) Home network device and method of proxy service discovering
US20140003286A1 (en) Connectionless Wi-Fi Mesh Communication
US20170295455A1 (en) Method and apparatus for transmitting and receiving data in mesh network using bluetooth
JP2018520580A (en) Method, apparatus and computer program product for service discovery proxy for wireless communication
US10531370B2 (en) Method and apparatus for transmitting data in wireless communication system
US20180183701A1 (en) Method, system and apparatus for using neighbor awareness networking for mesh networking
US20180124550A1 (en) Method and device for transmitting/receiving data in mesh network using bluetooth
US20180176851A1 (en) Method and device for transmitting/receiving data in mesh network using bluetooth
WO2024083235A1 (en) Network configuration method based on wi-fi sensing, embedded chip system, and medium
WO2023019894A1 (en) Communication processing method, system, and communication node
Chaki et al. Seamless Group Reformation in WiFi Peer to Peer network using dormant backend links
Khan et al. Group owner election in Wi-Fi direct
JP6808411B2 (en) Communication equipment, communication methods, and programs
US20180146450A1 (en) Method for paging between nan devices, and nan device
US7613424B2 (en) Method for performing bluetooth high rate supervisor handover
WO2023065887A1 (en) Network access method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882499

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE