WO2023001082A1 - 一种配网方法及装置 - Google Patents

一种配网方法及装置 Download PDF

Info

Publication number
WO2023001082A1
WO2023001082A1 PCT/CN2022/106098 CN2022106098W WO2023001082A1 WO 2023001082 A1 WO2023001082 A1 WO 2023001082A1 CN 2022106098 W CN2022106098 W CN 2022106098W WO 2023001082 A1 WO2023001082 A1 WO 2023001082A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
network
information
router
wireless access
Prior art date
Application number
PCT/CN2022/106098
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP22845247.0A priority Critical patent/EP4344274A4/en
Priority to US18/577,933 priority patent/US20240323675A1/en
Publication of WO2023001082A1 publication Critical patent/WO2023001082A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/043Key management, e.g. using generic bootstrapping architecture [GBA] using a trusted network node as an anchor
    • H04W12/0431Key distribution or pre-distribution; Key agreement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/50Secure pairing of devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information

Definitions

  • the present application relates to the technical field of communications, and in particular to a network distribution method and device.
  • Smart home devices may be, for example, smart cameras, smart speakers, smart plugs, and the like. Usually these devices need to be connected to the Wi-Fi at home to work properly.
  • the smart home devices listed above are inconvenient for users to directly input distribution network information (such as the name and password of the router).
  • users can use electronic devices such as mobile phones and tablet computers to perform network distribution for the above-mentioned electronic devices that are not convenient for users to directly input distribution network information.
  • various manufacturers have also implemented various simple network distribution methods. These distribution network methods have some security loopholes, which have brought great challenges to users' information security. Therefore, how to realize safe and convenient distribution network is an urgent problem to be solved.
  • the embodiment of the present application provides a network distribution method and device, which improves the security when the wireless access device is used for network distribution of electronic equipment, and reduces manual intervention in the network distribution process (for example, the user does not need to manually input the wireless access device The name and password of the wireless LAN where it is located), which improves the user experience.
  • the embodiment of the present application provides a network distribution method, which can be applied to a network distribution system including a first electronic device, a wireless access device, and a server.
  • the method includes: the first electronic device accesses the wireless Access the device's unauthenticated network.
  • the wireless access device sends a first request message to the server.
  • the server After receiving the first request message, the server generates a first authorization code, where the first authorization code is different from an authorization code generated by the server after receiving a request message from another electronic device sent by the wireless access device.
  • the wireless access device and the first electronic device obtain a first authorization code, and negotiate to obtain a first key based on the first authorization code.
  • the wireless access device encrypts network distribution information of the wireless local area network where the wireless access device is located based on the first key, obtains encrypted network distribution information, and sends the encrypted network distribution information to the first electronic device.
  • the first electronic device receives the encrypted network distribution information, decrypts the encrypted network distribution information based on the first key, obtains the network distribution information, and connects to the wireless local area network where the wireless access device is located based on the network distribution information.
  • the first authorization code is randomly generated by the server in response to request messages from different electronic devices, wherein the authorization code may be randomly generated by the server according to a preset random number generation algorithm; in some implementations, it is also possible for the server to generate the same authorization code for different electronic devices.
  • the server may also generate the first authorization code and the second authorization code, the server sends the first authorization code and the second authorization code to the wireless access device, and the wireless access device saves the first authorization code to Locally, the wireless access device sends the second authorization code to the first electronic device. Afterwards, the wireless access device negotiates with the first electronic device to obtain the first key based on the first authorization code and the second authorization code. When the first authorization code is the same as the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code. When the first authorization code is different from the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on different authorization codes.
  • the first electronic device can be any of the following: smart lights, smart ovens, smart fans, smart air conditioners, smart TVs, smart big screens, smart bracelets, smart watches, smart speakers, smart refrigerators, smart doors and windows, smart cars, Smart monitors, smart robots, smart cameras, etc.
  • the network distribution method does not require the user to input the name and password of the wireless local area network where the wireless access device is located, and the operation is simple.
  • the wireless access device is always in the AP mode. In this way, ongoing services of other devices connected to the wireless access device will not be affected.
  • the server generates different authorization codes for different electronic devices, which ensures that the high-density channels used by each electronic device are not the same. ) transfer security, ensuring the security of the distribution network process.
  • the method further includes: the first electronic device sends the first authorization code to the server through the wireless access device The first authentication information locally stored on the device; the server receives the first authentication information, and determines that the first electronic device is a legitimate device according to the first authentication information.
  • the server judges that the first authentication information satisfies the first condition, it determines that the first electronic device is a legitimate device.
  • the first authentication information includes first registration information.
  • the server After the server receives the first request information and before the server receives the first authentication information sent by the wireless access device, the server generates the first registration information (such as a registration code), and saves the first registration information locally to obtain the second registration information information.
  • the server sends the first registration information to the first electronic device through the wireless access device. After receiving the first registration information, the first electronic device saves the first registration information locally.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. That is, when the server confirms that the first registration information sent by the first electronic device through the wireless access device is the registration information of the first electronic device previously sent by the server through the wireless access device, the server can preliminarily determine that the electronic device is a legitimate device.
  • the first authentication information includes first registration information and first verification information.
  • the first inspection information may be any one of a digital certificate or a KPI certificate.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. And the first verification information is legal verification information.
  • the server before the server determines that the first verification information is valid verification information, the server generates a first random number and sends the first random number to the first electronic device through the wireless access device. After receiving the first random number, the first electronic device encrypts the first random number according to the first private key to obtain the encrypted first random number. The first electronic device sends the encrypted first random number to the server through the wireless access device. After receiving the encrypted first random number, the server decrypts the encrypted first random number according to the first public key preset in the first verification information, and after obtaining the first random number, the server determines that the first verification information is Valid verification information.
  • the server After the server determines that the first electronic device is a legitimate device through the first registration information, the server further verifies the legitimacy of the first electronic device according to the verification information. In this way, the security of subsequent transmission of distribution network information can be improved.
  • the server will generate the first authorization code for the first electronic device to negotiate with the wireless access device to obtain the first key and transfer the distribution network information.
  • the server determines that the first electronic device is not a legitimate device through the first authentication information, then the server will not generate the first authorization code, and the first electronic device cannot obtain network distribution information, and the first electronic device cannot join the wireless access device In this way, the security in the process of network distribution is guaranteed.
  • the method further includes: the first electronic device based on the local The saved preset parameters and the wireless access device negotiate to obtain a second key based on the locally saved preset parameters; the first electronic device sends the first authentication information locally stored by the first electronic device to the server through the wireless access device, specifically including : The first electronic device encrypts the first authentication information based on the second key to obtain the encrypted first authentication information; the first electronic device sends the encrypted first authentication information to the wireless access device; the wireless access device receives the encrypted After obtaining the first authentication information, the encrypted first authentication information is decrypted based on the second key to obtain the first authentication information; the wireless access device sends the first authentication information to the server.
  • the wireless access device before the wireless access device sends the first registration information to the first electronic device, the wireless access device encrypts the first registration information with a second key to obtain encrypted first registration information. The wireless access device sends the encrypted first registration information to the first electronic device. In this way, the security of information transmission between the first electronic device and the wireless access device can be guaranteed.
  • the first electronic device before the first electronic device initiates a registration request to the server (or before the first electronic device sends the first authentication information to the server through the wireless access device), if the first electronic device and the wireless access device can pass the local After the stored preset parameters are negotiated to obtain the second key, the first electronic device can be considered as a preliminary legal device, and the first electronic device can initiate a registration request to the server through the wireless access device.
  • the first electronic device that initiates a registration request to the server is a preliminary legal electronic device, that is, the first electronic device stores preset parameters.
  • the information transmitted between the first electronic device and the wireless access device is transmitted after being encrypted by the second key, which can ensure the security of information transmission between the first electronic device and the wireless access device.
  • the first authorization code includes m authorization codes, where m is a positive integer greater than or equal to 1; the wireless access device and the first electronic device negotiate to obtain the first authorization code based on the first authorization code.
  • a key specifically including: the wireless access device negotiates with the first electronic device based on x authorization codes in the first authorization code and obtains the first key based on y authorization codes in the first authorization code; wherein, x is greater than or equal to 1 is less than or equal to m, and y is greater than or equal to 1 and less than or equal to m.
  • the server sends the first authorization code to the wireless access device
  • the wireless access device stores the first authorization code locally
  • the wireless access device also needs to send the first authorization code to the first electronic device.
  • the wireless access device and the first electronic device may select part or all of the authorization codes from the first authorization codes and negotiate to obtain the first key.
  • the x authorization codes in the first authorization code are the same as the y authorization codes in the first authorization code, then the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code .
  • the x authorization codes in the first authorization code are different from the y authorization codes in the first authorization code, and the wireless access device and the first electronic device negotiate to obtain the first password based on different authorization codes. key.
  • the method further includes: the wireless access device sends the non-authentication network access information of the wireless access device; the first electronic device accessing the non-authentication network of the wireless access device specifically includes: the first electronic device receives the access information, and accesses the non-authentication network of the wireless access device based on the access information.
  • the first user operation group may be the pressing operation of the network configuration key of the wireless access device, and the access information of the non-authenticated network may include the identifier of the non-authenticated network and the physical address of the wireless access device. Only after the wireless access device receives the operation of the first user (that is, is authorized by the user), the wireless access device will send the access information of the non-authenticated network of the wireless access device.
  • the wireless access device continuously sends the access information of the non-authenticated network in response to the first user operation.
  • the third electronic device accesses the non-authentication network of the wireless access device.
  • the wireless access device sends a second request message to the server.
  • the server After receiving the second request message, the server generates a second authorization code, where the second authorization code is different from the authorization code generated by the server after receiving the request message of other electronic devices sent by the wireless access device.
  • the wireless access device and the third electronic device obtain the second authorization code, and negotiate to obtain the second key based on the second authorization code.
  • the wireless access device encrypts network distribution information of the wireless local area network where the wireless access device is located based on the second key, obtains encrypted network distribution information, and sends the encrypted network distribution information to the third electronic device.
  • the third electronic device receives the encrypted distribution network information, decrypts the encrypted distribution network information based on the second key, obtains the distribution network information, and connects to the wireless local area network where the wireless access device is located based on the distribution network information. In this way, the wireless access device only needs to receive one user operation, and continuously sends the access information of the non-authenticated network. Before the wireless access device stops sending the access information of the non-authenticated network, one or more electronic devices may be connected to the non-authenticated network of the wireless access device, then the wireless access device may adopt the same configuration as the first electronic device.
  • the network process completes the network distribution process with one or more other electronic devices (for example, the third electronic device).
  • the wireless access device only needs to receive one user operation to complete the network distribution process with multiple electronic devices, compared with the current wireless access device that receives one user operation and can only complete the network distribution process with one electronic device , improving the distribution network efficiency of electronic equipment.
  • the wireless access device after the wireless access device completes the network configuration process with the third electronic device, after the wireless access device determines that the number of electronic devices connected to the non-authentication network of the wireless access device is 0, the wireless access device The ingress device stops sending the access information of the non-authenticated network.
  • the wireless access device determines that the number of electronic devices connected to the non-authenticated network of the wireless access device is 0 and waits for a period of time. During this period, the wireless access device still continuously sends the access information of the non-authentication network. If no other electronic device is connected to the non-authentication network of the wireless access device, the wireless access device stops sending the non-authentication Network access information.
  • the network distribution system further includes a second electronic device, and before the server generates the first authorization code, the method further includes: the second electronic device receives an operation by the second user, and the second user The operation is used to instruct the wireless access device to send the access information of the non-authenticated network.
  • the operation of the second user is used to control the wireless access device to send the access information of the non-authenticated network.
  • the wireless access device displays prompt information on the application program on the mobile phone of the second electronic device that has been connected to the network through the server, so that the user can view
  • the prompt information is used to prompt the user to input a second user operation on the network configuration interface on the application program, so that the wireless access device sends the access information of the non-authenticated network. That is to say, the user may not press the network allocation key on the wireless access device (that is, the first user operates), and the wireless access device may also send the access information of the non-authenticated network. It can ensure that when it is inconvenient for the user to press the network allocation key of the wireless access device, the user can control the wireless access device to send access information of the non-authenticated network on the application program.
  • the second user operation may also be controlling the server to send the first authorization code to the wireless access device and the first electronic device.
  • the server displays prompt information on the application program on the mobile phone of the second electronic device, so that the user can see the prompt information.
  • the prompt information is used to prompt the user to input a second user operation on the network configuration interface of the application program, so that the server sends the first authorization code to the wireless access device and the first electronic device.
  • the number of the first electronic device is one or more
  • the method further includes: the second electronic device displays the first A user interface, the first user interface includes one or more device identifiers corresponding to one or more first electronic devices; after the second electronic device receives the user's second user operation, the method further includes: the second electronic device displays the first Two user interfaces, the second user interface includes one or more status identifiers corresponding to one or more first electronic devices, and the one or more status identifiers are used to indicate that one or more first electronic devices have completed network distribution, or, One or more first electronic devices are connected to the network.
  • the second user interface may further include information such as one or more device identifiers corresponding to the one or more first electronic devices.
  • the server After the server verifies that the first electronic device is a legitimate device, the server associates the first electronic device with the wireless access device with the same account. In this way, the user can check the networking status of the second electronic device on the application program of the second electronic device, and the networking status includes but not limited to online, offline, in network distribution, network distribution failure and so on.
  • the method before the first electronic device accesses the non-authentication network of the wireless access device, the method further includes: the first electronic device broadcasts the network configuration information element of the first electronic device, Wherein, the distribution network information element is used to enable other electronic devices to discover the first electronic device that is in the state of waiting for network distribution.
  • the distribution network information element of the first electronic device includes one or more of the following: an identifier of the first electronic device, whether the first electronic device supports interconnection capabilities, a physical address of the first electronic device, and the like.
  • the network configuration information includes a name and a password of the wireless local area network where the wireless access device is located.
  • the embodiment of the present application provides a network distribution method applied to the first electronic device, the method includes: accessing the non-authentication network of the wireless access device; obtaining the first authorization code, the first authorization code is provided by the server Generated, wherein the first authorization code is different from the authorization codes received by other electronic devices accessing the non-authentication network of the wireless access device; based on the first authorization code, negotiate with the wireless access device to determine the first key; receive The encrypted network distribution information sent by the wireless access device is decrypted based on the first key to obtain the network distribution information; based on the network distribution information, the wireless local area network where the wireless access device is located is connected.
  • the first authorization code is randomly generated by the server in response to request messages from different electronic devices, wherein the authorization code may be randomly generated by the server according to a preset random number generation algorithm; in some implementations, it is also possible for the server to generate the same authorization code for different electronic devices.
  • the server may also generate the first authorization code and the second authorization code, the server sends the first authorization code and the second authorization code to the wireless access device, and the wireless access device saves the first authorization code to Locally, the wireless access device sends the second authorization code to the first electronic device. Afterwards, the wireless access device negotiates with the first electronic device to obtain the first key based on the first authorization code and the second authorization code. When the first authorization code is the same as the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code. When the first authorization code is different from the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on different authorization codes.
  • the first electronic device can be any of the following: smart lights, smart ovens, smart fans, smart air conditioners, smart TVs, smart big screens, smart bracelets, smart watches, smart speakers, smart refrigerators, smart doors and windows, smart cars, Smart monitors, smart robots, smart cameras, etc.
  • the network distribution method does not require the user to input the name and password of the wireless local area network where the wireless access device is located, and the operation is simple.
  • the wireless access device is always in the AP mode. In this way, ongoing services of other devices connected to the wireless access device will not be affected.
  • the server generates different authorization codes for different electronic devices, which ensures that the high-density channels used by each electronic device are not the same. ) transfer security, ensuring the security of the distribution network process.
  • the method before obtaining the first authorization code, further includes: sending the first authentication information locally stored by the first electronic device to the server through the wireless access device; wherein, the first The authentication information is used by the server to determine that the first electronic device is a legitimate device.
  • the server judges that the first authentication information satisfies the first condition, it determines that the first electronic device is a legitimate device.
  • the first authentication information includes first registration information.
  • the server After the server receives the first request information and before the server receives the first authentication information sent by the wireless access device, the server generates the first registration information (such as a registration code), and saves the first registration information locally to obtain the second registration information information.
  • the server sends the first registration information to the first electronic device through the wireless access device. After receiving the first registration information, the first electronic device saves the first registration information locally.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. That is, when the server confirms that the first registration information sent by the first electronic device through the wireless access device is the registration information of the first electronic device previously sent by the server through the wireless access device, the server can preliminarily determine that the electronic device is a legitimate device.
  • the first authentication information includes first registration information and first verification information.
  • the first inspection information may be any one of a digital certificate or a KPI certificate.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. And the first verification information is legal verification information.
  • the server before the server determines that the first verification information is valid verification information, the server generates a first random number and sends the first random number to the first electronic device through the wireless access device. After receiving the first random number, the first electronic device encrypts the first random number according to the first private key to obtain the encrypted first random number. The first electronic device sends the encrypted first random number to the server through the wireless access device. After receiving the encrypted first random number, the server decrypts the encrypted first random number according to the first public key preset in the first verification information, and after obtaining the first random number, the server determines that the first verification information is Valid verification information.
  • the server After the server determines that the first electronic device is a legitimate device through the first registration information, the server further verifies the legitimacy of the first electronic device according to the verification information. In this way, the security of subsequent transmission of distribution network information can be improved.
  • the server will generate the first authorization code for the first electronic device to negotiate with the wireless access device to obtain the first key and transfer the distribution network information.
  • the server determines that the first electronic device is not a legitimate device through the first authentication information, then the server will not generate the first authorization code, and the first electronic device cannot obtain network distribution information, and the first electronic device cannot join the wireless access device In this way, the security of the network distribution process is guaranteed.
  • the method before sending the first authentication information locally stored by the first electronic device to the server through the wireless access device, the method further includes: based on the locally saved preset parameters and the wireless access The access device negotiates to obtain the second key based on the locally saved preset parameters; the wireless access device sends the first authentication information locally stored by the first electronic device to the server, which specifically includes: based on the second key, the first authentication information stored locally Encrypting the authentication information to obtain encrypted first authentication information; sending the encrypted first authentication information to the wireless access device; where the encrypted first authentication information is used by the wireless access device to encrypt the first authentication information based on the second key After the information is decrypted, the first authentication information is obtained, and the first authentication information is sent to the server.
  • the wireless access device before the wireless access device sends the first registration information to the first electronic device, the wireless access device encrypts the first registration information with a second key to obtain encrypted first registration information. The wireless access device sends the encrypted first registration information to the first electronic device. In this way, the security of information transmission between the first electronic device and the wireless access device can be guaranteed.
  • the first electronic device before the first electronic device initiates a registration request to the server (or before the first electronic device sends the first authentication information to the server through the wireless access device), if the first electronic device and the wireless access device can pass the local After the stored preset parameters are negotiated to obtain the second key, the first electronic device can be considered as a preliminary legal device, and the first electronic device can initiate a registration request to the server through the wireless access device.
  • the first electronic device that initiates a registration request to the server is a preliminary legal electronic device, that is, the first electronic device stores preset parameters.
  • the information transmitted between the first electronic device and the wireless access device is transmitted after being encrypted by the second key, which can ensure the security of information transmission between the first electronic device and the wireless access device.
  • the first authorization code includes m authorization codes, where m is a positive integer greater than or equal to 1; based on the first authorization code, negotiate with the wireless access device to determine the first key , specifically includes: negotiating with the wireless access device based on x authorization codes in the first authorization code and obtaining the first key based on y authorization codes in the first authorization code; wherein, x is greater than or equal to 1 and less than or equal to m, and y is greater than Equal to 1 and less than or equal to m.
  • the server sends the first authorization code to the wireless access device
  • the wireless access device stores the first authorization code locally
  • the wireless access device also needs to send the first authorization code to the first electronic device.
  • the wireless access device and the first electronic device may select part or all of the authorization codes from the first authorization codes and negotiate to obtain the first key.
  • the x authorization codes in the first authorization code are the same as the y authorization codes in the first authorization code, then the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code .
  • the x authorization codes in the first authorization code are different from the y authorization codes in the first authorization code, and the wireless access device and the first electronic device negotiate to obtain the first password based on different authorization codes. key.
  • the method before accessing the non-authentication network of the wireless access device, the method further includes: receiving access information sent by the wireless access device;
  • the authentication network specifically includes: a non-authentication network for accessing wireless access devices based on access information.
  • the access information of the non-authenticated network may include the identifier of the non-authenticated network, the physical address of the wireless access device, and the like.
  • the method before accessing the non-authentication network of the wireless access device, the method further includes: broadcasting a network configuration information element of the first electronic device, where the network allocation information element is used to The other electronic devices are made to discover the first electronic device in the state of waiting for network configuration.
  • the network configuration information includes a name and a password of the wireless local area network where the wireless access device is located.
  • the embodiment of the present application provides a network distribution method applied to a wireless access device, the method includes: after the first electronic device accesses the non-authentication network of the wireless access device, sending a first request to the server message; wherein, the first request message is used for the server to generate a first authorization code, wherein the first authorization code is different from the authorization code sent by the wireless access device to other electronic devices that access the non-authentication network of the wireless access device; obtain The first authorization code, and based on the first authorization code, negotiate with the first electronic device to determine the first key; encrypt the distribution network information of the wireless local area network where the wireless access device is located based on the first key, and obtain encrypted distribution network information, And send the encrypted distribution network information to the first electronic device; wherein, the encrypted distribution network information is used for the first electronic device to decrypt the encrypted distribution network information based on the first key to obtain the distribution network information, and based on the distribution network information Connect to the wireless LAN where the wireless access device is located.
  • the first authorization code is randomly generated by the server in response to request messages from different electronic devices, wherein the authorization code may be randomly generated by the server according to a preset random number generation algorithm; in some implementations, it is also possible for the server to generate the same authorization code for different electronic devices.
  • the server may also generate the first authorization code and the second authorization code, the server sends the first authorization code and the second authorization code to the wireless access device, and the wireless access device saves the first authorization code to Locally, the wireless access device sends the second authorization code to the first electronic device. Afterwards, the wireless access device negotiates with the first electronic device to obtain the first key based on the first authorization code and the second authorization code. When the first authorization code is the same as the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code. When the first authorization code is different from the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on different authorization codes.
  • the network distribution method does not require the user to input the name and password of the wireless local area network where the wireless access device is located, and the operation is simple.
  • the wireless access device is always in the AP mode. In this way, ongoing services of other devices connected to the wireless access device will not be affected.
  • the server generates different authorization codes for different electronic devices, which ensures that the high-density channels used by each electronic device are not the same. ) transfer security, ensuring the security of the distribution network process.
  • the method before obtaining the first authorization code, further includes: receiving the first authentication information locally stored in the first electronic device sent by the first electronic device; sending the first authentication information to the server. Authentication information; wherein, the first authentication information is used by the server to determine that the first electronic device is a legitimate device.
  • the server judges that the first authentication information satisfies the first condition, it determines that the first electronic device is a legitimate device.
  • the first authentication information includes first registration information.
  • the server After the server receives the first request information and before the server receives the first authentication information sent by the wireless access device, the server generates the first registration information (such as a registration code), and saves the first registration information locally to obtain the second registration information information.
  • the server sends the first registration information to the first electronic device through the wireless access device. After receiving the first registration information, the first electronic device saves the first registration information locally.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. That is, when the server confirms that the first registration information sent by the first electronic device through the wireless access device is the registration information of the first electronic device previously sent by the server through the wireless access device, the server can preliminarily determine that the electronic device is a legitimate device.
  • the first authentication information includes first registration information and first verification information.
  • the first inspection information may be any one of a digital certificate or a KPI certificate.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. And the first verification information is legal verification information.
  • the server before the server determines that the first verification information is valid verification information, the server generates a first random number and sends the first random number to the first electronic device through the wireless access device. After receiving the first random number, the first electronic device encrypts the first random number according to the first private key to obtain the encrypted first random number. The first electronic device sends the encrypted first random number to the server through the wireless access device. After receiving the encrypted first random number, the server decrypts the encrypted first random number according to the first public key preset in the first verification information, and after obtaining the first random number, the server determines that the first verification information is Valid verification information.
  • the server After the server determines that the first electronic device is a legitimate device through the first registration information, the server further verifies the legitimacy of the first electronic device according to the verification information. In this way, the security of subsequent transmission of distribution network information can be improved.
  • the server will generate the first authorization code for the first electronic device to negotiate with the wireless access device to obtain the first key and transfer the distribution network information.
  • the server determines that the first electronic device is not a legitimate device through the first authentication information, then the server will not generate the first authorization code, and the first electronic device cannot obtain network distribution information, and the first electronic device cannot join the wireless access device In this way, the security of the network distribution process is guaranteed.
  • the method before receiving the first authentication information sent by the first electronic device and locally stored in the first electronic device, the method further includes: based on locally saved preset parameters and the first electronic The device negotiates to obtain the second key based on the preset parameters stored locally; receiving the first authentication information sent by the first electronic device and stored locally by the first electronic device specifically includes: receiving the encryption information based on the second key sent by the first electronic device; the first authentication information; before sending the first authentication information to the server, the method further includes: decrypting the encrypted first authentication information based on the second key to obtain the first authentication information.
  • the wireless access device before the wireless access device sends the first registration information to the first electronic device, the wireless access device encrypts the first registration information with a second key to obtain encrypted first registration information. The wireless access device sends the encrypted first registration information to the first electronic device. In this way, the security of information transmission between the first electronic device and the wireless access device can be guaranteed.
  • the first electronic device before the first electronic device initiates a registration request to the server (or before the first electronic device sends the first authentication information to the server through the wireless access device), if the first electronic device and the wireless access device can pass the local After the stored preset parameters are negotiated to obtain the second key, the first electronic device can be considered as a preliminary legal device, and the first electronic device can initiate a registration request to the server through the wireless access device.
  • the first electronic device that initiates a registration request to the server is a preliminary legal electronic device, that is, the first electronic device stores preset parameters.
  • the information transmitted between the first electronic device and the wireless access device is transmitted after being encrypted by the second key, which can ensure the security of information transmission between the first electronic device and the wireless access device.
  • the first authorization code includes m authorization codes, where m is a positive integer greater than or equal to 1; negotiating with the first electronic device to determine the first key specifically includes: based on the first x authorization codes in one authorization code and the first electronic device negotiate to obtain a first key based on y authorization codes in the first authorization code; wherein, x is greater than or equal to 1 and less than or equal to m, and y is greater than or equal to 1 and less than or equal to m.
  • the server sends the first authorization code to the wireless access device
  • the wireless access device stores the first authorization code locally
  • the wireless access device also needs to send the first authorization code to the first electronic device.
  • the wireless access device and the first electronic device may select part or all of the authorization codes from the first authorization codes and negotiate to obtain the first key.
  • the x authorization codes in the first authorization code are the same as the y authorization codes in the first authorization code, then the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code .
  • the x authorization codes in the first authorization code are different from the y authorization codes in the first authorization code, then the wireless access device and the first electronic device negotiate to obtain the first password based on different authorization codes. key.
  • the method before the first electronic device accesses the non-authentication network of the wireless access device, the method further includes: in response to the first user operation, sending access information of the non-authentication network ; Wherein, the access information is used for the first electronic device to access the non-authentication network of the wireless access device.
  • the first user operation group may be the pressing operation of the network configuration key of the wireless access device, and the access information of the non-authenticated network may include the identifier of the non-authenticated network and the physical address of the wireless access device. Only after the wireless access device receives the operation of the first user (that is, is authorized by the user), the wireless access device will send the access information of the non-authenticated network of the wireless access device.
  • the wireless access device continuously sends the access information of the non-authenticated network in response to the first user operation.
  • the third electronic device accesses the non-authentication network of the wireless access device.
  • the wireless access device sends a second request message to the server.
  • the server After receiving the second request message, the server generates a second authorization code, where the second authorization code is different from the authorization code generated by the server after receiving the request message of other electronic devices sent by the wireless access device.
  • the wireless access device and the third electronic device obtain the second authorization code, and negotiate to obtain the second key based on the second authorization code.
  • the wireless access device encrypts network distribution information of the wireless local area network where the wireless access device is located based on the second key, obtains encrypted network distribution information, and sends the encrypted network distribution information to the third electronic device.
  • the third electronic device receives the encrypted distribution network information, decrypts the encrypted distribution network information based on the second key, obtains the distribution network information, and connects to the wireless local area network where the wireless access device is located based on the distribution network information. In this way, the wireless access device only needs to receive one user operation, and continuously sends the access information of the non-authenticated network. Before the wireless access device stops sending the access information of the non-authenticated network, one or more electronic devices may be connected to the non-authenticated network of the wireless access device, then the wireless access device may adopt the same configuration as the first electronic device.
  • the network process completes the network distribution process with one or more other electronic devices (for example, the third electronic device).
  • the wireless access device only needs to receive one user operation to complete the network distribution process with multiple electronic devices, compared with the current wireless access device that receives one user operation and can only complete the network distribution process with one electronic device , improving the distribution network efficiency of electronic equipment.
  • the wireless access device after the wireless access device completes the network configuration process with the third electronic device, after the wireless access device determines that the number of electronic devices connected to the non-authentication network of the wireless access device is 0, the wireless access device The ingress device stops sending the access information of the non-authenticated network.
  • the wireless access device determines that the number of electronic devices connected to the non-authenticated network of the wireless access device is 0 and waits for a period of time. During this period, the wireless access device still continuously sends the access information of the non-authentication network. If no other electronic device is connected to the non-authentication network of the wireless access device, the wireless access device stops sending the non-authentication Network access information.
  • the method before the first electronic device accesses the non-authentication network of the wireless access device, the method further includes: receiving the network distribution information of the first electronic device broadcast by the first electronic device; element, wherein, the distribution network information element is used to enable other electronic devices to discover the first electronic device in the state of waiting for network distribution.
  • the network configuration information includes a name and a password of the wireless local area network where the wireless access device is located.
  • the embodiment of the present application provides a method for network distribution, which is applied to a server, and the method includes: receiving a first request message, and generating a first authorization code, wherein the first authorization code is different from that received by the server from the wireless access device An authorization code generated after sending a request message from another electronic device; sending the first authorization code to the wireless access device and the first electronic device, wherein the first authorization code is obtained through negotiation between the wireless access device and the first electronic device
  • the first key is used by the wireless access device to encrypt the distribution network information of the wireless local area network where the wireless access device is located based on the first key, to obtain encrypted distribution network information, and to send the encrypted network distribution information to the first electronic device
  • Distribution network information the encrypted distribution network information is used by the first electronic device to decrypt the encrypted distribution network information based on the first key to obtain the distribution network information, and connect to the wireless local area network where the wireless access device is located based on the distribution network information.
  • the first authorization code is randomly generated by the server in response to request messages from different electronic devices, wherein the authorization code may be randomly generated by the server according to a preset random number generation algorithm; in some implementations, it is also possible for the server to generate the same authorization code for different electronic devices.
  • the server may also generate the first authorization code and the second authorization code, the server sends the first authorization code and the second authorization code to the wireless access device, and the wireless access device saves the first authorization code to Locally, the wireless access device sends the second authorization code to the first electronic device. Afterwards, the wireless access device negotiates with the first electronic device to obtain the first key based on the first authorization code and the second authorization code. When the first authorization code is the same as the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on the same authorization code. When the first authorization code is different from the second authorization code, the wireless access device and the first electronic device negotiate to obtain the first key based on different authorization codes.
  • the first electronic device can be any of the following: smart lights, smart ovens, smart fans, smart air conditioners, smart TVs, smart big screens, smart bracelets, smart watches, smart speakers, smart refrigerators, smart doors and windows, smart cars, Smart monitors, smart robots, smart cameras, etc.
  • the network distribution method does not require the user to input the name and password of the wireless local area network where the wireless access device is located, and the operation is simple.
  • the wireless access device is always in the AP mode. In this way, ongoing services of other devices connected to the wireless access device will not be affected.
  • the server generates different authorization codes for different electronic devices, which ensures that the high-density channels used by each electronic device are not the same. ) transfer security, ensuring the security of the distribution network process.
  • the method before generating the first authorization code, further includes: receiving first authentication information locally stored on the first electronic device sent by the wireless access device, and The information determines that the first electronic device is a legitimate device.
  • the server judges that the first authentication information satisfies the first condition, it determines that the first electronic device is a legitimate device.
  • the first authentication information includes first registration information.
  • the server After the server receives the first request information and before the server receives the first authentication information sent by the wireless access device, the server generates the first registration information (such as a registration code), and saves the first registration information locally to obtain the second registration information information.
  • the server sends the first registration information to the first electronic device through the wireless access device. After receiving the first registration information, the first electronic device saves the first registration information locally.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. That is, when the server confirms that the first registration information sent by the first electronic device through the wireless access device is the registration information of the first electronic device previously sent by the server through the wireless access device, the server can preliminarily determine that the electronic device is a legitimate device.
  • the first authentication information includes first registration information and first verification information.
  • the first inspection information may be any one of a digital certificate or a KPI certificate.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the first electronic device locally stored by the server. And the first verification information is legal verification information.
  • the server before the server determines that the first verification information is valid verification information, the server generates a first random number and sends the first random number to the first electronic device through the wireless access device. After receiving the first random number, the first electronic device encrypts the first random number according to the first private key to obtain the encrypted first random number. The first electronic device sends the encrypted first random number to the server through the wireless access device. After receiving the encrypted first random number, the server decrypts the encrypted first random number according to the first public key preset in the first verification information, and after obtaining the first random number, the server determines that the first verification information is Valid verification information.
  • the server After the server determines that the first electronic device is a legitimate device through the first registration information, the server further verifies the legitimacy of the first electronic device according to the verification information. In this way, the security of subsequent transmission of distribution network information can be improved.
  • the server will generate the first authorization code for the first electronic device to negotiate with the wireless access device to obtain the first key and transfer the distribution network information.
  • the server determines that the first electronic device is not a legitimate device through the first authentication information, then the server will not generate the first authorization code, and the first electronic device cannot obtain network distribution information, and the first electronic device cannot join the wireless access device In this way, the security of the network distribution process is guaranteed.
  • the network configuration information includes a name and a password of the wireless local area network where the wireless access device is located.
  • an embodiment of the present application provides an electronic device, which is a first electronic device, and the first electronic device includes: one or more processors, one or more memories; one or more memories and one or more The processors are coupled, and one or more memories are used to store computer program codes, the computer program codes include computer instructions, and one or more processors invoke computer instructions to make the first electronic device execute any of the above aspects in any possible implementation manner Method steps performed by the first electronic device.
  • the embodiment of the present application provides a wireless access device, and the wireless access device includes: one or more processors, one or more memories; one or more memories are coupled to one or more processors, One or more memories are used to store computer program codes, and the computer program codes include computer instructions, and one or more processors call computer instructions to make the wireless access device execute any of the above aspects.
  • the wireless access device in any possible implementation manner The method steps performed.
  • the embodiment of the present application provides a chip device.
  • the chip device includes at least one processor and a memory, and the memory is used to store computer program codes.
  • the computer program codes include computer instructions.
  • At least one processor calls the computer instructions so that the installed
  • the first electronic device of the chip device executes the method steps executed by the first electronic device in any possible implementation manner of any aspect above.
  • the embodiment of the present application provides a chip device.
  • the chip device includes at least one processor and a memory, and the memory is used to store computer program codes.
  • the computer program codes include computer instructions.
  • At least one processor calls the computer instructions so that the installed
  • the wireless access device of the chip device executes the method steps performed by the wireless access device in any possible implementation manner of any aspect above.
  • the embodiment of the present application provides a readable storage medium for storing computer instructions, and when the computer instructions are run on the first electronic device, the first electronic device executes any possible implementation of any of the above aspects Method steps performed by the first electronic device in the manner.
  • the embodiment of the present application provides a readable storage medium, which is used to store computer instructions, and when the computer instructions are run on the wireless access device, the wireless access device performs any possible implementation of any of the above aspects. Method steps performed by the wireless access device in the manner.
  • the embodiment of the present application provides a computer program product.
  • the computer program product runs on the first electronic device
  • the first electronic device executes the first electronic program in any possible implementation manner of any of the above aspects. Method steps performed by the device.
  • the embodiment of the present application provides a computer program product, which, when the computer program product runs on a wireless access device, enables the wireless access device to perform wireless access in any possible implementation manner of any of the above aspects. Method steps performed by the device.
  • FIG. 1 is a flow chart of a method for a soft access point distribution method provided in an embodiment of the present application
  • FIG. 1A is a distribution network interface diagram provided by the embodiment of the present application.
  • FIG. 2 is a flow chart of a method for a multicast distribution network solution provided in an embodiment of the present application
  • FIG. 3 is a flow chart of a method based on an artificial intelligence Internet of Things antenna distribution network solution provided by an embodiment of the present application;
  • Fig. 3A-Fig. 3B are a set of distribution network interface diagrams provided by the embodiment of the present application.
  • FIG. 4 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device 200 provided in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a router 300 provided in an embodiment of the present application.
  • FIG. 7 is a flowchart of a method for connecting an electronic device 200 to an open ssid of a router 300 provided in an embodiment of the present application;
  • FIG. 8 is a flow chart of a method for the server 400 to generate the registration information of the electronic device 200 and complete the verification tasks of the electronic device 200 provided by the embodiment of the present application;
  • FIG. 9 is a flowchart of a method for transmitting distribution network information between an electronic device 200 and a router 300 provided in an embodiment of the present application;
  • Figures 9A-9F are UI diagrams of a group of "remote distribution network" provided by the embodiment of the present application.
  • Fig. 10A-Fig. 10C are UI diagrams of a set of "one-key distribution network" provided by the embodiment of the present application.
  • FIGS 11-13 are several flow charts of "one-key distribution network" provided by the embodiment of this application.
  • FIG. 14 is a schematic flowchart of a network distribution method provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the “multiple” The meaning is two or more.
  • UI user interface
  • the term "user interface (UI)" in the specification, claims and drawings of this application is a medium interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the internal form of information Conversion to and from a form acceptable to the user.
  • the user interface of the application program is the source code written in specific computer languages such as java and extensible markup language (XML). Such as images, text, buttons and other controls.
  • Control also known as widget (widget), is the basic element of user interface.
  • Typical controls include toolbar (toolbar), menu bar (menu bar), input box, button (button), scroll bar (scrollbar), images and text.
  • the properties and contents of the controls in the interface are defined through labels or nodes.
  • XML specifies the controls contained in the interface through nodes such as ⁇ Textview>, ⁇ ImgView>, and ⁇ VideoView>.
  • a node corresponds to a control or property in the interface, and after the node is parsed and rendered, it is presented as the content visible to the user.
  • the interfaces of many applications, such as hybrid applications usually include web pages.
  • a web page, also called a page, can be understood as a special control embedded in an application program interface.
  • a web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style Tables (cascading style sheets, CSS), java scripts (JavaScript, JS), etc.
  • the source code of the web page can be loaded and displayed as user-recognizable content by a browser or a web page display component similar in function to the browser.
  • the specific content contained in the webpage is also defined by the tags or nodes in the source code of the webpage. For example, HTML defines the elements and attributes of the webpage through ⁇ p>, ⁇ img>, ⁇ video>, and ⁇ canvas>.
  • GUI graphical user interface
  • Method 1 Soft access point (softAP) distribution network method
  • FIG. 1 exemplarily shows a flow chart of a method in which the electronic device 100 configures a network for the electronic device 200 in a softAP network configuration manner.
  • the softAP network allocation method may include steps S101-S108. in:
  • the electronic device 200 is turned on, and is in a state of waiting for network distribution.
  • the electronic device 200 is in the state of waiting for network configuration, which may also be referred to as the electronic device 200 is in the AP mode.
  • the electronic device 100 may turn on the hotspot.
  • the above-mentioned user operation for triggering the electronic device 200 to turn on and be in the state of network provisioning may be a long press operation (for example, long press for 3 seconds) on a relevant button (for example, a network distribution key) on the electronic device 200 .
  • the network distribution key may be "Hi key” or "WPS key”, etc., and this application does not limit the name of the network distribution key.
  • the type of the network distribution key is a push type, a rotary type, or a toggle type. This application does not limit the type of the network distribution key.
  • the above-mentioned user operation for triggering the electronic device 200 to turn on and be in the state of waiting for network configuration may be the operation of powering on the electronic device 200 that has not been connected to the wireless network where other devices are located, or it may be the operation of making The operation of powering on the electronic device 200 after being connected to the wireless network where other devices are located, but restoring factory settings.
  • the embodiment of the present application does not limit the above user operations for triggering the electronic device 200 to turn on and be in a state of waiting for network configuration.
  • the electronic device 200 can enter the network-to-be-configured state through various methods, such as smart remote control or opening in a mobile phone APP, and so on.
  • the electronic device 200 may send a distribution network information element (information element, IE) in a broadcast form.
  • IE distribution network information element
  • the electronic device 200 In response to the electronic device 200 being in the state of waiting for network configuration, the electronic device 200 broadcasts the network configuration IE of the electronic device 200 .
  • the distribution network IE of the electronic device 200 may include but not limited to: the identification of the electronic device 200 , whether the electronic device 200 supports interconnection capability, the physical address of the electronic device 200 , and the like.
  • the distribution network IE of the electronic device 200 may also include other more information, such as the manufacturer of the electronic device 200 , etc. This application does not limit the distribution network IE of the electronic device 200 .
  • the electronic device 200 may continuously broadcast the network configuration IE of the electronic device 200 .
  • the electronic device 100 may receive a distribution network IE from the electronic device 200 , and receive a user operation for selecting a hotspot to connect to the electronic device 200 .
  • the electronic device 100 may connect to the hotspot of the electronic device 200 .
  • the electronic device 100 may receive at least one configuration IE of the electronic device.
  • the at least one electronic device includes the electronic device 200 .
  • the electronic device 100 may display the name of the hotspot including the above at least one electronic device.
  • the electronic device 100 may connect to the hotspot of the electronic device 200 according to the physical address of the electronic device 200 in the distribution network IE.
  • the electronic device 100 and the electronic device 200 can establish a local area network between the devices.
  • the local area network can be used for data transmission between the electronic device 100 and the electronic device 200 .
  • the electronic device 100 may receive the network distribution information input by the user, and the network distribution information may include the name and password of the router.
  • the electronic device 100 may display a user interface 10 as shown in FIG. 1A .
  • the user interface 10 may include a distribution network information input box 1001 floating on the main interface of the smart life application program.
  • the distribution network information input box 1001 may also be suspended and displayed on other user interfaces (such as the main interface of the electronic device 100 ), which is not limited in this application.
  • the distribution network information input box 1001 may include a name input box 1002 , a password input box 1003 and a confirmation control 1004 .
  • the name input field 1002 can be used to input or select the name of the router (ie, the name of the Wi-Fi access) from the list.
  • the password input field 1003 can be used to input the password of the router (ie, the password for accessing Wi-Fi).
  • the confirmation control 1004 can be used to trigger the electronic device 100 to send the received router name and password to the electronic device 200 .
  • FIG. 1A is only an exemplary illustration of the user interface of the electronic device 100 for receiving user input of network distribution information in the present application, and does not limit the present application.
  • the above-mentioned distribution network information is stored in the electronic device 100 .
  • the electronic device 100 does not require the user to input distribution network information, that is, the name of the router in the name input column 1002 in the distribution network information input box 1001 shown in FIG. 1A and the router password in the password input column 1003 have been automatically filled in the corresponding location, the user is not required to enter the name of the router and the password of the router again.
  • the user only needs to click the confirmation control 1004 , and the electronic device 100 can send the name and password of the router to the electronic device 200 .
  • the electronic device 100 may send network distribution information to the electronic device 200 through the local area network.
  • the electronic device 100 can send the above network distribution information to the electronic device 200 .
  • the electronic device 200 may send a network distribution information reception response to the electronic device 100 . This step is optional.
  • the electronic device 200 may send a network distribution information reception response to the electronic device 100 to indicate that the electronic device 100 itself has received the network distribution information.
  • the electronic device 100 when it sends the network distribution information, it may encrypt the network distribution information. When receiving the encrypted network distribution information, the electronic device 200 can decrypt it to obtain the network distribution information.
  • the embodiment of the present application does not limit the foregoing encryption and decryption methods.
  • the electronic device 200 may stop broadcasting the distribution network IE, and use the received distribution network information to connect to the router.
  • the electronic device 200 may stop broadcasting the distribution network IE. Using the received network distribution information, the electronic device 200 can establish a connection with the router 300 .
  • the electronic device 200 works in the access point (access point, AP) mode, and the electronic device 100 connects to The hotspot of the electronic device 200 sends the distribution network information of the router 300 to the electronic device 200; when the electronic device 200 receives the distribution network information, the electronic device 200 switches from the AP mode to the station (station, STA) mode, and based on the distribution network information Connect to router 300.
  • access point access point
  • AP access point
  • STA station
  • the embodiment of the present application does not limit the softAP distribution method between the electronic device 100 and the electronic device 200 .
  • the electronic device 100 and the electronic device 200 may also exchange more or less information.
  • the electronic device 200 when the electronic device 200 is connected to the router 300 through a soft access point distribution network, the user needs to open the first application program (such as a smart life application program) to perform operations, such as entering the name and password of the router and clicking OK.
  • the electronic device 200 can obtain the name and password of the router 300 and connect to the router 300 .
  • the entire process requires user intervention to complete the network distribution process of the electronic device 200; and if there are multiple devices to be networked that need to be networked, the user needs to repeat the same operation multiple times to make multiple devices to be networked To complete the connection with the router 300 in sequence, the operation is relatively complicated.
  • FIG. 2 exemplarily shows a flowchart of a method for the electronic device 100 to configure a network for the electronic device 200 using a multicast network configuration solution.
  • the electronic device 200 (such as a smart speaker) is turned on, and the electronic device 200 is in a state of waiting for network distribution.
  • the electronic device 200 sends the distribution network IE of the electronic device 200 in a broadcast form.
  • the electronic device 200 is in the state of waiting for network provisioning, which may also be referred to as the electronic device 200 is in the AP mode.
  • the electronic device 200 In response to the electronic device 200 being in the state of waiting for network configuration, the electronic device 200 broadcasts the network configuration IE of the electronic device 200 .
  • the router 300 receives the distribution network IE of the electronic device 200, and the indicator light of the router 300 flickers.
  • the router 300 receives the distribution network IE of the electronic device 200, and recognizes that the electronic device 200 is in the state of waiting for network distribution, and the indicator light of the router 300 flickers, thereby prompting the user that the router 300 has discovered a device (for example, the electronic device 200) to be distributed. .
  • the router 300 may also use other methods to prompt the user that the router 300 has found a device to be configured, which is not limited in this application.
  • the router 300 receives an operation of triggering (for example, pressing) the network allocation key by the user.
  • the router 300 In response to the operation of the user triggering (for example, pressing) the network allocation key, the router 300 sends a multicast message, and the multicast message carries the name and password of the router 300.
  • the indicator light of the router 300 flickers to remind the user that the router 300 has found a device to be configured.
  • the router 300 receives the user's operation of triggering (for example, pressing) the network configuration key, and the router 300 sends a multicast message to the router, and the multicast message carries the name and password of the router 300 .
  • the multicast message may also carry other information, which is not limited in this application.
  • the router 300 may encrypt the multicast message according to a preset encryption and decryption method and then send it to the electronic device 200 .
  • the electronic device 200 receives the multicast message, and obtains the name and password of the router 300 carried in the multicast message.
  • the electronic device 200 receives the multicast message, and obtains the name and password of the router 300 carried in the multicast message.
  • the electronic device 200 receives the multicast message encrypted in the preset encryption and decryption method, and decrypts the multicast message encrypted in the preset encryption and decryption method according to the preset decryption method, and parses out The name and password of router 300 carried in the multicast message.
  • the preset encryption method and the preset decryption method are preset before the router 300 and the electronic device 200 leave the factory.
  • the router 300 encrypts the multicast packet according to the encryption method specified in the preset protocol, and then the electronic device 200 can decrypt the encrypted multicast packet according to the decryption method specified in the preset protocol.
  • the electronic device 200 connects to the router 300 based on the name and password of the router 300 .
  • the electronic device 200 Before the electronic device 200 connects to the router 300 based on the name and password of the router 300 , the electronic device 200 is always in the AP mode, and the electronic device 100 has not established a connection with the router 300 .
  • the electronic device 200 and the router 300 need to transmit network distribution information through the reserved field of the multicast message, which does not conform to the wireless local area network standard stipulated in the current 802.11 protocol.
  • the electronic device 200 and the router 300 transmit the network configuration information of the router 300 through the multicast message, they need to follow the same encryption and decryption method, that is, the encryption and decryption method has been preset before the electronic device 200 and the router 300 leave the factory. If the electronic device 200 and the router 300 are not produced by the same manufacturer, the electronic device 200 cannot complete the network distribution process with the router 300 , and devices from different manufacturers have compatibility problems.
  • Method 3 Distribution network scheme based on artificial intelligence of things (AIoT) antenna
  • AIoT is a technology that combines artificial intelligence technology with IoT infrastructure to achieve more efficient IoT operations, improve human-computer interaction, and enhance data management and analysis capabilities.
  • the third method may be used to complete the network distribution of the electronic device 200, wherein the AIoT antenna may refer to an antenna used to discover and connect to a device in a state to be networked.
  • Method 3 By installing an AIoT antenna on the router 300, the router 300 can work in a manner similar to that of the electronic device 100 in the method 1, so that the router 300 can send the name and password of the router 300 to the computer with the distribution network through the AIoT antenna.
  • device eg, electronic device 200).
  • the router 300 needs to switch the working mode from AP mode to STA mode, and connect to the hotspot of the device to be distributed, so that the router 300 can The distribution network information can be sent to the device to be distributed.
  • other electronic devices such as the electronic device 100
  • the router 300 needs to switch the working mode from the AP mode to the STA mode
  • other electronic devices such as the electronic device 100
  • the router 300 is connected to the wireless network where the router 300 is located, and communicate with other electronic devices through the wireless network where the router 300 is located.
  • Electronic devices (such as tablets) for video calls.
  • the router 300 switches its working mode from the AP mode to the STA mode, the router 300 will not be able to provide network services for the electronic device 100 connected to the wireless network where the router 300 is located. At this time, the ongoing service of the electronic device 100 will be affected, for example, the video call between the electronic device 100 and the tablet may be stuck or even interrupted.
  • the AIoT antenna on the router 300 can solve this problem very well. That is, the router 300 can receive the broadcast frame sent by the electronic device 200 through the AIoT antenna, and discover the electronic device 200 in the state of waiting for network configuration. Afterwards, the router 300 can connect to the hotspot of the electronic device 200 through the AIoT antenna, and the router 300 sends the distribution network information to the electronic device 200 through the AIoT antenna. In this way, the router 300 can always work in the AP mode without affecting the ongoing services of electronic devices connected to the wireless network where the router 300 is located.
  • AIoT antennas may also be referred to as smart antennas for short.
  • FIG. 3 exemplarily shows a flow chart of a method in which the electronic device 100 configures a network for the electronic device 200 by using an AIoT antenna.
  • Method 3 may include the following steps:
  • the electronic device 200 (such as a smart speaker) is turned on, and the electronic device 200 is in a state of waiting for network distribution.
  • the state of waiting for network distribution is the state of waiting to receive network distribution information.
  • the user operation that puts the electronic device 200 in the state of waiting for network distribution is the same as the user operation of putting the electronic device 200 in the state of waiting for network distribution in S101.
  • the relevant description in S101 Let me repeat.
  • the electronic device 200 In response to the electronic device 200 being in a state of waiting for network configuration, the electronic device 200 sends a network configuration IE of the electronic device 200 in a broadcast form.
  • the router 300 discovers the distribution network IE of the electronic device 200, and connects to the hotspot of the electronic device 200.
  • the router 300 sends information one to the server.
  • the router 300 After the router 300 discovers the distribution network IE of the electronic device 200 , the smart antenna of the router 300 switches to the STA mode, and the smart antenna of the router 300 connects to the hotspot of the electronic device 200 . Afterwards, the router 300 sends information one to the server, the information one is used to instruct the server that the router 300 has discovered the electronic device 200 in the network to be provisioned. S305. The electronic device 100 pops up a window to display that the device to be distributed is found, and the electronic device 100 receives a confirmation operation from the user.
  • the server 400 displays the prompt information that the router 300 finds the electronic device 200 to be distributed on the user interface of the first application program (such as a smart life application program), so that the user can see
  • the electronic device 100 After receiving the prompt information, the electronic device 100 then receives the user's confirmation operation for agreeing to configure the network for the electronic device 200 . Only after the electronic device 100 receives the user's confirmation operation, the router 300 can send the network distribution information to the electronic device 200 .
  • FIG. 3A exemplarily shows the user interface 20 on the electronic device 100 .
  • the user interface 20 may include a prompt bar 2001 suspended and displayed on the main interface of the first application program (such as a smart life application program).
  • the prompt bar 2001 may also be suspended and displayed on other user interfaces (such as the main interface of the electronic device 100 ), which is not limited in this application.
  • the prompt column 2001 may include question prompt information "smart antenna finds smart speaker", control 2002 and control 2003 .
  • the prompt bar 2001 is used to prompt the user to complete the verification process.
  • the electronic device 100 may receive an operation of the user triggering (for example, clicking) the control 2002 , which indicates that the user does not agree to the router sending the distribution network information to the electronic device 200 .
  • the electronic device 100 may also receive an operation of the user triggering (for example, clicking) the control 2003 , which indicates that the user agrees that the router 300 sends the distribution network information to the electronic device 200 .
  • the electronic device 100 receives the operation of the user triggering (for example, clicking) the control 2003, and in response to the operation of the user triggering (for example, clicking) the control 2003, the electronic device 100 sends confirmation information to the server, and the server The confirmation information is sent to the router 300 , and the confirmation information is used to inform the router 300 that the user agrees that the router 300 sends the network distribution information to the electronic device 200 .
  • the electronic device 100 After the electronic device 100 receives the user's operation of triggering (for example, clicking) the control 2003 , the electronic device 100 displays the user interface 30 as shown in FIG. 3B .
  • the user interface 30 is used to prompt the user to associate the electronic device 200 and the electronic device 100 with the same account, that is, bind the electronic device 100 and the electronic device 200 .
  • User interface 30 includes control 3001 , control 3002 and control 3003 .
  • the electronic device 100 receives a user's trigger operation (such as a click operation) on the control 3003, and the electronic device 100 associates the electronic device 200 with the electronic device 100 with the same account, that is, the electronic device 100 and the electronic device 200 have a binding relationship.
  • a user's trigger operation such as a click operation
  • the server 400 may record that the electronic device 100 and the electronic device 200 are associated with the same account.
  • the server 400 may receive an instruction from the electronic device 100 for controlling the electronic device 200 (such as an instruction to turn on the electronic device 200).
  • the server 400 may send the control instruction to the electronic device 200, so that the electronic device 200 executes the operation corresponding to the control instruction.
  • the server 400 may also receive a message from the electronic device 200 for reporting its state information to the electronic device 100 (for example, a message indicating the battery level of the electronic device 200 ).
  • the server 400 may send the above message indicating the state information of the electronic device 200 to the electronic device 100, so that the electronic device 100 updates the state information of the electronic device 200.
  • the electronic device 100 sends the information 2 to the router 300.
  • the router 300 After the router 300 receives the information two, the router 300 sends the name and password of the router 300 to the electronic device 200 through the smart antenna.
  • the electronic device 100 After the electronic device 100 receives the user operation for confirming the connection, the electronic device 100 sends information 2 to the server, and the server sends the information 2 to the router 300. After the router 300 receives the information 2 sent by the server, the router 300 sends the smart antenna to the STA. The mode is switched to AP mode. Afterwards, the router 300 sends the name and password of the router 300 to the electronic device 200 through the smart antenna, and waits for the electronic device 200 to connect to the router 300 .
  • the electronic device 100 can directly send the information 2 to the router 300.
  • the router 300 After the router 300 receives the information 1 sent by the electronic device 100, the router 300 sends the name and password of the router 300 to the electronic device 200 through the smart antenna.
  • the electronic device 200 receives the name and password of the router 300, and connects to the router 300 through the name and password of the router.
  • the essence of this solution is to add a smart antenna to the router 300.
  • the router 300 discovers and connects to the hotspot of the device that is in the state of the network to be distributed. state of the device.
  • the coverage of the smart antenna is within about 9 meters from the center of the router 300 radiating outward.
  • the wall penetration of the signal sent by the smart antenna is very poor, that is, the signal sent by the smart antenna is almost attenuated and unusable after passing through obstacles, so that the electronic device 200 cannot receive the distribution network information sent by the smart antenna of the router 300, resulting in Network provisioning failed.
  • an embodiment of the present application provides a network distribution method, which includes:
  • the electronic device 200 is connected to the non-authenticated network (open ssid) of the router 300 .
  • the electronic device 200 is in a state of waiting for network configuration, and the electronic device 200 broadcasts a network configuration IE of the electronic device 200 .
  • the router 300 receives the distribution network IE of the electronic device 200, the router 300 sends the open ssid of the router 300, and the electronic device 200 receives the open ssid of the router 300, and then, the electronic device 200 connects to the open ssid of the router 300.
  • the server 400 randomly generates an auth code (authorization code), and the electronic device 200 and the router 300 obtain the auth code.
  • the router 300 and the electronic device 200 negotiate a key one, and the electronic device 200 encrypts the registration information and verification information of the electronic device 200 with the key one, and sends them to the server 400 through the router 300 .
  • the server 400 determines that the electronic device 200 is a device that allows network distribution, and the server 400 associates the electronic device 200 and the router 300 with the same account.
  • the server 400 randomly generates an auth code (authorization code), and the server 400 sends the auth code to the router 300.
  • the router 300 receives the auth code sent by the server 400, and sends the auth code to the electronic device 200.
  • both the router 300 and the electronic device 200 obtain the auth code randomly generated by the server 400.
  • the router 300 sends the distribution network information encrypted with the key based on the auth code to the electronic device 200, and the electronic device 200 receives and decrypts it to obtain the distribution network information, and the electronic device 200 uses the distribution network information to access the router 300.
  • the router 300 and the electronic device 200 obtain the key 2 through auth code negotiation, and the router 300 encrypts the name and password of the router 300 with the key 2 and sends it to the electronic device 200;
  • the name and password of the router 300 encrypted by the key two are decrypted using the key two.
  • the electronic device 200 obtains the name and password of the router 300 .
  • the electronic device 200 uses the name and password of the router 300 to connect to the router 300 .
  • the above-mentioned name and password of the router 300 may also be replaced with the name and password of the wireless local area network where the router 300 is located.
  • sending in this embodiment of the present application may refer to device A sending directly to device B, or device A sending to device B through forwarding from one to multiple other devices.
  • auth code sent by the server 400 to the electronic device 200 and the router 300 may be the same or different, and this embodiment of the application is not limited here.
  • the auth code sent is the same as an example for illustration.
  • Method 1 The server 400 generates an auth code set 1, the auth code set 1 includes m auth codes, and m is greater than or equal to 1.
  • the server 400 sends the auth code set one to the router 300, and after the router 300 receives the auth code set one, the router 300 saves the auth code set one locally. Then, the router 300 sends the auth code set one to the electronic device 200, and the electronic device 200 obtains the auth code set one. Afterwards, the electronic device 200 and the router 300 negotiate to obtain the key 2 based on the m auth codes in the auth code set 1 through a preset algorithm.
  • Method 2 The server 400 generates auth code set 1 and auth code set 2, auth code set 1 includes m auth codes, auth code set 2 includes m auth codes, m is greater than or equal to 1.
  • the m auth codes in the auth code set 1 are the same as the m auth codes in the auth code set 2. It can also be said that the auth code set 1 and the auth code set 2 are the same.
  • the server 400 sends the auth code set 1 and the auth code set 2 to the router 300. After the router 300 receives the auth code set 1 and the auth code set 2, the router 300 saves the auth code set 1 locally.
  • the router 300 sends the second auth code set to the electronic device 200, and the electronic device 200 obtains the second auth code set. Afterwards, the electronic device 200 and the router 300 negotiate to obtain the key 2 based on the m auth codes in the auth code set 1 and the m auth codes in the auth code set 2 through a preset algorithm.
  • Method 1 The server 400 needs to generate auth code set 1, auth code set 1 includes m auth codes, and m is greater than or equal to 2.
  • the server 400 sends the auth code set one to the router 300, and after the router 300 receives the auth code set one, the router 300 saves the auth code set one locally. Then, the router 300 sends the auth code set one to the electronic device 200, and the electronic device 200 obtains the auth code set one. Afterwards, the electronic device 200 negotiates with the router 300 based on the x auth codes in the auth code set 1 to obtain the key 2 based on the y auth codes in the auth code set 1.
  • x auth codes in auth code set 1 are different from y auth codes in auth code set 1, x is greater than or equal to 1 and less than or equal to m, and y is greater than or equal to 1 and less than or equal to m.
  • the server 400 needs to generate different auth code sets (such as auth code set 1 and auth code set 2).
  • the auth code contained in the second auth code set is different.
  • the server 400 sends the auth code set 1 and the auth code set 2 to the router 300.
  • the router 300 can save the auth code set 2 to the local, and then the router 300 saves the auth code set 2 to the local.
  • the code set one is sent to the electronic device 200, and the electronic device 200 obtains the auth code set one.
  • the router 300 may also save the auth code set one locally, the router 300 sends the auth code set two to the electronic device 200, and the electronic device 200 obtains the auth code set two.
  • the electronic device 200 and the router 300 obtain the key 2 through negotiation based on the auth code set 1 and the auth code set 2 through a preset algorithm.
  • the auth code set 2 can include one or more auth codes.
  • the preset algorithm here may be the Diffie Hellman (DH) algorithm introduced in the following embodiments, and the preset algorithm may also be other algorithms, which are not limited in this embodiment of the present application.
  • auth code set 1 may include one or more sets of auth codes
  • auth code 2 may also include one or more auth codes.
  • the network distribution method provided in the embodiment of the present application can reduce manual intervention in the network distribution process. Specifically, the network distribution method provided by the embodiment of the present application does not require the user to input the name and password of the router 300, and the operation is simple.
  • the network distribution method provided in the embodiment of the present application does not modify the wireless local area network standard stipulated in the 802.11 protocol. Specifically, the electronic device 200 and the router 300 do not need to transmit the network configuration information through the reserved field of the multicast message.
  • the network distribution method provided in the embodiment of the present application does not require additional hardware. Specifically, the router 300 does not need to install an additional AIoT antenna, and the router 300 can also be in the AP mode all the time during the network distribution process. In this way, ongoing services of other devices connected to the router 300 will not be affected.
  • the network distribution method provided by the embodiment of the present application can improve the security of the network distribution process.
  • the server 400 After the server 400 verifies that the electronic device 200 is a device that allows network distribution through the verification information, the server 400 randomly generates auth codes. It can be understood that the auth codes generated by the server 400 for different devices are different.
  • the auth code is used for the router 300 and the electronic device 200 to negotiate a high-density channel so as to complete the transmission of sensitive information (name and password of the router 300).
  • the auth codes of different devices are different, so the high-density channels used by each device to be distributed are different. This solution improves the security of sensitive information (such as the name and password of router 300) and ensures the network distribution process. security.
  • the network configuration method provided in the embodiment of the present application can be applied to the application scenario of "one-key network configuration", that is, to configure the network for one or more devices to be configured at one time. Specifically, when the router 300 discovers one or more devices to be configured, the router 300 receives a user operation agreeing to configure the network. Afterwards, the router 300 continuously broadcasts the open ssid of the router 300. After the one or more network-to-be-distributed devices are connected to the open ssid of the router 300, the router 300 sequentially completes the network distribution process of the one or more network-to-be-distributed devices connected to the open ssid of the router 300.
  • Router 300 only needs to receive one operation from the user to complete the network distribution process with one or more devices to be distributed. Compared with the current router 300 that receives one user operation, it can only complete the network distribution process with one device to be distributed. , the network distribution solution provided by the embodiment of the present application improves the network distribution efficiency of the router, saves the number of user operations, and improves user experience.
  • the network distribution method provided in the embodiment of the present application can also be applied to the application scenario of "remote network distribution".
  • the network distribution of the electronic device 200 is completed remotely by operating the electronic device 100 .
  • the router 300 discovers the electronic device 200 in the state of waiting for network configuration, and the electronic device 100 displays a prompt message indicating that the electronic device 200 in the state of waiting for network distribution is found on the remote network configuration interface of the first application program.
  • the electronic device 100 may receive user A's input operation on the remote network distribution interface of the first application program, and trigger the router 300 to send the network distribution information to the electronic device 200 in the state of network distribution, so that the electronic device 200 receives the router's
  • the electronic device 200 connects to the router 300 through the distribution network information sent by the router 300 .
  • User A and user B may not be the same user, and user A does not need to be near the router 300 and the electronic device 200, so that user A can remotely connect the electronic device 200 to the router 300.
  • FIG. 4 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • the communication system 40 may include an electronic device 100 , an electronic device 200 , a router 300 , and a server 400 .
  • the electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a personal digital assistant (personal digital assistant). assistant, PDA) and other equipment.
  • UMPC ultra-mobile personal computer
  • PDA personal digital assistant
  • the electronic device 200 may be a smart lamp, a smart oven, a smart fan, a smart air conditioner, a smart TV, a smart large screen, a smart bracelet, a smart watch, a smart speaker, a smart refrigerator, smart doors and windows, a smart car, a smart monitor, a smart robot, smart camera etc.
  • the embodiment of the present application does not limit the types of the electronic device 100 and the electronic device 200 .
  • the following embodiments of the present application are described by taking the electronic device 100 as a mobile phone and the electronic device 200 as a smart speaker as an example.
  • the electronic device 100 may be connected to the wireless local area network where the router 300 is located, or the electronic device 100 may not be connected to the wireless local area network where the router 300 is located.
  • the embodiments of the present application are not limited here.
  • the electronic device 100 and the router 300 may be associated with the same account, and the server 400 may record information that the electronic device 100 and the router 300 are associated with the same account.
  • the electronic device 100 can communicate with the server 400 , and the electronic device 100 can also verify through the server 400 that the electronic device 100 and the router 300 are associated with the same account.
  • the server 400 may receive an instruction from the electronic device 100 for controlling the router 300 (such as an instruction instructing the router 300 to be turned on).
  • the server 400 may send the control instruction to the router 300, so that the router 300 executes the operation corresponding to the control instruction.
  • the server 400 may also receive a message from the router 300 for reporting its state information (such as the number of devices connected to the router 300 ) to the electronic device 100 .
  • the server 400 may send the above message indicating the state information of the router 300 to the electronic device 100, so that the electronic device 100 can receive the state information of the router 300.
  • the electronic device 200 When the electronic device 200 needs to be connected to the router 300, the electronic device 200 receives the user's operation so that the electronic device 200 is turned on and is in the state of waiting for network distribution. Net IE.
  • the router 300 After the router 300 receives and recognizes the distribution network IE of the electronic device 200 , the router 300 sends a request to the server 400 to generate registration information of the electronic device 200 .
  • the server 400 receives and responds to the request, and the server 400 generates registration information of the electronic device 200 . Afterwards, the server 400 sends the registration information to the router 300 .
  • router 300 After router 300 receives the registration information of electronic device 200 sent by server 400 , router 300 will negotiate key one with electronic device 200 through preset parameters, and encrypt the registration information by key one and send it to electronic device 200 . How the router 300 negotiates the key 1 with the electronic device 200 through preset parameters will be described in detail in subsequent embodiments, and details will not be described here in this embodiment of the present application. After the electronic device 200 receives the registration information of the electronic device 200 encrypted with the key one sent by the router 300, the electronic device 200 decrypts the registration information of the electronic device 200 encrypted with the key one according to the key one to obtain the electronic device 200 registration information.
  • the electronic device 200 broadcasts the distribution network IE
  • the server 400 generates the registration information of the electronic device 200
  • the server 400 sends the registration information of the electronic device 200 to the router 300 and the electronic device 200. In FIG. 4 Not reflected.
  • the electronic device 200 encrypts the registration information and verification information of the electronic device 200 with key one and sends them to the router 300 (corresponding to step 1 in FIG. 4 ), and the router 300 uses the key one to encrypt the information encrypted with the key one
  • the registration information and verification information of the electronic device 200 are sent to the server 400 (corresponding to step 2 in FIG. 4 ).
  • the server 400 After the server 400 receives the registration information and verification information of the electronic device 200, after the server 400 verifies that the electronic device 200 is a legal device according to the registration information and verification information of the electronic device 200, the server 400 will randomly generate auth code (such as auth code collection 1).
  • the server 400 sends the auth code set one to the router 300 and the electronic device 200 (corresponding to step 3 in FIG. 4 ).
  • the router 300 receives the auth code set one sent by the server 400, and the router 300 encrypts the auth code set one with the key one and sends it to the electronic device 200.
  • the electronic device 200 After receiving the auth code set 1 encrypted with the key 1, the electronic device 200 decrypts the auth code set 1 encrypted with the key 1 with the key 1, and the electronic device 200 obtains the auth code set 1.
  • the electronic device 200 and the router 300 will negotiate the key 2 through the auth code set 1, and the router 300 will share the network distribution information of the router 300 (such as the name and password of the router 300) through the key 2
  • the electronic device 200 After sending to the electronic device 200 (corresponding to step 4 in FIG. 4 ), the electronic device 200 connects to the router 300 through the name and password of the router 300 after receiving the name and password of the router 300 .
  • the electronic device 200 can establish a binding relationship with the electronic device 100 (for example, associate the same account).
  • the electronic device 200 connects to the router 300 through the name and password of the router 300
  • the router 300 sends information to the server 400
  • the server 400 receives the information
  • the server 400 can associate the electronic device 200 with the router 300 with the same account.
  • the foregoing embodiments have introduced that the electronic device 100 and the router 300 have been associated with the same account, and at this time the electronic device 100, the router 300 and the electronic device 200 are also associated with the same account, so that the electronic device 200 can establish a binding relationship with the electronic device 100 .
  • the electronic device 100 and the electronic device 200 are associated with the same account, and the server 400 records information that the electronic device 100 and the electronic device 200 are associated with the same account.
  • the electronic device 100 can communicate with the server 400 , and the electronic device 100 can also verify through the server 400 that the electronic device 100 and the electronic device 200 are associated with the same account.
  • the server 400 may receive an instruction from the electronic device 100 for controlling the electronic device 200 (such as an instruction to turn on the electronic device 200 ).
  • the server 400 may send the control instruction to the electronic device 200, so that the electronic device 200 executes the operation corresponding to the control instruction.
  • the server 400 may also receive a message from the electronic device 200 for reporting its own status information (such as a message indicating the battery level of the electronic device 200 ) to the electronic device 100 .
  • the server 400 determines that the electronic device 100 and the electronic device 200 are associated with the same account, the server 400 can send the above message indicating the battery level of the electronic device 200 to the electronic device 100, so that the electronic device 100 can receive the message indicating the battery level of the electronic device 200.
  • the electronic device 100 may communicate with the server 400 through any one of a cellular communication network, a wireless local area network (wireless local area network, WLAN), a wired network, and the like.
  • a wireless local area network wireless local area network, WLAN
  • the electronic device 100 can preferably communicate with the server 400 through the wireless local area network provided by the access router 300; when the electronic device 100 is not located near the router 300
  • the electronic device 100 may communicate with the server 400 through any network provided by other devices, such as a wireless local area network, a cellular communication network, or a wired network. That is to say, the network distribution method provided by the embodiment of the present application does not require the electronic device 100 to access the wireless local area network of the router 300 , nor does it require the electronic device 100 to access the hotspot of the electronic device 200 .
  • FIG. 5 exemplarily shows a schematic structural diagram of an electronic device 200 .
  • the electronic device 200 may include: a processor 501, a memory 502, a wireless communication processing module 503, a wired LAN communication processing module 504, an HDMI communication processing module 505, a USB communication processing module 506, a display screen 507 and a power switch 508. in:
  • Processor 501 may be used to read and execute computer readable instructions.
  • the processor 501 may mainly include a controller, an arithmetic unit, and a register.
  • the controller is mainly responsible for instruction decoding, and sends out control signals for the operations corresponding to the instructions.
  • the arithmetic unit is mainly responsible for performing fixed-point or floating-point arithmetic operations, shift operations, and logic operations, and can also perform address operations and conversions.
  • the register is mainly responsible for saving the register operands and intermediate operation results temporarily stored during the execution of the instruction.
  • the hardware architecture of the processor 501 may be an application specific integrated circuit (ASIC) architecture, a MIPS architecture, an ARM architecture, or an NP architecture, and the like.
  • ASIC application specific integrated circuit
  • the processor 501 may be configured to analyze signals received by the wireless communication processing module 503 and/or the wired LAN communication processing module 504 , such as network configuration information sent by the router 300 and the like.
  • the processor 501 may be configured to perform corresponding processing operations according to the analysis results, such as generating a probe response, or driving the display screen 507 to perform display according to the display request or display instruction, and so on.
  • the processor 501 can also be used to generate a signal sent by the wireless communication processing module 503 and/or the wired LAN communication processing module 504, such as a Bluetooth broadcast signal, a beacon signal, or send a signal containing an electronic signal to the router 300.
  • the signal of the distribution network IE of the device 200 can also be used to generate a signal sent by the wireless communication processing module 503 and/or the wired LAN communication processing module 504, such as a Bluetooth broadcast signal, a beacon signal, or send a signal containing an electronic signal to the router 300.
  • the signal of the distribution network IE of the device 200 can also be used to generate a signal sent by the wireless communication processing module 503 and/or the wired LAN communication processing module 504, such as a Bluetooth broadcast signal, a beacon signal, or send a signal
  • the memory 502 is coupled with the processor 501 for storing various software programs and/or sets of instructions.
  • the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices or other non-volatile solid-state storage devices.
  • the memory 502 can store operating systems, such as embedded operating systems such as uCOS, VxWorks, RTLinux, and HarmonyOS.
  • Memory 502 may also store a communication program that may be used to communicate with one or more servers, or additional devices.
  • the wireless communication processing module 503 may include one or more of a WLAN communication processing module 5031 , a Bluetooth (BT) communication processing module 5032 , and an NFC processing module 5033 .
  • BT Bluetooth
  • the wireless communication processing module 503 may also include a cellular mobile communication processing module (not shown).
  • the cellular mobile communication processing module can communicate with other devices (such as servers) through cellular mobile communication technology.
  • the wired LAN communication processing module 504 can be used to communicate with other devices in the same LAN through the wired LAN, and can also be used to connect to the WAN through the wired LAN, and can communicate with devices in the WAN.
  • the HDMI communication processing module 505 can be used to communicate with other devices through an HDMI interface (not shown).
  • the USB communication processing module 506 can be used to communicate with other devices through a USB interface (not shown).
  • the display screen 507 can be used to display images, videos and the like.
  • the display screen 507 can be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED) display screen, an active-matrix organic light-emitting diode (active-matrix organic light emitting diode, AMOLED) Display, flexible light-emitting diode (FLED) display, quantum dot light emitting diodes (QLED) display, etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED active-matrix organic light-emitting diode
  • FLED flexible light-emitting diode
  • QLED quantum dot light emitting diodes
  • the electronic device 200 may not include the display screen 507, which is not limited in this application.
  • the power switch 508 can be used to control the power supply from the power source to the electronic device 200 .
  • the structure shown in FIG. 5 does not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • FIG. 6 exemplarily shows a schematic structural diagram of the router 300 .
  • FIG. 6 shows a router provided by some embodiments of the present application.
  • the router may include a processor 601, a memory 602, a WLAN communication module 603, an antenna 604, a wired local area network (local area network, LAN) communication processing module 605, and a bus 606.
  • the processor 601 , the memory 602 , the WLAN communication module 603 , and the wired LAN communication processing module 605 may be connected through a bus 606 . in:
  • the router shown in FIG. 6 is only an example, and the router may have more or fewer components than those shown in FIG. 6, may combine two or more components, or may have different components configuration.
  • the various components shown in Figure 6 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • a processor 601 may be used to read and execute computer readable instructions.
  • the processor 601 may mainly include a controller, an arithmetic unit, and a register.
  • the controller is mainly responsible for instruction decoding, and sends out control signals for the operations corresponding to the instructions.
  • the arithmetic unit is mainly responsible for saving the register operands and intermediate operation results temporarily stored during the execution of the instruction.
  • the hardware architecture of the processor 601 may be an application specific integrated circuit (ASIC) architecture, a MIPS architecture, an ARM architecture, or an NP architecture, and the like.
  • ASIC application specific integrated circuit
  • a memory may also be provided in the processor 601 for storing instructions and data.
  • the memory in processor 601 is a cache memory.
  • the memory may hold instructions or data that the processor 601 has just used or recycled. If the processor 601 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 601 is reduced, thus improving the efficiency of the system.
  • the memory 602 is coupled with the processor 601 for storing various software programs and/or sets of instructions.
  • the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices or other non-volatile solid-state storage devices.
  • the memory 602 can store operating systems, such as embedded operating systems such as uCOS, VxWorks, and RTLinux.
  • the memory 602 can also store a communication program, which can be used to communicate with electronic devices or other devices.
  • the memory 602 can also store the current configuration, routing table, and forwarding table. The routing table can be used to save routing information.
  • the routing table is usually maintained by the routing protocol and the routing table management module, including more information (network address, next hop, timeout, etc.); the forwarding table can be generated based on the routing table, which is a router Used in actual forwarding, the router can send the data packet to the next-hop device according to the forwarding table.
  • the WLAN communication module 603 can be used to modulate and demodulate electromagnetic wave signals, and the WLAN communication module 603 can convert the information and instructions sent by the processor 601 into electromagnetic wave signals.
  • the received electromagnetic wave signal is converted into a digital signal and processed by the processor 601 .
  • the antenna 604 can be used to transmit and receive electromagnetic wave signals, and the router can have one or more antennas.
  • the wired LAN communication processing module may include one or more LAN physical interfaces, and the one or more LAN physical interfaces can be used for other electronic devices to establish connections with the router through network cables.
  • the router can also include a wired wide area network (WAN) communication processing module, and the wired wide area network (WAN) communication processing module can include a WAN physical interface, and the WAN physical interface can be used to connect the router to the Internet.
  • WAN wide area network
  • the router may also include a network distribution key, which may be a "Hi key” or a "WPS key” and so on. This application does not limit the name of the network distribution key.
  • the type of the network distribution key is a push type, a rotary type, or a toggle type. This application does not limit the type of the network distribution key.
  • the router may also include a network distribution indicator light.
  • the network distribution indicator light can flash to remind the user that the router has discovered a device to be network-provided.
  • the router may also include a cellular communication module for communicating with a cellular communication base station. At this time, the router may not include the wired LAN communication processing module 605 .
  • the router shown in FIG. 6 is only an implementation of the embodiment of the present application. In practical applications, the router may also include more or fewer components, which is not limited here.
  • Step 1 The electronic device 200 is connected to the open ssid (non-authenticated network) of the router 300 .
  • Step 2 The server 400 generates the registration information of the electronic device 200 and completes the verification tasks of the electronic device 200 .
  • the router 300 sends a request to the server 400 to generate the registration information of the electronic device 200
  • the server 400 receives and responds to the request
  • the server 400 generates the registration information of the electronic device 200 .
  • the server 400 sends the registration information of the electronic device 200 to the router 300
  • the router 300 receives the registration information of the electronic device 200 sent by the server 400 and sends the registration information of the electronic device 200 to the electronic device 200 .
  • the electronic device 200 sends the registration information and verification information to the server 400 through the router 300, and after the server 400 receives the registration information and verification information of the electronic device 200 and determines that the electronic device 200 is a legal device, the server 400 sends the electronic device 200 Bind with router 300.
  • Step 3 After the server 400 determines that the electronic device 200 is a legal device, it sends the auth code set 1 to the router 300 , and the router 300 receives the auth code set 1 and sends the auth code set 1 to the electronic device 200 . Afterwards, the electronic device 200 and the router 300 negotiate a high-density channel through the auth code set one, and complete the transmission of distribution network information (such as the name and password of the router 300) through the high-density channel.
  • distribution network information such as the name and password of the router 300
  • Step 4 The electronic device 200 is connected to the WLAN where the router 300 is located.
  • the electronic device 200 and the router 300 negotiate a high-density channel through the set of auth codes randomly issued by the server 400 , and different devices and the router 300 negotiate different high-density channels. Moreover, a device that fails the verification cannot establish a high-density channel with the router 300, thereby avoiding data eavesdropping and acquisition by the device that fails the verification. In this way, the security of network distribution information transmission between the electronic device 200 and the router 300 during the network distribution process is guaranteed.
  • the electronic device 200 is connected to the open ssid of the router 300, and the two have only established a connection relationship.
  • the electronic device 200 can transmit data with the router 300, but the electronic device 200 cannot use the wireless network of the router 300.
  • the electronic device 200 is connected to the open ssid of the router 300 for subsequent electronic device 200 to transmit registration information and verification information to the server 400 through the router 300 and router 300 to transmit network distribution information to the electronic device 200.
  • FIG. 7 exemplarily shows a flowchart of a method for connecting the electronic device 200 to the open ssid of the router 300 .
  • S701-S705 exemplarily show the steps of the method for connecting the electronic device 200 to the open ssid of the router 300. It should be noted that, in some embodiments, the method for connecting the electronic device 200 to the open ssid of the router 300 may include more or less steps than S701-S705, which is not limited in this application. And this application does not limit the execution order of each step in S701-S705.
  • the electronic device 200 is turned on, and the electronic device 200 is in a state of waiting for network distribution.
  • the user operation for placing the electronic device 200 in the state of waiting for network distribution is the same as the user operation for placing the electronic device 200 in the state of waiting for network distribution in S101.
  • the relevant description in S101 please refer to the relevant description in S101. Let me repeat.
  • the electronic device 200 is in the state of waiting for network provisioning, which may also be referred to as the electronic device 200 is in the AP mode.
  • the electronic device 200 sends the distribution network IE of the electronic device 200 in a broadcast form.
  • the electronic device 200 In response to the electronic device 200 being in the configuration network state, the electronic device 200 sends the distribution network IE of the electronic device 200 in a broadcast form.
  • the router 300 receives the network distribution IE of the electronic device 200, and receives the operation of the first user agreeing to network distribution.
  • the router 300 sends a multicast packet, where the multicast packet carries the open ssid of the router 300.
  • the router 300 receives the distribution network IE of the electronic device 200, and in response to the distribution network IE, the indicator light of the router 300 flickers, which is used to remind the user that the router 300 has found the electronic device 200 in the state of network distribution.
  • the router 300 may also prompt the user in other ways that the router 300 has found the electronic device 200 that is in the state of network provisioning, which is not limited in this application.
  • the router 300 When the indicator light of the router 300 is blinking, the router 300 receives a user operation agreeing to network distribution, and the user operation is used to indicate that the user agrees that the router 300 sends the open ssid to the electronic device 200 .
  • the foregoing user operation may be an operation in which the router 300 receives a user trigger (for example, pressing) a network configuration key on the router 300 .
  • the router 300 discovers the electronic device 200 to be network-distributed, the indicator light of the router 300 blinks, and at the same time, the router 300 sends information one to the server 400, and the information one is used for the server 400 to discover the router 300
  • the prompt information of the electronic device 200 to be network-configured is displayed on the user interface of the first application program (for example, the smart life application program).
  • the electronic device 100 can receive and respond to the user's input operation on the first application program, and the input operation indicates that the user agrees that the router 300 sends the open ssid to the device to be configured. Specifically, the electronic device 100 sends the information 2 to the server 400 through the first application program, and the server 400 forwards the information 2 to the router 300 .
  • the router 300 After the router 300 receives the information two, the router 300 sends a multicast message, and the multicast message carries the open ssid of the router 300.
  • the router 300 Before the router 300 sends the distribution network information to the electronic device 200, the router 300 continues to send the open ssid of the router 300.
  • the electronic device 200 obtains the open ssid of the router 300 carried in the multicast packet sent by the router 300, and connects to the open ssid of the router 300.
  • the electronic device 200 After the electronic device 200 receives the multicast message of the router 300 sent by the router 300, the electronic device 200 switches from the AP mode to the STA mode, and the electronic device 200 parses out the open ssid of the router 300 carried in the multicast message, and connects to the router 300 The open ssid.
  • the electronic device 200 is connected to the open ssid of the router 300, and the two only establish a connection relationship, and the electronic device 200 can transmit data with the router 300.
  • the electronic device 200 is connected to the open ssid of the router 300 for subsequent electronic device 200 to transmit registration information and verification information to the server 400 through the router 300 and router 300 to transmit network distribution information to the electronic device 200.
  • the electronic device 200 sends a request to the server 400 to generate the registration information of the electronic device 200 through the router 300. After receiving the request, the server 400 generates the registration information of the electronic device 200 and completes the task of verifying the electronic device 200 .
  • the router 300 After the electronic device 200 is connected to the open ssid of the router 300, the router 300 sends a request to the server 400 to generate the registration information of the electronic device 200, the server 400 receives and responds to the request, and the server 400 generates the registration information of the electronic device 200. Afterwards, the server 400 sends the registration information of the electronic device 200 to the router 300 , the router 300 receives the registration information of the electronic device 200 sent by the server 400 , and the router 300 sends the registration information of the electronic device 200 to the electronic device 200 . Afterwards, the electronic device 200 sends the registration information and verification information to the server 400 , and after the server 400 verifies that the electronic device 200 is a legitimate device, the server 400 binds the electronic device 200 to the router 300 .
  • the server 400 first generates the registration information of the electronic device 200 , and the server 400 sends the registration information of the electronic device 200 to the electronic device 200 through the router 300 .
  • the electronic device 200 sends the registration information and verification information of the electronic device 200 to the server 400 through the router 300 .
  • the server 400 receives the registration information and verification information of the electronic device 200 sent by the electronic device 200 through the router 300 .
  • the server 400 confirms that the registration information of the electronic device 200 sent by the electronic device 200 through the router 300 is the registration information sent by the server to the electronic device 200 through the router 300 before, and the server 400 preliminarily confirms that the electronic device 200 is a legal device.
  • the server 400 further confirms that the verification information sent by the electronic device 200 through the router 300 is legal verification information, then the server 400 further determines that the electronic device 200 is a legal device, then the server 400 sends a message to the router 300, and the message uses The purpose is to inform the router 300 and the electronic device 200 that the distribution network information can be transmitted.
  • the server 400 improves the security mechanism for the server 400 to verify the legitimacy of the device through the double verification mechanism. This ensures the security that the subsequent router 300 and the electronic device 200 can transmit distribution network information.
  • the server 400 may not execute the steps in the tasks of generating the registration information of the electronic device 200 and completing the verification of the electronic device 200 shown in FIG. 8 . That is, in the embodiment shown in FIG. 7, after the electronic device 200 is connected to the open ssid of the router 300, the server 400 directly executes the embodiment shown in FIG. 9, that is, the server 400 directly randomly generates auth code (such as auth code set one) , and send the auth code set one to the router 300.
  • the router 300 receives the auth code set one sent by the server 400 .
  • the router 300 sends the auth code set one to the electronic device 200, and the electronic device 200 obtains the auth code set one.
  • the embodiment of the present application does not limit whether the electronic device 200 , the router 300 and the server 400 execute each step in the tasks of generating the registration information of the electronic device 200 and completing the verification of the electronic device 200 shown in FIG. 8 .
  • FIG. 8 exemplarily shows a flow chart of a method for the server 400 to generate registration information of the electronic device 200 and complete verification tasks of the electronic device 200 .
  • S801-S808 exemplarily show the method steps for the server 400 to complete the registration and verification tasks of the electronic device 200 .
  • the method steps for the server 400 to complete the registration and verification of the electronic device 200 may include more or less steps than S801-S808, which is not limited in this application. And this application does not limit the execution order of each step in S801-S808.
  • the router 300 sends a request to the server 400 to generate registration information of the electronic device 200 .
  • the router 300 After the electronic device 200 is connected to the open ssid of the router 300, the router 300 sends a request to the server 400 to generate the registration information of the electronic device 200. This request is used for the server 400 to generate registration information of the electronic device 200 .
  • the server 400 receives and responds to the request for generating the registration information of the electronic device 200, and the server 400 generates the registration information of the electronic device 200.
  • the server 400 sends the registration information of the electronic device 200 to the router 300.
  • the router 300 obtains the registration information of the electronic device 200 .
  • the server 400 After the server 400 receives the request sent by the router 300 to generate the registration information of the electronic device 200 , the server 400 agrees to the request sent by the router 300 , and the server 400 generates the registration information of the electronic device 200 . The server 400 sends the registration information of the electronic device 200 to the router 300 .
  • the registration information may include, but not limited to, information such as a registration code of the electronic device 200 , and this application does not limit the type of information included in the registration information.
  • the router 300 sends the registration information to the electronic device 200.
  • the electronic device 200 acquires the registration information of the electronic device 200 .
  • the router 300 and the electronic device 200 will negotiate a key through preset parameters— , and transmit registration information based on key one.
  • preliminarily trusted devices may be referred to as "first-level whitelist devices". Only when the electronic device belongs to the "first-level white list device", the electronic device can initiate a registration request to the server, that is, the electronic device can access the server. In this way, it can be guaranteed that the device accessing the server is a trusted device.
  • the router 300 and the electronic device 200 negotiate a key one through preset parameters.
  • the router 300 After the router 300 receives the registration information of the electronic device 200 sent by the server 400, the router 300 and the electronic device 200 negotiate to obtain a key one through preset parameters.
  • the key negotiation between the router 300 and the electronic device 200 through preset parameters can be completed before the router 300 sends a request for generating the registration information of the electronic device 200 to the server 400, or it can be completed after the router 300 sends the request for generating the registration information of the electronic device 200 to the server 400.
  • the request for the registration information of the device 200 is completed later, which is not limited in this application.
  • the key negotiation between the router 300 and the electronic device 200 through preset parameters may be completed before step S801, or may be completed after step S801, which is not limited in this application. As long as before step S804, the router 300 and the electronic device 200 have obtained the key one through negotiation of preset parameters.
  • the router 300 and the electronic device 200 have been configured with the same preset parameters before leaving the factory.
  • the router 300 and the electronic device 200 may download the preset parameters from the server and save them in the router 300 and the electronic device 200 . It should be noted that the preset parameters obtained by the router 300 and the electronic device 200 from the server are the same.
  • the preset parameters may be integrated in a software development kit (software development kit,).
  • SDK is a collection of relevant documents, examples and tools for the development of mobile application software (Application, APP).
  • Application, APP mobile application software
  • developers can hand over a certain function to a third party for development, and the third party will package a certain function into an SDK for developers to use. Therefore, it is only necessary to integrate the preset parameters into the SDK, and the router 300 and the electronic device 200 download the SDK from the server to obtain the preset parameters integrated in the SDK.
  • the process of router 300 and electronic device 200 negotiating to obtain key 1 through preset parameters can refer to the process of router 300 and electronic device 200 negotiating to obtain key 2 through auth code set 1 introduced in the subsequent embodiments. I won't go into details here.
  • the router 300 sends the registration information encrypted with the key one to the electronic device 200 .
  • the router 300 In order to ensure the security of the data transmitted between the router 300 and the electronic device 200, the router 300 encrypts the registration information of the electronic device 200 with the key one, and sends the registration information of the electronic device 200 encrypted with the key one to the electronic device 200 .
  • the electronic device 200 obtains the registration information.
  • the electronic device 200 when the electronic device 200 receives the registration information encrypted with the key one sent by the router 300, the electronic device 200 decrypts the registration information encrypted with the key one through the key one to obtain the registration information.
  • the electronic device 200 sends the registration information and verification information to the router 300.
  • router 300 obtains registration information and verification information.
  • the verification information may include one or more of the following: public key infrastructure (public key Infrastructure, KPI) certificate, software license (license).
  • KPI public key Infrastructure
  • license software license
  • the electronic device 200 After the electronic device 200 obtains the registration information, the electronic device 200 will initiate a registration request to the server 400 , that is, the electronic device 200 will send the registration information and verification information to the router 300 .
  • the electronic device 200 may also only send registration information to the router 300 .
  • the electronic device 200 may also only send verification information to the router 300 .
  • the electronic device 200 sends the registration information encrypted with the key one and the verification information encrypted with the key one to the router 300 .
  • the electronic device 200 may also only send the registration information encrypted with key one to the router 300 .
  • the electronic device 200 may also only send the verification information encrypted with the key one to the router 300 .
  • the router 300 sends the registration information and verification information to the server 400.
  • the server 400 obtains registration information and verification information.
  • router 300 After router 300 acquires the registration information and verification information, router 300 sends the registration information and verification information to server 400 .
  • the router 300 receives the registration information sent by the electronic device 200 , and the router 300 sends the registration information to the server 400 .
  • the router 300 receives the verification information sent by the electronic device 200 , and the router 300 sends the verification information to the server 400 .
  • the router 300 receives the registration information encrypted with the key one and the verification information encrypted with the key one sent by the electronic device 200, and the router 300 converts the registration information encrypted with the key one and the verification information encrypted with the key one based on the key one.
  • the key-encrypted verification information is decrypted to obtain unencrypted registration information and unencrypted verification information, and the router 300 sends the unencrypted registration information and unencrypted verification information to the server 400 .
  • the router 300 when the electronic device 200 only sends the registration information encrypted with the key one to the router 300, the router 300 receives the registration information encrypted with the key one sent by the electronic device 200, and the router 300 uses the key one based on the key one.
  • the encrypted registration information is decrypted to obtain unencrypted registration information, and the router 300 sends the unencrypted registration information to the server 400 .
  • the router 300 when the electronic device 200 only sends the verification information encrypted with the key one to the router 300, the router 300 receives the verification information encrypted with the key one sent by the electronic device 200, and the router 300 uses the key one based on the key one.
  • the key-encrypted verification information is decrypted to obtain unencrypted verification information, and the router 300 sends the unencrypted verification information to the server 400 .
  • the electronic device 200 when the electronic device 200 needs to send verification information to the server 400 through the router 300, before the server 400 verifies that the electronic device 200 is a legal device, the electronic device 200 obtains the verification information in advance and saves the verification information locally. That is, the acquisition and saving of the verification information by the electronic device 200 needs to be completed before S807.
  • the electronic device 200 generates a pair of public-private keys (public key 1 and private key 1). After device A encrypts data with the private key 1, device B can encrypt the data with the private key 1 according to the public key 1 corresponding to the private key 1. After the encrypted data is decrypted and the unencrypted data is obtained, device A can also use the private key to encrypt the data, and device B can decrypt the data encrypted with the private key according to the private key corresponding to the public key. And get unencrypted data. After the electronic device 200 generates a pair of public and private keys, the electronic device 200 sends the public key one and a request for obtaining verification information to the server 400 .
  • the server 400 After the server 400 receives the public key one and the request for obtaining the verification information, in response to the request for obtaining the verification information, the server 400 presets the public key one in the verification information, and then the server 400 will preset the public key one
  • the verification information of is sent to the electronic device 200, and the electronic device 200 obtains the verification information preset with the public key one. It should be noted that the verification information is stored locally in the server 400 .
  • the server 400 determines that the electronic device 200 is a legal device based on the registration information and the verification information, and binds the electronic device 200 to the router 300 .
  • the server 400 may consider the electronic device 200 to be a safe device.
  • secure devices may be referred to as "secondary whitelisted devices.” Only when the electronic device belongs to the "secondary white list device", the electronic device can obtain the distribution network information and connect to the wireless local area network where the router is located through the distribution network information. In this way, it can be ensured that the electronic equipment connected to the wireless local area network where the router is located is a safe equipment.
  • the server 400 After receiving the registration information and verification information of the electronic device 200 forwarded by the router 300 , the server 400 will verify whether the electronic device 200 is a legitimate device according to the registration information and verification information of the electronic device 200 .
  • the server 400 will verify whether the electronic device 200 is a legitimate device according to the registration information of the electronic device 200 .
  • the server 400 will verify whether the electronic device 200 is a legitimate device according to the verification information of the electronic device 200 .
  • the server 400 may verify whether the electronic device 200 is a legal device according to any of the following methods.
  • Way 1 The server 400 verifies that the electronic device 200 is a legitimate device through the registration information and verification information.
  • the server 400 can preliminarily determine that the electronic device 200 is legal. device of.
  • the server 400 further verifies that the electronic device 200 is a legitimate device through the verification information.
  • the following describes how the server 400 further verifies that the electronic device 200 is a legitimate device according to the verification information.
  • the server 400 can obtain the public key 1 preset in the verification information, and the server 400 will randomly generate a random number, and pass the random number and verification The public key one preset in the information verifies the legitimacy of the electronic device 200 .
  • the attacker's electronic device sends the verification information preset with the public key one to the server 400 through the router 300 .
  • the server 400 may confirm the attacker's electronic device as a legitimate device. Therefore, in order to prevent this from happening, the server 200 will further verify the legitimacy of the electronic device 200 according to the random number after receiving the verification information preset with the public key one sent by the electronic device 200 . In this way, the security of the distribution network information of the subsequent transmission router 300 can be improved.
  • the server 400 will randomly generate a random number, and send the random number to the electronic device 200 through the router 300 .
  • the electronic device 200 After the electronic device 200 receives the random number through the router 300 , the electronic device 200 encrypts the random number with the private key one, and then the electronic device 200 sends the random number encrypted with the private key one to the server 400 through the router 300 .
  • the server 400 receives the random number encrypted with the private key 1 sent by the electronic device 200 through the router 300 , and the server 400 decrypts the random number encrypted with the private key 1 with the public key 1 corresponding to the private key 1 .
  • the server 400 can receive the random number encrypted with the private key sent by the electronic device 200, and decrypt the random number encrypted with the private key with the corresponding public key, then the server 400 determines that the electronic If the device 200 is a legitimate device, the router 300 and the electronic device 200 can transmit network distribution information.
  • the server 400 can receive the verification information and registration information sent by the electronic device 200 , but the server 400 cannot receive the private key-encrypted random number sent by the electronic device 200 . Because the private key one is generated by the legitimate device before applying for verification information to the server 400 , illegal devices cannot obtain the private key one in the electronic device 200 . In this way, the server 400 further improves the security mechanism for the server 400 to verify the legitimacy of the device through the double verification mechanism. This ensures the security that the subsequent router 300 and the electronic device 200 can transmit distribution network information.
  • the server 400 after the server 400 receives the registration information and verification information of the electronic device 200 sent by the electronic device 200 through the router 300, the server 40 does not need to generate random numbers to verify the legitimacy of the electronic device 200.
  • the server 400 only needs to confirm that the registration information of the electronic device 200 sent by the electronic device 200 through the router 300 is the registration information previously sent by the server to the electronic device 200 through the router 300, and the server 400 obtains the pre-registered information in the verification information from the verification information. Once the public key is set, the server 400 can confirm that the electronic device 200 is a legitimate device.
  • Method 2 The server 400 only verifies that the electronic device 200 is a legal device through the registration information.
  • the electronic device 200 only needs to send the registration information to the server 400, and the server 400 only needs to verify that the electronic device 200 is a legal device through the registration information of the electronic device 200.
  • the electronic device 200 sends the registration information of the electronic device 200 to the server 400 through the router 300.
  • the registration information of the electronic device 200 sent is the same as the registration information sent by the server to the electronic device 200 through the router 300 before, and the server 400 can confirm that the electronic device 200 is a legal device.
  • the server 400 only verifies that the electronic device 200 is a legitimate device through the verification information.
  • the electronic device 200 only needs to send the verification information to the server 400, and the server 400 only needs to verify that the electronic device 200 is a legitimate device through the verification information of the electronic device 200.
  • the electronic device 200 only needs to send the verification information of the electronic device 200 to the server 400 through the router 300.
  • the server 400 After the server 400 receives the verification information of the electronic device 200 sent by the electronic device 200 through the router 300, the server 400 passes the verification information. The information verifies that the electronic device 200 is a legitimate device.
  • the server 400 After the server 400 verifies that the electronic device 200 is a legitimate device, the server 400 stores the binding relationship between the electronic device 200 and the router 300 . And associate the electronic device 200 and the router 300 with the same account. After the electronic device 200 and the router 300 are associated with the same account, the server 400 records information that the electronic device 200 and the router 300 are associated with the same account.
  • the electronic device 200 can communicate with the server 400 , and the electronic device 200 can also verify through the server 400 that the electronic device 200 and the router 300 are associated with the same account.
  • the server 400 may receive an instruction from the electronic device 200 for controlling the router 300 (such as an instruction instructing the router 300 to turn on).
  • the server 400 may send the control instruction to the router 300, so that the router 300 executes the operation corresponding to the control instruction.
  • the server 400 After verifying that the electronic device 200 is a legal device, the server 400 sends the auth code set one to the router 300, the router 300 receives the auth code set one sent by the server 400, and the router 300 sends the auth code set one to the electronic device 200. Afterwards, the electronic device 200 and the router 300 negotiate the key 2 through the auth code set 1, and complete the transfer of distribution network information (such as the name and password of the router 300) through the key 2.
  • distribution network information such as the name and password of the router 300
  • the auth code set one is randomly generated by the server 400, and the auth code set one may include one or more auth codes.
  • FIG. 9 exemplarily shows a flowchart of a method for transmitting network distribution information between the electronic device 200 and the router 300 .
  • S901-S906 exemplarily show the method steps for the electronic device 200 and the router 300 to transmit network distribution information. It should be noted that, in some embodiments, the steps of the method for transmitting network distribution information between the electronic device 200 and the router 300 may include more or less steps than S901-S906, which is not limited in this application. And the present application does not limit the execution order of each step in S901-S906.
  • the server 400 sends the auth code set one to the router 300.
  • the router 300 sends the auth code set one to the electronic device 200.
  • the server 400 After the server 400 verifies that the electronic device 100 is a legal device, the server 400 randomly generates auth code (auth code set one), and sends the auth code set one to the router 300, and the router 300 receives the auth code set one sent by the server 400, and the router 300 then sends the auth code set 1 to the electronic device 200, so that the subsequent router 300 and the electronic device 200 can negotiate the key 2 according to the auth code set 1 to transmit network distribution information.
  • auth code auth code set one
  • the set of auth codes randomly generated by the server 400 is different for different network devices to be provisioned. Therefore, the keys 2 negotiated by different network devices to be provisioned and the router 300 according to the auth code set 1 are also different. In this way, the security of the transmission of network distribution information between the electronic device 200 and the router 300 is further improved.
  • the electronic device 200 and the router 300 negotiate key two according to the auth code set one.
  • the electronic device 200 and the router 300 may negotiate the key 2 according to the auth code set 1 according to the Diffie Hellman (DH) algorithm.
  • the electronic device 100 and the router 300 may negotiate to obtain the key 2 according to the auth code set 1 through other algorithms, which is not limited in this embodiment of the present application.
  • the electronic device 200 and the router 300 negotiate the key 2 according to the auth code set 1 through the DH algorithm for illustration.
  • the electronic device 200 and the router 300 will only pass the parameters in the formula that calculates the key 2 through the formula, and will not directly pass the key 2. In this way, if an attacker is monitoring the communication process between the electronic device 200 and the router 300, even if the attacker obtains the parameters in the formula for calculating the key 2, the attacker does not know which formula is used to obtain the key 2, so the attack It is difficult for the reader to obtain the key two.
  • the electronic device 200 and the router 300 negotiate the key 2 in this way, which ensures that the key 2 cannot be stolen by an attacker, and ensures the security of the electronic device 200 and the router 300 transmitting distribution network information.
  • the DH algorithm can include but not limited to the following steps:
  • Step 1 The router 300 sends the prime number P and the prime number G to the electronic device 200 .
  • prime number P is a very large number
  • prime number G may be a relatively small number, which is not limited in this application.
  • the prime number P and the prime number G may also be generated by the electronic device 200 and sent to the router 300, which is not limited in this embodiment of the present application.
  • Step 2 The electronic device 200 calculates the value of (GA ) mod P, and sends the value of (GA ) mod P to the router 300 .
  • Step 3 The router 300 calculates the value of ( GB ) mod P, and sends the value of ( GB ) mod P to the electronic device 200 .
  • the auth code set 1 includes m auth codes, where m is greater than or equal to 1.
  • A represents the auth code in the auth code set one.
  • m is greater than or equal to 2
  • A represents the product of m auth codes in auth code set 1.
  • the calculation principle of B is similar to that of A.
  • Step 4 The electronic device 200 can calculate the key 2 according to formula 1 according to the value of ( GB ) mod P sent by the router 300 .
  • K G A*B mod P.
  • A is the auth code set 1 sent by the server 400 to the electronic device 200
  • K is the key 2 obtained through negotiation between the electronic device 200 and the router 300 .
  • Step 5 The router 300 can calculate the key 2 according to the formula 2 according to the value of (GA ) mod P sent by the electronic device 200 .
  • K G A*B mod P.
  • B is the auth code set 1 sent by the server 400 to the router 300
  • K is the key 2 obtained through negotiation between the electronic device 200 and the router 300 .
  • the key 2 obtained through negotiation between the electronic device 200 and the router 300 is the same. Afterwards, the electronic device 200 and the router 300 can transmit network configuration information through the second key.
  • the formula shown in the above embodiment is only for explaining the process of negotiating the key 2 between the electronic device 200 and the router 300.
  • the formula for calculating the key in the DH algorithm can be the same as that calculated in the above steps
  • the formulas for obtaining the second key are the same or different, which is not limited in this application.
  • the way in which the electronic device 200 and the router 300 negotiate to obtain the key 2 through the DH algorithm can improve the security of subsequent transmission of distribution network information.
  • the electronic device 200 and the router 300 negotiate to obtain the key 2 through the DH algorithm.
  • the electronic device 200 and the router 300 only pass the parameter value in the formula, even if an attacker is monitoring the communication between the electronic device 200 and the router 300 process, and intercepted the parameter value in the formula passed between the electronic device 200 and the router 300, it is also difficult to calculate the real key according to the parameter value in the formula; on the other hand, the server 400 has verified that the electronic device 200 is After the legitimate device, the server 400 will send auth code set 1 to the router 400 and the electronic device 200, that is, after different devices initiate verification to the server 400 at different times, the server 400 randomly sends the auth code set 1 to different electronic devices It is also different, that is, different devices and the router 300 negotiate different keys through the DH algorithm, and it is difficult for an attacker to obtain the key. In this way, the security of transmission of distribution network information between different devices and the router 300 is further improved.
  • the router 300 sends the network distribution information encrypted with the second key to the electronic device 200.
  • the electronic device 200 obtains the network distribution information encrypted with the second key.
  • the electronic device 200 decrypts the distribution network information encrypted with the key 2 through the key 2 to obtain the distribution network information.
  • the router 300 encrypts the network distribution information with the second key, and sends the network distribution information encrypted with the second key to the electronic device 200 .
  • the electronic device 200 After the electronic device 200 receives the network distribution information encrypted with the key 2, the electronic device 200 decrypts the network distribution information encrypted with the key 2 according to the key 2 to obtain the network distribution information of the router 300 .
  • the router 300 After the router 300 sends the network distribution information encrypted with the key 2 to the electronic device 200, the router 300 stops sending the open ssid of the router 300.
  • the electronic device 200 connects to the router 300 based on the network distribution information of the router 300 .
  • the network distribution information may include but not limited to the name and password of the router 300, etc.
  • the network distribution information may also include other more information, which is not limited in this application.
  • the electronic device 200 After the electronic device 200 obtains the network configuration information of the router 300, the electronic device 200 connects to the router 300 based on the network configuration information of the router. In this way, the electronic device 200 can access the Internet through the router 300 .
  • the remote distribution network application scenario refers to that user A who operates electronic device 100 can also remotely guide user B who operates electronic device 200 to power on electronic device 200, and user A remotely completes the configuration of electronic device 200 by operating electronic device 100.
  • network Specifically, the router 300 discovers the electronic device 200 in the state of waiting for network distribution, and the electronic device 100 displays that the electronic device 200 in the state of waiting for network distribution is found on the remote network distribution interface of the first application program (such as a smart life application program). prompt information.
  • the electronic device 100 may receive user A's input operation on the remote network distribution interface of the first application program, and trigger the router 300 to send the network distribution information to the electronic device 200 in the state of network distribution, so that the electronic device 200 receives the router's
  • the electronic device 200 connects to the router 300 through the distribution network information sent by the router 300 .
  • User A and user B may not be the same user, and user A does not need to be near the router 300 and the electronic device 200. In this way, even if user A does not operate the router 300 and the electronic device 200, he can remotely set the The electronic device 200 is connected to the router 300 .
  • a child buys a smart product (such as a smart speaker) for the parents at home
  • the parents do not know how to connect the smart speaker to the router at home.
  • the children guide their parents by phone to power on the smart speaker and put it in the state of waiting for network distribution.
  • the smart speaker broadcasts network distribution cells.
  • the indicator light of the router is flashing at this time. If the parents do not know how to press the network distribution button of the router, or the router is in a place where it is inconvenient to obtain, such as a weak current box or the top of a cabinet.
  • the child can enter the remote network distribution interface of the first application program (such as the smart life application program) through his mobile phone, and the child's mobile phone can display on the remote network distribution network interface of the smart life application program that it has found a device that is in the state of waiting for network distribution.
  • the prompt information of the device the child confirms that the device to be distributed on the remote network distribution interface is the smart speaker bought by the parents, then the mobile phone can receive the input operation of the child on the remote network distribution interface, and in response to the input operation, the router 300 Send the distribution network information to the smart speaker, and the smart speaker will connect to the home router after obtaining the distribution network information.
  • the home application scene includes a first room area 901 , a second room area 902 and a living room area 903 .
  • the first room area 901 includes a smart TV 9012
  • the second room area 902 includes a smart speaker 9013
  • the living room area 903 includes a router 300 and a smart projector 9014 and so on.
  • the user who turns on the electronic device 200 so that the electronic device 200 is in the state of waiting for network distribution may not be the same user as the user who inputs operations on the electronic device 100, It can also be the same user.
  • user B the user who turns on the electronic device 200 so that the electronic device 200 is in the state of waiting for network distribution
  • user A the user who enters the operation on the electronic device 100
  • user B needs to be in the home shown in Figure 9A to turn on the electronic device 200 so that the electronic device 200 is in the state of waiting for network distribution
  • user A may not be in the home shown in Figure 9A, and does not need to access the A router 300 in a home is shown.
  • User A can remotely instruct user B to power on the electronic device 200 , and then remotely operate the electronic device 100 to complete the network distribution of the electronic device 200 . Therefore, remote network distribution can be realized by applying this solution.
  • the network distribution method provided by the embodiment of the present application is applied to the remote network distribution scene. On the one hand, it can reduce the learning cost of user B, simplify the operation of user B, and the remote user A can complete the network distribution operation for user B.
  • the server 400 before the router 300 sends the distribution network information to the electronic device 200, the server 400 will check whether the electronic device 200 is a legitimate device.
  • the server 400 After the server 400 verifies that the electronic device 200 is a legitimate device, the server 400 randomly generates a set of auth codes and sends them to the router 300 and the electronic device 200, and the router 300 and the electronic device 200 use the set of auth codes to negotiate a key to encrypt the transmission configuration. network information. It can be seen from the analysis of the foregoing embodiments that after different devices initiate verification to the server 400 at different times, the set of auth codes randomly sent by the server 400 to different devices is also different. The security of network distribution information transmission between the router 300 and the electronic device 200 is further improved.
  • FIG. 9B-FIG. 9F exemplarily show UI diagrams of the user controlling the connection of the electronic device 200 to the router 300 on the remote network configuration interface of the first application program.
  • FIG. 9B exemplarily shows a user interface 910 of the electronic device 100 .
  • the user interface 910 may include icons of some application programs. For example, icon 9001 for file management, icon 9002 for email, icon 9003 for music, icon 9004 for smart life, icon 9005 for sports and health, icon 9006 for weather, icon 9007 for camera, icon 9008 for address book, and icon for phone 9009. Information icon 9010.
  • user interface 910 may include icons for more or fewer applications.
  • the user interface 910 may include icons of some application programs different from those shown in FIG. 9B , which is not limited here.
  • the electronic device 100 may start the smart life in response to a user operation acting on the smart life icon 9004 on the user interface 910 .
  • FIG. 9C exemplarily shows a user interface 920 displayed after the electronic device 100 starts the smart life.
  • the user interface 920 is the main page provided by the smart life application.
  • the user interface 920 includes one or more electronic devices associated with the same account, and the one or more electronic devices associated with the same account have a binding relationship.
  • the user interface 920 exemplarily shows the router 300 , the router 300 is in an online state, and the router 300 is placed in the living room area 903 shown in FIG. 9A .
  • the smart TV 9012 is online, and the smart TV 9012 is placed in the first room area 901 shown in FIG. 9A .
  • the smart projector 9014 is offline, and the smart projector 9014 is placed in the living room area 903 shown in FIG. 9A .
  • online state may refer to a state in which the electronic device 200 can communicate with the server 400 or with the electronic device 100, and the user A can control the electronic device 200 in the online state through the electronic device 100, or obtain status information of the electronic device 200;
  • offline state may refer to a state in which the electronic device 200 cannot communicate with the server 400 or the electronic device 100 , and the user A cannot control the electronic device 200 in the offline state through the electronic device 100 .
  • the electronic device 200 When the user B operating the electronic device 200 needs to establish a connection between the electronic device 200 and the router 300 , the electronic device 200 is already in a state of waiting for network distribution and is near the router 300 . But user B is not familiar with the operation of establishing a connection between the electronic device 200 and the router 300 . Then user A who operates the electronic device 100 can check in the remote network configuration interface of the first application program to see if there is a prompt message about the router 300 finding the electronic device 200 that is in the state of network distribution, if user A confirms the remote network configuration The prompt information displayed on the interface is exactly the information of the electronic device 200 that needs network distribution, then the electronic device 100 can receive the confirmation operation of user A, and the router 300 sends the network distribution information of the router 300 to the electronic device 200 .
  • the icon 9201 may receive a user's trigger (for example, click) operation, and in response to the user's trigger operation, the electronic device 200 displays the user interface 930 as shown in FIG. 9D .
  • a user's trigger for example, click
  • the user interface 930 includes an information bar 9301, and the information bar 9301 includes an icon 9302.
  • the icon 9302 can receive a user's trigger (for example, click) operation, and in response to the user's trigger operation, the electronic device 100 displays the remote distribution network as shown in FIG. 9E
  • the user interface 940 of the contains the text "remote distribution network", but it should be understood that the text information can also be “distribution network", that is to say, whether it is remote distribution network or non-remote distribution network, the implementation of this application All the network distribution methods provided in the examples are applicable, and the content shown in the drawings does not constitute a limitation to the embodiments of the present application.
  • the user interface 940 may include a prompt bar 9401 , and the prompt bar 9401 includes icons, names (for example, smart speakers) and controls 9402 of devices found by the router 300 to be provisioned.
  • the electronic device 100 can receive and respond to the user's trigger operation (for example, single click) on the control 9402, which means that the user agrees that the router 300 will send the open ssid to the device to be configured. Specifically, the electronic device 100 sends the information 2 to the server 400 through the first application (such as the smart life application mentioned here), and the server 400 forwards the information 2 to the router 300 .
  • the user's trigger operation for example, single click
  • the electronic device 100 sends the information 2 to the server 400 through the first application (such as the smart life application mentioned here), and the server 400 forwards the information 2 to the router 300 .
  • the electronic device 100 may also automatically pop up and display the prompt bar 9401 in its user interface in response to the prompt information sent by the server 400 that the electronic device 200 is found to be in the state of network provisioning. Instead of requiring the user to click the icon 9302, the prompt bar 9401 is displayed.
  • the electronic device 100 before the electronic device 100 automatically pops up and displays the prompt bar 9401, the electronic device 100 can be in any user interface, such as the main screen, the negative screen, the interface of other application programs, the interface of the smart life application program, the lock screen interface, and the screen-off interface. interface etc. In this way, the user A can obtain the prompt information related to the distribution network of the electronic device 200 at any time, so as to respond in time and make user operations in time.
  • the router 300 After the router 300 receives the information 2, the router 300 sends the open ssid to the device (such as the electronic device 200) to be configured.
  • the device such as the electronic device 200
  • the electronic device 200 receives the open ssid of the router 300 and connects to the open ssid of the router 300 . Afterwards, after the electronic device 200 establishes a binding relationship with the router 300 through the embodiment shown in FIG. 8 , the electronic device 200 and the router 300 are associated with the same account. Then the icon, name and connection status of the electronic device 200 can be displayed in the user interface 950 .
  • the user interface 950 includes one or more electronic devices associated with the same account, and the one or more electronic devices associated with the same account have a binding relationship.
  • the router 300, the smart TV 9012, the smart projector 9014 and the electronic device 200 are all associated with the same account.
  • the user interface 950 exemplarily shows that the router 300 is in an online state. Smart TV 9012 is online. Smart projector 9014 is offline. The electronic device 200 is in an online state.
  • the status of the electronic device 200 can be displayed as “Connecting”, “distributing network”, “configuring”, etc.; when the electronic device 200 completes the entire network distribution process, the status of the electronic device 200 can be displayed as "online” or "connected” in the user interface 950 , "Network distribution completed” and so on. Therefore, the user A can accurately perceive the network distribution progress of the electronic device 200 through the electronic device 100 .
  • the user interface of the electronic device 100 may also display a failure prompt message to inform user A of the network distribution process. failure, so that user A can take action in time to troubleshoot the cause, for example, user A can call user B to ask whether the power supply of electronic device 200 is plugged in firmly, whether the router is working normally, etc.
  • the electronic device 200 and the router 300 can obtain the distribution network information of the router 300 through the embodiment shown in FIG. 9 , and the electronic device 200 is connected to the router 300 through the distribution network information of the router 300 where the wireless LAN is located. In this way, the whole process of remote network distribution for the electronic device 200 is completed.
  • One-click network configuration refers to the network configuration for one or more devices to be configured at one time. That is, the user only needs to operate once, and the router 300 continuously sends the open ssid, and completes the network distribution process of multiple devices to be configured connected to the open ssid of the router 300 in turn, and determines the open ssid connected to the router 300 on the router 300 After the number of is 0, the router 300 stops sending open ssid.
  • router 300 discovers the smart speakers and smart projectors that are waiting for network distribution. After the smart speaker and the smart projector are connected to the open ssid of the router 300, the router 300 can complete the network distribution process with the smart speaker and the smart projector in turn. It can be seen that the router 300 only needs to receive a user operation agreeing to network distribution to complete the network distribution process with multiple smart single products. Compared with the current router 300 that can only complete the network distribution process of one device after receiving a user operation that agrees to network distribution, the embodiment of the present application can realize simultaneous network distribution of multiple devices and improve the efficiency of multi-device network distribution.
  • the router 300 After the router 300 receives a message carrying a distribution network IE sent by one or more nearby electronic devices that are in the state of waiting for network distribution, the router 300 is not limited to the blinking of the indicator light of the router 300, and the router 300 can also pass other The method prompts the user that the router 300 has found one or more electronic devices that are in the state of network distribution, which is not limited in this application.
  • the router 300 After the indicator light of the router 300 flickers, the router 300 receives the first user operation agreeing to network distribution, and the first user operation is used to indicate that the user agrees that the router 300 sends the open ssid to one or more electronic devices in the state of network distribution.
  • the first user operation may also be an input operation on the one-key network configuration interface of the first application program, and the first user operation may also be an operation in which the router 300 receives a user trigger (for example, pressing) the network configuration key on the router 300; the present application
  • a user trigger for example, pressing
  • the embodiment does not limit the specific implementation of the operation of the first user agreeing to network allocation.
  • 10A-10B are schematic diagrams of the electronic device 100 receiving a first user operation on the one-key network configuration interface of the first application program.
  • the electronic device 100 receives a user operation to open a first application program (such as a smart life application program).
  • a first application program such as a smart life application program
  • the electronic device 100 receives the user's operation of opening the one-key network configuration interface in the first application program.
  • the icon 9201 may receive a user's trigger (for example, click) operation, and in response to the user's trigger operation, the electronic device 100 displays the user interface 960 as shown in FIG. 10A .
  • a user's trigger for example, click
  • the user interface 960 includes an information bar 1001, and the information bar 1001 includes an icon 1002.
  • the icon 1002 can receive a user's trigger (for example, click) operation, and in response to the user's trigger operation, the electronic device 100 displays the one-key configuration The user interface 970 of the web.
  • the user interface 970 may include one or more icons of electronic devices in a state of waiting for network configuration discovered by the router 300 and a control 1003 .
  • the icons of the electronic devices in the network-to-be-configured state discovered by the router 300 are the icons of the electronic device 200 (smart speaker) and the icon of the electronic device 500 (smart camera).
  • the electronic device 100 can receive and respond to the user's trigger operation (such as clicking) on the control 1003. This operation means that the user agrees that the router 300 will send the open ssid, and the electronic device 100 can use the first application program (such as the wisdom described here) life application program) sends the information two to the server 400, and the server 400 forwards the information two to the router 300.
  • the first application program such as the wisdom described here
  • the router 300 After the router 300 receives the message 2, the router 300 sends the open ssid. It can be understood that, in the application scenario of one-key network configuration, the router 300 continuously sends the open ssid. The user can only click the icon 1003 once to make multiple devices to be configured to complete the network configuration process with the router 300 at one time.
  • the router 300 After the router 300 continuously sends the open ssid in the form of broadcast, one or more electronic devices in the state of waiting for network distribution receive the open ssid sent by the router 300. Afterwards, through the embodiments shown in FIGS. 7-9 above, the router 300 establishes connections with the one or more electronic devices in turn, so that the one or more electronic devices can pass through the embodiments shown in FIGS. 7-9 above. Obtain the network distribution information of the router 300, and connect to the router 300 through the network distribution information of the router 300.
  • the electronic device 200 (smart speaker) and the electronic device 500 (smart camera) receive and connect to the open ssid of the router 300.
  • the server 400 will sequentially associate the smart speaker, the smart camera and the router 300 with the same account through the embodiment of FIG. 8 .
  • the smart speaker, smart camera and router 300 are associated with the same account.
  • the icon, name and connection status of the smart speaker and the icon, name and connection status of the smart camera can be displayed in the user interface 920 .
  • the user interface 980 includes one or more electronic devices associated with the same account, and the one or more electronic devices associated with the same account have a binding relationship.
  • the router 300, the smart TV 9012, the smart projector 9014, the smart speaker and the smart camera are all linked to the same account.
  • the user interface 980 exemplarily shows that the router 300 is in an online state.
  • Smart TV 9012 is online.
  • Smart projector 9014 is offline.
  • the smart speaker 200 is online.
  • Smart Camera 500 is online.
  • the smart speaker and the smart camera After the smart speaker and the smart camera are connected to the open ssid of the router 300, the smart speaker and the smart camera can obtain the distribution network information of the router 300 through the embodiment shown in FIG.
  • the distribution network information of the router 300 is connected to the wireless local area network.
  • the router 300 continuously sends the open ssid of the router 300, in some embodiments, during the process of establishing a connection between the router 300 and one or more electronic devices in the state of the network to be distributed, there are other The electronic device in the state of network distribution is connected to the open ssid of the router 300 .
  • the router 300 will determine the number of electronic devices connected to the open ssid of the router 300, if If the number of electronic devices connected to the open ssid of the router 300 is greater than or equal to 1, the router arbitrarily selects a device from the electronic devices connected to the open ssid of the router 300 to complete the network distribution process until the router 300 determines the open ssid connected to the router 300 The number of electronic devices is 0.
  • the router 300 After the router 300 determines that the number of electronic devices connected to the open ssid of the router 300 is 0, the router will continue to continuously send the open ssid of the router 300 for a certain period of time. If within a certain period of time, other devices to be distributed are connected to the open ssid of router 300, other devices to be distributed will obtain the distribution network information of router 300 through the embodiments shown in Figures 7-9 above, And connect to the router 300 through the distribution network information of the router 300 . If within a certain period of time, no other device to be distributed is connected to the open ssid of the router 300, then the router 300 will disable the function of sending the open ssid, and the distribution network connection ends.
  • the router 300 only needs to receive one user operation to complete the network distribution task items with one or more network devices to be distributed, realizing "one-key network distribution", and improving the communication between multiple network devices to be distributed.
  • the network distribution efficiency of the router 300 is the reason for the router 300.
  • FIGS 11-13 exemplarily show several "one-key network configuration" flow charts provided by the embodiment of this application.
  • the "one-key network configuration" process may include S1101-S1106.
  • the router discovers the device to be distributed, and responds to the first user operation, continuously sends the open ssid of the router (that is, executes S1101, S1102), and starts sending the open ssid at the moment
  • investigate whether there is one or more electronic devices accessing the open ssid of the router within the first preset time after this moment that is, execute the judgment step of S1103).
  • the router completes one or more electronic devices connected to the open ssid of the router in turn.
  • the network distribution process until the number of electronic devices connected to the open ssid of the router is 0 that is, execute S1104.
  • the router can continue to continuously send open ssid, so during this process, one or more electronic devices that are in the state of waiting for network distribution can also be continuously connected to the open ssid of the router , the router will also complete the network distribution process with these newly connected one or more electronic devices in sequence, until the number of electronic devices connected to the open ssid of the router is 0.
  • the router can also start the timer again to investigate whether there is one or more electronic devices connected to the open ssid of the router within the second preset time after executing S1104 (that is, execute the judgment step of S1105) , if yes, execute S1104 again, otherwise execute S1106.
  • the router can also start the timer again, and the moment when it is judged as "No” is used as the starting point of timing (or , taking the timing end time of the first preset time as the starting point of timing), investigate whether there is one or more electronic devices connected to the open ssid of the router within the second preset time after this moment (that is, execute the judgment step of S1105 ), if there is (that is, S1105 judges as "yes"), then execute S1104, otherwise execute S1106, end distribution network, router stops sending open ssid.
  • the second preset time may be the same as or different from the first preset time.
  • the router will wait for a period of time after sending the open ssid to check whether there are one or more electronic devices connected during this period of time. If so, the router will complete the communication with the one or more distribution network of electronic devices.
  • the router can still continue to send open ssid continuously, so that during this period, new devices that are waiting to be networked can be connected to the open ssid of the router, and the router can also sequentially Complete the network configuration process for these newly connected devices.
  • the router will also execute the judgment step of S1105, that is, when the router judges that the number of electronic devices currently connected to the router's open ssid is 0, the router will It is not to end the distribution network directly and stop sending open ssid, but to wait for a period of time to check whether there are new electronic devices to be connected to the open ssid of the router during this period of time. If so, the router will also Complete the network configuration process for these newly connected devices.
  • FIG. 12 is similar to FIG. 11 , S1201 is similar to S1101 , and S1202 is similar to S1102 .
  • the difference is that the process shown in Figure 12 may not include S1105 in the embodiment of Figure 11, that is, after S1203 is judged as "No" or after S1204 is executed, the router can directly end the network configuration without waiting for the second preset time .
  • the embodiment of the present application also provides a "one-key network distribution process" as shown in FIG. 13 .
  • FIG. 13 is similar to FIG. 11
  • S1301 is similar to S1101
  • S1302 is similar to S1102 .
  • the router does not wait for the second preset time, and the router can directly execute S1306 to end the network configuration.
  • the flow process shown in FIG. 13 still includes S1303 (equivalent to S1103 in the embodiment of FIG. 11 ), S1304 (equivalent to S1104 in the embodiment of FIG. 11 ), and S1305 (equivalent to S1105 in the embodiment of FIG. 11 )
  • S1303 Equivalent to S1103 in the embodiment of FIG. 11
  • S1304 equivalent to S1104 in the embodiment of FIG. 11
  • S1305 equivalent to S1105 in the embodiment of FIG. 11
  • FIG. 14 is a schematic flowchart of a method for network distribution provided by an embodiment of the present application.
  • the electronic device 200 accesses the non-authentication network of the router 300.
  • the electronic device 200 may also be called a first electronic device.
  • Router 300 may be called a wireless access device.
  • the electronic device 200 broadcasts the distribution network information element of the electronic device 200, wherein the distribution network information element is used to make other electronic devices discover the Electronic device 200.
  • the distribution network information element of the electronic device 200 includes one or more of the following: the identification of the electronic device 200 , whether the electronic device 200 supports interconnection capability, the physical address of the electronic device 200 , and the like.
  • the router 300 After the router 300 receives the distribution network IE of the electronic device 200, the router 300 sends the access information of the router 300.
  • the access information of the router 300 may include the identification of the non-authenticated network, the physical address of the non-authenticated network, etc., and the electronic device 200 receives The access information to the router 300, and then the electronic device 200 connects to the non-authentication network of the router 300 based on the access information of the router 300.
  • the router 300 sends a first request message to the server 400.
  • the router 300 After the electronic device 200 accesses the non-authentication network of the router 300, the router 300 sends a first request message to the server 400, and the first request message is used by the server 400 to generate a first authorization code. That is, in the embodiment of FIG. 7, after S705 is executed, in the embodiment of FIG. 9, before the server 400 executes 901, the router 300 sends the first request message to the server 400, and only the server 400 receives the first request message After that, the server 400 will generate the first authorization code (that is, execute S901).
  • the first request message may also be used by the server 400 to generate registration information of the electronic device 200 .
  • the first request message may be the request for generating registration data described in S801 in the embodiment of FIG. 8 .
  • the server 400 receives the first request message, and generates a first authorization code.
  • the first authorization code may also be referred to as authcode set one.
  • the router 300 sends the first request message to the server 400, and the server 400 will generate the first authorization code after the server 400 receives the first request message.
  • the first authorization code (that is, execute S901).
  • the server 400 When the first request message can also be used by the server 400 to generate the registration information of the electronic device 200 , after the server 400 receives the first request message, the server 400 generates the registration information of the electronic device 200 . Afterwards, the electronic device 200, router 300 and server 400 go through steps S803-S808, the server 400 verifies that the electronic device 200 is a legal device, and binds the electronic device 200 and the router 300 to the same account. Afterwards, the server 400 executes S901 to generate a first authorization code.
  • the first authorization code is randomly generated by the server 400 in response to request messages from different electronic devices, wherein the authorization code may be randomly generated by the server 400 according to a preset random number generation algorithm; in some implementations Among them, it is also possible for the server 100 to generate the same authorization code for different electronic devices.
  • the server 400 may also generate the first authorization code and the second authorization code (also referred to as authcode set two), the server 400 sends the first authorization code and the second authorization code to the router 300, and the router 300 saves the first authorization code locally, and the router 300 sends the second authorization code to the electronic device 200 . Afterwards, the router 300 negotiates with the electronic device 200 to obtain the first key based on the first authorization code and the second authorization code.
  • the router 300 and the electronic device 200 negotiate to obtain the first key based on the same authorization code.
  • the router 300 and the electronic device 200 negotiate to obtain the first key based on different authorization codes.
  • the second electronic device receives a second user operation, and the second user operation is used to instruct the router 300 to send the access information of the non-authenticated network.
  • the operation of the second user is used to control the router 300 to send the access information of the non-authenticated network.
  • the router 300 displays prompt information on the application program on the mobile phone of the electronic device 100 that has been connected to the Internet through the server 400, so that the user can see the prompt information, the prompt information is used to prompt the user to input a second user operation on the network configuration interface on the application program, so that the router 300 sends the access information of the non-authenticated network.
  • the user does not need to press the network configuration key on the router 300 (that is, the first user operation), and the router 300 can also send the access information of the non-authenticated network. It can be ensured that when the user is inconvenient to press the network configuration key of the router 300, the user can control the router 300 on the application program to send the access information of the non-authenticated network.
  • the second user operation may also be that the control server 400 sends the first authorization code to the router 300 and the electronic device 200 .
  • the server 400 displays prompt information on the application program on the mobile phone of the electronic device 100, so that the user can see the prompt information, and the prompt information It is used to prompt the user to input a second user operation on the network configuration interface on the application program, so that the server 400 sends the first authorization code to the router 300 and the electronic device 200 .
  • the router 300 and the electronic device 200 acquire the first authorization code, and negotiate to obtain the first key based on the first authorization code.
  • the first key may also be referred to as key two.
  • the first authorization code includes m authorization codes, where m is a positive integer greater than or equal to 1.
  • Router 300 negotiates with the electronic device 200 to obtain a first key based on x authorization codes in the first authorization code and y authorization codes in the first authorization code; wherein, x is greater than or equal to 1 and less than or equal to m, and y is greater than or equal to 1 and less than equal to m.
  • the server 400 sends the first authorization code to the router 300 , the router 300 stores the first authorization code locally, and the router 300 also needs to send the first authorization code to the electronic device 200 .
  • the router 300 and the electronic device 200 may select part or all of the authorization codes from the first authorization codes and negotiate to obtain the first key.
  • the x authorization codes in the first authorization codes are the same as the y authorization codes in the first authorization codes, then the router 300 and the electronic device 200 negotiate to obtain the first key based on the same authorization codes.
  • the router 300 and the electronic device 200 negotiate to obtain the first key based on different authorization codes.
  • how the router 300 and the electronic device 200 negotiate to obtain the first key based on the first authorization code can refer to the related description in the embodiment of FIG.
  • the electronic device 200 sends the first authentication certificate locally stored in the electronic device 200 to the server 400 through the router 300 information; the server 400 receives the first authentication information, and determines that the electronic device 200 is a legitimate device according to the first authentication information.
  • the server 400 will generate the first authorization code for the electronic device 200 and the router 300 to negotiate to obtain the first key transfer network distribution information.
  • the server 400 determines that the router 300 is not a legitimate device through the first authentication information, the server 400 will not generate the first authorization code, and the router 300 cannot obtain the distribution network information, and the router 300 cannot join the wireless local area network where the router 300 is located. , to ensure the security of the network distribution process.
  • the server 400 judges that the first authentication information satisfies the first condition, it determines that the electronic device 200 is a legitimate device.
  • the first authentication information includes first registration information (the first registration information may be the registration information described in the embodiment of FIG. 8 ).
  • the server 400 After the server 400 receives the first request information and before the server 400 receives the first authentication information sent by the router 300, the server 400 generates the first registration information (such as a registration code), and saves the first registration information locally to obtain the second authentication information. registration message.
  • the server 400 sends the first registration information to the electronic device 200 through the router 300 . After receiving the first registration information, the electronic device 200 saves the first registration information locally.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the electronic device 200 stored locally by the server 400 . That is, when the server 400 confirms that the first registration information sent by the electronic device 200 through the router 300 is the registration information of the electronic device 200 sent by the server 400 through the router 300 before, the server 400 can preliminarily determine that the electronic device 200 is a legitimate device.
  • the first authentication information includes first registration information and first verification information (the first verification information may be the verification information described in the embodiment in FIG. 8 ).
  • the first inspection information may be any one of a digital certificate or a KPI certificate.
  • the first condition includes: the first registration information in the first authentication information is the same as the second registration information of the electronic device 200 stored locally by the server 400 .
  • the first verification information is legal verification information.
  • the server 400 determines that the first verification information is legitimate verification information
  • the server 400 generates a first random number and sends the first random number to the electronic device 200 through the router 300 .
  • the electronic device 200 After receiving the first random number, the electronic device 200 encrypts the first random number according to the first private key to obtain the encrypted first random number.
  • the electronic device 200 sends the encrypted first random number to the server 400 through the router 300 .
  • the server 400 After receiving the encrypted first random number, the server 400 decrypts the encrypted first random number according to the first public key preset in the first verification information, and after obtaining the first random number, the server 400 determines the first verification The information is valid verification information.
  • the server 400 After the server 400 determines that the electronic device 200 is a legitimate device through the first registration information, the server 400 further verifies the legitimacy of the electronic device 200 according to the verification information. In this way, the security of subsequent transmission of distribution network information can be improved.
  • how the server 400 verifies the legitimacy of the electronic device 200 according to the first registration information and the first verification information may refer to the relevant description in the embodiment of FIG. 8 , which will not be repeated here in this embodiment of the application.
  • the electronic device 200 negotiates with the router 300 based on the locally stored preset parameters to obtain the first authentication information based on the locally stored preset parameters.
  • Second key (also referred to as key one); the electronic device 200 sends the first authentication information locally stored in the electronic device 200 to the server 400 through the router 300, specifically including: the electronic device 200 sends the first authentication information based on the second key to the server 400 The information is encrypted to obtain encrypted first authentication information; the electronic device 200 sends the encrypted first authentication information to the router 300; after receiving the encrypted first authentication information, the router 300 converts the encrypted first authentication information based on the second key to Decrypt to obtain the first authentication information; the router 300 sends the first authentication information to the server 400 .
  • the router 300 before the router 300 sends the first registration information to the electronic device 200, the router 300 encrypts the first registration information with a second key to obtain encrypted first registration information. The router 300 sends the encrypted first registration information to the electronic device 200 . In this way, the security of information transmission between the electronic device 200 and the router 300 can be guaranteed.
  • the electronic device 200 before the electronic device 200 initiates a registration request to the server 400 (or before the electronic device 200 sends the first authentication information to the server 400 through the router 300), if the electronic device 200 and the router 300 can pass the locally stored preset parameter If the second key is obtained through negotiation, the electronic device 200 can be considered as a preliminary legal device, and the electronic device 200 can initiate a registration request to the server 400 through the router 300 .
  • the electronic device 200 that initiates the registration request to the server 400 is a preliminary legal electronic device, that is, the electronic device 200 stores preset parameters.
  • the information transmitted between the electronic device 200 and the router 300 is transmitted after being encrypted by the second key, which can ensure the security of the information transmitted between the electronic device 200 and the router 300 .
  • the router 300 encrypts the network distribution information of the wireless local area network where the router 300 is located based on the first key, obtains the encrypted network distribution information, and sends the encrypted network distribution information to the electronic device 200.
  • the network distribution information may include but not limited to the name and password of the router 300, etc.
  • the network distribution information may also include other more information, which is not limited in this application.
  • the router 300 and the electronic device 200 After the router 300 and the electronic device 200 obtain the first authorization code, and negotiate to obtain the first key based on the first authorization code, the router 300 encrypts the distribution network information of the wireless LAN where the router 300 is located based on the first key, and obtains the encrypted distribution network information, and send encrypted network distribution information to the electronic device 200. In this way, the electronic device 200 can obtain the distribution network information of the wireless local area network where the router 300 is located.
  • the electronic device 200 receives the encrypted network distribution information, decrypts the encrypted network distribution information based on the first key, obtains the network distribution information, and connects to the wireless local area network where the router 300 is located based on the network distribution information.
  • the electronic device 200 After receiving the encrypted network distribution information, the electronic device 200 decrypts the encrypted network distribution information based on the first key to obtain the network distribution information, and connects to the wireless local area network where the router 300 is located based on the network distribution information. In this way, the electronic device 200 can access the Internet through the router 300 .
  • the router 300 sends access information of the non-authentication network in response to the first user operation.
  • the electronic device 200 receives the access information, and accesses the authentication-free network of the router 300 based on the access information.
  • the first user operation group may be the pressing operation of the network configuration key of the router 300
  • the access information of the non-authenticated network may include the identification of the non-authenticated network and the physical address of the router 300 and so on. Only after the router 300 receives the operation of the first user (that is, is authorized by the user), the router 300 will send the access information of the non-authenticated network of the router 300 .
  • the router 300 continuously sends the access information of the non-authenticated network in response to the first user operation.
  • the third electronic device (electronic device 500 ) is connected to the non-authentication network of the router 300 .
  • the router 300 sends the second request message to the server 400 .
  • the server 400 After receiving the second request message, the server 400 generates a second authorization code, wherein the second authorization code is different from the authorization code generated by the server 400 after receiving the request message from other electronic devices sent by the router 300 .
  • the router 300 and the electronic device 500 obtain the second authorization code, and negotiate to obtain the second key based on the second authorization code.
  • the router 300 encrypts the network distribution information of the WLAN where the router 300 is located based on the second key, obtains the encrypted network distribution information, and sends the encrypted network distribution information to the electronic device 500 .
  • the electronic device 500 receives the encrypted network distribution information, decrypts the encrypted network distribution information based on the second key, obtains the network distribution information, and connects to the wireless local area network where the router 300 is located based on the network distribution information. In this way, the router 300 only needs to receive one user operation, and continuously sends the access information of the non-authenticated network.
  • the router 300 Before the router 300 stops sending the access information of the non-authenticated network, one or more electronic devices can be connected to the non-authenticated network of the router 300, then the router 300 can adopt the same distribution process as the electronic device 200 to complete the connection with the other one. or a network distribution process of multiple electronic devices (such as the electronic device 500). That is to say, the router 300 only needs to receive one user operation, and can complete the network distribution process with multiple electronic devices. Equipment distribution network efficiency.
  • the router 300 After the router 300 completes the network configuration process with the electronic device 500, and the router 300 determines that the number of electronic devices connected to the non-authenticated network connected to the router 300 is 0, the router 300 stops sending the non-authenticated network connection. input information.
  • the router 300 waits for a period of time after determining that the number of electronic devices connected to the router 300's non-authenticated network is 0, during this period During the period, the router 300 still continuously sends the access information of the non-authenticated network, and if no other electronic device is connected to the non-authenticated network of the router 300, the router 300 stops sending the access information of the non-authenticated network.
  • how the router 300 implements "one-key network configuration" can refer to the embodiments shown in FIG. 10A-FIG. 10C and FIG. 11-FIG. 13 , which will not be repeated here in this embodiment.
  • the number of electronic devices 200 is one or more.
  • the electronic device 100 displays the first user interface (the user interface 940 shown in FIG. 9E or the user interface shown in FIG. 10B ).
  • the first user interface includes one or more device identifiers corresponding to one or more electronic devices 200; after the electronic device 100 receives the user's second user operation, the electronic device 100 displays the second user interface (Fig. 9F, or the user interface 980 shown in FIG. Multiple electronic devices 200 have completed network configuration, or one or more electronic devices 200 have been connected to the network.
  • the second user interface may also include information such as one or more device identifiers corresponding to one or more electronic devices 200 .
  • the server 400 associates the electronic device 200 with the router 300 with the same account.
  • the user can view the networking status of the electronic device 200 on the application program in the electronic device 100 .
  • the networking status includes but not limited to online, offline, network distribution, network distribution failure and so on.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting".
  • the phrases “in determining” or “if detected (a stated condition or event)” may be interpreted to mean “if determining" or “in response to determining" or “on detecting (a stated condition or event)” or “in response to detecting (a stated condition or event)”.
  • the processes can be completed by computer programs to instruct related hardware.
  • the programs can be stored in computer-readable storage media.
  • When the programs are executed may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.

