Equipment access method, electronic equipment and storage medium

By broadcasting verification messages to the second device in scenarios such as smart homes and automatically accessing them, the problem of cumbersome manual operations when the terminal device replaces the gateway is solved, and a more intelligent device access process is realized.

CN120128922APending Publication Date: 2025-06-10ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311682723.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

In smart home and other scenarios, when terminal devices (such as sensor devices) need to replace gateway devices, manual operation is complicated, especially when the device is installed at a high place or inconveniently accessible location, resulting in inconvenient access.

Method used

The verification message is broadcast to the second device through the first device, and a response message is received and verified. If the verification is passed, the second device is connected to the first device to avoid manual operation.

Benefits of technology

It simplifies the device access process, improves the intelligence level of device access, and improves the user experience, especially when the device is inconvenient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128922A_ABST
    Figure CN120128922A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment access method, electronic equipment and a storage medium, and relates to the technical field of communication. The first device broadcasts the verification message to the second device, receives the verification response message sent by the second device, and accesses the second device passing the verification to the first device when the verification result is that the verification is passed. When the first device is replaced, the verification message is broadcasted to enable the second device to start the access process after the verification is passed, so that the tedious and inconvenient operation that the second device can access the first device only by manually operating the second device is avoided, the intelligent level of device access is improved, and the user experience of the product is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technologies, and in particular, to a method for device access, an electronic device, and a storage medium. Background Art

[0002] In existing wireless access technologies, it is a common access form that a terminal device can access the Internet through a gateway device. Taking the smart home scenario as an example, the terminal device can be various different types of sensor devices, and the sensor devices can be connected to the gateway wirelessly and access the Internet through the gateway.

[0003] In related technologies, when the gateway to which the terminal device is connected fails and needs to be replaced with a new gateway, the operation is very cumbersome. For example, in the smart home scenario, after replacing the new gateway device, it is necessary to manually operate on the sensor device to complete the access of the sensor device to the new gateway device. For example, it is necessary to manually scan a code or press a button on the sensor device to make the sensor device access the new gateway device. Since most of the already installed sensor devices are not easy to operate, such as the sensor devices are installed at a very high position or in a corner that is not easy to approach, and it is very cumbersome to operate each sensor device one by one, which makes it very inconvenient for the sensor device to access the new gateway device. Summary of the Invention

[0004] An object of embodiments of the present disclosure is to provide a method for device access, an electronic device, and a storage medium.

[0005] To solve the above technical problems, embodiments of the present disclosure are implemented through the following aspects.

[0006] According to a first aspect of embodiments of the present disclosure, there is provided a method for device access, which is applied to a first device. The method includes: broadcasting a verification message to the at least one second device, where the verification message includes authentication information to be verified; receiving a verification response message sent by the second device, and obtaining a verification result of the second device from the verification response message, where the verification result is a comparison result between the authentication information to be verified and the authentication information in the second device; and when the verification result is verification passed, connecting the second device with verification passed to the first device.

[0007] According to a second aspect of the embodiments of the present disclosure, a method for device access is provided, which is applied to a second device that stores identity authentication information. The method includes: receiving a verification message sent by the first device, where the verification message includes the identity authentication information to be verified; obtaining a verification result of the identity authentication information to be verified according to a comparison result between the identity authentication information to be verified and the stored identity authentication information; sending a verification response message including the verification result to the first device; and accessing the first device when the verification result is verification passed.

[0008] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including: a memory, a processor, and computer-executable instructions stored on the memory and executable on the processor. When the computer-executable instructions are executed by the processor, the method for device access in the first aspect or the second aspect is implemented.

[0009] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the method for device access in the first aspect or the second aspect is implemented.

[0010] By adopting the above technical solution, the first device broadcasts a verification message to the second device, receives the verification response message sent by the second device, and when the verification result is verification passed, accesses the second device that has passed the verification to the first device. When replacing the first device, it is possible to broadcast the verification message so that the second device starts the access process after passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0011] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.

[0012] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0014] Figure 1 FIG. shows a schematic diagram of an application scenario of the method for device access provided by the embodiments of the present disclosure;

[0015] Figure 2 A schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0016] Figure 3 Another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0017] Figure 4 Still another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0018] Figure 5 Still another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0019] Figure 6 A schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0020] Figure 7 Another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0021] Figure 8 Still another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0022] Figure 9 Still another schematic flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0023] Figure 10 A schematic interaction flowchart showing a method for device access provided by an embodiment of the present disclosure;

