Equipment network distribution method and device, equipment and computer readable storage medium

By using asymmetric encryption algorithm and digital signature verification of hash algorithm in Wi-Fi device distribution network, the problem of low efficiency of traditional network distribution methods is solved, efficient network distribution and information security of multiple devices are achieved, and the distribution network is improved. efficiency and reliability.

CN118695328APending Publication Date: 2024-09-24BEIJING ESWIN COMPUTING TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410711526.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

When there are a large number of Wi-Fi devices, traditional network distribution methods are inefficient and cannot support network distribution for multiple devices at the same time, resulting in low network distribution efficiency.

Method used

Digital signatures and hash algorithms based on asymmetric encryption algorithms are used to verify the distribution network information through the cloud server, and generate and verify messages to ensure the security and reliability of the distribution network information, thereby improving the network distribution efficiency of the equipment.

Benefits of technology

It realizes efficient Wi-Fi network distribution in the case of multiple devices, improves the efficiency of joining devices that have not joined the network, and ensures the security and integrity of distribution network information through digital signatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118695328A
    Figure CN118695328A
Patent Text Reader

Abstract

The invention discloses an equipment network distribution method and device, equipment and a computer readable storage medium, and relates to the technical field of communication. The method is applied to a first device, the first device is a device that has been added to a Wi-Fi network established by a reference access point, the method comprises: receiving a first message, the first message comprising network distribution information and a digital signature, and the digital signature being obtained by performing a signature operation on the network distribution information based on a private key of an asymmetric encryption algorithm; verifying the digital signature based on a public key of an asymmetric encryption algorithm; and under the condition that the verification is passed, a second message is acquired based on the network distribution information and the digital signature, and the second message is broadcasted, so that a second device which monitors the second message is added to the Wi-Fi network based on the second message. And under the condition that the broadcasted second message is monitored, each second device can join the Wi-Fi network based on the second message. Therefore, under the condition that the number of the second devices is large, the network distribution efficiency of the second devices is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a device network configuration method, apparatus, device, and computer-readable storage medium. Background Art

[0002] In the field of communication technology, devices with wireless fidelity (Wi-Fi) functions can join the Wi-Fi network established by an access point and communicate with other devices based on the Wi-Fi network. The operation of joining the Wi-Fi network established by the access point is called network configuration. When there are a large number of devices with Wi-Fi functions, a device network configuration method is needed to improve network configuration efficiency. Summary of the invention

[0003] The present application provides a device network configuration method, apparatus, device and computer-readable storage medium for improving network configuration efficiency. The technical solution is as follows:

[0004] In a first aspect, a device network configuration method is provided, the method is applied to a first device, the first device is a device that has joined a Wi-Fi network established by a reference access point, the method comprising: receiving a first message, the first message comprising network configuration information and a digital signature, the digital signature being obtained by signing the network configuration information based on a private key of an asymmetric encryption algorithm; verifying the digital signature based on a public key of the asymmetric encryption algorithm; and if the verification passes, obtaining a second message based on the network configuration information and the digital signature, broadcasting the second message, so that a second device that monitors the second message joins the Wi-Fi network based on the second message.

[0005] In one possible implementation, before receiving the first message, the method also includes: sending network configuration information to a cloud server through a reference access point; receiving the first message includes: receiving the first message from the cloud server, and the digital signature is obtained by the cloud server signing the network configuration information based on a private key of an asymmetric encryption algorithm.

[0006] In one possible implementation, the first message includes first encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; the digital signature is verified based on the public key of the asymmetric encryption algorithm, including: obtaining the session key; decrypting the first encrypted information based on the session key to obtain the network configuration information and the digital signature; and verifying the digital signature based on the public key of the asymmetric encryption algorithm.

[0007] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; verifying the digital signature based on a public key of the asymmetric encryption algorithm, including: decrypting the digital signature based on the public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a second hash value; and determining that the verification is successful when the first hash value is consistent with the second hash value.

[0008] In a possible implementation, obtaining a second message based on the network configuration information and the digital signature includes: encrypting the network configuration information and the digital signature based on the session public key to obtain second encrypted information; encapsulating the second encrypted information to obtain a second message, wherein the payload of the second message includes the second encrypted information.

[0009] In a second aspect, a device network configuration method is provided, which is applied to a second device, where the second device is a device that has not joined a Wi-Fi network established by a reference access point, the method comprising: monitoring a second message broadcast by a first device, where the first device is a device that has joined the Wi-Fi network, the second message comprising network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm; verifying the digital signature with a public key based on the asymmetric encryption algorithm; and if the verification passes, joining the Wi-Fi network based on the network configuration information.

[0010] In a possible implementation, the digital signature is obtained by the cloud server signing the network configuration information with a private key based on an asymmetric encryption algorithm.