Landscapes

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

Abstract

本申请公开了一种配网方法及装置,方法包括:首先,第一电子设备连接上无线接入设备的无认证网络;之后,服务器随机生成授权码,第一电子设备和无线接入设备获取到授权码。最后,无线接入设备将使用基于授权码的密钥加密的配网信息发送给第一电子设备,第一电子设备接收并进行解密、获取配网信息,第一电子设备基于配网信息接入无线接入设备。这样,可以提高了无线接入设备为电子设备配网时的安全性,并且减少了配网过程中人工的干预(例如不需要用户手动输入无线接入设备所在的无线局域网的名称和密码),提高了用户体验。

Description

一种配网方法及装置
本申请要求于2021年07月19日提交中国专利局、申请号为202110814541.8、申请名称为“一种配网方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种配网方法及装置。
背景技术
随着物联网与智能家居的发展和普及,各家厂商都推出了各种智能家居设备。智能家居设备可以是例如智能摄像头、智能音箱、智能插头等。通常这些设备都需要连接家中的Wi-Fi才可以正常工作。
上述列举的智能家居设备不方便用户直接输入配网信息(如路由器的名称和密码)。为了解决这一问题,用户可以通过手机、平板电脑等电子设备为上述不便于用户直接输入配网信息的电子设备进行配网。目前,各厂商也实现了各种简易的配网方式,这些配网方式存在一些安全漏洞,给用户的信息安全带来了很大的挑战。因此,如何实现安全、方便的配网是亟待解决的问题。
发明内容
本申请实施例提供了一种配网方法及装置,提高了无线接入设备为电子设备配网时的安全性,减少了配网过程中人工的干预(例如不需要用户手动输入无线接入设备所在的无线局域网的名称和密码),提高了用户体验。
第一方面,本申请实施例提供了一种配网方法,该方法可以应用于包括第一电子设备、无线接入设备和服务器的配网系统中,该方法包括:第一电子设备接入无线接入设备的无认证网络。无线接入设备向服务器发送第一请求消息。服务器接收第一请求消息后,生成第一授权码,其中,第一授权码不同于服务器接收无线接入设备发送的其他电子设备的请求消息后生成的授权码。无线接入设备、第一电子设备获取第一授权码,并基于第一授权码协商得到第一密钥。无线接入设备基于第一密钥加密无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向第一电子设备发送加密的配网信息。第一电子设备接收加密的配网信息,基于第一密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上无线接入设备所在的无线局域网。
其中,在一些实现方式中,第一授权码是由服务器响应不同的电子设备的请求消息随机生成的,其中,授权码可以是服务器根据预设的随机数生成算法随机生成的;在一些实现方式中,服务器也有可能为不同的电子设备生成相同的授权码。
在另一些实现方式中,服务器也可以生成第一授权码和第二授权码,服务器将第一授权码和第二授权码发送至无线接入设备,无线接入设备将第一授权码保存至本地,无线接入设备将第二授权码发送至第一电子设备。之后,无线接入设备与第一电子设备基于第一授权码和第二授权码协商得到第一密钥。当第一授权码和第二授权码相同时,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。当第一授权码和第二授权码不同时,则无 线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
第一电子设备可以是以下任一一项:智能灯、智能烤箱、智能风扇、智能空调、智能电视、智能大屏、智能手环、智能手表、智能音箱、智能冰箱,智能门窗、智能汽车、智能监控器、智能机器人、智能摄像头等。
通过第一方面的方法,第一、可以减少配网过程中人工的干预。具体地,配网方法不需要用户输入无线接入设备所在的无线局域网的名称和密码,操作简单。第二、在配网过程中,无线接入设备一直处于AP模式。这样,不会影响连接上无线接入设备的其他设备正在进行的业务。第三、服务器针对不同的电子设备生成的授权码不同,保证了每个电子设备使用的高密的通道均不相同,该方案提高了敏感信息(如无线接入设备所在的无线局域网的名称和密码)传递的安全性,保证了配网过程的安全性。
结合第一方面,在一种可能的实现方式中,在无线接入设备、第一电子设备获取第一授权码之前,方法还包括:第一电子设备通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息;服务器接收第一认证信息,并根据第一认证信息确定第一电子设备为合法设备。
服务器判断第一认证信息满足第一条件时,则确定第一电子设备为合法设备。
在一些实现方式中,第一认证信息包括第一注册信息。
在服务器接收第一请求信息之后,在服务器接收无线接入设备发送的第一认证信息之前,服务器生成第一注册信息(例如注册码),并将第一注册信息保存在本地,得到第二注册信息。服务器将第一注册信息通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一注册信息之后,将第一注册信息保存在本地。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。即当服务器确认第一电子设备通过无线接入设备发送的第一注册信息是之前服务器通过无线接入设备发送的第一电子设备的注册信息,则服务器可以初步确定出电子设备为合法的设备。
在另一些实现方式中,第一认证信息包括第一注册信息和第一校验信息。第一检验信息可以为数字证书或者KPI证书中的任意一种。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。并且第一校验信息为合法的校验信息。
具体的,服务器在确定第一校验信息为合法的校验信息之前,服务器生成第一随机数并将第一随机数通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一随机数后,根据第一私钥将第一随机数加密,得到加密第一随机数。第一电子设备将加密第一随机数通过无线接入设备发送至服务器。服务器在接收到加密第一随机数后,并根据第一校验信息中预置的第一公钥将加密第一随机数解密,得到第一随机数后,服务器确定出第一校验信息为合法的校验信息。
服务器在通过第一注册信息确定第一电子设备为合法的设备之后,服务器进一步根据校验信息验证第一电子设备的合法性。这样,可以提高后续传输配网信息的安全性。
这样,只有服务器通过第一认证信息确定第一电子设备为合法的设备之后,服务器才会生成第一授权码用于第一电子设备和无线接入设备协商得到第一密钥传递配网信息。当服务器通过第一认证信息确定第一电子设备不是合法的设备,那么服务器不会生成第一授权码,则第一电子设备得不到配网信息,第一电子设备也不能加入无线接入设备所在的无线局域网, 这样,保证了配网过程中的安全性。
结合第一方面,在一种可能的实现方式中,在第一电子设备通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息之前,方法还包括:第一电子设备基于本地保存的预置参数和无线接入设备基于本地保存的预置参数协商得到第二密钥;第一电子设备通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息,具体包括:第一电子设备基于第二密钥将第一认证信息加密,得到加密的第一认证信息;第一电子设备向无线接入设备发送加密的第一认证信息;无线接入设备在接收到加密的第一认证信息后,基于第二密钥将加密的第一认证信息解密,得到第一认证信息;无线接入设备将第一认证信息发送至服务器。
在一些实现方式中,在无线接入设备将第一注册信息发送至第一电子设备之前,无线接入设备将第一注册信息以第二密钥加密,得到加密的第一注册信息。无线接入设备将加密的第一注册信息发送至第一电子设备。这样,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
这样,在第一电子设备向服务器发起注册请求之前(也可以说在第一电子设备通过无线接入设备向服务器发送第一认证信息之前),若第一电子设备与无线接入设备可以通过本地存储的预置参数协商得到第二密钥,则可以认为第一电子设备为初步合法的设备,第一电子设备可以通过无线接入设备向服务器发起注册请求。一方面,可以保证向服务器发起注册请求的第一电子设备为初步合法的电子设备,即第一电子设备中保存有预置参数。另一方面,第一电子设备与无线接入设备之间传递的信息通过第二密钥加密后在传递,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
结合第一方面,在一种可能的实现方式中,第一授权码包括m个授权码,m为大于等于1的正整数;无线接入设备、第一电子设备基于第一授权码协商得到第一密钥,具体包括:无线接入设备基于第一授权码中的x个授权码和第一电子设备基于第一授权码中的y个授权码协商得到第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
也就是说,服务器将第一授权码发送至无线接入设备,无线接入设备将第一授权码保存在本地,且无线接入设备还需将第一授权码发送至第一电子设备。无线接入设备与第一电子设备可以从第一授权码中选取部分或全部的授权码协商得到第一密钥。
在一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码相同,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。
在另一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码不同,则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
结合第一方面,在一种可能的实现方式中,在第一电子设备接入无线接入设备的无认证网络之前,方法还包括:无线接入设备响应于第一用户操作,发送无认证网络的接入信息;第一电子设备接入无线接入设备的无认证网络,具体包括:第一电子设备接收接入信息,基于接入信息接入无线接入设备的无认证网络。第一用户操组可以是作用于无线接入设备的配网键的按压操作,无认证网络的接入信息可以包括无认证网络的标识和无线接入设备的物理地址等。无线接入设备只有接收第一用户操作后(即得到用户的授权),无线接入设备才会发送无线接入设备的无认证网络的接入信息。
在一些实现方式中,无线接入设备响应于第一用户操作,持续性发送无认证网络的接入信息。
在第一电子设备接入无线接入设备所在的无线局域网后,第三电子设备接入无线接入设备的无认证网络。无线接入设备向服务器发送第二请求消息。服务器接收第二请求消息后,生成第二授权码,其中,第二授权码不同于服务器接收无线接入设备发送的其他电子设备的请求消息后生成的授权码。无线接入设备、第三电子设备获取第二授权码,并基于第二授权码协商得到第二密钥。无线接入设备基于第二密钥加密无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向第三电子设备发送加密的配网信息。第三电子设备接收加密的配网信息,基于第二密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上无线接入设备所在的无线局域网。这样,无线接入设备只需接收一次用户操作,持续性发送无认证网络的接入信息。在无线接入设备停止发送无认证网络的接入信息之前,可以有一个或多个电子设备接上无线接入设备的无认证网络,那么无线接入设备可以采取与第一电子设备一样的配网流程完成与其他的一个或多个电子设备(例如第三电子设备)的配网流程。也即,无线接入设备只需接收一次用户操作,可完成与多个电子设备的配网流程,与目前无线接入设备接收一次用户操作,只能完成与一个电子设备的配网流程相比,提高了电子设备的配网效率。
在一些实现方式中,在无线接入设备完成与第三电子设备的配网流程后,无线接入设备确定出连接上无线接入设备的无认证网络的电子设备的数量为0之后,无线接入设备停止发送无认证网络的接入信息。
在一些实现方式中,在无线接入设备完成与第三电子设备的配网流程后,无线接入设备确定出连接上无线接入设备的无认证网络的电子设备的数量为0之后在等一段时间,在这段时间内,无线接入设备仍然持续性发送无认证网络的接入信息,若没有其他的电子设备连接上无线接入设备的无认证网络,则无线接入设备停止发送无认证网络的接入信息。
结合第一方面,在一种可能的实现方式中,配网系统还包括第二电子设备,在服务器生成第一授权码之前,方法还包括:第二电子设备接收第二用户操作,第二用户操作用于指示无线接入设备发送无认证网络的接入信息。
在一些实现方式中,第二用户操作用于控制无线接入设备发送无认证网络的接入信息。具体的,在无线接入设备发现了处于待配网状态的电子设备后,无线接入设备通过服务器在已联网的第二电子设备的手机上的应用程序上显示提示信息,以使得用户可以看到该提示信息,该提示信息用于提示用户在应用程序上配网界面上输入第二用户操作,以使得无线接入设备发送无认证网络的接入信息。也就是说,用户可以不在无线接入设备上按压配网键(即第一用户操作),无线接入设备也可以发送无认证网络的接入信息。可以保证用户不方便按压无线接入设备的配网键时,用户可以在应用程序上控制无线接入设备发送无认证网络的接入信息。
并且该方案也可以运用于“远程配网”应用场景。即操作第一电子设备的用户不熟悉将第一电子设备连接上无线接入设备的流程,即使操作第二电子设备的用户不在第一电子设备的用户附近,操作第二电子设备的用户可以远程通过在第二电子设备上的第二操作控制第一电子设备连接上无线接入设备。
在另一些实现方式中,第二用户操作也可以是控制服务器向无线接入设备和第一电子设备发送第一授权码。具体的,在服务器向无线接入设备和第一电子设备发送第一授权码之前, 服务器在第二电子设备的手机上的应用程序上显示提示信息,以使得用户可以看到该提示信息,该提示信息用于提示用户在应用程序上配网界面上输入第二用户操作,以使得服务器向无线接入设备和第一电子设备发送第一授权码。
结合第一方面,在一种可能的实现方式中,第一电子设备的数量为一个或多个,在第二电子设备接收用户的第二用户操作之前,方法还包括:第二电子设备显示第一用户界面,第一用户界面包括一个或多个第一电子设备对应的一个或多个设备标识;在第二电子设备接收用户的第二用户操作之后,方法还包括:第二电子设备显示第二用户界面,第二用户界面包括一个或多个第一电子设备对应的一个或多个状态标识,一个或多个状态标识用于表示一个或多个第一电子设备已完成配网,或者,一个或多个第一电子设备已连接网络。
第二用户界面还可以包括一个或多个第一电子设备对应的一个或多个设备标识等信息。
这样,在服务器验证第一电子设备为合法的设备之后,服务器将第一电子设备与无线接入设备关联同一账号。这样,用户可以在第二电子设备中应用程序上的查看第二电子设备的联网状态,联网状态包括但不仅限于在线、离线、配网中、配网失败等等。
结合第一方面,在一种可能的实现方式中,在第一电子设备接入无线接入设备的无认证网络之前,方法还包括:第一电子设备广播第一电子设备的配网信元,其中,配网信元用于使得其他电子设备发现处于待配网状态的第一电子设备。第一电子设备的配网信元包括以下一项或多项:第一电子设备的标识、第一电子设备是否支持互连的能力、第一电子设备的物理地址等。
结合第一方面,在一种可能的实现方式中,配网信息包括,无线接入设备所在的无线局域网的名称和密码。
第二方面,本申请实施例提供了一种配网方法,应用于第一电子设备,方法包括:接入无线接入设备的无认证网络;获取第一授权码,第一授权码是由服务器生成的,其中,第一授权码不同于接入无线接入设备的无认证网络的其他电子设备接收到的授权码;基于第一授权码,与无线接入设备协商确定第一密钥;接收无线接入设备发送的加密的配网信息,并基于第一密钥对加密的配网信息进行解密,得到配网信息;基于配网信息连接上无线接入设备所在的无线局域网。
其中,在一些实现方式中,第一授权码是由服务器响应不同的电子设备的请求消息随机生成的,其中,授权码可以是服务器根据预设的随机数生成算法随机生成的;在一些实现方式中,服务器也有可能为不同的电子设备生成相同的授权码。
在另一些实现方式中,服务器也可以生成第一授权码和第二授权码,服务器将第一授权码和第二授权码发送至无线接入设备,无线接入设备将第一授权码保存至本地,无线接入设备将第二授权码发送至第一电子设备。之后,无线接入设备与第一电子设备基于第一授权码和第二授权码协商得到第一密钥。当第一授权码和第二授权码相同时,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。当第一授权码和第二授权码不同时,则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
第一电子设备可以是以下任一一项:智能灯、智能烤箱、智能风扇、智能空调、智能电视、智能大屏、智能手环、智能手表、智能音箱、智能冰箱,智能门窗、智能汽车、智能监 控器、智能机器人、智能摄像头等。
通过第二方面的方法,第一、可以减少配网过程中人工的干预。具体地,配网方法不需要用户输入无线接入设备所在的无线局域网的名称和密码,操作简单。第二、在配网过程中,无线接入设备一直处于AP模式。这样,不会影响连接上无线接入设备的其他设备正在进行的业务。第三、服务器针对不同的电子设备生成的授权码不同,保证了每个电子设备使用的高密的通道均不相同,该方案提高了敏感信息(如无线接入设备所在的无线局域网的名称和密码)传递的安全性,保证了配网过程的安全性。
结合第二方面,在一种可能的实现方式中,在获取第一授权码之前,方法还包括:通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息;其中,第一认证信息用于服务器确定第一电子设备为合法设备。
服务器判断第一认证信息满足第一条件时,则确定第一电子设备为合法设备。
在一些实现方式中,第一认证信息包括第一注册信息。
在服务器接收第一请求信息之后,在服务器接收无线接入设备发送的第一认证信息之前,服务器生成第一注册信息(例如注册码),并将第一注册信息保存在本地,得到第二注册信息。服务器将第一注册信息通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一注册信息之后,将第一注册信息保存在本地。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。即当服务器确认第一电子设备通过无线接入设备发送的第一注册信息是之前服务器通过无线接入设备发送的第一电子设备的注册信息,则服务器可以初步确定出电子设备为合法的设备。
在另一些实现方式中,第一认证信息包括第一注册信息和第一校验信息。第一检验信息可以为数字证书或者KPI证书中的任意一种。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。并且第一校验信息为合法的校验信息。
具体的,服务器在确定第一校验信息为合法的校验信息之前,服务器生成第一随机数并将第一随机数通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一随机数后,根据第一私钥将第一随机数加密,得到加密第一随机数。第一电子设备将加密第一随机数通过无线接入设备发送至服务器。服务器在接收到加密第一随机数后,并根据第一校验信息中预置的第一公钥将加密第一随机数解密,得到第一随机数后,服务器确定出第一校验信息为合法的校验信息。
服务器在通过第一注册信息确定第一电子设备为合法的设备之后,服务器进一步根据校验信息验证第一电子设备的合法性。这样,可以提高后续传输配网信息的安全性。
这样,只有服务器通过第一认证信息确定第一电子设备为合法的设备之后,服务器才会生成第一授权码用于第一电子设备和无线接入设备协商得到第一密钥传递配网信息。当服务器通过第一认证信息确定第一电子设备不是合法的设备,那么服务器不会生成第一授权码,则第一电子设备得不到配网信息,第一电子设备也不能加入无线接入设备所在的无线局域网,这样,保证了配网过程中的安全性。
结合第二方面,在一种可能的实现方式中,在通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息之前,方法还包括:基于本地保存的预置参数和无线接入设备 基于本地保存的预置参数协商得到第二密钥;通过无线接入设备向服务器发送第一电子设备本地存储的第一认证信息,具体包括:基于第二密钥将本地存储的第一认证信息加密,得到加密的第一认证信息;向无线接入设备发送加密的第一认证信息;其中,加密的第一认证信息用于无线接入设备基于第二密钥将加密的第一认证信息解密后得到第一认证信息,并将第一认证信息发送至服务器。
在一些实现方式中,在无线接入设备将第一注册信息发送至第一电子设备之前,无线接入设备将第一注册信息以第二密钥加密,得到加密的第一注册信息。无线接入设备将加密的第一注册信息发送至第一电子设备。这样,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
这样,在第一电子设备向服务器发起注册请求之前(也可以说在第一电子设备通过无线接入设备向服务器发送第一认证信息之前),若第一电子设备与无线接入设备可以通过本地存储的预置参数协商得到第二密钥,则可以认为第一电子设备为初步合法的设备,第一电子设备可以通过无线接入设备向服务器发起注册请求。一方面,可以保证向服务器发起注册请求的第一电子设备为初步合法的电子设备,即第一电子设备中保存有预置参数。另一方面,第一电子设备与无线接入设备之间传递的信息通过第二密钥加密后在传递,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
结合第二方面,在一种可能的实现方式中,第一授权码包括m个授权码,m为大于等于1的正整数;基于第一授权码,与无线接入设备协商确定第一密钥,具体包括:基于第一授权码中的x个授权码和无线接入设备基于第一授权码中的y个授权码协商得到第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
也就是说,服务器将第一授权码发送至无线接入设备,无线接入设备将第一授权码保存在本地,且无线接入设备还需将第一授权码发送至第一电子设备。无线接入设备与第一电子设备可以从第一授权码中选取部分或全部的授权码协商得到第一密钥。
在一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码相同,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。
在另一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码不同,则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
结合第二方面,在一种可能的实现方式中,在接入无线接入设备的无认证网络之前,方法还包括:接收无线接入设备发送的接入信息;接入无线接入设备的无认证网络,具体包括:基于接入信息接入无线接入设备的无认证网络。无认证网络的接入信息可以包括无认证网络的标识和无线接入设备的物理地址等。
结合第二方面,在一种可能的实现方式中,在接入无线接入设备的无认证网络之前,方法还包括:广播第一电子设备的配网信元,其中,配网信元用于使得其他电子设备发现处于待配网状态的第一电子设备。
结合第二方面,在一种可能的实现方式中,配网信息包括,无线接入设备所在的无线局域网的名称和密码。
第三方面,本申请实施例提供了在一种配网方法,应用于无线接入设备,方法包括:在 第一电子设备接入无线接入设备的无认证网络后,向服务器发送第一请求消息;其中,第一请求消息用于服务器生成第一授权码,其中,第一授权码不同于无线接入设备向接入无线接入设备的无认证网络的其他电子设备发送的授权码;获取第一授权码,并基于第一授权码,与第一电子设备协商确定第一密钥;基于第一密钥加密无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向第一电子设备发送加密的配网信息;其中,加密的配网信息用于第一电子设备基于第一密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上无线接入设备所在的无线局域网。
其中,在一些实现方式中,第一授权码是由服务器响应不同的电子设备的请求消息随机生成的,其中,授权码可以是服务器根据预设的随机数生成算法随机生成的;在一些实现方式中,服务器也有可能为不同的电子设备生成相同的授权码。
在另一些实现方式中,服务器也可以生成第一授权码和第二授权码,服务器将第一授权码和第二授权码发送至无线接入设备,无线接入设备将第一授权码保存至本地,无线接入设备将第二授权码发送至第一电子设备。之后,无线接入设备与第一电子设备基于第一授权码和第二授权码协商得到第一密钥。当第一授权码和第二授权码相同时,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。当第一授权码和第二授权码不同时,则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
通过第三方面的方法,第一、可以减少配网过程中人工的干预。具体地,配网方法不需要用户输入无线接入设备所在的无线局域网的名称和密码,操作简单。第二、在配网过程中,无线接入设备一直处于AP模式。这样,不会影响连接上无线接入设备的其他设备正在进行的业务。第三、服务器针对不同的电子设备生成的授权码不同,保证了每个电子设备使用的高密的通道均不相同,该方案提高了敏感信息(如无线接入设备所在的无线局域网的名称和密码)传递的安全性,保证了配网过程的安全性。
结合第三方面,在一种可能的实现方式中,在获取第一授权码之前,方法还包括:接收第一电子设备发送的第一电子设备本地存储的第一认证信息;向服务器发送第一认证信息;其中,第一认证信息用于服务器确定第一电子设备为合法设备。
服务器判断第一认证信息满足第一条件时,则确定第一电子设备为合法设备。
在一些实现方式中,第一认证信息包括第一注册信息。
在服务器接收第一请求信息之后,在服务器接收无线接入设备发送的第一认证信息之前,服务器生成第一注册信息(例如注册码),并将第一注册信息保存在本地,得到第二注册信息。服务器将第一注册信息通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一注册信息之后,将第一注册信息保存在本地。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。即当服务器确认第一电子设备通过无线接入设备发送的第一注册信息是之前服务器通过无线接入设备发送的第一电子设备的注册信息,则服务器可以初步确定出电子设备为合法的设备。
在另一些实现方式中,第一认证信息包括第一注册信息和第一校验信息。第一检验信息可以为数字证书或者KPI证书中的任意一种。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。并且第一校验信息为合法的校验信息。
具体的,服务器在确定第一校验信息为合法的校验信息之前,服务器生成第一随机数并 将第一随机数通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一随机数后,根据第一私钥将第一随机数加密,得到加密第一随机数。第一电子设备将加密第一随机数通过无线接入设备发送至服务器。服务器在接收到加密第一随机数后,并根据第一校验信息中预置的第一公钥将加密第一随机数解密,得到第一随机数后,服务器确定出第一校验信息为合法的校验信息。
服务器在通过第一注册信息确定第一电子设备为合法的设备之后,服务器进一步根据校验信息验证第一电子设备的合法性。这样,可以提高后续传输配网信息的安全性。
这样,只有服务器通过第一认证信息确定第一电子设备为合法的设备之后,服务器才会生成第一授权码用于第一电子设备和无线接入设备协商得到第一密钥传递配网信息。当服务器通过第一认证信息确定第一电子设备不是合法的设备,那么服务器不会生成第一授权码,则第一电子设备得不到配网信息,第一电子设备也不能加入无线接入设备所在的无线局域网,这样,保证了配网过程中的安全性。
结合第三方面,在一种可能的实现方式中,在接收第一电子设备发送的第一电子设备本地存储的第一认证信息之前,方法还包括:基于本地保存的预置参数和第一电子设备基于本地保存的预置参数协商得到第二密钥;接收第一电子设备发送的第一电子设备本地存储的第一认证信息,具体包括:接收第一电子设备发送的基于第二密钥加密的第一认证信息;在向服务器发送第一认证信息之前,方法还包括:基于第二密钥将加密的第一认证信息解密,得到第一认证信息。
在一些实现方式中,在无线接入设备将第一注册信息发送至第一电子设备之前,无线接入设备将第一注册信息以第二密钥加密,得到加密的第一注册信息。无线接入设备将加密的第一注册信息发送至第一电子设备。这样,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
这样,在第一电子设备向服务器发起注册请求之前(也可以说在第一电子设备通过无线接入设备向服务器发送第一认证信息之前),若第一电子设备与无线接入设备可以通过本地存储的预置参数协商得到第二密钥,则可以认为第一电子设备为初步合法的设备,第一电子设备可以通过无线接入设备向服务器发起注册请求。一方面,可以保证向服务器发起注册请求的第一电子设备为初步合法的电子设备,即第一电子设备中保存有预置参数。另一方面,第一电子设备与无线接入设备之间传递的信息通过第二密钥加密后在传递,可以保证第一电子设备与无线接入设备之间信息传递的安全性。
结合第三方面,在一种可能的实现方式中,第一授权码包括m个授权码,m为大于等于1的正整数;与第一电子设备协商确定第一密钥,具体包括:基于第一授权码中的x个授权码和第一电子设备基于第一授权码中的y个授权码协商得到第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
也就是说,服务器将第一授权码发送至无线接入设备,无线接入设备将第一授权码保存在本地,且无线接入设备还需将第一授权码发送至第一电子设备。无线接入设备与第一电子设备可以从第一授权码中选取部分或全部的授权码协商得到第一密钥。
在一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码相同,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。
在另一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码不同, 则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
结合第三方面,在一种可能的实现方式中,在第一电子设备接入无线接入设备的无认证网络之前,方法还包括:响应于第一用户操作,发送无认证网络的接入信息;其中,接入信息用于第一电子设备接入无线接入设备的无认证网络。第一用户操组可以是作用于无线接入设备的配网键的按压操作,无认证网络的接入信息可以包括无认证网络的标识和无线接入设备的物理地址等。无线接入设备只有接收第一用户操作后(即得到用户的授权),无线接入设备才会发送无线接入设备的无认证网络的接入信息。
在一些实现方式中,无线接入设备响应于第一用户操作,持续性发送无认证网络的接入信息。
在第一电子设备接入无线接入设备所在的无线局域网后,第三电子设备接入无线接入设备的无认证网络。无线接入设备向服务器发送第二请求消息。服务器接收第二请求消息后,生成第二授权码,其中,第二授权码不同于服务器接收无线接入设备发送的其他电子设备的请求消息后生成的授权码。无线接入设备、第三电子设备获取第二授权码,并基于第二授权码协商得到第二密钥。无线接入设备基于第二密钥加密无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向第三电子设备发送加密的配网信息。第三电子设备接收加密的配网信息,基于第二密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上无线接入设备所在的无线局域网。这样,无线接入设备只需接收一次用户操作,持续性发送无认证网络的接入信息。在无线接入设备停止发送无认证网络的接入信息之前,可以有一个或多个电子设备接上无线接入设备的无认证网络,那么无线接入设备可以采取与第一电子设备一样的配网流程完成与其他的一个或多个电子设备(例如第三电子设备)的配网流程。也即,无线接入设备只需接收一次用户操作,可完成与多个电子设备的配网流程,与目前无线接入设备接收一次用户操作,只能完成与一个电子设备的配网流程相比,提高了电子设备的配网效率。
在一些实现方式中,在无线接入设备完成与第三电子设备的配网流程后,无线接入设备确定出连接上无线接入设备的无认证网络的电子设备的数量为0之后,无线接入设备停止发送无认证网络的接入信息。
在一些实现方式中,在无线接入设备完成与第三电子设备的配网流程后,无线接入设备确定出连接上无线接入设备的无认证网络的电子设备的数量为0之后在等一段时间,在这段时间内,无线接入设备仍然持续性发送无认证网络的接入信息,若没有其他的电子设备连接上无线接入设备的无认证网络,则无线接入设备停止发送无认证网络的接入信息。
结合第三方面,在一种可能的实现方式中,在第一电子设备接入无线接入设备的无认证网络之前,方法还包括:接收第一电子设备广播的第一电子设备的配网信元,其中,配网信元用于使得其他电子设备发现处于待配网状态的第一电子设备。
结合第三方面,在一种可能的实现方式中,配网信息包括,无线接入设备所在的无线局域网的名称和密码。
第四方面,本申请实施例提供了一种配网方法,应用于包括服务器,方法包括:接收第一请求消息,生成第一授权码,其中,第一授权码不同于服务器接收无线接入设备发送的其 他电子设备的请求消息后生成的授权码;将第一授权码发送至无线接入设备和第一电子设备,其中,第一授权码用于无线接入设备和第一电子设备协商得到第一密钥;第一密钥用于无线接入设备基于第一密钥加密无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向第一电子设备发送加密的配网信息;加密的配网信息用于第一电子设备基于第一密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上无线接入设备所在的无线局域网。
其中,在一些实现方式中,第一授权码是由服务器响应不同的电子设备的请求消息随机生成的,其中,授权码可以是服务器根据预设的随机数生成算法随机生成的;在一些实现方式中,服务器也有可能为不同的电子设备生成相同的授权码。
在另一些实现方式中,服务器也可以生成第一授权码和第二授权码,服务器将第一授权码和第二授权码发送至无线接入设备,无线接入设备将第一授权码保存至本地,无线接入设备将第二授权码发送至第一电子设备。之后,无线接入设备与第一电子设备基于第一授权码和第二授权码协商得到第一密钥。当第一授权码和第二授权码相同时,则无线接入设备与第一电子设备基于相同的授权码协商得到第一密钥。当第一授权码和第二授权码不同时,则无线接入设备与第一电子设备基于不同的授权码协商得到第一密钥。
第一电子设备可以是以下任一一项:智能灯、智能烤箱、智能风扇、智能空调、智能电视、智能大屏、智能手环、智能手表、智能音箱、智能冰箱,智能门窗、智能汽车、智能监控器、智能机器人、智能摄像头等。
通过第四方面的方法,第一、可以减少配网过程中人工的干预。具体地,配网方法不需要用户输入无线接入设备所在的无线局域网的名称和密码,操作简单。第二、在配网过程中,无线接入设备一直处于AP模式。这样,不会影响连接上无线接入设备的其他设备正在进行的业务。第三、服务器针对不同的电子设备生成的授权码不同,保证了每个电子设备使用的高密的通道均不相同,该方案提高了敏感信息(如无线接入设备所在的无线局域网的名称和密码)传递的安全性,保证了配网过程的安全性。
结合第四方面,在一种可能的实现方式中,在生成第一授权码之前,方法还包括:接收无线接入设备发送的第一电子设备本地存储的第一认证信息,并根据第一认证信息确定第一电子设备为合法设备。
服务器判断第一认证信息满足第一条件时,则确定第一电子设备为合法设备。
在一些实现方式中,第一认证信息包括第一注册信息。
在服务器接收第一请求信息之后,在服务器接收无线接入设备发送的第一认证信息之前,服务器生成第一注册信息(例如注册码),并将第一注册信息保存在本地,得到第二注册信息。服务器将第一注册信息通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一注册信息之后,将第一注册信息保存在本地。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第二注册信息相同。即当服务器确认第一电子设备通过无线接入设备发送的第一注册信息是之前服务器通过无线接入设备发送的第一电子设备的注册信息,则服务器可以初步确定出电子设备为合法的设备。
在另一些实现方式中,第一认证信息包括第一注册信息和第一校验信息。第一检验信息可以为数字证书或者KPI证书中的任意一种。
第一条件包括:第一认证信息中的第一注册信息与服务器本地保存的第一电子设备的第 二注册信息相同。并且第一校验信息为合法的校验信息。
具体的,服务器在确定第一校验信息为合法的校验信息之前,服务器生成第一随机数并将第一随机数通过无线接入设备发送至第一电子设备。第一电子设备在接收到第一随机数后,根据第一私钥将第一随机数加密,得到加密第一随机数。第一电子设备将加密第一随机数通过无线接入设备发送至服务器。服务器在接收到加密第一随机数后,并根据第一校验信息中预置的第一公钥将加密第一随机数解密,得到第一随机数后,服务器确定出第一校验信息为合法的校验信息。
服务器在通过第一注册信息确定第一电子设备为合法的设备之后,服务器进一步根据校验信息验证第一电子设备的合法性。这样,可以提高后续传输配网信息的安全性。
这样,只有服务器通过第一认证信息确定第一电子设备为合法的设备之后,服务器才会生成第一授权码用于第一电子设备和无线接入设备协商得到第一密钥传递配网信息。当服务器通过第一认证信息确定第一电子设备不是合法的设备,那么服务器不会生成第一授权码,则第一电子设备得不到配网信息,第一电子设备也不能加入无线接入设备所在的无线局域网,这样,保证了配网过程中的安全性。
结合第四方面,在一种可能的实现方式中,配网信息包括,无线接入设备所在的无线局域网的名称和密码。
第五方面,本申请实施例提供了一种电子设备,为第一电子设备,第一电子设备包括:一个或多个处理器、一个或多个存储器;一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,一个或多个处理器调用计算机指令以使得第一电子设备执行上述任一方面任一可能的实现方式中第一电子设备执行的方法步骤。
第六方面,本申请实施例提供了一种无线接入设备,无线接入设备包括:一个或多个处理器、一个或多个存储器;一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,一个或多个处理器调用计算机指令以使得无线接入设备执行上述任一方面任一可能的实现方式中无线接入设备执行的方法步骤。
第七方面,本申请实施例提供了一种芯片装置,芯片装置包括至少一个处理器以及存储器,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,至少一个处理器调用计算机指令使得安装有芯片装置的第一电子设备执行上述任一方面任一可能的实现方式中第一电子设备执行的方法步骤。
第八方面,本申请实施例提供了一种芯片装置,芯片装置包括至少一个处理器以及存储器,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,至少一个处理器调用计算机指令使得安装有芯片装置的无线接入设备执行上述任一方面任一可能的实现方式中无线接入设备执行的方法步骤。
第九方面,本申请实施例提供了一种可读存储介质,用于存储计算机指令,当计算机指 令在第一电子设备上运行时,使得第一电子设备执行上述任一方面任一可能的实现方式中第一电子设备执行的方法步骤。
第十方面,本申请实施例提供了一种可读存储介质,用于存储计算机指令,当计算机指令在无线接入设备上运行时,使得无线接入设备执行上述任一方面任一可能的实现方式中无线接入设备执行的方法步骤。
第十一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在第一电子设备上运行时,使得第一电子设备执行上述任一方面任一可能的实现方式中第一电子设备执行的方法步骤。
第十二方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在无线接入设备上运行时,使得无线接入设备执行上述任一方面任一可能的实现方式中无线接入设备执行的方法步骤。
附图说明
图1为本申请实施例提供的一种软接入点配网方式的方法流程图;
图1A为本申请实施例提供的一种配网界面图;
图2为本申请实施例提供的一种组播配网方案的方法流程图;
图3为本申请实施例提供的一种基于人工智能物联网天线配网方案的方法流程图;
图3A-图3B为本申请实施例提供的一组配网界面图;
图4为本申请实施例提供的一种系统架构示意图;
图5为本申请实施例提供的一种电子设备200的结构示意图;
图6为本申请实施例提供的一种路由器300的结构示意图;
图7为本申请实施例提供的一种电子设备200连接至路由器300的open ssid的方法流程图;
图8为本申请实施例提供的一种服务器400生成电子设备200的注册信息并完成电子设备200的校验的任务事项的方法流程图;
图9为本申请实施例提供的一种电子设备200与路由器300传输配网信息的方法流程图;
图9A-图9F为本申请实施例提供的一组“远程配网”的UI图;
图10A-图10C为本申请实施例提供的一组“一键配网”的UI图;
图11-图13为本申请实施例提供的几种“一键配网”流程图;
图14为本申请实施例提供的一种配网方法的流程示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请的说明书和权利要求书及附图中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。应用程序的用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在终端设备上经过解析,渲染,最终呈现为用户可以识别的内容,比如图像、文本、按钮等控件。控件(control)也称为部件(widget),是用户界面的基本元素,典型的控件有工具栏(toolbar)、菜单栏(menu bar)、输入框、按钮(button)、滚动条(scrollbar)、图像和文本。界面中的控件的属性和内容是通过标签或者节点来定义的,比如XML通过<Textview>、<ImgView>、<VideoView>等节点来规定界面所包含的控件。一个节点对应界面中一个控件或属性,节点经过解析和渲染之后呈现为用户可视的内容。此外,很多应用程序,比如混合应用(hybrid application)的界面中通常还包含有网页。网页,也称为页面,可以理解为内嵌在应用程序界面中的一个特殊的控件,网页是通过特定计算机语言编写的源代码,例如超文本标记语言(hyper text markup language,HTML),层叠样式表(cascading style sheets,CSS),java脚本(JavaScript,JS)等,网页源代码可以由浏览器或与浏览器功能类似的网页显示组件加载和显示为用户可识别的内容。网页所包含的具体内容也是通过网页源代码中的标签或者节点来定义的,比如HTML通过<p>、<img>、<video>、<canvas>来定义网页的元素和属性。
用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个窗口、控件等界面元素。
首先介绍,目前常用的几种配网方法。
方式一:软接入点(soft access point,softAP)配网方式
图1示例性示出了电子设备100利用softAP配网方式为电子设备200配网的方法流程图。
如图1所示,该softAP配网的方法可以包括步骤S101~S108。其中:
S101、电子设备200开启,处于待配网状态。
电子设备200处于待配网状态,也可以称为电子设备200处于AP模式。
当接收到用于触发电子设备200(例如智能音箱)进入待配网状态的用户操作,电子设备100可以开启热点。上述用于触发电子设备200开启,并处于待配网状态的用户操作可以是作用在电子设备200上的相关按键(例如配网键)的长按操作(例如,长按3秒)。
可选的,配网键可以是“Hi键”或“WPS键”等等,本申请对于配网键的名称不做限定。
配网键的类型是按压式的,也可以是旋转式的,还可以是拨动式的,本申请对于配网键的类型不做限定。
在一些实施例中,上述用于触发电子设备200开启,并处于待配网状态的用户操作可以是使得未连接过其他设备所在的无线网络的电子设备200上电的操作,或者也可以是使得已连接过其他设备所在的无线网络,但是恢复出厂设置后的电子设备200上电的操作。
本申请实施例对上述用于触发电子设备200开启并处于待配网状态的用户操作不作限定。在实际应用中,电子设备200可以通过多种方式进入待配网状态,例如智能遥控或手机应用 APP中开启等等。
S102、电子设备200可以以广播的形式发送配网信元(information element,IE)。
响应于电子设备200处于待配网状态,电子设备200以广播的形式发送电子设备200的配网IE。
电子设备200的配网IE可以包括但不仅限于:电子设备200的标识、电子设备200是否支持互连的能力、电子设备200的物理地址等。电子设备200的配网IE还可以包括其他更多的信息,例如电子设备200的生产厂商等,本申请对于电子设备200的配网IE不做限定。
需要说明的是,在电子设备200接收到配网信息之前,电子设备200可以持续地广播电子设备200的配网IE。
S103、电子设备100可以接收到来自电子设备200的配网IE,并接收到用于选择连接电子设备200的热点的用户操作。
S104、电子设备100可以连接电子设备200的热点。
在一些实施例中,电子设备100可以接收到至少一个电子设备的配网IE。该至少一个电子设备中包括电子设备200。电子设备100可以显示包含有上述至少一个电子设备的热点名称。响应于用于选择电子设备200的热点的用户操作,电子设备100可以根据配网IE中电子设备200的物理地址连接电子设备200的热点。
当连接上电子设备200的热点,电子设备100和电子设备200可以建立设备之间的局域网。该局域网可用于电子设备100和电子设备200之间进行数据传输。
S105、电子设备100可以接收用户输入的配网信息,配网信息可包括路由器的名称和密码。
示例性的,电子设备100可以显示如图1A所示的用户界面10。用户界面10可包括悬浮显示在智慧生活应用程序的主界面上的配网信息输入框1001。配网信息输入框1001也可以悬浮显示在其他用户界面(例如电子设备100的主界面)上,本申请在此不做限定。配网信息输入框1001中可包括名称输入栏1002、密码输入栏1003以及确认控件1004。其中,名称输入栏1002可用于输入或从列表中选择路由器的名称(即接入Wi-Fi的名称)。密码输入栏1003可用于输入路由器的密码(即接入Wi-Fi的密码)。确认控件1004可用于触发电子设备100将接收到的路由器的名称以及密码发送给电子设备200。
图1A仅为本申请中电子设备100接收用户输入配网信息的用户界面的示例性说明,不对本申请构成限定。
在一些实施例中,电子设备100中存储有上述配网信息。电子设备100可以无需用户输入配网信息,即图1A中所示的配网信息输入框1001中的名称输入栏1002的路由器的名称和密码输入栏1003中的路由器的密码已经自动填写在对应的位置,不需要用户再次输入路由器的名称和路由器的密码。用户只需点击确认控件1004,电子设备100可将路由器的名称以及密码发送给电子设备200。
S106、电子设备100可以通过局域网向电子设备200发送配网信息。
利用电子设备100和电子设备200之间的局域网,电子设备100可以将上述配网信息发送给电子设备200。
S107、电子设备200可以向电子设备100发送配网信息接收应答。此步骤是可选步骤。
当接收到上述配网信息,电子设备200可以向电子设备100发送配网信息接收应答,来指示电子设备100自己已收到配网信息。
需要进行说明的是,电子设备100发送配网信息时可以对配网信息进行加密。当接收到 经过加密的配网信息,电子设备200可以进行解密以得到配网信息。本申请实施例对上述加密和解密的方法不作限定。
S108、电子设备200可以停止广播配网IE,并利用接收到的配网信息连接路由器。
当关闭热点,电子设备200可以停止广播配网IE。利用接收到的配网信息,电子设备200可以与路由器300建立连接。
图1实施例所示的softAP配网方式中,在电子设备200接收到电子设备100发送的配网信息之前,电子设备200工作在接入点(access point,AP)模式,电子设备100通过连接电子设备200的热点将路由器300的配网信息发送给电子设备200;当电子设备200接收到配网信息之后,电子设备200由AP模式切换为站点(station,STA)模式,并基于配网信息连接上路由器300。
本申请实施例对电子设备100与电子设备200之间进行softAP配网的方法不作限定。在softAP配网的过程中,电子设备100和电子设备200还可以交互更多或更少的信息。
由上述分析可知,电子设备200通过软接入点配网方式连接至路由器300时,需要用户打开第一应用程序(例如智慧生活应用程序)进行操作,例如输入路由器的名称和密码并点击确定,电子设备200才能获取路由器300的名称和密码、连接至路由器300。可以看出,整个过程需要用户干预才能完成电子设备200的配网流程;并且若有多个待配网的设备需要配网时,用户需要重复多次同样的操作使多个待配网的设备依次完成与路由器300的连接,操作比较复杂。
方式二:组播配网方案
图2示例性示出了电子设备100利用组播配网方案为电子设备200配网的方法流程图。
S201、电子设备200(例如智能音箱)开启,电子设备200处于待配网状态。
S202、电子设备200以广播的形式发送电子设备200的配网IE。
S201中,使得电子设备200处于待配网状态的用户操作与S101中使得电子设备200处于待配网状态的用户操作相同,具体的,可以参考S101中的相关描述,本申请实施例在此不再赘述。
在一些实施例中,电子设备200处于待配网状态,也可以称为电子设备200处于AP模式。
响应于电子设备200处于待配网状态,电子设备200以广播的形式发送电子设备200的配网IE。
S203、路由器300接收到电子设备200的配网IE,路由器300的指示灯闪烁。
路由器300接收到电子设备200的配网IE,并识别到电子设备200处于待配网状态,路由器300的指示灯闪烁,以此提示用户路由器300发现了待配网的设备(例如电子设备200)。
不限于路由器300的指示灯闪烁,路由器300还可以通过其他的方式来提示用户路由器300发现了待配网的设备,本申请在此不做限定。
S204、路由器300接收用户触发(例如按压)配网键的操作。
S205、响应于用户触发(例如按压)配网键的操作,路由器300发送组播报文,组播报文携带了路由器300的名称和密码。
路由器300的指示灯闪烁,以此提示用户路由器300发现了待配网的设备。路由器300接收用户触发(例如按压)配网键的操作,路由器300向发送组播报文,组播报文携带了路由器300的名称和密码。
组播报文还可以携带其他的信息,本申请在此不做限定。
可选的,路由器300可以根据预设的加解密方式将组播报文加密后发送至电子设备200。
S206、电子设备200接收到组播报文,得到组播报文中携带的路由器300的名称和密码。
电子设备200接收到组播报文,得到组播报文中携带的路由器300的名称和密码。
可选的,电子设备200接收到以预设的加解密方式加密的组播报文,并根据预设的解密方式将以预设的加解密方式加密的组播报文解密出来,并解析出组播报文中携带的路由器300的名称和密码。
这里,预设的加密方式和预设的解密方式是路由器300和电子设备200在出厂之前已预设好的。路由器300根据预设的协议规定的加密方式将组播报文加密,之后,电子设备200可以将根据预设的协议规定的解密方式将加密的组播报文解密出来。
S207、电子设备200基于路由器300的名称和密码连接上路由器300。
由上述分析可知,在电子设备200基于路由器300的名称和密码连接上路由器300之前,电子设备200一直处于AP模式,且电子设备100也没有与路由器300建立连接。电子设备200与路由器300需通过组播报文预留字段来传递配网信息,这种方式不符合目前802.11协议规定的无线局域网标准。并且电子设备200与路由器300在通过组播报文传递路由器300的配网信息时,需要遵循相同的加解密方式,即加解密方式在电子设备200与路由器300出厂之前已预设好的。若电子设备200和路由器300不属于同一个厂商生产的设备时,电子设备200无法完成与路由器300的配网流程,不同厂商的设备存在兼容性的问题。
方式三:基于人工智能物联网(artificial intelligence of things,AIoT)天线的配网方案
AIoT是将人工智能技术与物联网基础设施相结合,以实现更高效的物联网操作,改善人机交互,增强数据管理和分析能力的一种技术。当路由器300包含AIoT天线时,可以采用方式三完成对电子设备200的配网,其中,AIoT天线可以指用于发现并连接处于待配网状态的设备的天线。方式三通过在路由器300上加装AIoT天线,使路由器300可以以类似于方式一中的电子设备100的方式工作,从而路由器300通过AIoT天线可以将路由器300的名称和密码发送给带配网的设备(例如电子设备200)。
具体地,若路由器300上没有AIoT天线,在路由器300发现处于待配网设备之后,路由器300需要将工作模式由AP模式切换至STA模式,并连接上待配网设备的热点,这样路由器300才可以将配网信息发送给待配网设备。但是,在路由器300需要将工作模式由AP模式切换至STA模式时,此时有其他的电子设备(例如电子设备100)连接上路由器300所在的无线网络,并通过路由器300所在的无线网络与其他的电子设备(例如平板)进行视频通话。但是若路由器300将工作模式由AP模式切换至STA模式,路由器300将无法为连接至路由器300所在的无线网络的电子设备100提供网络服务。这时,会影响电子设备100正在进行的业务,例如电子设备100与平板的视频通话出现卡顿甚至中断的问题。
路由器300上的AIoT天线可以很好的解决这一问题。即路由器300可以通过AIoT天线接收电子设备200发送的广播帧,并发现处于待配网状态的电子设备200。之后路由器300可以通过AIoT天线连接上电子设备200的热点,路由器300通过AIoT天线将配网信息发送至电子设备200。这样,路由器300可以一直工作在AP模式,不会影响连接至路由器300所在的无线网络的电子设备正在进行的业务。在一些实施例中,AIoT天线也可以简称为智能天线。
图3示例性示出了电子设备100利用AIoT天线为电子设备200配网的方法流程图。
方式三可以包含以下步骤:
S301、电子设备200(例如智能音箱)开启,电子设备200处于待配网状态。待配网状态即等待接收配网信息的状态。
S301中,使得电子设备200处于待配网状态的用户操作与S101中使得电子设备200处于待配网状态的用户操作相同,具体的,可以参考S101中的相关描述,本申请实施例在此不再赘述。
S302、响应于电子设备200处于待配网状态,电子设备200以广播的形式发送电子设备200的配网IE。
S303、路由器300发现电子设备200的配网IE,并连接上电子设备200的热点。
S304、路由器300发送信息一至服务器。
路由器300发现电子设备200的配网IE之后,路由器300的智能天线切换至STA模式,路由器300的智能天线连接上电子设备200的热点。之后,路由器300向服务器发送信息一,该信息一用于指示服务器,路由器300发现了处于待配网的电子设备200。S305、电子设备100弹窗显示发现待配网设备,电子设备100接收用户的确认操作。
服务器接收到路由器300发送的信息一之后,服务器400将路由器300发现待配网的电子设备200的提示信息显示在第一应用程序(例如智慧生活应用程序)的用户界面上,以使得用户可以看到该提示信息,继而电子设备100接收用户的用于同意为电子设备200配网的确认操作。只有在电子设备100接收到用户的确认操作,路由器300才可以将配网信息发送至电子设备200。
示例性的,如图3A所示,图3A示例性示出了电子设备100上的用户界面20。
用户界面20可包括悬浮显示在第一应用程序(例如智慧生活应用程序)的主界面上的提示栏2001。提示栏2001也可以悬浮显示在其他用户界面(例如电子设备100的主界面)上,本申请在此不做限定。提示栏2001中可包括问题提示信息“智能天线发现智能音箱”、控件2002和控件2003。提示栏2001用于提示用户完成验证过程。电子设备100可以接收用户触发(例如单击)控件2002的操作,该操作表示用户不同意路由器将配网信息发送至电子设备200。电子设备100也可以接收用户触发(例如单击)控件2003的操作,该操作表示用户同意路由器300将配网信息发送至电子设备200。
示例性的,如图3A所示,电子设备100接收用户触发(例如单击)控件2003的操作,响应于用户触发(例如单击)控件2003的操作,电子设备100向服务器发送确认信息,服务器将该确认信息发送至路由器300,该确认信息用于告知路由器300,用户同意路由器300将配网信息发送至电子设备200。
在电子设备100接收用户触发(例如单击)控件2003的操作之后,电子设备100显示如图3B所示的用户界面30。
用户界面30用于提示用户将电子设备200与电子设备100关联同一个账户,即将电子设备100与电子设备200之间绑定。
用户界面30包括控件3001、控件3002和控件3003。
如图3B所示,电子设备100接收用户对控件3003的触发操作(例如单击操作),电子设备100将电子设备200与电子设备100关联同一个账户,即电子设备100与电子设备200之间具有绑定关系。
例如,电子设备100和电子设备200之间具有绑定关系。服务器400可以记录电子设备100和电子设备200关联同一个账户。服务器400可以接收来自电子设备100用于控制电子 设备200的指令(如指示电子设备200开启的指令)。当确定电子设备100与电子设备200是关联有同一个账户的电子设备,服务器400可以将该控制指令发送给电子设备200,使得电子设备200执行该控制指令对应的操作。服务器400也可以接收来自电子设备200用于向电子设备100上报自己的状态信息的消息(例如指示电子设备200电量的消息)。当确定电子设备100与电子设备200是关联有同一个账户的电子设备,服务器400可以将上述指示电子设备200状态信息的消息发送给电子设备100,使得电子设备100更新电子设备200的状态信息。
S306、电子设备100发送信息二至路由器300。
S307、路由器300在接收到信息二之后,路由器300通过智能天线向电子设备200发送路由器300的名称和密码。
在电子设备100接收确认连接的用户操作之后,电子设备100向服务器发送信息二,服务器将该信息二发送至路由器300,在路由器300接收到服务器发送的信息二之后,路由器300将智能天线由STA模式切换为AP模式。之后,路由器300通过智能天线向电子设备200发送路由器300的名称和密码,并等待电子设备200连接上路由器300。
可选的,电子设备100可以直接将信息二发送至路由器300,路由器300接收到电子设备100发送的信息一之后,路由器300通过智能天线向电子设备200发送路由器300的名称和密码。
S308、电子设备200接收路由器300的名称和密码,并通过路由器的名称和密码连接至路由器300。
由上述分析可知,该方案的本质是在路由器300上添加了一个智能天线,路由器300发现并连接处于待配网状态的设备的热点,路由器300通过智能天线将配网信息发送至处于待配网状态的设备。但是智能天线的覆盖范围是以路由器300为中心向外辐射的约9米以内的距离。并且,智能天线发送的信号的穿墙性很差,即智能天线发送的信号经过障碍物之后,几乎衰减的不可用,导致电子设备200接收不到路由器300的智能天线发送的配网信息,导致配网失败。
综上所述,为了解决上述配网方式存在的缺陷,本申请实施例提供了一种配网方法,该方法包括:
首先,电子设备200连接上路由器300的无认证网络(open ssid)。在一种实现方式中,电子设备200处于待配网状态,电子设备200广播电子设备200的配网IE。路由器300接收到电子设备200的配网IE之后,路由器300发送路由器300的open ssid,电子设备200接收到路由器300的open ssid,之后,电子设备200连接上路由器300的open ssid。
之后,服务器400随机生成auth code(授权码),电子设备200和路由器300获取到该auth code。在一种实现方式中,路由器300与电子设备200协商密钥一,电子设备200将注册信息以及电子设备200的校验信息通过密钥一加密后,通过路由器300发送至服务器400。服务器400接收到电子设备200的注册信息和校验信息之后,判断电子设备200为允许配网的设备,服务器400将电子设备200和路由器300关联同一账号。之后,服务器400随机生成auth code(授权码),服务器400将auth code发送至路由器300。路由器300接收服务器400发送的auth code,并将auth code发送给电子设备200。从而,路由器300和电子设备200都获取到服务器400随机生成的auth code。
最后,路由器300将使用基于auth code的密钥加密的配网信息发送给电子设备200,电 子设备200接收并进行解密、获取配网信息,电子设备200使用配网信息接入路由器300。在一种实现方式中,路由器300和电子设备200通过auth code协商得到密钥二,路由器300将路由器300的名称和密码通过密钥二加密后发送至电子设备200;电子设备200接收到通过密钥二加密后的路由器300的名称和密码并使用密钥二进行解密。电子设备200获取到路由器300的名称和密码。从而,电子设备200使用路由器300的名称和密码连接上路由器300。其中,上述路由器300的名称和密码也可替换为路由器300所在的无线局域网的名称和密码。
应理解,本申请实施例所述的“发送”,可以指设备A直接向设备B发送,也可以指设备A经由一个至多个其他设备的转发向设备B发送。
需要说明的是,服务器400向电子设备200和路由器300发送的auth code可以相同,也可以不同,本申请实施例在此不做限定,本申请以下实施例以服务器400向电子设备200和路由器300发送的auth code相同为例进行说明。
当服务器400向电子设备200和路由器300发送的auth code相同时,有以下两种实现方式:
方式一:服务器400生成auth code集合一,auth code集合一包括m个auth code,m大于等于1。服务器400将auth code集合一发送至路由器300,路由器300接收到auth code集合一之后,路由器300将auth code集合一保存至本地。然后,路由器300再将auth code集合一发送至电子设备200,电子设备200获取到auth code集合一。之后,电子设备200和路由器300通过预置算法基于auth code集合一中的m个auth code协商得到密钥二。
方式二:服务器400生成auth code集合一和auth code集合二,auth code集合一包括m个auth code,auth code集合二包括m个auth code,m大于等于1。auth code集合一中的m个auth code和auth code集合二中的m个auth code相同,也可以说auth code集合一和auth code集合二相同。服务器400将auth code集合一和auth code集合二发送至路由器300,路由器300接收到auth code集合一和auth code集合二之后,路由器300将auth code集合一保存至本地。然后,路由器300再将auth code集合二发送至电子设备200,电子设备200获取到auth code集合二。之后,电子设备200和路由器300通过预置算法基于auth code集合一中的m个auth code和auth code集合二中的m个auth code协商得到密钥二。
当服务器400向电子设备200和路由器300发送的auth code不同时,有以下两种实现方式:
方式一:服务器400需生成auth code集合一,auth code集合一包括m个auth code,m大于等于2。服务器400将auth code集合一发送至路由器300,路由器300接收到auth code集合一之后,路由器300将auth code集合一保存至本地。然后,路由器300再将auth code集合一发送至电子设备200,电子设备200获取到auth code集合一。之后,电子设备200基于auth code集合一中的x个auth code和路由器300基于auth code集合一中的y个auth code协商得到密钥二。其中,auth code集合一中的x个auth code与auth code集合一中的y个auth code不同,x大于等于1小于等于m,y大于等于1小于等于m。
方式二:服务器400需生成不同的auth code集合(例如auth code集合一和auth code集合二),auth code集合一和auth code集合二不相同,也可以说auth code集合一内包含的auth code和auth code集合二内包含的auth code不同。服务器400将auth code集合一和auth code集合二发送至路由器300,路由器300接收到auth code集合一和auth code集合二之后,路由器300可以将auth code集合二保存至本地,然后,路由器300将auth code集合一发送至电子设备200,电子设备200获取到auth code集合一。或者,路由器300也可以将auth code集 合一保存至本地,路由器300将auth code集合二发送至电子设备200,电子设备200获取到auth code集合二。电子设备200和路由器300通过预置算法基于auth code集合一和auth code集合二协商得到密钥二。auth code集合二可以包括一个或多个auth code。
这里的预置算法可以是以下实施例介绍的迪菲-赫尔曼(diffie hellman,DH)算法,预置算法也可以是其他的算法,本申请实施例在此不做限定。需要说明的是,auth code集合一可以包括一个或多个auth code的集合,auth code二也可以包括一个或多个auth code的。
本申请实施例提供的配网方法,至少可以在以下方面具备有益效果:
第一方面,与方式一中的softAP配网方案相比,本申请实施例提供的配网方法可以减少配网过程中人工的干预。具体地,本申请实施例提供的配网方法不需要用户输入路由器300的名称和密码,操作简单。
第二方面,与方式二提供的组播配网方案相比,本申请实施例提供的配网方法未修改802.11协议规定的无线局域网标准。具体地,电子设备200与路由器300不需要通过组播报文预留字段来传递配网信息。
第三方面,与方式三提供的AIoT天线的配网方案相比,本申请实施例提供的配网方法没有新增硬件要求。具体的,路由器300不需要另外安装一个AIoT天线,也可以使得路由器300在配网过程中可以一直处于AP模式。这样,不会影响连接上路由器300的其他设备正在进行的业务。
第四方面,本申请实施例提供的配网方法可以提高配网过程的安全性。在服务器400通过校验信息验证电子设备200为允许配网的设备之后,服务器400随机生成auth code,可以理解的是,服务器400为不同设备生成的auth code是不同的。auth code用于路由器300和电子设备200协商高密的通道从而完成敏感信息(路由器300的名称和密码)的传送。不同设备的auth code是不同的,因此每个待配网设备使用的高密的通道均不相同,该方案提高了敏感信息(如路由器300的名称和密码)传递的安全性,保证了配网过程的安全性。
本申请实施例提供的配网方法可以应用于“一键配网”的应用场景,即,一次性为一至多个待配网设备配网。具体地,路由器300发现了一个或多个待配网设备时,路由器300接收同意配网的用户操作。之后,路由器300持续性地广播路由器300的open ssid。该一个或多个待配网设备连接上路由器300的open ssid之后,路由器300依次完成连接上路由器300的open ssid的一个或多个待配网设备的配网过程。路由器300只需接收用户一次操作,即可完成与一个或多个待配网设备的配网过程,与目前路由器300接收一次用户操作,只能完成与一个待配网设备的配网过程相比,本申请实施例提供的配网方案提高了路由器的配网效率,并且节省了用户操作的次数,提高了用户体验。
本申请实施例提供的配网方法也可以应用于“远程配网”的应用场景,操作电子设备100的用户A也可以远程指导操作电子设备200的用户B将电子设备200上电后,用户A远程通过操作电子设备100来完成对电子设备200的配网。具体的,路由器300发现了处于待配网状态的电子设备200,电子设备100在第一应用程序的远程配网界面上显示发现了处于待配网状态的电子设备200的提示信息。之后,电子设备100可以接收用户A在第一应用程序的远程配网界面上的输入操作,触发路由器300将配网信息发送至处于待配网状态的电子设备200,从而电子设备200接收到路由器300发送的配网信息,电子设备200通过路由器300的配网信息连接上路由器300。用户A与用户B可以不是同一个用户,且用户A不需要在路由 器300和电子设备200的附近,实现了用户A远程将电子设备200连接上路由器300。
如图4所示,图4为本申请实施例提供的一种系统架构示意图。
如图4所示,通信系统40可包括电子设备100、电子设备200、路由器300、服务器400。其中,电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及个人数字助理(personal digital assistant,PDA)等设备。
电子设备200可以是智能灯、智能烤箱、智能风扇、智能空调、智能电视、智能大屏、智能手环、智能手表、智能音箱、智能冰箱,智能门窗、智能汽车、智能监控器、智能机器人、智能摄像头等。
本申请实施例对电子设备100和电子设备200的类型不作限定。本申请以下实施例以电子设备100为手机,电子设备200为智能音箱为例进行说明。
电子设备100可以连接上路由器300所在的无线局域网,或者,电子设备100也可以未连接上路由器300所在的无线局域网。本申请实施例在此不做限定。电子设备100可以与路由器300关联同一账号,且服务器400中可以记录有电子设备100和路由器300关联同一个账户的信息。电子设备100可以与服务器400通信,且电子设备100也可以通过服务器400验证电子设备100与路由器300关联了同一账号。具体的,服务器400可以接收来自电子设备100用于控制路由器300的指令(如指示路由器300开启的指令)。当服务器400确定电子设备100与路由器300关联了同一个账户,服务器400可以将该控制指令发送给路由器300,使得路由器300执行该控制指令对应的操作。服务器400也可以接收来自路由器300用于向电子设备100上报自己的状态信息(如与路由器300连接的设备的数量)的消息。当服务器400确定电子设备100与路由器300关联了同一个账户,服务器400可以将上述指示路由器300状态信息的消息发送给电子设备100,使得电子设备100可以接收到路由器300的状态信息。
当电子设备200需要连接至路由器300时,电子设备200接收用户操作从而电子设备200开启并处于待配网状态,处于待配网状态的电子设备200,可以以广播的形式发送电子设备200的配网IE。
路由器300接收并识别到电子设备200的配网IE之后,路由器300向服务器400发送生成电子设备200的注册信息的请求。服务器400接收并响应于该请求,服务器400生成电子设备200的注册信息。之后,服务器400将注册信息发送至路由器300。
路由器300接收到服务器400发送的电子设备200的注册信息之后,路由器300将与电子设备200通过预置参数协商密钥一,并通过密钥一将注册信息加密后发送至电子设备200。路由器300如何与电子设备200通过预置参数协商密钥一的,将在后续实施例详细介绍,本申请实施例在此不做赘述。电子设备200接收到路由器300发送的以密钥一加密的电子设备200的注册信息之后,电子设备200根据密钥一将以密钥一加密的电子设备200的注册信息解密后,得到电子设备200的注册信息。
需要说明的是,以上所述电子设备200广播配网IE、服务器400生成电子设备200的注册信息、服务器400将电子设备200的注册信息发送至路由器300和电子设备200等步骤,在图4中未体现。
之后,电子设备200将电子设备200的注册信息和校验信息以密钥一加密后发送至路由器300(可对应图4中的步骤一),路由器300以密钥一将以密钥一加密的电子设备200的注册信息和校验信息解密后,将电子设备200的注册信息和校验信息发送至服务器400(可对 应图4中的步骤二)。
服务器400接收到电子设备200的注册信息和校验信息之后,服务器400在根据电子设备200的注册信息和校验信息校验电子设备200为合法设备之后,服务器400将随机生成auth code(例如auth code集合一)。服务器400将auth code集合一发送至路由器300和电子设备200(可对应图4中的步骤三)。在一种实现方式中,路由器300接收到服务器400发送的auth code集合一,路由器300将auth code集合一以密钥一加密后发送至电子设备200。电子设备200接收到以密钥一加密后的auth code集合一后,以密钥一将以密钥一加密后的auth code集合一解密出来,电子设备200得到auth code集合一。这里,服务器400是如何根据电子设备200的注册信息和校验信息校验电子设备200为合法设备的,将在后续实施例中详细介绍,本申请实施例在此不做赘述。电子设备200获取到auth code集合一之后,电子设备200与路由器300将通过auth code集合一协商密钥二,路由器300通过密钥二将路由器300的配网信息(例如路由器300的名称和密码)发送至电子设备200(可对应图4中的步骤四),电子设备200接收到路由器300的名称和密码之后,通过路由器300的名称和密码连接上路由器300。
在一些实施例中,电子设备200通过路由器300的名称和密码连接上路由器300之后,电子设备200可以与电子设备100建立绑定关系(例如关联同一账号)。具体地,电子设备200通过路由器300的名称和密码连接上路由器300之后,路由器300向服务器400发送信息,服务器400接收到该信息之后,服务器400可以将电子设备200与路由器300关联同一账号。前述实施例介绍了电子设备100与路由器300已经关联了同一账号,则此时电子设备100、路由器300和电子设备200也均关联了同一账号,从而电子设备200可以与电子设备100建立绑定关系。
示例性的,电子设备100与电子设备200关联同一账号,且服务器400中记录有电子设备100和电子设备200关联同一个账户的信息。电子设备100可以与服务器400通信,且电子设备100也可以通过服务器400验证电子设备100与电子设备200关联了同一账号。具体的,服务器400可以接收来自电子设备100的用于控制电子设备200的指令(如指示电子设备200开启的指令)。当服务器400确定电子设备100与电子设备200关联了同一个账户,服务器400可以将该控制指令发送给电子设备200,使得电子设备200执行该控制指令对应的操作。服务器400也可以接收来自电子设备200用于向电子设备100上报自己的状态信息(如指示电子设备200电量的消息)的消息。当服务器400确定电子设备100与电子设备200关联了同一个账户,服务器400可以将上述指示电子设备200电量的消息发送给电子设备100,使得电子设备100可以接收到指示电子设备200电量的消息。
应当明确,本申请实施例提供的配网方法,不限定电子设备200与服务器400进行通信的具体方式。电子设备100可以是通过蜂窝通信网络、无线局域网(wireless local area network,WLAN)、有线网络等中的任一种网络与服务器400进行通信。示例性的,当电子设备100位于路由器300附近(如50米)时,则电子设备100优选地可以通过接入路由器300提供的无线局域网与服务器400进行通信;当电子设备100不位于路由器300附近时,电子设备100可以通过其他设备提供的无线局域网、蜂窝通信网络或者有线网络等中的任一种网络与服务器400进行通信。也就是说,本申请实施例提供的配网方法不要求电子设备100接入路由器300的无线局域网,也不要求电子设备100接入电子设备200的热点。
如图5所示,图5示例性示出了电子设备200的结构示意图。
如图5所示,电子设备200可包括:处理器501、存储器502、无线通信处理模块503、 有线LAN通信处理模块504、HDMI通信处理模块505、USB通信处理模块506、显示屏507和电源开关508。其中:
处理器501可用于读取和执行计算机可读指令。具体实现中,处理器501可主要包括控制器、运算器和寄存器。其中,控制器主要负责指令译码,并为指令对应的操作发出控制信号。运算器主要负责执行定点或浮点算数运算操作、移位操作以及逻辑操作等,也可以执行地址运算和转换。寄存器主要负责保存指令执行过程中临时存放的寄存器操作数和中间操作结果等。具体实现中,处理器501的硬件架构可以是专用集成电路(ASIC)架构、MIPS架构、ARM架构或者NP架构等等。
在一些实施例中,处理器501可以用于解析无线通信处理模块503和/有线LAN通信处理模块504接收到的信号,例如路由器300发送的配网信息等等。处理器501可以用于根据解析结果进行相应的处理操作,如生成探测响应,又如根据该显示请求或显示指令驱动显示屏507执行显示,等等。
在一些实施例中,处理器501还可以用于生成无线通信处理模块503和/有线LAN通信处理模块504向外发送的信号,如蓝牙广播信号、信标信号,又如向路由器300发送包含电子设备200的配网IE的信号。
存储器502与处理器501耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器502可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器502可以存储操作系统,例如uCOS、VxWorks、RTLinux、HarmonyOS等嵌入式操作系统。存储器502还可以存储通信程序,该通信程序可用于与一个或多个服务器,或附加设备进行通信。
无线通信处理模块503可以包括WLAN通信处理模块5031、蓝牙(BT)通信处理模块5032、NFC处理模块5033中的一项或多项。
在一些实施例中,无线通信处理模块503还可以包括蜂窝移动通信处理模块(未示出)。蜂窝移动通信处理模块可以通过蜂窝移动通信技术与其他设备(如服务器)进行通信。
有线LAN通信处理模块504可用于通过有线LAN和同一个LAN中的其他设备进行通信,还可用于通过有线LAN连接到WAN,可与WAN中的设备通信。
HDMI通信处理模块505可用于通过HDMI接口(未示出)与其他设备进行通信。
USB通信处理模块506可用于通过USB接口(未示出)与其他设备进行通信。
显示屏507可用于显示图像,视频等。显示屏507可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED)显示屏,有源矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED)显示屏,柔性发光二极管(flexible light-emitting diode,FLED)显示屏,量子点发光二极管(quantum dot light emitting diodes,QLED)显示屏等等。
在一些实施例中,电子设备200也可以不包括显示屏507,本申请在此不做限定。
电源开关508可用于控制电源向电子设备200的供电。
可以理解的是图5示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
如图6所示,图6示例性示出了路由器300的结构示意图。
参考图6,图6示出了本申请的一些实施例提供的路由器。如图6所示,路由器可以包 括处理器601、存储器602、WLAN通信模块603、天线604、有线局域网(localareanetwork,LAN)通信处理模块605和总线606。其中,处理器601、存储器602、WLAN通信模块603、有线LAN通信处理模块605可以通过总线606连接。其中:
需要说明的是,图6所示路由器仅是一个范例,并且路由器可以具有比图6中所示的更多或更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图6中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
如图6所示,处理器601可用于读取和执行计算机可读指令。具体实现中,处理器601可主要包括控制器、运算器和寄存器。其中,控制器主要负责指令译码,并为指令对应的操作发出控制信号。运算器主要负责保存指令执行过程中临时存放的寄存器操作数和中间操作结果等。具体实现中,处理器601的硬件架构可以是专用集成电路(ASIC)架构、MIPS架构、ARM架构或者NP架构等等。
处理器601中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器601中的存储器为高速缓冲存储器。该存储器可以保存处理器601刚用过或循环使用的指令或数据。如果处理器601需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器601的等待时间,因而提高了系统的效率。
存储器602与处理器601耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器602可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器602可以存储操作系统,例如uCOS,VxWorks、RTLinux等嵌入式操作系统。存储器602还可以存储通信程序,该通信程序可用于与电子设备,或其他设备进行通信。存储器602还可以存储当前配置、路由表、转发表。路由表可以用来保存路由信息,路由表通常由路由协议和路由表管理模块维护,包括更多的信息(网络地址、下一跳、超时间等);转发表可以基于路由表生成,是路由器实际转发时使用的,路由器可以根据转发表把数据包发送给下一跳的设备。
WLAN通信模块603可以用于调制和解调电磁波信号,WLAN通信模块603可以根据处理器601发出的信息和指令转换为电磁波信号。将收到的电磁波信号转换为数字信号,交由处理器601处理。
天线604可用于发射和接收电磁波信号,路由器的天线可以有一根或多根。
有线LAN通信处理模块可以包含一个或多个LAN物理接口,该一个或多个LAN物理接口可用于供其他电子设备通过网线与路由器建立连接。
该路由器还可以包括有线广域网(WAN)通信处理模块,该有线广域网(WAN)通信处理模块可以包括WAN物理接口,该WAN物理接口可用于将路由器接入因特网。
该路由器还可以包括配网键,该配网键可以是“Hi键”或“WPS键”等等,本申请对于配网键的名称不做限定。
配网键的类型是按压式的,也可以是旋转式的,还可以是拨动式的,本申请对于配网键的类型不做限定。
该路由器还可以包括配网指示灯。该配网指示灯可以闪烁,以此提示用户,该路由器发现了待配网的设备。
该路由器还可以包括蜂窝通信模块,用于与蜂窝通信基站进行通信。此时,该路由器可以不包括有线LAN通信处理模块605。
图6所示的路由器仅仅是本申请实施例的一种实现方式,实际应用中,路由器还可以包 括更多或更少的部件,这里不作限制。
本申请实施例提供的一种配网方法,主要分为以下三个步骤:
步骤一:电子设备200连接至路由器300的open ssid(无认证网络)。
步骤二:服务器400生成电子设备200的注册信息,并完成电子设备200校验的任务事项。具体的,路由器300向服务器400发送生成电子设备200的注册信息的请求,服务器400接收并响应该请求,服务器400生成电子设备200的注册信息。之后,服务器400将电子设备200的注册信息发送至路由器300,路由器300接收服务器400发送的电子设备200的注册信息,并将电子设备200的注册信息发送至电子设备200。之后,电子设备200将注册信息和校验信息通过路由器300发送至服务器400,服务器400接收到电子设备200的注册信息和校验信息并确定电子设备200为合法设备之后,服务器400将电子设备200与路由器300绑定。
步骤三:服务器400确定电子设备200为合法设备之后,向路由器300发送auth code集合一,路由器300接收auth code集合一,并将auth code集合一发送至电子设备200。之后,电子设备200与路由器300通过auth code集合一协商一个高密通道,并通过高密通道完成配网信息(例如路由器300的名称和密码)的传递。
步骤四:电子设备200连接至路由器300所在的无线局域网。
可以看出,电子设备200与路由器300通过服务器400随机下发的auth code集合一协商高密通道,不同的设备与路由器300协商的高密通道均不相同。并且,未通过校验的设备无法与路由器300建立高密通道,从而可以避免未通过校验的设备的数据窃听和获取。这样,保证了电子设备200与路由器300在配网过程中配网信息传递的安全性。
首先介绍电子设备200连接至路由器300的open ssid的过程。
电子设备200连接至路由器300的open ssid,两者只是建立了连接关系,电子设备200可以与路由器300之间传递数据,但是电子设备200无法使用路由器300的无线网络。电子设备200连接至路由器300的open ssid,是为了后续电子设备200通过路由器300向服务器400传输注册信息和校验信息以及路由器300向电子设备200传输配网信息等。
如图7所示,图7示例性示出了电子设备200连接至路由器300的open ssid的方法流程图。
S701-S705示例性示出了电子设备200连接至路由器300的open ssid的方法步骤。需要说明的是,在一些实施例中,电子设备200连接至路由器300的open ssid的方法可以包括比S701-S705更多或更少的步骤,本申请在此不做限定。且本申请对于S701-S705中每个步骤的执行顺序不做限定。
S701、电子设备200开启,电子设备200处于待配网状态。
S701中,使得电子设备200处于待配网状态的用户操作与S101中使得电子设备200处于待配网状态的用户操作相同,具体的,可以参考S101中的相关描述,本申请实施例在此不再赘述。
在一些实施例中,电子设备200处于待配网状态,也可以称为电子设备200处于AP模式。
S702、电子设备200以广播的形式发送电子设备200的配网IE。
响应于电子设备200处于配网状态,电子设备200以广播的形式发送电子设备200的配 网IE。
S703、路由器300接收到电子设备200的配网IE,接收同意配网的第一用户操作。
S704、响应于第一用户操作,路由器300发送组播报文,该组播报文携带了路由器300的open ssid。
路由器300接收到电子设备200的配网IE,响应于的配网IE,路由器300的指示灯闪烁,用于提示用户路由器300发现了处于待配网状态的电子设备200。
不限于路由器300的指示灯闪烁,路由器300还可以通过其他的方式提示用户路由器300发现了处于待配网状态的电子设备200,本申请在此不做限定。
路由器300的指示灯闪烁时,路由器300接收同意配网的用户操作,该用户操作用于表示用户同意路由器300将open ssid发送至电子设备200。
在一种可能的实现方式中,上述用户操作可以是路由器300接收用户触发(例如按压)路由器300上的配网键的操作。
在另一种可能的实现方式中,路由器300发现了待配网的电子设备200,路由器300的指示灯闪烁,同时,路由器300向服务器400发送信息一,信息一用于服务器400将路由器300发现待配网的电子设备200的提示信息显示在第一应用程序(例如智慧生活应用程序)的用户界面上。
其中,电子设备100可以接收并响应于用户对第一应用程序上的输入操作,该输入操作表示用户同意路由器300将open ssid发送至该待配网的设备。具体的,电子设备100通过第一应用程序将信息二发送至服务器400,服务器400将信息二转发至路由器300。
这里,电子设备100如何接收并响应于用户对第一应用程序上的输入操作的,可以参考后续图9B-图9E的实施例,本申请实施例在此不做赘述。
路由器300接收到信息二之后,路由器300发送组播报文,该组播报文携带了路由器300的open ssid。
在路由器300将配网信息发送至电子设备200之前,路由器300持续发送路由器300的open ssid。
S705、电子设备200获取到路由器300发送的组播报文中携带的路由器300的open ssid,并连接上路由器300的open ssid。
电子设备200接收到路由器300发送的路由器300的组播报文之后,电子设备200由AP模式切换为STA模式,电子设备200解析出组播报文中携带的路由器300的open ssid,并连接上路由器300的open ssid。
电子设备200连接至路由器300的open ssid,两者只是建立了连接关系,电子设备200可以与路由器300之间传递数据。电子设备200连接至路由器300的open ssid,是为了后续电子设备200通过路由器300向服务器400传输注册信息和校验信息以及路由器300向电子设备200传输配网信息等。
接下来介绍电子设备200通过路由器300向服务器400发送生成电子设备200的注册信息的请求,服务器400收到该请求后,生成电子设备200的注册信息,并完成电子设备200的校验的任务事项。
电子设备200连接至路由器300的open ssid之后,路由器300向服务器400发送生成电子设备200的注册信息的请求,服务器400接收并响应该请求,服务器400生成电子设备200的注册信息。之后,服务器400将电子设备200的注册信息发送至路由器300,路由器300 接收服务器400发送的电子设备200的注册信息,路由器300将电子设备200的注册信息发送至电子设备200。之后,电子设备200将注册信息和校验信息发送至服务器400,服务器400校验电子设备200为合法设备之后,服务器400将电子设备200与路由器300绑定。
这样,服务器400首先生成电子设备200的注册信息,服务器400通过路由器300将电子设备200的注册信息发送至电子设备200。电子设备200通过路由器300将电子设备200的注册信息和校验信息发送至服务器400。服务器400接收电子设备200通过路由器300发送的电子设备200的注册信息和校验信息。服务器400确认电子设备200通过路由器300发送的电子设备200的注册信息是之前服务器通过路由器300发送至电子设备200的注册信息,则服务器400初步确认电子设备200为合法的设备。之后,服务器400进一步确认电子设备200通过路由器300发送的校验信息为合法的校验信息,则服务器400进一步确定出电子设备200为合法的设备,则服务器400向路由器300发送消息,该消息用于告知路由器300和电子设备200可以传输配网信息。这样,服务器400通过双重验证机制,提高了服务器400校验设备合法性的安全机制。保障了后续路由器300和电子设备200可以传输配网信息的安全性。
可选的,服务器400也可以不执行图8所示的生成电子设备200的注册信息和完成电子设备200的校验的任务事项中的各个步骤。即在图7所示的实施例中,电子设备200连接上路由器300的open ssid之后,服务器400直接执行图9所示的实施例,即服务器400直接随机生成auth code(例如auth code集合一),并把auth code集合一发送至路由器300。路由器300接收到服务器400发送的auth code集合一。路由器300将auth code集合一发送至电子设备200,电子设备200获取到auth code集合一。
本申请实施例对于电子设备200、路由器300和服务器400是否执行图8所示的生成电子设备200的注册信息和完成电子设备200的校验的任务事项中的各个步骤,不做限定。
如图8所示,图8示例性示出了服务器400生成电子设备200的注册信息并完成电子设备200的校验的任务事项的方法流程图。
S801-S808示例性示出了服务器400完成电子设备200的注册和校验的任务事项的方法步骤。需要说明的是,在一些实施例中,服务器400完成电子设备200的注册和校验的任务事项的方法步骤可以包括比S801-S808更多或更少的步骤,本申请在此不做限定。且本申请对于S801-S808中每个步骤的执行顺序不做限定。
S801、路由器300向服务器400发送生成电子设备200的注册信息的请求。
电子设备200连接上路由器300的open ssid之后,路由器300向服务器400发送生成电子设备200的注册信息的请求。该请求用于服务器400生成电子设备200的注册信息。
S802、服务器400接收并响应生成电子设备200的注册信息的请求,服务器400生成电子设备200的注册信息。
S803、服务器400向路由器300发送电子设备200的注册信息。相应的,路由器300获取到电子设备200的注册信息。
服务器400接收路由器300发送的生成电子设备200的注册信息的请求之后,服务器400同意路由器300发送的请求,服务器400生成电子设备200的注册信息。服务器400将电子设备200的注册信息发送至路由器300。
注册信息可以包括但不仅限于电子设备200的注册码等信息,本申请对于注册信息的包括的信息种类不做限定。
S804、路由器300将注册信息发送至电子设备200。相应的,电子设备200获取到电子设备200的注册信息。
在一些实施例中,为了保证电子设备200与路由器300之间传输数据的安全性,在路由器300将注册信息发送至电子设备200之前,路由器300与电子设备200将通过预置参数协商密钥一,并基于密钥一传输注册信息。
这里,当电子设备200可以通过预置参数与路由器300协商得到密钥一时,则可以认为电子设备200是初步可信的设备。在一些实施例中,初步可信的设备,可以被称为“一级白名单设备”。只有当电子设备属于“一级白名单设备”时,该电子设备才可以向服务器发起注册请求,也即该电子设备可以访问服务器。这样,可以保证访问服务器的设备是可信的设备。
首先,路由器300与电子设备200通过预置参数协商密钥一。
路由器300接收到服务器400发送的电子设备200的注册信息之后,路由器300与电子设备200通过预置参数协商得到密钥一。
需要说明的是,路由器300与电子设备200通过预置参数协商密钥一可以在路由器300向服务器400发送生成电子设备200的注册信息的请求之前完成,也可以在路由器300向服务器400发送生成电子设备200的注册信息的请求之后完成,本申请在此不做限定。
也就是说,路由器300与电子设备200通过预置参数协商密钥一可以在步骤S801之前完成,也可以在步骤S801之后完成,本申请在此不做限定。只要在步骤S804之前,路由器300与电子设备200已经通过预置参数协商得到密钥一即可。
在一些实施例中,路由器300和电子设备200在出厂之前已经配置好了相同的预置参数。或者,路由器300和电子设备200在出厂设置之前,没有配置预置参数,则路由器300和电子设备200可以从服务器中下载预置参数,并保存在路由器300和电子设备200中。需要说明的是,路由器300和电子设备200从服务器中获取到的预置参数是一样的。
在一种可选的实现方式中,预置参数可以集成在软件开发工具包(software development kit,)中。SDK为移动应用软件(Application,APP)辅助开发的相关文档、范例和工具的集合。开发者为了提高开发效率,可以将某项功能交给第三方来开发,第三方将某项功能封装为SDK供开发者使用。因此,只需要将预置参数集成在SDK中,路由器300和电子设备200从服务器中下载SDK,就可以获取到该SDK中集成的预置参数。
路由器300与电子设备200如何通过预置参数协商得到密钥一的,与后续实施例中介绍的路由器300与电子设备200如何通过auth code集合一协商得到密钥二的原理是一致的,不同之处仅在于,密钥一是基于预置参数协商得到的,而密钥二是基于auth code集合一协商得到的。因此,路由器300与电子设备200通过预置参数协商得到密钥一的过程,可以参考后续实施例中介绍的路由器300与电子设备200通过auth code集合一协商得到密钥二的过程,本申请在此不做赘述。
之后,路由器300将以密钥一加密的注册信息发送至电子设备200。
为了保证路由器300和电子设备200之间传递数据的安全性,路由器300以密钥一将电子设备200的注册信息加密,并将以密钥一加密的电子设备200的注册信息发送给电子设备200。
S805、电子设备200获取到注册信息。
在一些实施例中,电子设备200接收到路由器300发送的以密钥一加密的注册信息,则 电子设备200通过密钥一解密以密钥一加密的注册信息,获取到注册信息。
S806、电子设备200将注册信息和校验信息发送至路由器300。相应的,路由器300获取到注册信息和校验信息。
校验信息可以包括以下一项或多项:公钥基础设施(public key Infrastructure,KPI)证书、软件许可证(license)。
电子设备200获取到注册信息之后,电子设备200将向服务器400发起注册请求,即电子设备200将注册信息和校验信息发送至路由器300。
可选的,电子设备200也可以仅向路由器300发送注册信息。
可选的,电子设备200也可以仅向路由器300发送校验信息。
在一些实施例中,电子设备200向路由器300发送以密钥一加密的注册信息和以密钥一加密的校验信息。
可选的,电子设备200也可以仅向路由器300发送以密钥一加密的注册信息。
可选的,电子设备200也可以仅向路由器300发送以密钥一加密的校验信息。
S807、路由器300向服务器400发送注册信息和校验信息。相应的,服务器400获取到注册信息和校验信息。
路由器300获取到注册信息和校验信息之后,路由器300将注册信息和校验信息发送至服务器400。
可选的,当电子设备200仅向路由器300发送注册信息时,路由器300接收电子设备200发送的注册信息,路由器300将注册信息发送至服务器400。
可选的,当电子设备200仅向路由器300发送校验信息时,路由器300接收电子设备200发送的校验信息,路由器300将校验信息发送至服务器400。
在一些实施例中,路由器300接收电子设备200发送的以密钥一加密的注册信息和以密钥一加密的校验信息,路由器300基于密钥一将以密钥一加密的注册信息和以密钥一加密的校验信息解密,得到未加密的注册信息和未加密的校验信息,路由器300将未加密的注册信息和未加密的校验信息发送至服务器400。
可选的,当电子设备200仅向路由器300发送以密钥一加密的注册信息时,路由器300接收电子设备200发送的以密钥一加密的注册信息,路由器300基于密钥一将以密钥一加密的注册信息解密,得到未加密的注册信息,路由器300将未加密的注册信息发送至服务器400。可选的,当电子设备200仅向路由器300发送以密钥一加密的校验信息时,路由器300接收电子设备200发送的以密钥一加密的校验信息,路由器300基于密钥一将以密钥一加密的校验信息解密,得到未加密的校验信息,路由器300将未加密的校验信息发送至服务器400。
需要说明的是,当电子设备200需要通过路由器300向服务器400发送校验信息时,在服务器400验证电子设备200为合法设备之前,电子设备200预先获取到校验信息,并将校验信息保存在本地。即电子设备200获取并保存校验信息需要在S807之前完成。
接下来介绍电子设备200如何获取到校验信息的。
具体的,电子设备200生成一对公私密钥(公钥一和私钥一),设备A用私钥一将数据加密后,设备B可以根据与私钥一对应的公钥一将以私钥一加密的数据解密,并获取到未加密的数据,设备A也可以用私钥一将数据加密后,设备B可以根据与公钥一对应的私钥一将以私钥一加密的数据解密,并获取到未加密的数据。电子设备200生成一对公私密钥之后, 电子设备200将公钥一和获取校验信息的请求发送至服务器400。服务器400接收到公钥一和获取校验信息的请求之后,响应于获取校验信息的请求,服务器400将公钥一预置在校验信息中,之后,服务器400将预置有公钥一的校验信息发送至电子设备200,电子设备200获取到预置有公钥一的校验信息。需要说明的是,校验信息是服务器400中本地保存的。
S808、服务器400基于注册信息和校验信息确定电子设备200为合法设备,并将电子设备200与路由器300绑定。
这里,当服务器400基于注册信息和校验信息确定电子设备200为合法设备时,则服务器400可以认为电子设备200是安全的设备。在一些实施例中,安全的设备,可以被称为“二级白名单设备”。只有当电子设备属于“二级白名单设备”时,该电子设备才可以获取到配网信息并通过配网信息连接至路由器所在的无线局域网。这样,可以保证接入路由器所在的无线局域网的电子设备是安全的设备。
服务器400接收到路由器300转发的电子设备200的注册信息和校验信息之后,将根据电子设备200的注册信息和校验信息验证电子设备200是否为合法的设备。
可选的,服务器400接收到路由器300转发的电子设备200的注册信息之后,将根据电子设备200的注册信息验证电子设备200是否为合法的设备。
可选的,服务器400接收到路由器300转发的电子设备200的校验信息之后,将根据电子设备200的校验信息验证电子设备200是否为合法的设备。
具体的,服务器400可以根据以下任意一种方式验证电子设备200是否为合法的设备。
方式一:服务器400通过注册信息和校验信息验证电子设备200为合法的设备。
具体的,首先当服务器400确认电子设备200通过路由器300发送的电子设备200的注册信息是之前服务器通过路由器300发送至电子设备200的注册信息时,则服务器400可以初步确定出电子设备200为合法的设备。
之后,服务器400通过校验信息进一步验证电子设备200为合法的设备。
下面介绍服务器400如何根据校验信息进一步验证电子设备200为合法的设备的。
服务器4000通过路由器300获取到电子设备200发送的校验信息之后,服务器400可以获取到该校验信息中预置的公钥一,且服务器400将随机生成随机数,通过该随机数和校验信息中预置的公钥一校验电子设备200的合法性。
因为,若攻击者采取特殊手段获取到了预置有公钥一的校验信息。攻击者的电子设备通过预置有公钥一的校验信息通过路由器300发送至服务器400。服务器400接收到攻击者的电子设备发送的预置有公钥一的校验信息,则服务器400可能会将攻击者的电子设备确认为合法的设备。因此为了防止该情况的发生,服务器200在接收到电子设备200发送的预置有公钥一的校验信息之后,会进一步根据随机数验证电子设备200的合法性。这样,可以提高后续传输路由器300的配网信息的安全性。
具体的,服务器400将随机产生随机数,并将随机数通过路由器300发送至电子设备200。
电子设备200通过路由器300接收到该随机数之后,电子设备200将该随机数以私钥一加密,之后,电子设备200通过路由器300将以私钥一加密的随机数发送至服务器400。
服务器400通过路由器300接收到电子设备200发送的以私钥一加密的随机数,服务器400以私钥一对应的公钥一将以私钥一加密的随机数解密出来。
这样,若服务器400可以接收到电子设备200发送的以私钥一加密的随机数,并以私钥一对应的公钥一将以私钥一加密的随机数解密出来,则服务器400确定出电子设备200为合法的设备,则路由器300和电子设备200可以传输配网信息。
在一些实施例中,若服务器400可以接收到电子设备200发送的校验信息和注册信息,但是服务器400接收不到电子设备200发送的私钥一加密的随机数。因为私钥一是由合法的设备向服务器400申请校验信息之前生成的,非法的设备无法获取到电子设备200中的私钥一。这样,服务器400通过双重验证机制,进一步提高了服务器400校验设备合法性的安全机制。保障了后续路由器300和电子设备200可以传输配网信息的安全性。
可选的,上述S808的步骤中,服务器400通过路由器300接收到电子设备200发送的电子设备200的注册信息和校验信息之后,服务器40不需要再生成随机数验证电子设备200的合法性。服务器400只需确认电子设备200通过路由器300发送的电子设备200的注册信息是之前服务器通过路由器300发送至电子设备200的注册信息,且服务器400从校验信息中获取到该校验信息中预置的公钥一,则服务器400即可确认电子设备200为合法的设备。
方式二:服务器400仅通过注册信息验证电子设备200为合法的设备。
具体的,上述S806-S808的步骤中,电子设备200只需将注册信息发送至服务器400,服务器400只需通过电子设备200的注册信息验证电子设备200为合法的设备。具体的,电子设备200将电子设备200的注册信息通过路由器300发送至服务器400,服务器400通过路由器300接收到电子设备200发送的电子设备200的注册信息之后,服务器400确认电子设备200通过路由器300发送的电子设备200的注册信息与之前服务器通过路由器300发送至电子设备200的注册信息是一样的,则服务器400即可确认电子设备200为合法的设备。
方式三:服务器400仅通过校验信息验证电子设备200为合法的设备。
具体的,上述S806-S808的步骤中,电子设备200只需将校验信息发送至服务器400,服务器400只需通过电子设备200的校验信息验证电子设备200为合法的设备。具体的,电子设备200只需将电子设备200的校验信息过路由器300发送至服务器400,服务器400通过路由器300接收到电子设备200发送的电子设备200的校验信息之后,服务器400通过校验信息验证电子设备200为合法的设备。
服务器400如何通过校验信息验证电子设备200为合法的设备,在上述方式一中已经详细的描述了,具体的,可以参考方式一中的具体介绍,本申请实施例在此不再赘述。
服务器400验证电子设备200为合法的设备之后,服务器400中存储有电子设备200与路由器300之间的绑定关系。并将电子设备200和路由器300关联同一账号。当电子设备200与路由器300关联了同一账号之后,服务器400中记录有电子设备200和路由器300关联同一个账户的信息。电子设备200可以与服务器400通信,且电子设备200也可以通过服务器400验证电子设备200与路由器300关联了同一账号。具体的,服务器400可以接收来自电子设备200用于控制路由器300的指令(如指示路由器300开启的指令)。当服务器400确定电子设备200与路由器300关联了同一个账户,服务器400可以将该控制指令发送给路由器300,使得路由器300执行该控制指令对应的操作。
服务器400校验电子设备200为合法的设备之后,向路由器300发送auth code集合一, 路由器300接收服务器400发送的auth code集合一,路由器300再将auth code集合一发送至电子设备200。之后,电子设备200与路由器300通过auth code集合一协商密钥二,并通过密钥二完成配网信息(例如路由器300的名称和密码)的传递。
这里,auth code集合一是服务器400随机生成的,auth code集合一可以包括一个或多个auth code。
如图9所示,图9示例性示出了电子设备200与路由器300传输配网信息的方法流程图。
S901-S906示例性示出了电子设备200与路由器300传输配网信息的方法步骤。需要说明的是,在一些实施例中,电子设备200与路由器300传输配网信息的方法步骤可以包括比S901-S906更多或更少的步骤,本申请在此不做限定。且本申请对于S901-S906中每个步骤的执行顺序不做限定。
S901、服务器400向路由器300发送auth code集合一。
S902、路由器300将auth code集合一发送至电子设备200。
服务器400在验证电子设备100为合法的设备之后,服务器400随机生成auth code(auth code集合一),并将auth code集合一发送至路由器300,路由器300接收服务器400发送的auth code集合一,路由器300再将auth code集合一发送至电子设备200,以便后续路由器300和电子设备200根据auth code集合一协商密钥二传输配网信息。
需要说明的时,针对不同的待配网设备,服务器400随机生成的auth code集合一不一样。因此,不同的待配网设备与路由器300根据auth code集合一协商的密钥二也不一样。这样,进一步提高了电子设备200与路由器300传输配网信息的安全性。
S903、电子设备200与路由器300根据auth code集合一协商密钥二。
在一些实施例中,电子设备200与路由器300可以根据迪菲-赫尔曼(diffie hellman,DH)算法根据auth code集合一协商密钥二。在其他实施例中,电子设备100与路由器300也可以通过其他的算法根据auth code集合一协商得到密钥二,本申请实施例在此不做限定。本申请以下实施例以电子设备200与路由器300通过DH算法根据auth code集合一协商密钥二进行说明。
在DH算法中,电子设备200与路由器300只会传递通过公式计算得到密钥二的公式中的参数,而不会直接传递密钥二。这样,若有攻击者在监听电子设备200与路由器300的通信过程,即使攻击者获取到了计算得到密钥二的公式中的参数,但是攻击者不知道根据哪个公式得到密钥二,这样,攻击者很难获取到密钥二。电子设备200与路由器300通过此方式协商密钥二,保证了密钥二可以不被攻击者窃取,保证了电子设备200与路由器300传输配网信息的安全性。
下面,介绍DH算法的基本原理。DH算法可以包括但不仅限于以下几个步骤:
步骤一:路由器300向电子设备200发送质数P和质数G。
需要说明的是,质数P是一个非常大的数,质数G可以是一个较小的数字,本申请在此不做限制。
在一些实施例中,质数P和质数G也可以是电子设备200生成并发送至路由器300的,本申请实施例在此不做限定。
步骤二:电子设备200计算(G A)mod P的值,并将(G A)mod P的值发送至路由器300。
步骤三:路由器300计算(G B)mod P的值,并将(G B)mod P的值发送至电子设备200。
在步骤二和步骤三中,auth code集合一包括m个auth code,m大于等于1。当m=1时, 即auth code集合一中仅包括一个auth code,A表示auth code集合一中这一个auth code。当m大于等于2时,即auth code集合一中包括至少两个auth code时,A表示auth code集合一中m个auth code的乘积。B的计算原理与A的计算原理类似。
步骤四:电子设备200根据路由器300发送的(G B)mod P的值可以根据公式一计算得到密钥二。
K=((G B)) Amod P公式(1)
由公式(1)可知,K=G A*Bmod P。其中,A为服务器400向电子设备200发送的auth code集合一,K为电子设备200与路由器300协商得到的密钥二。
步骤五:路由器300根据电子设备200发送的(G A)mod P的值可以根据公式二计算得到密钥二。
K=((G A)) Bmod P公式(2)
由公式(2)可知,K=G A*Bmod P。其中,B为服务器400向路由器300发送的auth code集合一,K为电子设备200与路由器300协商得到的密钥二。
由步骤四和步骤五可知,电子设备200与路由器300协商得到的密钥二相同。之后,电子设备200和路由器300可以通过密钥二传输配网信息。
需要说明的是,上述实施例中示出的公式只是为了解释电子设备200与路由器300协商密钥二的过程,在其他实施例中,DH算法中的计算密钥的公式可以与上述步骤中计算得到密钥二的公式相同或不同,本申请在此不做限定。
由上述分析可知,电子设备200与路由器300通过DH算法协商得到密钥二的方式,可以提高后续传输配网信息的安全性。一方面,电子设备200与路由器300通过DH算法协商得到密钥二的方式电子设备200与路由器300之间只是传递了公式中的参数值,即使有攻击者在监听电子设备200与路由器300的通信过程,并截获了电子设备200与路由器300之间传递的公式中的参数值,也很难根据公式中的参数值计算得到真正的密钥;另一方面,在服务器400验证了电子设备200为合法设备之后,服务器400会向路由器400和电子设备200发送auth code集合一,也即对于不同设备在不同时间向服务器400发起校验之后,服务器400向不同的电子设备随机发送的auth code集合一也不同,也即不同的设备与路由器300通过DH算法协商得到的密钥也不同,攻击者很难获取到该密钥。这样,也进一步提高了不同的设备与路由器300传输配网信息的安全性。
S904、路由器300将以密钥二加密的配网信息发送至电子设备200。相应的,电子设备200获取到以密钥二加密的配网信息。
S905、电子设备200通过密钥二将以密钥二加密的配网信息解密出来,得到配网信息。
路由器300将配网信息以密钥二加密,并将以密钥二加密的配网信息发送至电子设备200。电子设备200接收到以密钥二加密的配网信息之后,电子设备200根据密钥二将以密钥二加密的配网信息解密出来,得到路由器300的配网信息。
在路由器300将以密钥二加密的配网信息发送至电子设备200之后,路由器300停止发送路由器300的open ssid。
S906、电子设备200基于路由器300的配网信息连接上路由器300。
配网信息可以包括但不仅限于路由器300的名称和密码等等,配网信息还可以包括其他更多的信息,本申请在此不做限定。
电子设备200得到路由器300的配网信息之后,电子设备200基于路由器的配网信息连接上路由器300。这样,电子设备200可以通过路由器300访问互联网。
基于本申请实施例提供的一种配网方法,下面介绍本申请实施例涉及到的两个应用场景。
场景一:远程配网
远程配网应用场景指的是操作电子设备100的用户A也可以远程指导操作电子设备200的用户B将电子设备200上电后,用户A远程通过操作电子设备100来完成对电子设备200的配网。具体的,路由器300发现了处于待配网状态的电子设备200,电子设备100在第一应用程序(例如智慧生活应用程序)的远程配网界面上显示发现了处于待配网状态的电子设备200的提示信息。之后,电子设备100可以接收用户A在第一应用程序的远程配网界面上的输入操作,触发路由器300将配网信息发送至处于待配网状态的电子设备200,从而电子设备200接收到路由器300发送的配网信息,电子设备200通过路由器300的配网信息连接上路由器300。用户A与用户B可以不是同一个用户,且用户A不需要在路由器300和电子设备200的附近,这样的话,即使用户A不操作路由器300和电子设备200,也可以在电子设备100上远程将电子设备200连接上路由器300。
例如子女给在家的父母购买了一个智能单品(例如智能音箱),父母不知道如何操作将智能音箱连接上家里的路由器。那么采用本申请实施例提供的配网方法,子女通过电话指导父母将智能音箱上电并处于待配网状态,智能音箱广播配网信元,家里的路由器接收到配网信元并发现了处于待配网状态的智能音箱上,此时路由器的指示灯闪烁,若父母不知道怎么按下路由器的配网键,或者路由器处于弱电箱或者柜顶等不方便获取的地方。此时,子女可以通过其手机进入第一应用程序(例如智慧生活应用程序)的远程配网界面,子女的手机可以在智慧生活应用程序的远程配网界面上显示发现了处于待配网状态的设备的提示信息,子女确定该远程配网界面上显示的待配网设备正是买给父母的智能音箱,那么手机可以接收子女在远程配网界面上的输入操作,响应于输入操作,路由器300将配网信息发送至智能音箱,智能音箱获取到配网信息后连接至家里的路由器。
如图9A所示,该家庭应用场景包括第一房间区域901、第二房间区域902和客厅区域903。第一房间区域901包括智能电视9012,第二房间区域902包括智能音箱9013,客厅区域903包括路由器300以及智能投影仪9014等等。
应理解,此处所述的远程配网应用场景中,将电子设备200开启、使得电子设备200处于待配网状态的用户,与在电子设备100上输入操作的用户,可以不是同一个用户,也可以是同一个用户。
在不是同一个用户的情况下,若将电子设备200开启、使得电子设备200处于待配网状态的用户称作“用户B”,将在电子设备100上输入操作的用户称作“用户A”。则用户B需要处于图9A所示的家中,以将电子设备200开启、使得电子设备200处于待配网状态,而用户A可以不处于图9A所示的家中,也不需要接入图9A所示的家中的路由器300。用户A可以远程指导用户B将电子设备200上电后,远程通过操作电子设备100来完成对电子设备200的配网。从而,应用本方案可以实现远程配网。
示例性地,当用户B是不熟悉配网操作的用户时,用户B只需要将电子设备200上电,就可以由用户A来远程完成其他的配网操作。从而本申请实施例提供的配网方法,应用于远程配网场景,一方面,可以降低用户B的学习成本,简化用户B的操作,可以由远程用户A为用户B完成配网操作。另一方面,在路由器300将配网信息发送至电子设备200之前,服务器400会校验电子设备200是否为合法设备。在服务器400校验电子设备200为合法设备 之后,服务器400随机生成auth code集合一并发送至路由器300和电子设备200,路由器300和电子设备200通过该auth code集合一协商密钥来加密传输配网信息。由前述实施例分析可知,不同设备在不同时间向服务器400发起校验之后,服务器400向不同的设备随机发送的auth code集合一也不同。进一步提高了路由器300与电子设备200之间传输配网信息的安全性。
图9B-图9F示例性示出了用户在第一应用程序的远程配网界面上控制电子设备200连接至路由器300的UI图。
图9B示例性地示出电子设备100的用户界面910。该用户界面910可以包括一些应用程序的图标。例如,文件管理的图标9001、电子邮件的图标9002、音乐的图标9003、智慧生活的图标9004、运动健康的图标9005、天气的图标9006、相机的图标9007、通讯录的图标9008、电话的图标9009、信息的图标9010。在一些实施例中,用户界面910可以包括更多或更少的应用程序的图标。在一些实施例中,用户界面910中可以包括一些与图9B示出的应用程序不同的应用程序的图标,此处不作限定。
电子设备100可以响应于作用于用户界面910上的智慧生活的图标9004上的用户操作,启动智慧生活。
图9C示例性示出了电子设备100启动智慧生活后所显示的用户界面920。该用户界面920是智慧生活应用提供的主页面。
用户界面920包括关联到同一个账户的一个或多个电子设备,关联到同一个账户的一个或多个电子设备之间具有绑定关系。用户界面920示例性示出了路由器300,路由器300处于在线状态,路由器300被放置在图9A所示的客厅区域903。智能电视9012处于在线状态,智能电视9012被放置在图9A所示的第一房间区域901。智能投影仪9014处于离线状态,智能投影仪9014被放置在图9A所示的客厅区域903。其中,“在线状态”可以指电子设备200可以与服务器400或者与电子设备100进行通信的状态,用户A可以通过电子设备100控制处于在线状态的电子设备200,或者获取电子设备200的状态信息;“离线状态”可以指电子设备200不可以与服务器400或者与电子设备100进行通信的状态,用户A不能够通过电子设备100控制处于离线状态的电子设备200。
当操作电子设备200的用户B需要将电子设备200与路由器300建立连接时,此时电子设备200已经处于待配网状态,并且在路由器300附近。但是用户B不熟悉将电子设备200与路由器300建立连接的操作。则操作电子设备100的用户A可以在第一应用程序的远程配网界面中,看是否有关于路由器300发现了处于待配网状态的电子设备200的提示信息,若用户A确认该远程配网界面中显示的提示信息正是需要配网的电子设备200的信息,则电子设备100可以接收用户A的确认操作,路由器300将路由器300的配网信息发送至电子设备200。
具体的,如图9C所示,图标9201可以接收用户的触发(例如单击)操作,响应于用户的触发操作,电子设备200显示如图9D所示的用户界面930。
用户界面930包括信息栏9301,信息栏9301中包括图标9302,图标9302可以接收用户的触发(例如单击)操作,响应于用户的触发操作,电子设备100显示如图9E所示的远程配网的用户界面940。其中,用户界面930种的图标9302包含文字“远程配网”,但应理解,该文字信息也可以为“配网”,也就是说,不论是远程配网还是非远程配网,本申请实施例提供的配网方法均可适用,附图所示内容不构成对本申请实施例的限定。
用户界面940可以包括提示栏9401,提示栏9401包括路由器300发现待配网的设备的图标、名称(例如智能音箱)和控件9402。
其中,电子设备100可以接收并响应于用户对控件9402的触发操作(例如单击),该操作表示用户同意路由器300将open ssid发送至该待配网的设备。具体的,电子设备100通过第一应用程序(如此处所述智慧生活应用程序)将信息二发送至服务器400,服务器400将信息二转发至路由器300。
在另一些实现方式中,电子设备100也可以是响应于服务器400发送的发现处于待配网状态的电子设备200的提示信息,就自动在其用户界面中弹出显示提示栏9401。而不是需要用户点击图标9302才显示提示栏9401。其中,电子设备100自动弹出显示提示栏9401之前,电子设备100可以处于任意一个用户界面,例如主屏幕、负一屏、其他应用程序的界面、智慧生活应用程序的界面、锁屏界面、熄屏界面等。这样,可以使用户A随时获取到电子设备200相关的配网提示信息,以便及时响应、及时作出用户操作。
路由器300接收信息二之后,路由器300将open ssid发送至该待配网的设备(例如电子设备200)。
电子设备200接收到路由器300的open ssid,并连接上路由器300的open ssid。之后,电子设备200通过图8所示的实施例与路由器300建立绑定关系之后,电子设备200与路由器300关联了同一账号。那么电子设备200的图标、名称以及连接状态可以显示在用户界面950中。
如图9F所示,用户界面950包括关联到同一个账户的一个或多个电子设备,关联到同一个账户的一个或多个电子设备之间具有绑定关系。路由器300、智能电视9012、智能投影仪9014和电子设备200均关联了到同一个账户。用户界面950示例性示出了路由器300处于在线状态。智能电视9012处于在线状态。智能投影仪9014处于离线状态。电子设备200处于在线状态。
在一些实现方式中,当电子设备200完成了连接路由器300的open ssid的步骤但尚未完成整个配网流程时,用户界面950中,电子设备200(此处以智能音箱为例)的状态可以显示为“连接中”、“正在配网”、“配置中”等;当电子设备200完成了整个配网流程后,用户界面950中,电子设备200的状态可以显示为“在线”、“已连接”、“配网完成”等。从而用户A可以通过电子设备100准确感知到电子设备200的配网进度。
在一些实现方式中,若电子设备200在配网过程中遇到故障导致无法成功走完整个配网流程,则电子设备100的用户界面中也可以显示失败提示信息,用于告知用户A配网失败,从而用户A可以及时采取行动排查故障原因,例如用户A可以打电话询问用户B,是否将电子设备200的电源插牢、路由器是否正常工作等。
电子设备200连接上路由器300的open ssid之后,电子设备200可以与路由器300经过图9所示的实施例获取到路由器300的配网信息,电子设备200经过路由器300的配网信息连接至路由器300所在的无线局域网。从而完成整个为电子设备200进行远程配网的流程。
场景二:一键配网
一键配网指的是一次性为一至多个待配网设备配网。即用户只需操作一次,路由器300持续性的发送open ssid,并依次完成连接上路由器300的open ssid的多个待配网设备的配网流程,在路由器300确定出连接上路由器300的open ssid的数量为0之后,路由器300停止发送open ssid。
例如,家中有多个智能单品(例如智能音箱和智能投影仪),路由器300发现了处于待配网状态的智能音箱和智能投影仪,路由器300接收同意配网的用户操作,路由器300持续性的发送open ssid,在智能音箱和智能投影仪连接上路由器300的open ssid之后,路由器300可以依次完成与智能音箱和智能投影仪的配网流程。可以看出,路由器300只需接收一次同意配网的用户操作即可完成与多个智能单品的配网流程。与目前路由器300接收一次同意配网的用户操作只能完成与一个设备的配网流程相比,本申请实施例可以实现多设备同时配网,并提升多设备配网的效率。
具体的,在路由器300接收到附近处于待配网状态的一个或多个电子设备发送的携带有的配网IE的报文之后,不限于路由器300的指示灯闪烁,路由器300还可以通过其他的方式提示用户路由器300发现了处于待配网状态的一个或多个电子设备,本申请在此不做限定。
路由器300的指示灯闪烁之后,路由器300接收同意配网的第一用户操作,第一用户操作用于表示用户同意路由器300将open ssid发送至处于待配网状态的一个或多个电子设备。
第一用户操作也可以是在第一应用程序的一键配网界面的输入操作,第一用户操作也可以是路由器300接收用户触发(例如按压)路由器300上的配网键的操作;本申请实施例对于同意配网的第一用户操作的具体实现不做限定。
图10A-图10B介绍了电子设备100在第一应用程序的一键配网界面上接收第一用户操作的示意图。
首先,电子设备100接收用户操作打开第一应用程序(例如智慧生活应用程序)。
具体的,可以参考图9B-图9C的实施例。
之后,电子设备100接收用户打开第一应用程序中的一键配网界面的操作。
具体的,如图9C所示,图标9201可以接收用户的触发(例如单击)操作,响应于用户的触发操作,电子设备100显示如图10A所示的用户界面960。
用户界面960包括信息栏1001,信息栏1001中包括图标1002,图标1002可以接收用户的触发(例如单击)操作,响应于用户的触发操作,电子设备100显示如图10B所示的一键配网的用户界面970。
用户界面970可以包括路由器300发现的一个或多个处于待配网状态的电子设备图标以及控件1003。例如,路由器300发现的处于待配网状态的电子设备图标为电子设备200(智能音箱)的图标和电子设备500(智能摄像头)的图标。
其中,电子设备100可以接收并响应于用户对控件1003的触发操作(例如单击),该操作表示用户同意路由器300将open ssid发送出去,电子设备100通过第一应用程序(如此处所述智慧生活应用程序)将信息二发送至服务器400,服务器400将信息二转发至路由器300。
路由器300接收信息二之后,路由器300将open ssid发送出去。可以理解的是,在一键配网应用场景中,路由器300是持续性发送open ssid的。用户可以只点击一次图标1003,就可以一次性使得多个待配网设备完成与路由器300的配网过程。
在路由器300持续性地将open ssid以广播的形式发送出去之后,处于待配网状态的一个或多个电子设备接收到路由器300发送的open ssid。之后,经过上述图7-图9所示的实施例,路由器300依次与该一个或多个电子设备建立连接,使得该一个或多个电子设备可以经过上述图7-图9所示的实施例获取到路由器300的配网信息,并经过路由器300的配网信息连接上路由器300。
示例性的,电子设备200(智能音箱)和电子设备500(智能摄像头)接收并连接至路由器300的open ssid。之后,服务器400将通过图8的实施例依次将智能音箱、智能摄像头与 路由器300关联同一账号。智能音箱、智能摄像头与路由器300关联了同一账号之后。那么智能音箱的图标、名称以及连接状态以及智能摄像头的图标、名称以及连接状态可以显示在用户界面920中。
如图10C所示,用户界面980包括关联到同一个账户的一个或多个电子设备,关联到同一个账户的一个或多个电子设备之间具有绑定关系。路由器300、智能电视9012、智能投影仪9014、智能音箱和智能摄像头均关联了到同一个账户。用户界面980示例性示出了路由器300处于在线状态。智能电视9012处于在线状态。智能投影仪9014处于离线状态。智能音箱200处于在线状态。智能摄像头500处于在线状态。
智能音箱和智能摄像头连接上路由器300的open ssid之后,智能音箱和智能摄像头可以与路由器300依次经过图9所示的实施例获取到路由器300的配网信息,智能音箱和智能摄像头依次经过路由器300的配网信息连接至路由器300所在的无线局域网。
需要说明的是,由于路由器300是持续性地发送路由器300的open ssid,在一些实施例中,在路由器300与处于待配网状态的一个或多个电子设备建立连接过程中,又有其他处于待配网状态的电子设备连接上了路由器300的open ssid。为了依次完成连接上路由器300的open ssid的电子设备的配网过程,路由器300在完成与一个电子设备的配网过程之后,路由器300会判断连接上路由器300的open ssid的电子设备的数量,若连接上路由器300的open ssid的电子设备的数量大于等于1,则路由器从连接上路由器300的open ssid的电子设备中任意选择一个设备完成配网过程,直至路由器300确定连接上路由器300的open ssid的电子设备的数量为0。
在路由器300确定连接上路由器300的open ssid的电子设备的数量为0之后,路由器还会继续持续性发送路由器300的open ssid一定时间。若在一定时间内,又有其他待配网的设备连接上路由器300的open ssid,其他待配网的设备将经过上述图7-图9所示的实施例获取到路由器300的配网信息,并经过路由器300的配网信息连接上路由器300。若在一定时间内,没有其他待配网的设备连接上路由器300的open ssid,则路由器300将关闭发送open ssid的功能,此次配网连接结束。
由上述分析可知,路由器300只需接收一次用户操作,即可完成与一个或多个待配网设备的配网任务事项,实现了“一键配网”,提高了多个待配网设备与路由器300的配网的效率。
图11-图13示例性展示了本申请实施例提供的几种“一键配网”流程图。
如图11所示,“一键配网”流程可以包括S1101-S1106。
在图11所示流程中,首先,路由器发现待配网设备,并响应于第一用户操作、持续性发送路由器的open ssid(即,执行S1101、S1102),并以路由器开始发送open ssid的时刻为计时起点,考察在该时刻之后的第一预设时间内是否有一个或多个电子设备接入路由器的open ssid(即,执行S1103的判断步骤)。
若在第一预设时间内有一个或多个电子设备接入路由器的open ssid(即,S1103判断为“是”),则路由器依次完成与接入路由器的open ssid的一个或多个电子设备的配网流程,直至接入路由器的open ssid的电子设备的数量为0(即,执行S1104)。其中,S1104执行的过程中,路由器可以继续保持持续性发送open ssid,因此在此过程中,也可以不断有新的处于待配网状态的一个或多个电子设备接入到路由器的open ssid中,路由器也会依次完成与这些新接入的一个或多个电子设备的配网流程,直至接入路由器的open ssid的电子设备的数量为0。在执行完S1104之后,路由器还可以再次启动计时器,考察在执行完S1104之后的第二预设 时间内是否有一个或多个电子设备接入路由器的open ssid(即,执行S1105的判断步骤),若有则再次执行S1104,否则执行S1106。
若在第一预设时间内没有电子设备接入路由器的open ssid(即,S1103判断为“否”),则路由器也可以再次启动定时器,以判断为“否”的时刻为计时起点(或者,以第一预设时间的计时结束时刻为计时起点),考察在该时刻之后的第二预设时间内是否有一个或多个电子设备接入路由器的open ssid(即,执行S1105的判断步骤),若有(即,S1105判断为“是”)则执行S1104,否则执行S1106,结束配网,路由器停止发送open ssid。其中,第二预设时间可以与第一预设时间相同或不同。
从而,图11实施例所示的流程中:
第一方面,在S1103中,路由器开始发送open ssid后会等待一段时间,考察这段时间内接入是否有一个或多个电子设备接入,若有,则路由器会依次完成与该一个或多个电子设备的配网。
第二方面,在S1104执行的过程中,路由器仍可以继续保持持续性发送open ssid,从而这段时间也可以不断有新的待配网状态的设备接入路由器的open ssid,进而路由器也能依次完成这些新接入的设备的配网流程。
第三方面,在S1103判断为“否”或者S1104执行完之后,路由器还会执行S1105的判断步骤,即,在路由器判断当前接入路由器的open ssid的电子设备的数量为0的情况下,路由器并不是直接结束配网、停止发送open ssid,而是再等待一段时间,考察这段时间内是否还有新的待配网状态的电子设备接入路由器的open ssid,若有,则路由器也会完成这些新接入的设备的配网流程。
以上几个方面,或者其中的部分几个方面,使得图11所示的方法可以达到“一键配网”的效果,即只需要一次用户操作就可以完成为多个电子设备配网的效果。
本申请实施例还提供如图12所示的“一键配网”流程。图12与图11类似,S1201与S1101类似,S1202与S1102类似。不同之处在于图12所示流程可以不包括图11实施例中的S1105,也即在S1203判断为“否”或者S1204执行完之后,路由器可以直接结束配网,不再等待第二预设时间。由于图12所示的流程仍包含S1203(相当于图11实施例中的S1103)、S1204(相当于图11实施例中的S1104),根据前述分析可知,图12所示的流程也能够达到“一键配网”的效果。
本申请实施例还提供如图13所示的“一键配网流程”。图13与图11类似,S1301与S1101类似,S1302与S1102类似。不同之处在于图13所示的流程中,在S1303判断为“否”之后,不再等待第二预设时间,路由器可以直接执行S1306结束配网。由于图13所示的流程仍包含S1303(相当于图11实施例中的S1103)、S1304(相当于图11实施例中的S1104)、S1305(相当于图11实施例中的S1105),根据前述分析可知,图13所示的流程也能够达到“一键配网”的效果。
如图14所示,图14为本申请实施例提供的一种配网方法的流程示意图。
S1401、电子设备200接入路由器300的无认证网络。
电子设备200也可以被称为第一电子设备。路由器300可以被称为无线接入设备。
可选的,在电子设备200接入路由器300的无认证网络之前,电子设备200广播电子设备200的配网信元,其中,配网信元用于使得其他电子设备发现处于待配网状态的电子设备 200。电子设备200的配网信元包括以下一项或多项:电子设备200的标识、电子设备200是否支持互连的能力、电子设备200的物理地址等。
路由器300接收到电子设备200的配网IE之后,路由器300发送路由器300的接入信息,路由器300的接入信息可以包括无认证网络的标识、无认证网络的物理地址等等,电子设备200接收到路由器300的接入信息,之后,电子设备200基于路由器300的接入信息连接上路由器300的无认证网络。
S1402、路由器300向服务器400发送第一请求消息。
在电子设备200接入路由器300的无认证网络后,路由器300向服务器400发送第一请求消息,第一请求信息用于服务器400生成第一授权码。也即在图7的实施例中,S705执行完之后,在图9的实施例中,在服务器400执行901之前,路由器300向服务器400发送第一请求消息,只有服务器400接收到第一请求消息之后,服务器400才会生成第一授权码(即执行S901)。
或者,第一请求消息也可以用于服务器400生成电子设备200的注册信息。第一请求消息可以是图8的实施例中S801中所述的生成注册数据的请求。
S1403、服务器400接收第一请求消息,生成第一授权码。
第一授权码也可以被称为authcode集合一。
当第一请求信息用于服务器400生成第一授权码时,即在服务器400执行901之前,路由器300向服务器400发送第一请求消息,服务器400接收到第一请求消息之后,服务器400才会生成第一授权码(即执行S901)。
当第一请求消息也可以用于服务器400生成电子设备200的注册信息时,在服务器400接收第一请求消息后,服务器400生成电子设备200的注册信息。之后,电子设备200、路由器300和服务器400经过S803-S808的步骤,服务器400校验电子设备200为合法的设备,并将电子设备200和路由器300绑定同一账号。之后,服务器400执行S901,生成第一授权码。
在一些实现方式中,第一授权码是由服务器400响应不同的电子设备的请求消息随机生成的,其中,授权码可以是服务器400根据预设的随机数生成算法随机生成的;在一些实现方式中,服务器100也有可能为不同的电子设备生成相同的授权码。
在另一些实现方式中,服务器400也可以生成第一授权码和第二授权码(也可以被称为authcode集合二),服务器400将第一授权码和第二授权码发送至路由器300,路由器300将第一授权码保存至本地,路由器300将第二授权码发送至电子设备200。之后,路由器300与电子设备200基于第一授权码和第二授权码协商得到第一密钥。当第一授权码和第二授权码相同时,则路由器300与电子设备200基于相同的授权码协商得到第一密钥。当第一授权码和第二授权码不同时,则路由器300与电子设备200基于不同的授权码协商得到第一密钥。
可选的,在服务器400生成第一授权码之前,第二电子设备(例如电子设备100)接收第二用户操作,第二用户操作用于指示路由器300发送无认证网络的接入信息。
在一些实现方式中,第二用户操作用于控制路由器300发送无认证网络的接入信息。具体的,在路由器300发现了处于待配网状态的电子设备200后,路由器300通过服务器400在已联网的电子设备100的手机上的应用程序上显示提示信息,以使得用户可以看到该提示 信息,该提示信息用于提示用户在应用程序上配网界面上输入第二用户操作,以使得路由器300发送无认证网络的接入信息。也就是说,用户可以不在路由器300上按压配网键(即第一用户操作),路由器300也可以发送无认证网络的接入信息。可以保证用户不方便按压路由器300的配网键时,用户可以在应用程序上控制路由器300发送无认证网络的接入信息。
并且该方案也可以运用于“远程配网”应用场景。即操作电子设备200的用户不熟悉将电子设备200连接上路由器300的流程,即使操作电子设备100的用户不在电子设备200的用户附近,操作电子设备100的用户可以远程通过在电子设备200上的第二用户操作控制电子设备200连接上路由器300。
具体的,对于“远程配网”应用场景的具体介绍,可以参考图9A-图9F所示的实施例,本申请实施例在此不再赘述。
在另一些实现方式中,第二用户操作也可以是控制服务器400向路由器300和电子设备200发送第一授权码。具体的,在服务器400向路由器300和电子设备200发送第一授权码之前,服务器400在电子设备100的手机上的应用程序上显示提示信息,以使得用户可以看到该提示信息,该提示信息用于提示用户在应用程序上配网界面上输入第二用户操作,以使得务器400向路由器300和电子设备200发送第一授权码。
S1404、路由器300、电子设备200获取第一授权码,并基于第一授权码协商得到第一密钥。
第一密钥也可以被称为密钥二。
第一授权码包括m个授权码,m为大于等于1的正整数。
路由器300基于第一授权码中的x个授权码和电子设备200基于第一授权码中的y个授权码协商得到第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
也就是说,服务器400将第一授权码发送至路由器300,路由器300将第一授权码保存在本地,且路由器300还需将第一授权码发送至电子设备200。路由器300与电子设备200可以从第一授权码中选取部分或全部的授权码协商得到第一密钥。
在一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码相同,则路由器300与电子设备200基于相同的授权码协商得到第一密钥。
在另一些实现方式中,第一授权码中的x个授权码和第一授权码中的y个授权码不同,则路由器300与电子设备200基于不同的授权码协商得到第一密钥。
这里,路由器300、电子设备200如何基于第一授权码协商得到第一密钥的,可以参考图9实施例中的相关描述,本申请实施例在此不再赘述。
可选的,在路由器300、电子设备200获取第一授权码,并基于第一授权码协商得到第一密钥之前,电子设备200通过路由器300向服务器400发送电子设备200本地存储的第一认证信息;服务器400接收第一认证信息,并根据第一认证信息确定电子设备200为合法设备。这样,只有服务器400通过第一认证信息确定电子设备200为合法的设备之后,服务器400才会生成第一授权码用于电子设备200和路由器300协商得到第一密钥传递配网信息。当服务器400通过第一认证信息确定路由器300不是合法的设备,那么服务器400不会生成第一授权码,则路由器300得不到配网信息,路由器300也不能加入路由器300所在的无线局域网,这样,保证了配网过程中的安全性。
具体的,服务器400判断第一认证信息满足第一条件时,则确定电子设备200为合法设 备。
在一些实现方式中,第一认证信息包括第一注册信息(第一注册信息可以是图8实施例中描述的注册信息)。
在服务器400接收第一请求信息之后,在服务器400接收路由器300发送的第一认证信息之前,服务器400生成第一注册信息(例如注册码),并将第一注册信息保存在本地,得到第二注册信息。服务器400将第一注册信息通过路由器300发送至电子设备200。电子设备200在接收到第一注册信息之后,将第一注册信息保存在本地。
第一条件包括:第一认证信息中的第一注册信息与服务器400本地保存的电子设备200的第二注册信息相同。即当服务器400确认电子设备200通过路由器300发送的第一注册信息是之前服务器400通过路由器300发送的电子设备200的注册信息,则服务器400可以初步确定出电子设备200为合法的设备。
在另一些实现方式中,第一认证信息包括第一注册信息和第一校验信息(第一校验信息可以是图8实施例中描述的校验信息)。第一检验信息可以为数字证书或者KPI证书中的任意一种。
第一条件包括:第一认证信息中的第一注册信息与服务器400本地保存的电子设备200的第二注册信息相同。并且第一校验信息为合法的校验信息。
具体的,服务器400在确定第一校验信息为合法的校验信息之前,服务器400生成第一随机数并将第一随机数通过路由器300发送至电子设备200。电子设备200在接收到第一随机数后,根据第一私钥将第一随机数加密,得到加密第一随机数。电子设备200将加密第一随机数通过路由器300发送至服务器400。服务器400在接收到加密第一随机数后,并根据第一校验信息中预置的第一公钥将加密第一随机数解密,得到第一随机数后,服务器400确定出第一校验信息为合法的校验信息。
服务器400在通过第一注册信息确定电子设备200为合法的设备之后,服务器400进一步根据校验信息验证电子设备200的合法性。这样,可以提高后续传输配网信息的安全性。
具体的,服务器400如何根据第一注册信息和第一校验信息校验电子设备200的合法性,可以参考图8实施例中的相关描述,本申请实施例在此不做赘述。
可选的,在电子设备200通过路由器300向服务器400发送电子设备200本地存储的第一认证信息之前,电子设备200基于本地保存的预置参数和路由器300基于本地保存的预置参数协商得到第二密钥(也可以被称为密钥一);电子设备200通过路由器300向服务器400发送电子设备200本地存储的第一认证信息,具体包括:电子设备200基于第二密钥将第一认证信息加密,得到加密的第一认证信息;电子设备200向路由器300发送加密的第一认证信息;路由器300在接收到加密的第一认证信息后,基于第二密钥将加密的第一认证信息解密,得到第一认证信息;路由器300将第一认证信息发送至服务器400。
在一些实现方式中,在路由器300将第一注册信息发送至电子设备200之前,路由器300将第一注册信息以第二密钥加密,得到加密的第一注册信息。路由器300将加密的第一注册信息发送至电子设备200。这样,可以保证电子设备200与路由器300之间信息传递的安全性。
这样,在电子设备200向服务器400发起注册请求之前(也可以说在电子设备200通过路由器300向服务器400发送第一认证信息之前),若电子设备200与路由器300可以通过本地存储的预置参数协商得到第二密钥,则可以认为电子设备200为初步合法的设备,电子设 备200可以通过路由器300向服务器400发起注册请求。一方面,可以保证向服务器400发起注册请求的电子设备200为初步合法的电子设备,即电子设备200中保存有预置参数。另一方面,电子设备200与路由器300之间传递的信息通过第二密钥加密后在传递,可以保证电子设备200与路由器300之间信息传递的安全性。
S1405、路由器300基于第一密钥加密路由器300所在的无线局域网的配网信息,得到加密的配网信息,并向电子设备200发加密的配网信息。
配网信息可以包括但不仅限于路由器300的名称和密码等等,配网信息还可以包括其他更多的信息,本申请在此不做限定。
路由器300、电子设备200获取第一授权码,并基于第一授权码协商得到第一密钥后,路由器300基于第一密钥加密路由器300所在的无线局域网的配网信息,得到加密的配网信息,并向电子设备200发加密的配网信息。这样,可以使得电子设备200获取到路由器300所在的无线局域网的配网信息。
S1406、电子设备200接收加密的配网信息,基于第一密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上路由器300所在的无线局域网。
电子设备200接收加密的配网信息后,基于第一密钥将加密的配网信息进行解密,得到配网信息,并基于配网信息连接上路由器300所在的无线局域网。这样,电子设备200可以通过路由器300访问互联网。
可选的,在电子设备200接入路由器300的无认证网络之前,路由器300响应于第一用户操作,发送无认证网络的接入信息。电子设备200接收接入信息,基于接入信息接入路由器300的无认证网络。第一用户操组可以是作用于路由器300的配网键的按压操作,无认证网络的接入信息可以包括无认证网络的标识和路由器300的物理地址等等。路由器300只有接收第一用户操作后(即得到用户的授权),路由器300才会发送路由器300的无认证网络的接入信息。
在一些实现方式中,路由器300响应于第一用户操作,持续性发送无认证网络的接入信息。
在电子设备200接入路由器300所在的无线局域网后,第三电子设备(电子设备500)接入路由器300的无认证网络。路由器300向服务器400发送第二请求消息。服务器400接收第二请求消息后,生成第二授权码,其中,第二授权码不同于服务器400接收路由器300发送的其他电子设备的请求消息后生成的授权码。路由器300、电子设备500获取第二授权码,并基于第二授权码协商得到第二密钥。路由器300基于第二密钥加密路由器300所在的无线局域网的配网信息,得到加密的配网信息,并向电子设备500发送加密的配网信息。电子设备500接收加密的配网信息,基于第二密钥对加密的配网信息进行解密,得到配网信息,并基于配网信息连接上路由器300所在的无线局域网。这样,路由器300只需接收一次用户操作,持续性发送无认证网络的接入信息。在路由器300停止发送无认证网络的接入信息之前,可以有一个或多个电子设备接上路由器300的无认证网络,那么路由器300可以采取与电子设备200一样的配网流程完成与其他的一个或多个电子设备(例如电子设备500)的配网流程。也即,路由器300只需接收一次用户操作,可完成与多个电子设备的配网流程,与目前路由器300接收一次用户操作,只能完成与一个电子设备的配网流程相比,提高了电子 设备的配网效率。
在一些实现方式中,在路由器300完成与电子设备500的配网流程后,路由器300确定出连接上路由器300的无认证网络的电子设备的数量为0之后,路由器300停止发送无认证网络的接入信息。
在一些实现方式中,在路由器300完成与电子设备500备的配网流程后,路由器300确定出连接上路由器300的无认证网络的电子设备的数量为0之后在等一段时间,在这段时间内,路由器300仍然持续性发送无认证网络的接入信息,若没有其他的电子设备连接上路由器300的无认证网络,则路由器300停止发送无认证网络的接入信息。
具体的,路由器300如何实现“一键配网”的,可以参考图10A-图10C、图11-图13所示的实施例,本申请实施例在此不再赘述。
可选的,电子设备200的数量为一个或多个,在电子设备100接收用户的第二用户操作之前,电子设备100显示第一用户界面(图9E所示的用户界面940或者图10B所示的用户界面970),第一用户界面包括一个或多个电子设备200对应的一个或多个设备标识;在电子设备100接收用户的第二用户操作之后,电子设备100显示第二用户界面(图9F所示的用户界面950或者图10C所示的用户界面980),第二用户界面包括一个或多个电子设备200对应的一个或多个状态标识,一个或多个状态标识用于表示一个或多个电子设备200已完成配网,或者,一个或多个电子设备200已连接网络。
第二用户界面还可以包括一个或多个电子设备200对应的一个或多个设备标识等信息。
这样,在服务器验证400确认电子设备200为合法的设备之后,服务器400将电子设备200与路由器300关联同一账号。这样,用户可以在电子设备100中应用程序上的查看电子设备200的联网状态,联网状态包括但不仅限于在线、离线、配网中、配网失败等等。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。