[0024] Figure 11 A schematic hardware structure diagram of an electronic device for executing the method for device access provided by an embodiment of the present disclosure. Detailed implementation manners

[0025] In order to enable those skilled in the art to better understand the technical solutions in the present disclosure, the following will clearly and completely describe the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.

[0026] Figure 1 A schematic application scenario diagram showing a method for device access provided by an embodiment of the present disclosure, Figure 1 (a) shows the device connection diagram before the first device is replaced, as Figure 1(As shown in (a)), at least one second device 2 accesses a third device 3. The at least one second device 2 can access the third device 3 through a wired or wireless connection and connect to the Internet through the third device 3. Figure 1 (b) shows the device connection diagram after the first device is replaced. As Figure 1 (shown in (b)), the first device 1 replaces the third device 3, and at least one second device 2 reconnects to the first device 1 and connects to the Internet through the first device 1. Taking the smart home scenario as an example, the third device 3 can be an old gateway device, the first device 1 can be a new gateway device, and the at least one second device 2 can be sensor devices set at different positions in the smart home scenario. In Figure 1 (a), at least one sensor device can access the old gateway device and access the Internet through the old gateway device. For example, it can be connected to the user's smart terminal device through the old gateway device via the Internet. In Figure 1 (b), at least one sensor device can reconnect to the new gateway device and access the Internet through the new gateway device.

[0027] It should be noted that although the present disclosure describes the above method for device access taking the smart home environment as an example, it can be understood that the above method for device access is also applicable to other similar application scenarios, such as the intelligent logistics, intelligent warehouse management and other scenarios. The present disclosure does not limit this.

[0028] Figure 2 As shown in the flowchart of a method for device access provided by an embodiment of the present disclosure, this method is applied to a first device. As Figure 2 shown, this method may include the following steps:

[0029] In step S101, a verification message is broadcast to at least one second device.

[0030] Among them, the verification message includes the authentication information to be verified.

[0031] In some embodiments, the authentication information to be verified can be generated by the third device according to the second device accessing the third device.

[0032] In some possible implementation manners, after the second device accesses, the third device can generate the authentication information in any of the following manners and send the authentication information to the second device so that the second device can save the authentication information.

[0033] Method 1: The third device can randomly generate unique authentication information through a preset algorithm.

[0034] In the second method, the third device can generate different identity authentication information for each second device according to the identification information of the second device. Taking the smart home scenario as an example, the old gateway device can generate different identity authentication information for each sensor device based on the hardware ID (Identity) or IMEI (International Mobile Equipment Identity) of the accessed sensor device. The old gateway device can also combine a part of the device identifier of the old gateway device with a part of the sensor identification information to generate a preset-length string, and use this string as the identity authentication information.

[0035] The above preset algorithm can be, for example, the Snowflake algorithm or the hash function algorithm in the related art, or a software algorithm that generates a unique ID from at least two of the timestamp, random number, and the identification information of the second device. The present disclosure places no limitation on this.

[0036] In some embodiments, the first device can obtain the identity authentication information through the third device, and use the obtained identity authentication information as the identity authentication information to be verified. After obtaining the identity authentication information to be verified, a verification message can be generated according to the identity authentication information to be verified, and the verification message can be broadcast to at least one second device.

[0037] Exemplarily, in the smart home scenario, the new gateway device can obtain the identity authentication information generated by the old gateway device from the old gateway device, and use this identity authentication information as the identity authentication information to be verified. After obtaining the identity authentication information to be verified, a verification message can be generated according to the identity authentication information to be verified, and this verification message can be broadcast to at least one sensor device.

[0038] In step S102, receive the verification response message sent by the second device, and obtain the verification result of the second device from the verification response message.

[0039] Among them, the verification result is the comparison result between the identity authentication information to be verified and the identity authentication information in the second device.

[0040] Exemplarily, the second device can compare the received identity authentication information to be verified with the identity authentication information stored in the second device respectively, and send verification results of verification passed or verification failed according to the comparison results.

[0041] In step S103, in the case where the verification result is verification passed, connect the second device with the verification passed to the first device.

[0042] Exemplarily, after receiving the verification results respectively sent by the second device, the first device may, according to the verification results, connect the second device that passes the verification to the first device. In the case where the verification result is not passed, the verification message may be repeatedly broadcast and / or an alarm message may be displayed to the user according to a preset retransmission policy.

[0043] It can be understood that the verification result can be explicitly represented by the verification result included in the verification response message, and the verification result can also be implicitly represented by whether the verification response message is received within a preset time. For example, receiving the verification response message within the preset time indicates that the verification result is passed, and not receiving the verification response message within the preset time indicates that the verification result is not passed.