[0011] In one possible implementation, the second message includes second encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; verifying the digital signature based on the public key of the asymmetric encryption algorithm, including: obtaining the session key; decrypting the second encrypted information based on the session key to obtain the network configuration information and the digital signature; verifying the digital signature based on the public key of the asymmetric encryption algorithm.

[0012] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; verifying the digital signature based on a public key of the asymmetric encryption algorithm, including: decrypting the digital signature based on the public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a third hash value; and determining that the verification is successful when the first hash value is consistent with the third hash value.

[0013] In a possible implementation manner, the second message is an action frame.

[0014] In a third aspect, a device network configuration apparatus is provided, the apparatus being applied to a first device, the first device being a device that has joined a Wi-Fi network established by a reference access point, the apparatus comprising:

[0015] An acquisition module is used to receive a first message, the first message includes network configuration information and a digital signature, the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm;

[0016] A verification module, used to verify the digital signature based on the public key of the asymmetric encryption algorithm;

[0017] The acquisition module is also used to acquire the second message based on the network configuration information and the digital signature when the verification is passed, and broadcast the second message so that the second device that monitors the second message joins the Wi-Fi network based on the second message.

[0018] In a possible implementation, the device further includes: a sending module, configured to send network configuration information to a cloud server via a reference access point;

[0019] The acquisition module is used to receive a first message from a cloud server, where the digital signature is obtained by the cloud server performing a signing operation on the network configuration information based on a private key of an asymmetric encryption algorithm.

[0020] In one possible implementation, the first message includes first encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; a verification module is used to obtain the session key; decrypt the first encrypted information based on the session key to obtain the network configuration information and the digital signature; and verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0021] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; a verification module is used to decrypt the digital signature based on a public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a second hash value; and determining that the verification is successful when the first hash value is consistent with the second hash value.

[0022] In a possible implementation, the acquisition module is used to encrypt the network configuration information and the digital signature based on the session public key to obtain second encrypted information; encapsulate the second encrypted information to obtain a second message, and the payload of the second message includes the second encrypted information.

[0023] In a fourth aspect, a device network configuration apparatus is provided, the apparatus being applied to a second device, the second device being a device that has not joined a Wi-Fi network established by a reference access point, the apparatus comprising:

[0024] A monitoring module, configured to monitor a second message broadcast by a first device, where the first device is a device that has joined a Wi-Fi network, and the second message includes network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm;

[0025] A verification module, used to verify the digital signature based on the public key of the asymmetric encryption algorithm;

[0026] The network configuration module is used to join the Wi-Fi network based on the network configuration information when the verification is passed.

[0027] In a possible implementation, the digital signature is obtained by the cloud server signing the network configuration information with a private key based on an asymmetric encryption algorithm.

[0028] In one possible implementation, the second message includes second encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; a verification module is used to obtain the session key; decrypt the second encrypted information based on the session key to obtain the network configuration information and the digital signature; and verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0029] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; a verification module is used to decrypt the digital signature based on a public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a third hash value; and determining that the verification is successful when the first hash value is consistent with the third hash value.

[0030] In a possible implementation manner, the second message is an action frame.

[0031] In a fifth aspect, a chip is provided, the chip including a processor, the processor being used to call and execute instructions stored in the memory from a memory, so that a device equipped with the chip executes any device network configuration method in the first aspect or the second aspect.

[0032] In a sixth aspect, an electronic device is provided, wherein the electronic device comprises the chip in the fifth aspect.

[0033] In the seventh aspect, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor of an electronic device so that the electronic device implements the device network configuration method of any one of the first aspect or the second aspect mentioned above.

[0034] In an eighth aspect, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the device network configuration method of any one of the first aspect or the second aspect.

[0035] The technical solution provided by this application brings at least the following beneficial effects:

[0036] In the solution provided by the present application, when the second message broadcast is monitored, each second device that has not joined the Wi-Fi network can join the Wi-Fi network based on the second message. Therefore, when the number of second devices that have not joined the Wi-Fi network is large, the efficiency of the second devices joining the Wi-Fi network is high. That is, the network configuration efficiency of the second devices is high.

[0037] Furthermore, the first device only needs to verify the digital signature in the received first message, obtain the second message and broadcast the second message if the verification is successful. Since the digital signature is obtained based on the private key of the asymmetric encryption algorithm, the first device cannot modify the digital signature. Compared with the method of encrypting the network configuration information only by the first device, the digital signature has higher security, so that if the verification is successful, the reliability of the received network configuration information is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0040] Figure 2 It is a flow chart of a device network configuration method provided in an embodiment of the present application;

[0041] Figure 3 is a schematic diagram of a TLV format provided in an embodiment of the present application;

[0042] Figure 4 This is a schematic diagram of a signature operation process provided by an embodiment of the present application;

[0043] Figure 5 This is a schematic diagram of a process for verifying a digital signature provided by an embodiment of the present application;