Claims (30)

  1. 一种配网方法,应用于包括第一电子设备、无线接入设备和服务器的配网系统中,其特征在于,所述方法包括:
    所述第一电子设备接入所述无线接入设备的无认证网络;
    所述无线接入设备向所述服务器发送第一请求消息;
    所述服务器接收所述第一请求消息,生成第一授权码,其中,所述第一授权码不同于所述服务器接收无线接入设备发送的其他电子设备的请求消息后生成的授权码;
    所述无线接入设备、所述第一电子设备获取所述第一授权码,并基于所述第一授权码协商得到第一密钥;
    所述无线接入设备基于所述第一密钥加密所述无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向所述第一电子设备发送所述加密的配网信息;
    所述第一电子设备接收所述加密的配网信息,基于所述第一密钥对所述加密的配网信息进行解密,得到所述配网信息,并基于所述配网信息连接上所述无线接入设备所在的无线局域网。
  2. 根据权利要求1所述的方法,其特征在于,在所述无线接入设备、所述第一电子设备获取所述第一授权码之前,所述方法还包括:
    所述第一电子设备通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息;
    所述服务器接收所述第一认证信息,并根据所述第一认证信息确定所述第一电子设备为合法设备。
  3. 根据权利要求2所述的方法,其特征在于,在所述第一电子设备通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息之前,所述方法还包括:
    所述第一电子设备基于本地保存的预置参数和所述无线接入设备基于本地保存的预置参数协商得到第二密钥;
    所述第一电子设备通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息,具体包括:
    所述第一电子设备基于所述第二密钥将所述第一认证信息加密,得到加密的第一认证信息;
    所述第一电子设备向所述无线接入设备发送所述加密的第一认证信息;
    所述无线接入设备在接收到所述加密的第一认证信息后,基于所述第二密钥将所述加密的第一认证信息解密,得到所述第一认证信息;
    所述无线接入设备将所述第一认证信息发送至所述服务器。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一授权码包括m个授权码,m为大于等于1的正整数;
    所述无线接入设备、所述第一电子设备基于所述第一授权码协商得到第一密钥,具体包括:
    所述无线接入设备基于所述第一授权码中的x个授权码和所述第一电子设备基于所述第一授权码中的y个授权码协商得到所述第一密钥;其中,x大于等于1小于等于m,y大于等 于1小于等于m。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,在所述第一电子设备接入所述无线接入设备的无认证网络之前,所述方法还包括:
    所述无线接入设备响应于第一用户操作,发送所述无认证网络的接入信息;
    所述第一电子设备接入所述无线接入设备的无认证网络,具体包括:
    所述第一电子设备接收所述接入信息,基于所述接入信息接入所述无线接入设备的所述无认证网络。
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述配网系统还包括第二电子设备,在所述服务器生成所述第一授权码之前,所述方法还包括:
    所述第二电子设备接收第二用户操作,所述第二用户操作用于指示所述无线接入设备发送所述无认证网络的接入信息。
  7. 根据权利要求6所述的方法,其特征在于,所述第一电子设备的数量为一个或多个,在所述第二电子设备接收用户的第二用户操作之前,所述方法还包括:
    所述第二电子设备显示第一用户界面,所述第一用户界面包括所述一个或多个第一电子设备对应的一个或多个设备标识;
    在所述第二电子设备接收用户的第二用户操作之后,所述方法还包括:
    所述第二电子设备显示第二用户界面,所述第二用户界面包括所述一个或多个第一电子设备对应的一个或多个状态标识,所述一个或多个状态标识用于表示所述一个或多个第一电子设备已完成配网,或者,所述一个或多个第一电子设备已连接网络。
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,在所述第一电子设备接入所述无线接入设备的无认证网络之前,所述方法还包括:
    所述第一电子设备广播所述第一电子设备的配网信元,其中,所述配网信元用于使得其他电子设备发现处于待配网状态的所述第一电子设备。
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述配网信息包括,所述无线接入设备所在的无线局域网的名称和密码。
  10. 一种配网方法,应用于第一电子设备,其特征在于,所述方法包括:
    接入无线接入设备的无认证网络;
    获取第一授权码,所述第一授权码是由服务器生成的,其中,所述第一授权码不同于接入所述无线接入设备的所述无认证网络的其他电子设备接收到的授权码;
    基于所述第一授权码,与所述无线接入设备协商确定第一密钥;
    接收所述无线接入设备发送的加密的配网信息,并基于所述第一密钥对所述加密的配网信息进行解密,得到配网信息;
    基于所述配网信息连接上所述无线接入设备所在的无线局域网。
  11. 根据权利要求10所述的配网方法,其特征在于,在获取第一授权码之前,所述方法 还包括:
    通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息;其中,所述第一认证信息用于所述服务器确定所述第一电子设备为合法设备。
  12. 根据权利要求11所述的配网方法,其特征在于,在通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息之前,所述方法还包括:
    基于本地保存的预置参数和所述无线接入设备基于本地保存的预置参数协商得到第二密钥;
    通过所述无线接入设备向所述服务器发送所述第一电子设备本地存储的第一认证信息,具体包括:
    基于所述第二密钥将本地存储的所述第一认证信息加密,得到加密的第一认证信息;
    向所述无线接入设备发送所述加密的第一认证信息;其中,所述加密的第一认证信息用于所述无线接入设备基于所述第二密钥将所述加密的第一认证信息解密后得到所述第一认证信息,并将所述第一认证信息发送至所述服务器。
  13. 根据权利要求10-12任一项所述的方法,其特征在于,所述第一授权码包括m个授权码,m为大于等于1的正整数;
    基于所述第一授权码,与所述无线接入设备协商确定第一密钥,具体包括:
    基于所述第一授权码中的x个授权码和所述无线接入设备基于所述第一授权码中的y个授权码协商得到所述第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
  14. 根据权利要求10-13任一项所述的方法,其特征在于,在接入无线接入设备的无认证网络之前,所述方法还包括:
    接收所述无线接入设备发送的接入信息;
    接入无线接入设备的无认证网络,具体包括:
    基于所述接入信息接入所述无线接入设备的所述无认证网络。
  15. 根据权利要求10-14任一项所述的方法,其特征在于,在接入无线接入设备的无认证网络之前,所述方法还包括:
    广播所述第一电子设备的配网信元,其中,所述配网信元用于使得其他电子设备发现处于待配网状态的所述第一电子设备。
  16. 根据权利要求10-15任一项所述的方法,其特征在于,所述配网信息包括,所述无线接入设备所在的无线局域网的名称和密码。
  17. 一种配网方法,应用于无线接入设备,其特征在于,所述方法包括:
    在第一电子设备接入所述无线接入设备的无认证网络后,向服务器发送第一请求消息;其中,所述第一请求消息用于所述服务器生成第一授权码,其中,所述第一授权码不同于所述无线接入设备向接入所述无线接入设备的所述无认证网络的其他电子设备发送的授权码;
    获取所述第一授权码,并基于所述第一授权码,与所述第一电子设备协商确定第一密钥;
    基于所述第一密钥加密所述无线接入设备所在的无线局域网的配网信息,得到加密的配 网信息,并向所述第一电子设备发送所述加密的配网信息;其中,所述加密的配网信息用于所述第一电子设备基于所述第一密钥对所述加密的配网信息进行解密,得到所述配网信息,并基于所述配网信息连接上所述无线接入设备所在的无线局域网。
  18. 根据权利要求17所述的方法,其特征在于,在获取所述第一授权码之前,所述方法还包括:
    接收所述第一电子设备发送的所述第一电子设备本地存储的第一认证信息;
    向所述服务器发送所述第一认证信息;其中,所述第一认证信息用于所述服务器确定所述第一电子设备为合法设备。
  19. 根据权利要求18所述的方法,其特征在于,在接收所述第一电子设备发送的所述第一电子设备本地存储的第一认证信息之前,所述方法还包括:
    基于本地保存的预置参数和所述第一电子设备基于本地保存的预置参数协商得到第二密钥;
    接收所述第一电子设备发送的所述第一电子设备本地存储的第一认证信息,具体包括:
    接收所述第一电子设备发送的基于所述第二密钥加密的第一认证信息;
    在向所述服务器发送所述第一认证信息之前,所述方法还包括:
    基于所述第二密钥将所述加密的第一认证信息解密,得到所述第一认证信息。
  20. 根据权利要求17-19任一项所述的方法,其特征在于,所述第一授权码包括m个授权码,m为大于等于1的正整数;
    与所述第一电子设备协商确定第一密钥,具体包括:
    基于所述第一授权码中的x个授权码和所述第一电子设备基于所述第一授权码中的y个授权码协商得到所述第一密钥;其中,x大于等于1小于等于m,y大于等于1小于等于m。
  21. 根据权利要求17-20任一项所述的方法,其特征在于,在第一电子设备接入所述无线接入设备的无认证网络之前,所述方法还包括:
    响应于第一用户操作,发送所述无认证网络的接入信息;其中,所述接入信息用于所述第一电子设备接入所述无线接入设备的所述无认证网络。
  22. 根据权利要求17-21任一项所述的方法,其特征在于,在第一电子设备接入所述无线接入设备的无认证网络之前,所述方法还包括:
    接收所述第一电子设备广播的所述第一电子设备的配网信元,其中,所述配网信元用于使得其他电子设备发现处于待配网状态的所述第一电子设备。
  23. 根据权利要求17-22任一项所述的方法,其特征在于,所述配网信息包括,所述无线接入设备所在的无线局域网的名称和密码。
  24. 一种配网方法,应用于服务器,其特征在于,所述方法包括:
    接收所述第一请求消息,生成第一授权码,其中,所述第一授权码不同于所述服务器接收无线接入设备发送的其他电子设备的请求消息后生成的授权码;
    将所述第一授权码发送至无线接入设备和第一电子设备,其中,所述第一授权码用于所述无线接入设备和所述第一电子设备协商得到第一密钥;
    所述第一密钥用于所述无线接入设备基于所述第一密钥加密所述无线接入设备所在的无线局域网的配网信息,得到加密的配网信息,并向所述第一电子设备发送所述加密的配网信息;
    所述加密的配网信息用于所述第一电子设备基于所述第一密钥对所述加密的配网信息进行解密,得到所述配网信息,并基于所述配网信息连接上所述无线接入设备所在的无线局域网。
  25. 根据权利要求24所述的方法,其特征在于,在生成所述第一授权码之前,所述方法还包括:
    接收所述无线接入设备发送的所述第一电子设备本地存储的第一认证信息,并根据所述第一认证信息确定所述第一电子设备为合法设备。
  26. 根据权利要求24-25任一项所述的方法,其特征在于,所述配网信息包括,所述无线接入设备所在的无线局域网的名称和密码。
  27. 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述一个或多个处理器调用所述计算机指令以使得所述电子设备执行上述权利要求10-16、权利要求17-23或权利要求24-26中的任一项所述的方法。
  28. 一种芯片装置,其特征在于,所述芯片装置包括至少一个处理器以及存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述至少一个处理器调用所述计算机指令使得安装有所述芯片装置的电子设备执行上述权利要求10-16、权利要求17-23或权利要求24-26中的任一项所述的方法。
  29. 一种计算机可读存储介质,用于存储计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行上述权利要求10-16、权利要求17-23或权利要求24-26中的任一项所述的方法。
  30. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行上述权利要求10-16、权利要求17-23或权利要求24-26中的任一项所述的方法。