[0044] Adopting the above technical solution, when replacing the first device, the verification message can be broadcast to enable the second device to start the access process after passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second device to connect the second device to the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0045] Figure 3 Another process schematic diagram of the device access method provided by the embodiments of the present disclosure is shown. As Figure 3 shown, before broadcasting the verification message to at least one second device, the method may include the following steps:

[0046] In step S104, establish a connection with the third device.

[0047] In some possible implementation manners, the connection with the third device may be established in a wired or wireless manner. In some possible implementation manners, the first device may establish a connection with the third device through the connection manner of the master and slave devices in a wireless mesh network (mesh).

[0048] In step S105, send a first request message to the third device, and obtain the identity authentication information to be verified from the first response message of the third device.

[0049] Among them, the identity authentication information to be verified is generated by the third device according to the second device accessing the third device.

[0050] In some possible implementation manners, the identity authentication information to be verified may be a unique identity authentication information randomly generated by the third device through a preset algorithm, that is, the identity authentication information corresponding to multiple second devices may be the same, and the identity authentication information to be verified may also be different identity authentication information generated by the third device for each second device according to the identification information of the second device through a preset algorithm, that is, the identity authentication information corresponding to multiple second devices may be different.

[0051] In some embodiments, the first response message may further include a list of device identifiers of the second devices accessing the third device. Taking the smart home scenario as an example, the first response message sent by the old gateway device to the new gateway device may include a list of device identifiers of the sensor devices originally accessing the old gateway device. The device identifier list may, for example, include the ID and / or IMEI of each sensor device. In the case where the authentication information to be verified corresponding to multiple second devices is different, the first response message may further include the correspondence between each second device and the corresponding authentication information to be verified, so that the first device can further improve the pertinence of the broadcast verification message according to this correspondence. For example, in the case where the verification response messages of some second devices are not received, the authentication information to be verified corresponding to the unreceived second devices may be included in the repeated verification message.

[0052] By adopting the above technical solution, when replacing the first device, relevant information of the second devices accessing the third device can be obtained in a timely manner from the third device. By broadcasting the verification message, the second devices can start the access process after passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second devices to make them access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0053] In some embodiments, in the case where the authentication information to be verified corresponding to multiple second devices is different, any of the following methods may be adopted to broadcast the verification message to at least one second device.

[0054] Method 1: Broadcast a first verification message including multiple different authentication information to be verified.

[0055] Method 2: Broadcast multiple second verification messages in sequence, where the authentication information to be verified included in the multiple second verification messages is different.

[0056] Taking the smart home scenario as an example, the authentication information to be verified corresponding to N sensor devices is different. The new gateway device may broadcast a first verification message to the N sensor devices, where the first verification message includes the authentication information to be verified corresponding to the N sensor devices respectively. It may also broadcast M second verification messages to the N sensor devices, where M is less than or equal to N, and each second verification message includes the authentication information to be verified corresponding to at least one sensor device. It can be understood that the number of authentication information to be verified included in different second verification messages may be the same or different. The number of the above second verification messages and the number of authentication information to be verified included in each second verification message can be flexibly set according to service requirements.

[0057] When the to-be-verified identity authentication information corresponding to multiple second devices is the same, the second device can broadcast a verification message including the to-be-verified identity authentication information to the multiple second devices.

[0058] By adopting the above technical solution, the verification message can be broadcast in a variety of flexible ways, so that the second device starts the access process after passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0059] In another embodiment, considering that the to-be-verified identity authentication information belongs to sensitive information, in order to further enhance security, the verification message including the encrypted to-be-verified identity authentication information can also be broadcast by using symmetric encryption or asymmetric encryption technology in related technologies.

[0060] Taking the example that a new gateway device broadcasts different to-be-verified identity authentication information to sensor devices, each sensor device can generate a pair of private key and public key according to the asymmetric encryption algorithm, such as the RSA algorithm, and send the public key to the old gateway device for encrypting information transmission. The new gateway device can obtain the public key corresponding to each sensor device from the old gateway device through the first response message, encrypt the corresponding to-be-verified identity authentication information through the public key corresponding to each sensor device, obtain the encrypted to-be-verified identity authentication information corresponding to each sensor device, and broadcast the verification message including multiple encrypted to-be-verified identity authentication information to the sensor devices. The sensor device decrypts the encrypted to-be-verified identity authentication information by using the saved private key, obtains the decrypted to-be-verified identity authentication information, and then compares it with the saved identity authentication information to obtain the verification result.