[0044] Figure 6 It is a process diagram of a device network configuration method provided by an embodiment of the present application;

[0045] Figure 7 is a flow chart of another device network configuration method provided in an embodiment of the present application;

[0046] Figure 8 It is a structural schematic diagram of a device network distribution device provided in an embodiment of the present application;

[0047] Fig. 9 It is a structural schematic diagram of a device network distribution device provided in an embodiment of the present application;

[0048] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0050] With the continuous development of Wi-Fi technology, devices with Wi-Fi functions are used in more and more scenarios. In this application, devices with Wi-Fi functions are referred to as Wi-Fi devices. Wi-Fi devices can join a Wi-Fi network established by an access point (AP) and communicate with other devices based on the Wi-Fi network. Among them, the operation of joining a Wi-Fi network established by an AP is called network configuration, and the access point for establishing a Wi-Fi network is also called a hotspot.

[0051] In the traditional network configuration method, only one Wi-Fi device can be supported for network configuration at the same time, and the network configuration efficiency is low. For example, in the AP network configuration method, a Wi-Fi device that is not connected to the Wi-Fi network is used as a soft AP to establish a Wi-Fi network, and a mobile terminal is used as a station to access the Wi-Fi network established by the soft AP. Then, the network configuration information is transmitted to the Wi-Fi device that is not connected to the Wi-Fi network through the mobile terminal. After the Wi-Fi device that is not connected to the Wi-Fi network obtains the network configuration information, it performs network configuration based on the network configuration information.

[0052] Therefore, when there are a large number of Wi-Fi devices, a device network configuration method is needed to improve network configuration efficiency.

[0053] The embodiment of the present application provides a device network configuration method for improving network configuration efficiency. Figure 1 Schematic diagram of an implementation environment provided by the embodiment of the present application. Figure 1 As shown, the implementation environment includes a Wi-Fi device 101 and an access point 102, and the Wi-Fi device 101 is connected to the access point 102 via Wi-Fi. Optionally, the implementation environment also includes a cloud server 103, and the access point 102 is connected to the cloud server 103 via Ethernet. The Wi-Fi device 101 can be an Internet of Things device, and the Internet of Things device can have a display screen or not. In the case where the Internet of Things device has a display screen, the Internet of Things device can achieve human-computer interaction with the user based on the display screen. In the case where the Internet of Things device does not have a display screen, the Internet of Things device does not have the ability of human-computer interaction. The access point 102 can be a router, and the cloud server 103 is deployed in the cloud, and the cloud server 103 can include at least one server.

[0054] Figure 1 The number of Wi-Fi devices 101 shown is only an example, and the access point 102 can be connected to more Wi-Fi devices 101, which is not limited in this embodiment of the present application.

[0055] Those skilled in the art should understand that the above-mentioned Wi-Fi device 101, access point 102 and cloud server 103 are only examples, and other existing or future Wi-Fi devices, access points or cloud servers, if applicable to the present application, should also be included in the scope of protection of the present application and are included here by reference.

[0056] The device network configuration method provided in the embodiment of the present application can be as follows Figure 2 As shown, the method is applied to a first device, which is a device that has joined a Wi-Fi network established by a reference access point. For example, the method is Figure 1 The Wi-Fi device 101 shown in the figure executes the method, and the Wi-Fi device 101 executing the method has joined the Wi-Fi network established by the access point 102. Figure 2 As shown, the method includes but is not limited to steps 201 to 203.

[0057] Step 201: Receive a first message, where the first message includes network configuration information and a digital signature. The digital signature is obtained by signing the network configuration information using a private key based on an asymmetric encryption algorithm.

[0058] Exemplarily, the digital signature is irreversible and non-repudiation, thereby ensuring the validity of the data. The irreversibility and non-repudiation of the digital signature means that the sender of the digital signature cannot deny the behavior and content of the information he sent, so that by verifying the digital signature, the first device can verify the sender of the first message, ensure that the first message comes from a trusted sender, and then ensure the validity and reliability of the first message. In addition, the digital signature can also prove that the data has not been tampered with and ensure the integrity of the data, which is a function that a handwritten signature does not have. Therefore, by digitally signing the network configuration information, the first device can subsequently verify whether the network configuration information has been tampered with based on the digital signature to ensure data integrity. Exemplarily, the asymmetric encryption algorithm is the elliptic curve digital signature algorithm (ECDSA).

[0059] In a possible implementation, the signing operation is performed by a cloud server, which is connected to the reference access point. Figure 1 The cloud server 103 is shown. Exemplarily, before receiving the first message, the method further includes: sending network configuration information to the cloud server through a reference access point; receiving the first message includes: receiving the first message from the cloud server, the digital signature is obtained by the cloud server signing the network configuration information based on the private key.