PCT/CN2022/106098 2021-07-19 2022-07-15 一种配网方法及装置 WO2023001082A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22845247.0A EP4344274A4 (en) 2021-07-19 2022-07-15 METHOD AND APPARATUS FOR NETWORK CONFIGURATION
US18/577,933 US20240323675A1 (en) 2021-07-19 2022-07-15 Network configuration method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110814541.8 2021-07-19
CN202110814541.8A CN115643565A (zh) 2021-07-19 2021-07-19 一种配网方法及装置

Publications (1)

Publication Number Publication Date
WO2023001082A1 true WO2023001082A1 (zh) 2023-01-26

Family

ID=84940622

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106098 WO2023001082A1 (zh) 2021-07-19 2022-07-15 一种配网方法及装置

Country Status (4)

Country Link
US (1) US20240323675A1 (zh)
EP (1) EP4344274A4 (zh)
CN (1) CN115643565A (zh)
WO (1) WO2023001082A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887250A (zh) * 2023-09-07 2023-10-13 飞天诚信科技股份有限公司 一种智能设备的网络连接实现方法及系统
CN116887385A (zh) * 2023-09-06 2023-10-13 博为科技有限公司 一种无线设备接入优化方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107426722A (zh) * 2016-05-23 2017-12-01 北京京东尚科信息技术有限公司 接入方法、智能设备、配置服务器和认证服务器
US20180206117A1 (en) * 2015-07-02 2018-07-19 Telefonaktiebolaget Lm Ericsson (Publ) Method for obtaining initial access to a network, and related wireless devices and network nodes
CN110336720A (zh) * 2019-06-29 2019-10-15 华为技术有限公司 设备控制方法和设备
CN110891299A (zh) * 2019-11-15 2020-03-17 北京小米移动软件有限公司 配网方法及装置、电子设备及存储介质
CN112291100A (zh) * 2020-11-03 2021-01-29 北京小米移动软件有限公司 配网方法、配网装置及存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110995665B (zh) * 2019-11-15 2023-04-18 北京小米移动软件有限公司 配网方法及装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180206117A1 (en) * 2015-07-02 2018-07-19 Telefonaktiebolaget Lm Ericsson (Publ) Method for obtaining initial access to a network, and related wireless devices and network nodes
CN107426722A (zh) * 2016-05-23 2017-12-01 北京京东尚科信息技术有限公司 接入方法、智能设备、配置服务器和认证服务器
CN110336720A (zh) * 2019-06-29 2019-10-15 华为技术有限公司 设备控制方法和设备
CN110891299A (zh) * 2019-11-15 2020-03-17 北京小米移动软件有限公司 配网方法及装置、电子设备及存储介质
CN112291100A (zh) * 2020-11-03 2021-01-29 北京小米移动软件有限公司 配网方法、配网装置及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4344274A4

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887385A (zh) * 2023-09-06 2023-10-13 博为科技有限公司 一种无线设备接入优化方法、装置及存储介质
CN116887385B (zh) * 2023-09-06 2023-12-12 博为科技有限公司 一种无线设备接入优化方法、装置及存储介质
CN116887250A (zh) * 2023-09-07 2023-10-13 飞天诚信科技股份有限公司 一种智能设备的网络连接实现方法及系统
CN116887250B (zh) * 2023-09-07 2023-11-07 飞天诚信科技股份有限公司 一种智能设备的网络连接实现方法及系统