[0061] By adopting the above technical solution, the to-be-verified identity authentication information can be encrypted, and on the basis of improving the intelligent level of device access and enhancing the user experience of the product, the security of device access can be further enhanced.

[0062] Figure 4 Another process schematic diagram showing the device access method provided by the embodiments of the present disclosure is as follows Figure 4 As shown, the method may further include the following steps:

[0063] In step S106, new to-be-verified identity authentication information is generated according to the accessed second device, and the new to-be-verified identity authentication information is saved.

[0064] In some possible implementation manners, the first device may generate new to-be-verified identity authentication information in any of the following ways after all second devices are accessed.

[0065] In Method 1, the first device can randomly generate unique identity authentication information through a preset algorithm.

[0066] In Method 2, the first device can generate different identity authentication information for each second device through a preset algorithm according to the identification information of the second device. Taking the smart home scenario as an example, an old gateway device can generate different identity authentication information for each sensor device based on the hardware ID and / or IMEI of the accessed sensor devices.

[0067] It can be understood that the generation method adopted by the first device to generate new identity authentication information to be verified can be the same as or different from that adopted by the third device, and the preset algorithm adopted by the first device when generating new identity authentication information to be verified can be the same as or different from the preset algorithm adopted by the third device.

[0068] In step S107, send the new identity authentication information to be verified to the accessed second device so that the accessed second device updates the saved identity authentication information.

[0069] Figure 5 Another flowchart showing the method for device access provided by the embodiments of the present disclosure is as Figure 5 shown, and the method may further include the following steps:

[0070] In step S108, in response to receiving a second request message for obtaining new identity authentication information to be verified, send a second response message including the new identity authentication information to be verified.

[0071] Exemplarily, the first device can, in response to receiving a second request message for obtaining new identity authentication information to be verified sent by the fourth device, send a second response message including the new identity authentication information to be verified to the fourth device.

[0072] In some embodiments, the second response message may further include a device identification list of the second device, and the second response message may further include the correspondence between each second device and the corresponding new identity authentication information to be verified. The fourth device can execute the method for device access in any of the above embodiments according to the above information in the second response message, thereby replacing the first device.

[0073] In some embodiments, the second response message may further include encryption information for encrypting and sending the new identity authentication information to be verified, such as public key information, so as to improve the security when the second device accesses the fourth device after the first device is replaced.

[0074] By adopting the above technical solution, new identity authentication information to be verified can be generated and sent to the second device so that the second device can update the saved identity authentication information, and in response to receiving a second request message for obtaining the new identity authentication information to be verified, a second response message including the new identity authentication information to be verified is sent, thereby improving the intelligent level when the second device accesses the fourth device when the first device is replaced and enhancing the user experience of the product.

[0075] In some embodiments, the state of the second device can be the sleep state. In the case where the state of the second device is the sleep state, the second device cannot respond to the messages of the third device or the first device. For example, in a smart home scenario, a sensor device can enter the sleep state to reduce the consumption of the power supply unit. In some possible implementation manners, the second device can be woken up at a preset wake-up time to complete the service interaction with the third device. In the case where at least one second device includes at least one second device in the sleep state, the verification message can be broadcast to at least one second device in the sleep state by at least one of the following methods.

[0076] Method 1: Broadcast the verification message to the second device in the sleep state at the preset wake-up time corresponding to the second device in the sleep state.

[0077] Exemplarily, the preset wake-up time can be a periodic or non-periodic preset wake-up time period. The preset wake-up times of different second devices in the sleep state can be the same or different.

[0078] In some possible implementation manners, the first device can obtain the preset wake-up time corresponding to the second device in the sleep state from the third device. The first device can also obtain the preset wake-up time corresponding to the second device in the sleep state from the configuration information preset by the user. For example, in a smart home scenario, an old gateway device can obtain the preset wake-up time corresponding to each sensor device respectively and send the preset wake-up time corresponding to each sensor device respectively to the new gateway device in the first response message.

[0079] In another possible implementation manner, the first device can also obtain the preset wake-up time corresponding to the second device in the sleep state from the configuration information preset by the user. For example, in a smart home scenario, the preset wake-up time corresponding to each sensor device respectively can be determined in response to the user's setting operation, and the new gateway device can obtain the preset wake-up time corresponding to the sensor device in the sleep state from the configuration information preset by the user.

[0080] It can be understood that when the first device broadcasts the verification message to the second device in the sleep state, the verification message can only include the identity authentication information to be verified corresponding to the second device in the sleep state that is at the preset wake-up time at the current moment.

[0081] Method 2: Broadcast a verification message to at least one second device in the sleep state according to a preset period.

[0082] For example, in a smart home scenario, a new gateway device can broadcast a verification message to at least one second device in the sleep state at a preset period T. The verification message can include the authentication information to be verified corresponding to at least one second device in the sleep state that has not initiated an access request or has not sent a verification response message in the device identification list of the second device.

[0083] Method 3: Broadcast a verification message in response to receiving indication information sent by a second device in the sleep state after waking up.

[0084] In some possible implementation manners, after waking up, the second device in the sleep state can also actively send indication information. The first device can broadcast a verification message in response to receiving the indication information sent by the second device in the sleep state after waking up.

[0085] For example, in a smart home scenario, after waking up, a sensor device can send an indication information of being awakened through a public channel. The new gateway device broadcasts a verification message to the second device in response to receiving the indication information sent by the second device in the sleep state after waking up. The verification message can include the authentication information to be verified corresponding to the second device.

[0086] By adopting the above technical solutions, the verification message can be re-broadcast to the second device that cannot respond to the verification message because it is in the sleep state in a timely manner, so that the second device in the sleep state can be automatically accessed in a timely manner after waking up, avoiding the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0087] Figure 6 FIG. shows a schematic flowchart of a method for device access provided by an embodiment of the present disclosure, which is applied to a second device. The second device stores authentication information, such as Figure 6 shown, and the method includes the following steps:

[0088] In step S201, receive a verification message sent by a first device.

[0089] Among them, the verification message includes the authentication information to be verified. The authentication information to be verified corresponding to different second devices may be the same or different.

[0090] In the case where the authentication information to be verified corresponding to different second devices is the same, the verification message may include one piece of authentication information to be verified, and the authentication information to be verified can be directly obtained from the verification message.

[0091] When the authentication information to be verified corresponding to different second devices is different, the verification message may include multiple pieces of authentication information to be verified.

[0092] The authentication information to be verified may be the authentication information encrypted by an encryption algorithm, and this encryption algorithm may be, for example, symmetric encryption or asymmetric encryption. Taking the new gateway device broadcasting different authentication information to be verified to the sensor device as an example, the verification information received by the second device may include the authentication information to be verified encrypted with the public key corresponding to each second device respectively. After the second device receives the encrypted authentication information to be verified, it can decrypt it using the saved private key. For specific details, reference can be made to the technical description of asymmetric encryption, which will not be elaborated here.

[0093] In step S202, obtain the verification result of the authentication information to be verified according to the comparison result between the authentication information to be verified and the saved authentication information.

[0094] When the verification message includes one piece of authentication information to be verified, the verification result of the authentication information to be verified can be obtained according to the comparison result between this authentication information to be verified and the saved authentication information. For example, when this authentication information to be verified matches the saved authentication information, determine that the verification result is verification passed; or, when this authentication information to be verified does not match the saved authentication information, determine that the verification result is verification failed.

[0095] When the verification message includes multiple pieces of authentication information to be verified, the authentication information to be verified can be obtained sequentially from the multiple pieces of authentication information to be verified and compared with the saved authentication information. When any piece of authentication information to be verified matches the saved authentication information, determine that the verification result is verification passed; when all pieces of authentication information to be verified do not match the saved authentication information, determine that the verification result is verification failed.

[0096] In step S203, send a verification response message including the verification result to the first device.

[0097] For example, when the verification result is verification passed, a verification response message including the verification result of verification passed can be sent to the first device; while when the verification result is verification failed, a verification response message including the verification result of verification failed can be sent to the first device.

[0098] It can be understood that the verification result can be explicitly characterized by the verification result included in the verification response message, and the verification result can also be implicitly characterized by whether the verification response message is sent within a preset time. For example, when the verification result is verification passed, the verification response message can be sent; when the verification result is verification failed, the identity authentication information to be verified can also be ignored without sending the verification response message.

[0099] In step S204, when the verification result is verification passed, the access of the second device is completed.

[0100] It can be understood that after the second device completes the access or when the verification result of any identity authentication information to be verified is verification passed, the second device can ignore the verification messages broadcast by the first device for other second devices received subsequently.

[0101] Adopting the above technical solution, the second device can initiate access after receiving the verification message sent by the first device and passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0102] Figure 7 Another flowchart showing the method for device access provided by an embodiment of the present disclosure is as Figure 7 shown. Before receiving the verification message sent by the first device, the method may further include the following steps:

[0103] In step S205, receive the identity authentication information from the third device and save the identity authentication information.

[0104] In some possible implementation manners, the identity authentication information may be unique identity authentication information randomly generated by the third device through a preset algorithm, that is, the identity authentication information corresponding to multiple second devices may be the same, or the identity authentication information may be different identity authentication information generated by the third device for each second device according to the identification information of the second device through a preset algorithm, that is, the identity authentication information corresponding to multiple second devices may be different.

[0105] In some embodiments, the identity authentication information may be the identity authentication information encrypted by an encryption algorithm. The encryption algorithm may be, for example, symmetric encryption or asymmetric encryption. The specific steps of encryption and decryption can refer to the description in related technologies and will not be elaborated here.

[0106] In some embodiments, after the second device accesses the third device, the second device may maintain the access state through the following steps.

[0107] Step 10: Send a third request message to the third device according to a preset period.

[0108] Step 11. When the number of message response timeouts is greater than or equal to a preset number threshold, change the status of the second device to the to-be-connected status. Herein, the message response timeout indicates that the third response message corresponding to the third request message times out.

[0109] The third request message can be, for example, a handshake call, and the third response message can be, for example, a handshake reply. Taking the smart home scenario as an example, after the sensor device accesses the old gateway device, it can send a handshake call to the old gateway device at a preset period (for example, every 5 minutes). The old gateway device sends a handshake reply within a specified timeout period (for example, 30 seconds). When the sensor device detects that the number of message response timeouts exceeds the preset number threshold (for example, 5 times), the status of the sensor device can be changed to the to-be-connected status. For example, when the old gateway device is replaced with a new gateway device, since the old gateway device is replaced and cannot send a handshake reply, the status of the sensor device can be timely changed to the to-be-connected status.

[0110] By adopting the above technical solution, when the first device replaces the third device, the second device can timely detect the status change, so as to timely enter the to-be-connected status, so that when receiving the verification message sent by the first device and passing the verification, it can timely access the first device. When replacing the first device, it can avoid the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improve the intelligent level of device access, and enhance the user experience of the product.

[0111] Figure 8 Another process schematic diagram showing the device access method provided by the embodiments of the present disclosure is shown as Figure 8 shown. The method may further include the following steps:

[0112] In step S206, receive the new to-be-verified identity authentication information sent by the first device.

[0113] In step S207, update the saved identity authentication information with the new to-be-verified identity authentication information.

[0114] The new to-be-verified identity authentication information can be generated by the first device according to the accessed second device, so that when the first device is replaced, the fourth device used to replace the first device can broadcast a verification message including the new to-be-verified identity authentication information to the second device, so that the second device can access the replaced fourth device after passing the verification of the to-be-verified identity authentication information.

[0115] When the second device receives new authentication information to be verified, it can update the saved authentication information with the new authentication information to be verified, that is, use the new authentication information to be verified as the new authentication information, so that when a verification message sent by the fourth device is received subsequently, the verification result can be determined according to the saved new authentication information.

[0116] By adopting the above technical solution, new authentication information can be saved in a timely manner, so as to avoid the cumbersome and inconvenient operation of manually operating the second device to enable the second device to access the fourth device when the first device is replaced subsequently, improve the intelligent level of device access, and enhance the user experience of the product.

[0117] Figure 9 Another schematic flowchart showing the method for device access provided by an embodiment of the present disclosure is as Figure 9 shown. The state of the second device can be the sleep state, and step S201 may include the following steps:

[0118] In step S2011, when the preset wake-up time arrives or in response to a user's wake-up operation, the state of the second device in the sleep state is changed to the state to be accessed.

[0119] Exemplarily, the preset wake-up time can be a periodic or non-periodic preset wake-up time period. The preset wake-up times of different second devices in the sleep state can be the same or different. The second device in the sleep state can be changed to the state to be accessed within the preset wake-up time period. It can also be changed to the state to be accessed in response to a user's wake-up operation, such as a key or touch operation.

[0120] In some possible implementation manners, the awakened second device can determine the state transition behavior after awakening based on the state before entering the sleep state last time. For example, the state before entering the sleep state last time can be the access state (that is, maintaining a normal connection with the third device), and during the period when the state of the second device is the sleep state, the third device is replaced by the first device. When the second device is awakened when the preset wake-up time arrives or in response to a user's wake-up operation, the second device can try to access the originally accessed third device, and enter the state to be accessed in case of a failed access attempt. In another possible implementation manner, the state before entering the sleep state last time can also be the state to be accessed. For example, after the third device is replaced, after the second device fails to maintain the access state through steps 10-11 and enters the state to be accessed and then enters the sleep state, when the second device is awakened when the preset wake-up time arrives or in response to a user's wake-up operation, the second device can also directly enter the state to be accessed. The specific process of changing the awakened second device in the sleep state to the state to be accessed can be flexibly set as needed, and the present disclosure does not limit this.

[0121] In step S2012, receive the verification message sent by the first device and / or send indication information to the first device to receive the verification message sent by the first device in response to the indication information.

[0122] Exemplarily, after the state of the second device in the sleep state changes to the to-be-connected state, it can passively receive the verification message sent by the first device, and / or actively send indication information to the first device to receive the verification message sent by the first device in response to the indication information.

[0123] For example, in the smart home scenario, after waking up, the sensor device can passively wait to receive the verification message sent by the first device, or can actively send the indication information of having woken up through the public channel. The new gateway device sends a verification message to the second device in response to the indication information received from the sensor device in the sleep state after waking up, and the verification message can include the authentication information to be verified corresponding to the second device.

[0124] By adopting the above technical solution, the second device in the sleep state can enter the to-be-connected state in time at the preset wake-up time or in response to the user's wake-up operation, so as to receive the verification message sent by the first device in time, and then access the replaced first device in time after passing the verification, avoiding the cumbersome and inconvenient operation of manually operating the second device to make it access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0125] Figure 10 The interaction flow diagram showing the method for device access provided by the embodiments of the present disclosure is as Figure 10 shown, and the method includes the following steps:

[0126] In step 101, the second device receives the authentication information from the third device.

[0127] Exemplarily, the second device can receive the authentication information from the connected third device.

[0128] In step 102, the second device saves the authentication information.

[0129] In step 103, the first device establishes a connection with the third device and sends a first request message to the third device.

[0130] In step 104, the first device obtains the authentication information to be verified from the first response message of the third device.

[0131] In step 105, the state of the second device changes to the to-be-connected state.

[0132] For example, the second device may send a third request message to the third device at a preset period; when the number of times of message response timeout is greater than or equal to a preset number threshold, the state of the second device is changed to a state to be accessed, where the message response timeout indicates that the third response message corresponding to the received third request message times out.

[0133] In step 106, the first device broadcasts a verification message to the second device, where the verification message includes authentication information to be verified.

[0134] In step 107, the second device obtains a verification result according to the comparison result between the authentication information to be verified and the saved authentication information.

[0135] In step 108, the second device sends a verification response message including the verification result to the first device. When the verification result is verification passed, the second device may also start a process of accessing the first device.

[0136] In step 109, when the verification result is verification passed, the first device accesses the second device that has passed the verification to the first device.

[0137] In step 110, the first device generates new authentication information to be verified according to the accessed second device.

[0138] In step 111, the new authentication information to be verified is sent to the accessed second device.

[0139] In step 112, the second device updates the saved authentication information with the new authentication information to be verified.

[0140] By adopting the above technical solution, when the first device is replaced, the second device can start the access process after passing the verification by broadcasting the verification message, avoiding the cumbersome and inconvenient operation of manually operating the second device to make the second device access the first device, improving the intelligent level of device access, and enhancing the user experience of the product.

[0141] Figure 11 The hardware structure diagram of the electronic device provided by the embodiments of the present disclosure is shown, as Figure 11 shown, at the hardware level, the electronic device includes at least one processor, and optionally includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory, etc. Of course, the electronic device may also include other hardware required for other services.

[0142] The processor, network interface, and memory can be interconnected through an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, only a bidirectional arrow is used in this figure, but it does not mean that there is only one bus or one type of bus.

[0143] The memory stores programs. Specifically, the program can include program code, and the program code includes at least one computer operation instruction. The memory can include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0144] At least one processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating target users at the logical level. At least one processor executes the program stored in the memory and specifically executes: Figure 2-10 The methods disclosed in the illustrated embodiments implement the functions and beneficial effects of the various methods described in the foregoing method embodiments, which will not be elaborated herein.

[0145] The above as in the present disclosure Figure 2-10The method disclosed in the illustrated embodiments can be applied to or implemented by at least one processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above method can be completed by the integrated logic circuit of the hardware in at least one processor or instructions in software form. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0146] The electronic device can also execute the various methods described in the foregoing method embodiments and achieve the functions and beneficial effects of the various methods described in the foregoing method embodiments, which will not be elaborated herein.

[0147] Of course, in addition to the software implementation, the electronic device of the present disclosure does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.

[0148] The embodiments of the present disclosure also propose a computer-readable storage medium, where the computer-readable medium stores one or more programs, and when the one or more programs are executed by at least one processor, they implement Figure 2-10 the method disclosed in the illustrated embodiments and achieve the functions and beneficial effects of the various methods described in the foregoing method embodiments, which will not be elaborated herein.

[0149] Among them, the computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disc, and the like.

[0150] Furthermore, an embodiment of the present disclosure also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the following processes are implemented: Figure 2-10 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be elaborated herein.

[0151] In summary, the above are only the preferred embodiments of the present disclosure, and do not limit the protection scope of the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0152] The systems, modules, or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0153] Computer-readable media includes both permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology for storing information. The information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0154] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.

[0155] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the description of the method embodiment.

Claims

1. A method for device access, characterized in that, applied to a first device, the method includes: broadcasting a verification message to the at least one second device, the verification message including authentication information to be verified; receiving a verification response message sent by the second device, and obtaining the verification result of the second device from the verification response message, where the verification result is a comparison result between the authentication information to be verified and the authentication information in the second device; in the case where the verification result is verification passed, connecting the second device with verification passed to the first device.

2. The method according to claim 1, characterized in that, before broadcasting the verification message to the at least one second device, the method further includes: establishing a connection with a third device; sending a first request message to the third device, and obtaining the authentication information to be verified from the first response message of the third device, where the authentication information to be verified is generated by the third device according to the second device accessing the third device.

3. The method according to claim 1, characterized in that, the broadcasting the verification message to the at least one second device includes: in the case where the authentication information to be verified corresponding to the multiple second devices is different, broadcasting a first verification message including multiple different authentication information to be verified, or sequentially broadcasting multiple second verification messages, where the authentication information to be verified included in the multiple second verification messages is different.

4. The method according to claim 1, characterized in that, the method further includes: generating new authentication information to be verified according to the second device accessed, and saving the new authentication information to be verified; sending the new authentication information to be verified to the accessed second device, so that the accessed second device updates the saved authentication information.

5. The method according to claim 4, characterized in that, the method further includes: responding to receiving a second request message for obtaining the new authentication information to be verified, and sending a second response message including the new authentication information to be verified.

6. The method according to any one of claims 1 to 5, characterized in that, the at least one second device includes at least one second device in a sleep state, and the broadcasting the verification message to the at least one second device includes at least one of the following: broadcasting the verification message to the second device in the sleep state at a preset wake-up time corresponding to the second device in the sleep state; broadcasting the verification message to at least one of the second devices in the sleep state according to a preset period; responding to receiving indication information sent by the second device in the sleep state after waking up, and broadcasting the verification message.

7. The method according to claim 6, characterized in that, the method further includes: obtaining the preset wake-up time corresponding to the second device in the sleep state from a third device; or, obtaining the preset wake-up time corresponding to the second device in the sleep state from the configuration information preset by the user.

8. A method for device access, characterized in that, applied to a second device, where the second device stores authentication information, the method includes: Receive a verification message sent by a first device, where the verification message includes authentication information to be verified. Obtain a verification result of the authentication information to be verified according to a comparison result between the authentication information to be verified and the saved authentication information. Send a verification response message including the verification result to the first device. Access the first device when the verification result is verification passed.

9. The method according to claim 8, wherein, before receiving the verification message sent by the first device, the method further includes: Receive the authentication information from a third device and save the authentication information.

10. The method according to claim 8, wherein, the method further includes: Send a third request message to the third device at a preset period; When the number of message response timeouts is greater than or equal to a preset number threshold, change the state of the second device to a state to be accessed, where the message response timeout indicates that the third response message corresponding to receiving the third request message times out.

11. The method according to claim 8, wherein, after accessing the first device, the method further includes: Receive new authentication information to be verified sent by the first device; Update the saved authentication information with the new authentication information to be verified.

12. The method according to claim 9, wherein, the state of the second device is a sleep state, and the receiving the verification message sent by the first device includes: When a preset wake-up time arrives or in response to a user's wake-up operation, change the state of the second device in the sleep state to a state to be accessed; Receive the verification message sent by the first device or send an indication message to the first device to receive the verification message sent by the first device in response to the indication message.

13. An electronic device, including: At least one processor; and A memory configured to store at least one computer-executable instruction, where when the at least one executable instruction is executed, it uses the at least one processor to execute the method for device access according to any one of claims 1-12.

14. A computer-readable storage medium storing at least one computer program, where when the at least one program is executed by at least one processor, it implements the method for device access according to any one of claims 1-12.