[0060] For example, after joining the Wi-Fi network established by the reference access point, the first device obtains network configuration information and sends the network configuration information to the cloud server through the reference access point. The network configuration information includes but is not limited to the service set identifier (SSID) and password of the Wi-Fi network. Exemplarily, the cloud server sends a first message to the first device through the reference access point.

[0061] In a possible implementation, the first device sends network configuration information to the cloud server through a reference access point, including: the first device fills the network configuration information into the payload of the network configuration information message according to the type, length and value (type, length, value, TLV) format, and forwards the network configuration information message to the cloud server through the reference access point.

[0062] Figure 3 This is a schematic diagram of a TLV format provided in an embodiment of the present application, see Figure 3 In the TLV format, the data is arranged in the order of a type, the length corresponding to the type, and the value corresponding to the type. Figure 3As shown, in the TLV format, they are arranged in the order of type 1, length 1, value 1, type 2, length 2, value 2, type 3, length 3, and value 3. Among them, length 1 and value 1 correspond to type 1, length 2 and value 2 correspond to type 2, and length 3 and value 3 correspond to type 3. Since the TLV format is relatively simple, after the cloud server receives the network configuration information message, it is more efficient to obtain the network configuration information filled in the TLV format.

[0063] The network configuration information message may be a transmission control protocol (TCP) message or a user datagram protocol (UDP) message. When the network configuration information message is a TCP message, the security and reliability of transmitting the network configuration information are higher.

[0064] Exemplarily, the cloud server generates and manages the public key and private key of the asymmetric encryption algorithm. When the network configuration information sent by the first device through the reference access point is obtained, the cloud server signs the network configuration information based on the private key of the asymmetric encryption algorithm to obtain a digital signature. Then, the cloud server generates a first message based on the network configuration information and the digital signature, and sends the first message to the first device through the reference access point. Exemplarily, when the asymmetric encryption algorithm is ECDSA, the cloud server can automatically generate and save the public key and private key according to ECDSA.

[0065] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key. The reference hash algorithm may be a secure hash algorithm (SHA) 256. Exemplarily, after obtaining the digital signature, the cloud server further encrypts the network configuration information and the digital signature to improve the security of the network configuration information and the digital signature during transmission. For example, the cloud server obtains a session key, encrypts the network configuration information and the digital signature based on the session key to obtain first encrypted information, and encapsulates the first encrypted information to obtain a first message.

[0066] The embodiments of the present application do not limit the order of obtaining the session key and performing the signature operation. The cloud server can obtain the session key before or after performing the signature operation, or obtain the session key while performing the signature operation. The session key can be stored in the cloud server, or in a reference storage device other than the cloud server. In the case where the session key is stored in the cloud server, the cloud server directly obtains the stored session key, and the efficiency of obtaining the session key is high. In the case where the session key is stored in a reference storage device other than the cloud server, the cloud server sends a first acquisition request to the reference storage device, and the first acquisition request is used to request to obtain the session key, and receive the session key returned by the reference storage device based on the first acquisition request.

[0067] Figure 4 This is a schematic diagram of a signature operation process provided by an embodiment of the present application. Figure 4 As shown, the network configuration information is hashed based on the reference hash algorithm to obtain a first hash value, and the first hash value is encrypted based on the private key of the asymmetric encryption algorithm to obtain a digital signature. Then, the network configuration information and the digital signature are encrypted based on the session key to obtain first encrypted information, and the first encrypted information is used to obtain a first message.

[0068] In a possible implementation, the cloud server also verifies the first device that sends the network configuration information. If the verification is successful, the cloud server executes a signing operation on the network configuration information using a private key based on an asymmetric algorithm. For example, the cloud server stores a device whitelist, and the device whitelist includes the media access control (MAC) address of the authorized device. The cloud server obtains the MAC address of the first device and determines whether the device whitelist includes the MAC address of the first device. In the case where the device whitelist includes the MAC address of the first device, the first device is determined to be an authorized device, and the first device is verified. In the case where the device whitelist does not include the MAC address of the first device, the first device is determined to be not an authorized device, and the first device is verified. Exemplarily, the network configuration information message includes the network configuration information and the MAC address of the first device, so that the efficiency of transmitting the network configuration information and the MAC address of the first device is high.

[0069] Step 202: Verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0070] In one possible implementation, the first device stores a public key of an asymmetric encryption algorithm. For example, during production testing, after burning the firmware, the Wi-Fi device obtains the public key of the asymmetric encryption algorithm from the cloud server and writes the obtained public key into a read-only flash area. The Wi-Fi device can also report the MAC address to the cloud server at the same time, so that the cloud server can generate a device whitelist based on the MAC address reported by the device. The public key of the asymmetric encryption algorithm stored in the first device corresponds to the private key used to perform the signature operation, and the public key and the private key are called a public / private key pair. Devices that use the public key and private key of an asymmetric encryption algorithm are called devices in an asymmetric crypto system.

[0071] In a possible implementation, when the first message includes first encrypted information, and the first encrypted information is obtained by encrypting the network configuration information and the digital signature based on the session key, the digital signature is verified based on the public key of the asymmetric encryption algorithm, including: obtaining the session key; decrypting the first encrypted information based on the session key to obtain the network configuration information and the digital signature; and verifying the digital signature based on the public key of the asymmetric encryption algorithm.

[0072] For example, the first device stores a session key, or the session key is stored in a reference storage device other than the first device. In the case where the first device stores a session key, the first device directly obtains the stored session key, and the efficiency of obtaining the session key is high. In the case where the session key is stored in a reference storage device other than the first device, the first device sends a second acquisition request to the reference storage device, the second acquisition request is used to request to obtain the session key, and receives the session key returned by the reference storage device based on the second acquisition request.

[0073] Exemplarily, when the signature operation includes performing hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key, verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: decrypting the digital signature based on the public key of the asymmetric encryption algorithm to obtain a first hash value; performing hash calculation on the network configuration information based on the reference hash algorithm to obtain a second hash value; and determining that the verification is passed when the first hash value is consistent with the second hash value. The method for calculating the second hash value is the same as the principle of calculating the first hash value, and will not be repeated here.

[0074] Figure 5 Schematic diagram of a digital signature verification process provided by an embodiment of the present application. Figure 5As shown, the first encrypted information is decrypted based on the session key to obtain the network configuration information and the digital signature. Then, the digital signature is decrypted using the public key of the asymmetric encryption algorithm to obtain the first hash value, and the network configuration information is hashed based on the reference hash algorithm to obtain the second hash value. After that, it is determined whether the first hash value and the second hash value are consistent; if the first hash value and the second hash value are consistent, it is determined that the verification is passed; if the first hash value and the second hash value are inconsistent, it is determined that the verification is not passed.

[0075] Step 203: if the verification is successful, obtain a second message based on the network configuration information and the digital signature, and broadcast the second message, so that a second device that monitors the second message joins the Wi-Fi network based on the second message.

[0076] In a possible implementation, when the verification is successful, the first device fills the network configuration information and the digital signature into the payload of the action frame to obtain the action frame, and uses the action frame as the second message. The function of the action frame is relatively simple and is usually used to trigger measurement operations. Therefore, compared with the method of carrying the network configuration information and the digital signature in other management frames, carrying the network configuration information and the digital signature in the action frame can avoid triggering additional operations and causing failures.

[0077] Exemplarily, the first device encrypts the network configuration information and the digital signature, and encapsulates the encrypted information in the second message, thereby further improving the security of transmitting the network configuration information and the digital signature. For example, obtaining the second message based on the network configuration information and the digital signature includes: encrypting the network configuration information and the digital signature based on the session public key to obtain the second encrypted information; encapsulating the second encrypted information to obtain the second message, and the payload of the second message includes the second encrypted information.

[0078] The first device may broadcast the second message periodically, thereby increasing the probability that the second device monitors the second message. In addition, if the verification fails, the first device may discard the first message.

[0079] Figure 6 Schematic diagram of a device network configuration method provided in an embodiment of the present application. Figure 6 As shown, the process includes but is not limited to steps 601 to 608.

[0080] Step 601: A first device sends a network configuration information message to a reference access point.

[0081] Step 602: forward the network configuration information message to the cloud server with reference to the access point.

[0082] Step 603: The cloud server signs the network configuration information based on the private key of the asymmetric encryption algorithm to obtain a digital signature.

[0083] Step 604: The cloud server obtains a first message based on the network configuration information and the digital signature.

[0084] Step 605: The cloud server sends a first message to the reference access point.

[0085] Step 606: forward the first message to the first device with reference to the access point.

[0086] Step 607: After receiving the first message, the first device verifies the digital signature based on the public key of the asymmetric encryption algorithm.

[0087] Step 608: If the verification is successful, the first device obtains the second message based on the network configuration information and the digital signature, and broadcasts the second message.

[0088] In the method provided in the present application, the first device broadcasts the second message, so that each second device that has not joined the Wi-Fi network can join the Wi-Fi network based on the second message when monitoring the broadcast second message. In the case where the number of second devices that have not joined the Wi-Fi network is large, the efficiency of the second devices joining the Wi-Fi network is high. That is, the network configuration efficiency of the second devices is high.

[0089] Furthermore, the first device only needs to verify the digital signature in the received first message, obtain the second message and broadcast the second message if the verification is successful. Since the digital signature is obtained based on the private key of the asymmetric encryption algorithm, the first device cannot modify the digital signature. Compared with the method of encrypting the network configuration information only by the first device, the digital signature has higher security, so that if the verification is successful, the reliability of the received network configuration information is higher.

[0090] The present application also provides another device network configuration method. Figure 7 The method is applied to a second device, which is a device that has not joined the Wi-Fi network established by the reference access point. For example, the method is Figure 1 The Wi-Fi device 101 shown in the figure performs the method, and the Wi-Fi device 101 performing the method does not join the Wi-Fi network established by the access point 102. Figure 7 As shown, the method includes but is not limited to steps 701 to 703.

[0091] Step 701, monitoring a second message broadcast by a first device, where the first device is a device that has joined a Wi-Fi network, and the second message includes network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information using a private key based on an asymmetric encryption algorithm.

[0092] Exemplarily, the second device enters the monitoring mode after power-on, and monitors the second message in the monitoring mode. For example, the second device monitors all management frames in the monitoring mode, and when the second message is an action frame, the second device monitors the second message by monitoring the action frame.

[0093] Exemplarily, the digital signature is obtained by the cloud server signing the network configuration information based on a private key.

[0094] Step 702: Verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0095] The principle of step 702 is the same as that of step 202. For example, when the second message includes the second encrypted information, and the second encrypted information is obtained by encrypting the network configuration information and the digital signature based on the session key, verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: obtaining the session key; decrypting the second encrypted information based on the session key to obtain the network configuration information and the digital signature; and verifying the digital signature based on the public key of the asymmetric encryption algorithm.

[0096] In a possible implementation, the second device stores a session key, or the session key is stored in a reference storage device other than the second device. In the case where the second device stores the session key, the second device directly obtains the stored session key, and the efficiency of obtaining the session key is high. In the case where the session key is stored in a reference storage device other than the second device, the second device sends a third acquisition request to the reference storage device, the third acquisition request is used to request to obtain the session key, and receives the session key returned by the reference storage device based on the third acquisition request.

[0097] Exemplarily, when the signature operation includes performing hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key, verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: decrypting the digital signature based on the public key of the asymmetric encryption algorithm to obtain a first hash value; performing hash calculation on the network configuration information based on the reference hash algorithm to obtain a third hash value; and determining that the verification is passed when the first hash value is consistent with the third hash value. The method for calculating the third hash value is the same as the principle of the method for calculating the first hash value, and will not be repeated here.

[0098] Step 703: If the verification is successful, join the Wi-Fi network based on the network configuration information.

[0099] The manner in which the second device joins the Wi-Fi network based on the network configuration information can be referred to the manner in which a Wi-Fi device that has not joined the Wi-Fi network joins the Wi-Fi network based on the network configuration information in the related art, and will not be further described in the embodiments of the present application.

[0100] Exemplarily, when the verification fails, the second device discards the second message.

[0101] In the method provided in the present application, by monitoring the second message broadcast by the first device, each second device that has not joined the Wi-Fi network can join the Wi-Fi network based on the second message when monitoring the broadcast second message. In the case where the number of second devices that have not joined the Wi-Fi network is large, the efficiency of the second devices joining the Wi-Fi network is high. That is, the network configuration efficiency of the second devices is high.

[0102] Furthermore, since the digital signature is obtained based on the private key of the asymmetric encryption algorithm, the first device cannot modify the digital signature. Compared with the method of encrypting the network configuration information only by the first device, the digital signature has higher security, so that when the verification is passed, the reliability of the received network configuration information is higher.

[0103] See also Figure 8 An embodiment of the present application provides a device network configuration apparatus, which is applied to a first device, where the first device is a device that has joined a Wi-Fi network established by a reference access point. The apparatus includes but is not limited to: an acquisition module 801 and a verification module 802.

[0104] Among them, the acquisition module 801 is used to receive a first message, the first message includes network configuration information and a digital signature, and the digital signature is obtained by signing the network configuration information based on a private key of an asymmetric encryption algorithm; the verification module 802 is used to verify the digital signature based on a public key of an asymmetric encryption algorithm; the acquisition module 801 is also used to obtain a second message based on the network configuration information and the digital signature when the verification is passed, and broadcast the second message, so that a second device that monitors the second message joins the Wi-Fi network based on the second message.

[0105] In one possible implementation, the device also includes: a sending module 803, used to send network configuration information to a cloud server through a reference access point; an acquisition module 801, used to receive a first message from the cloud server, and the digital signature is obtained by the cloud server signing the network configuration information based on a private key of an asymmetric encryption algorithm.

[0106] In one possible implementation, the first message includes first encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; the verification module 802 is used to obtain the session key; decrypt the first encrypted information based on the session key to obtain the network configuration information and the digital signature; and verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0107] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; a verification module 802 is used to decrypt the digital signature based on a public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a second hash value; and determining that the verification is successful when the first hash value is consistent with the second hash value.

[0108] In a possible implementation, the acquisition module 801 is used to encrypt the network configuration information and the digital signature based on the session public key to obtain second encrypted information; encapsulate the second encrypted information to obtain a second message, and the payload of the second message includes the second encrypted information.

[0109] When the above device is applied to the first device, the first device broadcasts the second message, so that each second device that has not joined the Wi-Fi network can join the Wi-Fi network based on the second message when monitoring the broadcast second message. When the number of second devices that have not joined the Wi-Fi network is large, the efficiency of the second devices joining the Wi-Fi network is high. That is, the network configuration efficiency of the second devices is high.

[0110] Furthermore, the first device only needs to verify the digital signature in the received first message, obtain the second message and broadcast the second message if the verification is successful. Since the digital signature is obtained based on the private key of the asymmetric encryption algorithm, the first device cannot modify the digital signature. Compared with the method of encrypting the network configuration information only by the first device, the digital signature has higher security, so that if the verification is successful, the reliability of the received network configuration information is higher.

[0111] See also Fig. 9 , an embodiment of the present application provides another device network configuration device, which is applied to a second device, and the second device is a device that has not joined the Wi-Fi network established by the reference access point. The device includes but is not limited to: a monitoring module 901, a verification module 902 and a network configuration module 903.

[0112] Among them, the monitoring module 901 is used to monitor the second message broadcast by the first device, the first device is a device that has joined the Wi-Fi network, the second message includes network configuration information and a digital signature, and the digital signature is obtained by signing the network configuration information based on the private key of the asymmetric encryption algorithm; the verification module 902 is used to verify the digital signature based on the public key of the asymmetric encryption algorithm; the network configuration module 903 is used to join the Wi-Fi network based on the network configuration information when the verification is passed.

[0113] In a possible implementation, the digital signature is obtained by the cloud server signing the network configuration information with a private key based on an asymmetric encryption algorithm.

[0114] In one possible implementation, the second message includes second encrypted information, which is obtained by encrypting the network configuration information and the digital signature based on the session key; the verification module 902 is used to obtain the session key; decrypt the second encrypted information based on the session key to obtain the network configuration information and the digital signature; and verify the digital signature based on the public key of the asymmetric encryption algorithm.

[0115] In one possible implementation, the signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on a private key of an asymmetric encryption algorithm; a verification module 902 is used to decrypt the digital signature based on a public key of the asymmetric encryption algorithm to obtain a first hash value; performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a third hash value; and determining that the verification is successful when the first hash value is consistent with the third hash value.

[0116] In a possible implementation manner, the second message is an action frame.

[0117] When the above device is applied to the second device, by monitoring the second message broadcast by the first device, each second device that has not joined the Wi-Fi network can join the Wi-Fi network based on the second message when monitoring the broadcast second message. When the number of second devices that have not joined the Wi-Fi network is large, the efficiency of the second devices joining the Wi-Fi network is high. That is, the network configuration efficiency of the second devices is high.

[0118] Furthermore, since the digital signature is obtained based on the private key of the asymmetric encryption algorithm, the first device cannot modify the digital signature. Compared with the method of encrypting the network configuration information only by the first device, the digital signature has higher security, so that when the verification is passed, the reliability of the received network configuration information is higher.

[0119] When the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0120] Fig.10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device can be Figure 1The Wi-Fi device 101 is shown. Figure 2 and Figure 6 The first device shown, or Figure 7 Any device in the second device shown. Electronic devices may have relatively large differences due to different configurations or performances. For example, the electronic device includes one or more processors 1001 and one or more memories 1002, wherein the processor 1001 may be a central processing unit (CPU), and at least one computer program is stored in one or more memories 1002, and at least one computer program is loaded and executed by one or more processors 1001, so that the electronic device implements the device network configuration method provided by the above-mentioned various method embodiments. The electronic device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device may also include other components for implementing device functions, which will not be described here.

[0121] In an exemplary embodiment, a chip is also provided. The chip includes a processor, and the processor is used to call and execute instructions stored in the memory from the memory, so that a device equipped with the chip executes any of the above-mentioned device network configuration methods.

[0122] In an exemplary embodiment, an electronic device is also provided, the electronic device includes the above chip. In an exemplary embodiment, an electronic device is also provided, the electronic device includes a processor and a memory, and at least one computer program is stored in the memory. The at least one computer program is loaded and executed by one or more processors to enable the electronic device to implement any of the above device network configuration methods.

[0123] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor of an electronic device to enable the electronic device to implement any of the above-mentioned device network configuration methods.

[0124] In one possible implementation, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0125] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes any of the above-mentioned device network configuration methods.

[0126] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0127] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0128] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0129] The embodiments described in the above exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0130] The above are merely exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A device network configuration method, characterized in that: The method is applied to a first device, where the first device is a device that has joined a wireless fidelity Wi-Fi network established by a reference access point, and the method includes: Receive a first message, where the first message includes network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm; Verifying the digital signature based on the public key of the asymmetric encryption algorithm; If the verification is successful, a second message is obtained based on the network configuration information and the digital signature, and the second message is broadcasted, so that a second device that monitors the second message joins the Wi-Fi network based on the second message.

2. The method according to claim 1, characterized in that Before receiving the first message, the method further includes: Sending the network configuration information to a cloud server via the reference access point; The receiving of the first message comprises: A first message is received from the cloud server, wherein the digital signature is obtained by the cloud server performing a signing operation on the network configuration information based on the private key.

3. The method according to claim 1 or 2, characterized in that: The first message includes first encrypted information, where the first encrypted information is obtained by encrypting the network configuration information and the digital signature based on a session key; The verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: Obtaining the session key; Decrypting the first encrypted information based on the session key to obtain the network configuration information and the digital signature; The digital signature is verified based on the public key.

4. The method according to claim 1 or 2, characterized in that: The signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on the private key; The verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: Decrypting the digital signature based on the public key to obtain the first hash value; Performing hash calculation on the network configuration information based on the reference hash algorithm to obtain a second hash value; When the first hash value is consistent with the second hash value, it is determined that the verification is successful.

5. The method according to claim 1 or 2, characterized in that: The acquiring the second message based on the network configuration information and the digital signature includes: Encrypting the network configuration information and the digital signature based on the session public key to obtain second encrypted information; The second encrypted information is encapsulated to obtain the second message, wherein the payload of the second message includes the second encrypted information.

6. A device network configuration method, characterized in that: The method is applied to a second device, where the second device is a device that has not joined a wireless fidelity Wi-Fi network established by a reference access point, and the method includes: monitoring a second message broadcast by a first device, where the first device is a device that has joined the Wi-Fi network, and the second message includes network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm; Verifying the digital signature based on the public key of the asymmetric encryption algorithm; If the verification is successful, join the Wi-Fi network based on the network configuration information.

7. The method according to claim 6, characterized in that The digital signature is obtained by the cloud server signing the network configuration information based on the private key.

8. The method according to claim 6 or 7, characterized in that: The second message includes second encrypted information, where the second encrypted information is obtained by encrypting the network configuration information and the digital signature based on a session key; The verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: Obtaining the session key; Decrypting the second encrypted information based on the session key to obtain the network configuration information and the digital signature; The digital signature is verified based on the public key.

9. The method according to claim 6 or 7, characterized in that: The signing operation includes: performing a hash calculation on the network configuration information based on a reference hash algorithm to obtain a first hash value, and encrypting the first hash value based on the private key; The verifying the digital signature based on the public key of the asymmetric encryption algorithm includes: Decrypting the digital signature based on the public key to obtain the first hash value; Performing hash calculation on the network configuration information based on the reference hash algorithm to obtain a third hash value; When the first hash value is consistent with the third hash value, it is determined that the verification is successful.

10. The method according to claim 6 or 7, characterized in that: The second message is an action frame.

11. A device for network distribution, characterized in that: The apparatus is applied to a first device, where the first device is a device that has joined a wireless fidelity Wi-Fi network established by a reference access point, and the apparatus includes: An acquisition module, configured to receive a first message, wherein the first message includes network configuration information and a digital signature, wherein the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm; A verification module, used to verify the digital signature based on the public key of the asymmetric encryption algorithm; The acquisition module is further configured to, when the verification is successful, acquire a second message based on the network configuration information and the digital signature, and broadcast the second message, so that a second device that monitors the second message joins the Wi-Fi network based on the second message.

12. A device for network distribution, characterized in that: The apparatus is applied to a second device, where the second device is a device that has not joined a wireless fidelity Wi-Fi network established by a reference access point, and the apparatus includes: a monitoring module, configured to monitor a second message broadcast by a first device, where the first device is a device that has joined the Wi-Fi network, and the second message includes network configuration information and a digital signature, where the digital signature is obtained by signing the network configuration information with a private key based on an asymmetric encryption algorithm; A verification module, used to verify the digital signature based on the public key of the asymmetric encryption algorithm; The network configuration module is used to join the Wi-Fi network based on the network configuration information when the verification is passed.

13. A chip, characterized in that: The chip includes a processor, which is used to call and run instructions stored in the memory from the memory, so that the device installed with the chip executes the device network configuration method as described in any one of claims 1-5, or executes the device network configuration method as described in any one of claims 6-10.

14. An electronic device, characterized in that: The electronic device comprises the chip as claimed in claim 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor of a computer so that the computer implements the device network configuration method as described in any one of claims 1 to 5, or implements the device network configuration method as described in any one of claims 6 to 10.

16. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the device network configuration method as described in any one of claims 1 to 5, or executes the device network configuration method as described in any one of claims 6 to 10.

Citation Information

Cited By

  • WIFI networking method, swan-gap equipment, intelligent terminal and medium

    CN118900413A