Also Published As

Publication number Publication date
EP4344274A4 (en) 2024-09-11
EP4344274A1 (en) 2024-03-27
US20240323675A1 (en) 2024-09-26
CN115643565A (zh) 2023-01-24

Similar Documents

Publication Publication Date Title
US10278058B2 (en) Wireless communication device information processing device, and communication method
WO2021036513A1 (zh) 一种智能设备的配网方法、系统以及可读介质
US20230093016A1 (en) Discovery and provisioning method, electronic device, and system
WO2021018153A1 (zh) 一种设备配网注册的方法、设备及系统
WO2023001082A1 (zh) 一种配网方法及装置
CA2605682C (en) Wireless device discovery and configuration
CN111459433B (zh) 一种传屏方法、设备及存储介质
EP2885936B1 (en) Configuration of a new enrollee device for use in a communication network
JP6929390B2 (ja) ワイヤレス・ローカル・エリア・ネットワーク構成方法及びデバイス
WO2017148308A1 (zh) 一种物联网设备接入网络的方法、装置及系统
JP2015507387A (ja) メッシュネットワークを形成する無線デバイスのためのワンクリック接続/切断機能
CN113347741B (zh) 网关设备的上线方法及系统
CN105284178A (zh) 配置无线附件设备
GB2494062A (en) Establishing pairing between two devices using probes
JP2007104310A (ja) ネットワーク装置、ネットワークシステム及び鍵更新方法
CN112566113B (zh) 密钥生成以及终端配网方法、装置、设备
WO2014166206A1 (zh) 安全网络接入处理方法及装置
WO2022028333A1 (zh) 一种自动控制方法、电子设备及计算机可读存储介质
WO2015139401A1 (zh) 无线网络的建立方法、系统及无线路由装置
WO2022042170A1 (zh) 一种IoT设备及其授权方法
WO2019015041A1 (zh) 一种物联网中继器数据的分时段加密方法及装置
WO2022042740A1 (zh) 一种数据传输方法及电子设备
WO2019015039A1 (zh) 一种基于物联网中继器的选择加密方法及装置
WO2023230975A1 (zh) 建立互操作通道的方法、装置、芯片和存储介质
WO2023230983A1 (zh) 建立互操作通道的方法、装置、芯片和存储介质

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: 22845247

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022845247

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022845247

Country of ref document: EP

Effective date: 20231222

WWE Wipo information: entry into national phase

Ref document number: 18577933

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE