Device authentication method, device, computer program product and electronic device
By generating a unified device password and storing set pairing relationships through the server, the problem of users needing to manually enter device passwords in the prior art is solved, and the automation of device authentication and user experience is achieved.
Patent Information
- Application Number
- CN202411999947.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
The existing device authentication method requires the user to manually enter the password of the electronic device, resulting in a poor user experience.
Through the server storage set pairing relationship, a unified device password of the first electronic device and the second electronic device is generated. The first electronic device sends an authentication request to the second electronic device based on its own device password to prevent the user from manually entering the password.
The device authentication process is simplified, the user operation steps are reduced, the user experience is improved, and the degree of automation of device authentication is realized.
Smart Images

Figure CN119788398A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of device communication technology, and in particular, relates to a device authentication method, apparatus, computer program product and electronic device. Background Art
[0002] In various application scenarios of modern security monitoring systems, two or more electronic devices are usually required to work together to achieve better functions; for example, a network video recorder (NVR) and an Internet Protocol Camera (IPC) can be used as a set, wherein the network camera can capture videos and send the captured videos to the network video recorder, while the network video recorder can receive, store and manage the videos captured by the network camera; through the network video recorder, users can easily view the videos captured by the network camera. For another example, a doorbell and a doorbell companion (also known as a doorbell display, doorbell indoor unit, etc.) can be used as a set, wherein the doorbell can be used to capture videos of the monitoring area (such as a certain area outside the door), and the captured videos can be sent to the doorbell companion, and the doorbell companion can receive, display, store and manage the videos captured by the doorbell.
[0003] For ease of description, the electronic device used for receiving and managing data in each device used in the set may be referred to as the first electronic device, and the electronic device used for collecting and sending data in each device used in the set may be referred to as the second electronic device. For example, a network video recorder may be referred to as the first electronic device, and a network camera may be referred to as the second electronic device; for another example, a doorbell companion may be referred to as the first electronic device, and a doorbell may be referred to as the second electronic device. Normally, the first electronic device and the second electronic device need to complete authentication and authorization before they can be used together; in the existing device authentication scheme, the first electronic device needs to know the password of the second electronic device and send the password of the second electronic device to the second electronic device; if the password sent by the first electronic device to the second electronic device is the same as the password of the second electronic device itself, the second electronic device can confirm that the authentication of the first electronic device is successful; however, the first electronic device usually cannot actively know the password of the second electronic device, so the user needs to manually enter the password of the second electronic device in the first electronic device, resulting in a poor user experience. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a device authentication method, apparatus, computer program product and electronic device to solve the problem that the device authentication method in the prior art requires the user to manually enter the password of the electronic device, resulting in a poor user experience.
[0005] A first aspect of an embodiment of the present application provides a device authentication method applied to a first electronic device, which may include:
[0006] Sending a first device password request to a server; wherein the first device password request triggers the server to query and send the first device password, the first device password is the device password of the first electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0007] When the first device password is received, the device authentication request is sent to each identified second electronic device based on the first device password; wherein the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password.
[0008] A second aspect of an embodiment of the present application provides a device authentication method applied to a second electronic device, which may include:
[0009] Sending a second device password request to a server; wherein the second device password request triggers the server to query and send a second device password, the second device password is the device password of the second electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0010] In the case of receiving the second device password sent by the server, if a device authentication request sent by the first electronic device is received, authenticating the first electronic device based on the device authentication request and the second device password to obtain an authentication result;
[0011] A device authentication request reply message is generated based on the authentication result, and the authentication request reply message is sent to the first electronic device.
[0012] A third aspect of an embodiment of the present application provides a device authentication apparatus applied to a first electronic device, which may include:
[0013] A first device password request sending module, configured to send a first device password request to a server; wherein the first device password request triggers the server to query and send a first device password, the first device password is a device password of the first electronic device, the server stores various set pairing relationships, the set pairing relationship is a pairing relationship between the first electronic device and various second electronic devices, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0014] A device authentication request sending module is used to send the device authentication request to each identified second electronic device based on the first device password when the first device password is received; wherein the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password.
[0015] A fourth aspect of an embodiment of the present application provides a device authentication apparatus applied to a second electronic device, which may include:
[0016] A second device password request sending module, configured to send a second device password request to a server; wherein the second device password request triggers the server to query and send a second device password, the second device password is a device password of the second electronic device, the server stores each set pairing relationship, the set pairing relationship is a pairing relationship between a first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0017] an authentication module, configured to, upon receiving the second device password sent by the server, perform authentication on the first electronic device based on the device authentication request and the second device password to obtain an authentication result if a device authentication request sent by the first electronic device is received;
[0018] A request reply message sending module is used to generate a device authentication request reply message based on the authentication result, and send the authentication request reply message to the first electronic device.
[0019] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any one of the above-mentioned device authentication methods applied to the first electronic device or applied to the second electronic device are implemented.
[0020] A sixth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements any one of the steps of the device authentication method applied to the first electronic device or the second electronic device.
[0021] A seventh aspect of an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, any one of the above-mentioned device authentication methods applied to the first electronic device or applied to the second electronic device is executed.
[0022] Compared with the prior art, the embodiment of the present application has the following beneficial effects: the embodiment of the present application sends a first device password request to the server; wherein the first device password request triggers the server to query and send the first device password, the first device password is the device password of the first electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; in the case of receiving the first device password, based on the first device password, the device authentication request is sent to each identified second electronic device; wherein the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password. In the embodiment of the present application, the device passwords of the first electronic device and the second electronic device that have a pairing relationship are the same, so the first electronic device only needs to know its own device password to request authentication from the second electronic device, thereby eliminating the need for the user to manually enter the password (of the second electronic device), effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 A schematic diagram of the existing device certification process;
[0025] Figure 2 This is a flow chart of an embodiment of a device authentication method applied to a first electronic device in an embodiment of the present application;
[0026] Figure 3This is a flow chart of an embodiment of a device authentication method applied to a second electronic device in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of a specific application scenario of the device authentication method of an embodiment of the present application;
[0028] Figure 5 This is a structural diagram of a first embodiment of a device authentication apparatus applied to a first electronic device in an embodiment of the present application;
[0029] Figure 6 This is a structural diagram of an embodiment of a first device password request sending module applied to a first electronic device in an embodiment of the present application;
[0030] Figure 7 This is a structural diagram of a second embodiment of a device authentication apparatus applied to a first electronic device in an embodiment of the present application;
[0031] Figure 8 This is a structural diagram of a third embodiment of a device authentication apparatus applied to a first electronic device in an embodiment of the present application;
[0032] Fig. 9 This is a structural diagram of an embodiment of a device authentication request sending module applied to a first electronic device in an embodiment of the present application;
[0033] Fig.10 This is a structural diagram of a fourth embodiment of a device authentication apparatus applied to a first electronic device in an embodiment of the present application;
[0034] Fig.11 This is a structural diagram of an embodiment of a device authentication apparatus applied to a second electronic device in an embodiment of the present application;
[0035] Fig.12 This is a structural diagram of an embodiment of an authentication module applied to a second electronic device in an embodiment of the present application;
[0036] Fig.13 This is a schematic block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0039] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0040] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0041] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0042] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0043] In various application scenarios of modern security monitoring systems, two or more electronic devices are usually required to work together to achieve better functions; for example, a network video recorder (NVR) and an Internet Protocol Camera (IPC) can be used as a set, wherein the network camera can capture videos and send the captured videos to the network video recorder, while the network video recorder can receive, store and manage the videos captured by the network camera; through the network video recorder, users can easily view the videos captured by the network camera. For another example, a doorbell and a doorbell companion (also known as a doorbell display, doorbell indoor unit, etc.) can be used as a set, wherein the doorbell can be used to capture videos of the monitoring area (such as a certain area outside the door), and the captured videos can be sent to the doorbell companion, and the doorbell companion can receive, display, store and manage the videos captured by the doorbell.
[0044] For ease of description, the electronic device used for receiving and managing data in the various devices used in the set may be referred to as the first electronic device, and the electronic device used for collecting and sending data in the various devices used in the set may be referred to as the second electronic device. For example, the network video recorder may be referred to as the first electronic device, and the network camera may be referred to as the second electronic device; for another example, the doorbell companion may be referred to as the first electronic device, and the doorbell may be referred to as the second electronic device.
[0045] Normally, the passwords of the first electronic device and the second electronic device can be set separately at the factory stage. During the initial installation stage, the first electronic device needs to complete authentication and authorization with the second electronic device before they can be used together; in the existing equipment authentication scheme, the first electronic device needs to know the password of the second electronic device and request authentication and authorization from the second electronic device based on the password of the second electronic device; if the password sent by the first electronic device to the second electronic device is the same as the password of the second electronic device itself, the second electronic device can confirm that the authentication of the first electronic device is successful; after the authentication is successful, the first electronic device can access the data or functions of the second electronic device to manage the second electronic device.
[0046] However, the first electronic device is usually unable to actively learn the password of the second electronic device, so during the initial installation phase, the user is required to manually input the password of the second electronic device in the first electronic device.
[0047] For example, see Figure 1 , the network video recorder 1 (also known as the first electronic device) needs to be authenticated with the network camera 1 (also known as the second electronic device 1) and the network camera 2 (also known as the second electronic device 2) respectively, then the user can enter the password of the network camera 1 in the display interface of the network video recorder 1, so that the network video recorder 1 can initiate an authentication request to the network camera 1 based on the password of the network camera 1, and since the password sent by the network video recorder 1 to the network camera 1 is the same as the password of the network camera 1 itself, the network camera 1 can confirm that the authentication of the network video recorder 1 is successful; thereafter, the user can enter the password of the network camera 2 in the display interface of the network video recorder 1, so that the network video recorder 1 can initiate an authentication request to the network camera 2 based on the password of the network camera 2; similarly, since the password sent by the network video recorder 1 to the network camera 2 is the same as the password of the network camera 2 itself, the network camera 2 can confirm that the authentication of the network video recorder 1 is successful.
[0048] If there are a large number of second electronic devices that need to be authenticated, the user needs to repeatedly enter the passwords of the corresponding second electronic devices in the first electronic device. This series of operation steps is cumbersome and time-consuming. In addition, the user may forget the password of the second electronic device and needs to repeatedly try to recall the password of the second electronic device, which greatly increases the complexity of the operation and leads to a poor user experience.
[0049] In view of this, the embodiments of the present application provide a device authentication method, apparatus, computer program product and electronic device to solve the problem that the device authentication method in the prior art requires the user to manually enter the password of the electronic device, resulting in a poor user experience.
[0050] In an embodiment of the present application, the pairing relationship between the first electronic device and each second electronic device can be determined at the factory stage, and the same password can be generated for the first electronic device and the second electronic device that have a pairing relationship; at the initial installation stage, the first electronic device can initiate an authentication request to the second electronic device based on its own password without having to know the password of the second electronic device; accordingly, the user is no longer required to participate in the password input of the second electronic device, which can simplify the process, reduce the user's operation steps, and thus improve the user experience.
[0051] Specifically, at the factory stage, the pairing relationship between the first electronic device and at least one second electronic device (called a set pairing relationship) can be determined, and the same device password can be generated for the first electronic device and the second electronic device in the pairing relationship through a preset server. In the embodiment of the present application, the server is a computing device for generating and managing passwords for each first electronic device and each second electronic device.
[0052] The following will firstly introduce in detail the process of generating the device passwords of the first electronic device and the second electronic device.
[0053] In the embodiment of the present application, the server may generate a unified initial password for the first electronic device and each second electronic device in a set pairing relationship.
[0054] For example, based on the set pairing relationship 1, the server can determine that the network video recorder 1 is paired with the network camera 1 and the network camera 2, so the server can generate the same initial device password for the network video recorder 1, the network camera 1 and the network camera 2. For another example, based on the set pairing relationship 3, the server can determine that the doorbell companion 1 is paired with the doorbell 1, the doorbell 3 and the doorbell 4, so the server can generate the same initial device password for the doorbell companion 1, the doorbell 1, the doorbell 3 and the doorbell 4.
[0055] Optionally, each set pairing relationship may be uploaded by a staff member; for example, when leaving the factory, a staff member may determine each set pairing relationship and upload each set pairing relationship to a server, or may send each set pairing relationship to a server via other computing devices.
[0056] In a specific implementation, the pairing relationship of the set in the embodiment of the present application can be specifically represented by the pairing relationship of the unique identifier of the device; for example, if a network video recorder is paired with a certain network camera, the unique identifier of the network video recorder and the unique identifier of the network camera can be determined as a pairing relationship of the set. For another example, if a doorbell companion is paired with a certain doorbell, the unique identifier of the doorbell companion and the unique identifier of the doorbell can be determined as a pairing relationship of the set.
[0057] In a specific implementation of the embodiment of the present application, in order to ensure information security and prevent password leakage, the server can encrypt the device password to obtain the device password ciphertext, and can store each package pairing relationship and the corresponding device password ciphertext. Among them, the encryption algorithm of the device password can be any encryption algorithm in the prior art, and the embodiment of the present application does not specifically limit this; for example, the encryption algorithm of the device password can be AES (Advanced Encryption Standard).
[0058] Optionally, the server may also send the device password of each first electronic device to the corresponding first electronic device, and send the device password of each second electronic device to the corresponding second electronic device. After receiving its own device password, the electronic device (first electronic device or second electronic device) may store its own device password in a local storage module (such as a solid state drive or flash memory). For example, the server may send the device password 1 of network video recorder 1 to network video recorder 1, and network video recorder 1 may store the device password 1 in the solid state drive of network video recorder 1; for another example, the server may send the device password 2 of network camera 2 to network camera 2, and network camera 2 may store the device password 2 in the solid state drive of network camera 2.
[0059] During the initial installation phase, both the first electronic device and the second electronic device can obtain their own device passwords, and the first electronic device can also send an authentication request to the second electronic device based on its own device password.
[0060] For ease of description, the following will take any first electronic device (referred to as the target first electronic device) as an example to describe the authentication process in the initial installation phase in detail; Figure 2In an embodiment of the present application, an embodiment of a device authentication method applied to a first electronic device may include steps S201 to S202:
[0061] Step S201: Send a first device password request to a server.
[0062] In the initial installation stage, the user can connect the target first electronic device and each second electronic device to a network for communication, so that the target first electronic device and each second electronic device can obtain their own device passwords from the server.
[0063] In an embodiment of the present application, after the target first electronic device is connected to the network, it can send a first device password request to the server; wherein the first device password request can trigger the server to query and send the device password of the target first electronic device (referred to as the first device password).
[0064] Specifically, the target first electronic device can encrypt the unique identification of the target first electronic device to obtain a unique identification ciphertext; based on the unique identification ciphertext, a first device password request can be generated, and then the first device password request can be sent to the server to obtain the first device password. Among them, the encryption algorithm for encrypting the unique identification of the target first electronic device is an encryption algorithm agreed with the server, which can be any common encryption algorithm in the prior art, and the embodiments of the present application do not limit this.
[0065] After receiving the first device password request, the server can parse the first device password request to extract the unique identification ciphertext of the target first electronic device from the first device password request, and can decrypt the unique identification ciphertext to obtain the unique identification plaintext; thereafter, the server can query the decrypted unique identification plaintext in each package pairing relationship (including each unique identification); if the decrypted unique identification plaintext is queried in each package pairing relationship, it can be determined that there is a package pairing relationship between the target first electronic device (and at least one second electronic device), and the initial device password of the package matching relationship corresponding to the queried unique identification can be sent to the target first electronic device.
[0066] For example, the unique identifier plaintext decrypted by the server is identifier 1, and the set matching relationship 1 is the pairing relationship between identifier 1 (the unique identifier of network video recorder 1) and identifier 2 (the unique identifier of network camera 1) and identifier 3 (the unique identifier of network camera 2). It can be determined that the target first electronic device has set matching relationship 1, and the device password corresponding to the set matching relationship 1 can be sent to the target first electronic device.
[0067] In an embodiment of the present application, the server may generate a corresponding first device password request reply message based on the device password obtained by the above query, and may send the first device password request reply message to the target first electronic device.
[0068] In a specific implementation method of an embodiment of the present application, if the device password obtained by the server query is a device password ciphertext, the queried device password ciphertext can be decrypted to obtain the corresponding decrypted device password plaintext, and the decrypted device password plaintext can be sent to the target first electronic device.
[0069] In another specific implementation method of the embodiment of the present application, in order to reduce the probability of the device password being interpreted or tampered with by an eavesdropper during transmission, the server can transmit the decrypted device password in plain text to the target first electronic device based on a preset transmission protocol; specifically, the preset transmission protocol can be the Transport Layer Security (TLS) protocol, or it can be set to other transmission protocols according to actual needs; during transmission, the reply message will be encrypted to obtain a first device password request reply message; accordingly, the security of password transmission can be improved and the risk of password leakage can be reduced.
[0070] After receiving the first device password request reply message sent by the server, the target first electronic device can decrypt the first device password request reply message to obtain the first device password request reply message civilized text, and then extract the first device password from the first device password request reply message civilized text.
[0071] In addition, if the server transmits the first device password request reply message based on a preset transmission protocol, the target first electronic device can also decrypt the first device password request reply message based on the same transmission protocol to obtain the first device password request reply message civilized text, and then extract the first device password from the first device password request reply message civilized text.
[0072] In a specific implementation method of an embodiment of the present application, after obtaining the first device password, the first device password can also be stored in a local storage module of the target first electronic device; and when authentication to the second electronic device is required subsequently, the first device password can be obtained from the local storage module.
[0073] It should be understood that if the server does not query the first device password, it can be considered that the target first electronic device does not have a package relationship, that is, the target first electronic device is a device for standalone use (single-product device), and the server can instantly randomly generate the first device password and return it.
[0074] Step S202: When the first device password is received, a device authentication request is sent to each identified second electronic device based on the first device password.
[0075] In an embodiment of the present application, the target first electronic device can perform device discovery in the local area network, so as to promptly initiate authentication requests to each second electronic device in the local area network, thereby improving the management efficiency of the second electronic devices.
[0076] Specifically, the target first electronic device can broadcast a device discovery message in the local area network to perform device discovery; if a second electronic device in the same local area network receives the device discovery message broadcast by the target first electronic device, it can send a device discovery reply message to the target first electronic device so that the target first electronic device can be aware of the existence of the second electronic device in the local area network.
[0077] When a device discovery reply message is received, the target first electronic device can identify the second electronic device based on the device discovery reply message; specifically, the target first electronic device can determine the second electronic device that sends the device discovery reply message, and can determine the second electronic device as the identified second electronic device; in an embodiment of the present application, the second electronic device identified in the local area network can be referred to as the target second electronic device.
[0078] After obtaining the first device password, the target first electronic device can send a device authentication request to each identified target second electronic device based on the first device password. The device authentication request can include the first device password, and the device authentication request can trigger the target second electronic device to authenticate the target first electronic device based on the first device password.
[0079] Specifically, the target first electronic device can generate a device authentication request plaintext based on the first device password, and can encrypt the device authentication request plaintext to obtain a device authentication request; then, the device authentication request can be sent to each target second electronic device. Among them, the encryption algorithm for encrypting the first device password is an encryption algorithm agreed with the target second electronic device, which can be any common encryption algorithm in the prior art, and the embodiment of the present application does not limit this.
[0080] After receiving the device authentication request, the target second electronic device can authenticate the target first electronic device based on the device authentication request and its own device password, and can send the authentication result to the target first electronic device. Here, the target second electronic device can send a device authentication request reply message to the target first electronic device, and the device authentication request reply message can indicate that the target second electronic device successfully authenticates the first electronic device or fails to authenticate.
[0081] Specifically, after the target first electronic device receives the device authentication request reply message sent by the target second electronic device, if the device authentication request reply message indicates that the target second electronic device has failed to authenticate the target first electronic device, it can be considered that the target second electronic device and the target first electronic device are not a set of devices. If the device authentication request reply message indicates that the target second electronic device has successfully authenticated the target first electronic device, the target first electronic device can send an add message to the target second electronic device to add the target second electronic device; after that, the data collected by the target second electronic device can be conveniently viewed, stored and managed on the target first electronic device.
[0082] For example, if a network camera successfully authenticates a network video recorder, the network video recorder can send an add message to the network camera to add the network camera. After the addition is completed, the network video recorder can receive, store and manage the video captured by the network camera; the user can also view the video captured by the network camera through the network video recorder.
[0083] For another example, if the doorbell successfully authenticates the doorbell companion, the doorbell companion can send an add message to the doorbell to add the doorbell. After the addition is completed, the doorbell companion can receive, store and manage the video captured by the doorbell; the user can view the video captured by the doorbell through the doorbell companion.
[0084] By generating a unified device password for the first electronic device and the second electronic device that are in a paired relationship, the first electronic device can directly send an authentication request to the second electronic device based on its own device password, and the step of the first electronic device obtaining the device password of the second electronic device can be omitted, thereby avoiding the operation of manually entering the password, thereby improving the degree of automation of the authentication process and effectively improving the user experience.
[0085] The following will take any second electronic device (referred to as the target second electronic device) as an example to describe the authentication process in the initial installation phase in detail; Figure 3 In an embodiment of the present application, an embodiment of a device authentication method applied to a second electronic device may include steps S301 to S303:
[0086] Step S301: Send a second device password request to the server.
[0087] In the embodiment of the present application, the user can connect the target second electronic device to a network for communication, so that the target second electronic device can obtain its own device password from the server.
[0088] In an embodiment of the present application, after the target second electronic device is connected to the network, it can send a second device password request to the server; wherein the second device password request can trigger the server to query and send the device password of the target second electronic device (referred to as the second device password).
[0089] Specifically, the target second electronic device can encrypt the unique identification of the target second electronic device to obtain a unique identification ciphertext; based on the unique identification ciphertext, a second device password request can be generated, and then the target second electronic device can send the second device password request to the server to obtain the second device password. Among them, the encryption algorithm for encrypting the unique identification of the target second electronic device is an encryption algorithm agreed with the server, which can be any common encryption algorithm in the prior art, and the embodiments of the present application do not limit this.
[0090] After receiving the second device password request, the server can parse the second device password request to extract the unique identification ciphertext of the target second electronic device from the second device password request, and can decrypt the unique identification ciphertext to obtain the unique identification plaintext; thereafter, the server can query the decrypted unique identification plaintext in each package pairing relationship (including each unique identification); if the decrypted unique identification plaintext is queried in each package pairing relationship, it can be determined that the target second electronic device has a package pairing relationship with a certain first electronic device, and the initial device password of the package matching relationship corresponding to the queried unique identification can be sent to the target second electronic device.
[0091] In an embodiment of the present application, the server may generate a corresponding second device password request reply message based on the device password obtained by the above query, and may send the second device password request reply message to the target second electronic device.
[0092] In a specific implementation method of an embodiment of the present application, if the device password obtained by the server query is a device password ciphertext, the queried device password ciphertext can be decrypted to obtain the corresponding decrypted device password plaintext, and the decrypted device password plaintext can be sent to the target second electronic device.
[0093] In another specific implementation method of the embodiment of the present application, in order to reduce the probability of the device password being interpreted or tampered with by an eavesdropper during transmission, the server can transmit the decrypted device password in plain text to the target second electronic device based on a preset transmission protocol; specifically, the preset transmission protocol can be the Transport Layer Security (TLS) protocol, or it can be set to other transmission protocols according to actual needs; during transmission, the reply message will be encrypted to obtain a second device password request reply message; accordingly, the security of password transmission can be improved and the risk of password leakage can be reduced.
[0094] After receiving the second device password request reply message sent by the server, the target second electronic device can decrypt the second device password request reply message to obtain the civilized text of the second device password request reply message, and can extract the second device password from the civilized text of the second device password request reply message.
[0095] Here, if the server transmits the second device password request reply message based on a preset transmission protocol, the target second electronic device can also decrypt the second device password request reply message based on the same transmission protocol to obtain the civilized text of the second device password request reply message, and then extract the second device password from the civilized text of the second device password request reply message.
[0096] It should be understood that if the server does not query the second device password, it can be considered that the target second electronic device does not have a package relationship, that is, the target second electronic device is a device for standalone use (single device), and the server can instantly randomly generate a second device password and return it.
[0097] In a specific implementation method of an embodiment of the present application, after obtaining the second device password, the second device password can be stored in a local storage module of the target second electronic device, and the second device password can be obtained from the storage module when the first electronic device needs to be authenticated later.
[0098] In addition, if the target second electronic device receives a device discovery message broadcast by other electronic devices in the local area network, a device discovery reply message may be sent to the electronic device so that the electronic device can know that the target second electronic device exists in the local area network.
[0099] Step S302: When the second device password sent by the server is received, if a device authentication request sent by the first electronic device is received, the first electronic device is authenticated based on the device authentication request and the second device password to obtain an authentication result.
[0100] In an embodiment of the present application, if the target second electronic device receives a device authentication request sent by the first electronic device, the first electronic device can be authenticated based on the device authentication request and the second device password to obtain an authentication result for the first electronic device.
[0101] Specifically, the target second electronic device may decrypt the device authentication request to obtain a plain text of the device authentication request; thereafter, the plain text of the device authentication request may be parsed to extract the first device password from the plain text of the device authentication request.
[0102] If the first device password is the same as the second device password, it can be determined that the authentication result of the target second electronic device to the target first electronic device is successful; if the first device password is different from the second device password, it can be determined that the authentication result of the target second electronic device to the target first electronic device is failed.
[0103] Step S303: Generate a device authentication request reply message based on the authentication result, and send the authentication request reply message to the first electronic device.
[0104] In an embodiment of the present application, the target second electronic device can send an authentication result to the first electronic device so that the first electronic device can know whether the authentication is successful and can perform subsequent processes in a timely manner when the authentication is successful.
[0105] Specifically, the target second electronic device may generate a corresponding device authentication request reply message based on the authentication result, and may send the device authentication request reply message to the first electronic device, wherein the device authentication request reply message may indicate that the authentication of the first electronic device is successful or failed.
[0106] When the authentication is successful, the first electronic device may send an add message to the target second electronic device, and the target second electronic device may be added to the corresponding list of the first electronic device.
[0107] For ease of understanding, the authentication process of the embodiment of the present application will be described below with reference to the accompanying drawings and specific examples.
[0108] Figure 4 A specific application scenario of the authentication process is shown. In one example, the first electronic device is a network video recorder 1, and each second electronic device includes a second electronic device 1 and a second electronic device 2, respectively. The second electronic device 1 is a network camera 1, and the second electronic device 2 is a network camera 2.
[0109] At the factory stage, the factory (staff) can determine the pairing relationship of each set, and can send (or upload) each set pairing relationship to the server (also known as the cloud); after receiving the pairing relationship of each set, the server can generate a unified device password for the network video recorder and each network camera in the pairing relationship of the set; thereafter, the server can save each set pairing relationship and the corresponding device password in a local storage module.
[0110] During the initial installation phase, the user can power on the network video recorder and each network camera and connect them to the network. After the network video recorder 1, network camera 1 and network camera 2 are connected to the network, they can send corresponding device password requests to the server to trigger the server to query and send the corresponding device password. The device password request may include the unique identifier of the device; in this example, the network video recorder 1 can send a first device password request to the server to instruct the server to send the device password of the network video recorder 1; network camera 1 and network camera 2 can send corresponding second device password requests to the server to instruct the server to send the corresponding device password.
[0111] After receiving the device password request, the server can query whether the unique identifier is included in each package pairing relationship based on the unique identifier in the device password request; if the unique identifier is queried, it can be determined that the device corresponding to the unique identifier (referred to as the target device) has a pairing relationship (or a package pairing relationship) with other devices, and the package pairing relationship corresponding to the target device can be determined as the target package pairing relationship; thereafter, the server can query the unified device password corresponding to the target package pairing relationship, and can send the queried password to the target device, which can be specifically transmitted through a preset transmission protocol.
[0112] After obtaining the corresponding device password, the network video recorder 1 can broadcast a device discovery message in the local area network to perform device discovery. After receiving the device discovery message broadcast by the network video recorder 1, the network camera 1 and the network camera 2 can reply with the corresponding discovery reply message; after receiving the discovery reply message sent by the network camera 1, the network video recorder 1 can send a device authentication request to the network camera 1 and the network camera 2 respectively based on the device password of the network video recorder 1, so as to trigger the network camera 1 and the network camera 2 to authenticate the network video recorder 1 respectively.
[0113] If the device password in the device authentication request is the same as the device password of the network camera 1 itself, the network camera 1 can confirm that the authentication of the network video recorder 1 is successful; if the device password in the device authentication request is different from the device password of the network camera 1 itself, it can be confirmed that the authentication of the network video recorder 1 has failed; then, the network camera 1 can generate a corresponding device authentication request reply message based on the authentication result of the network video recorder 1, and send it to the network video recorder 1. Similarly, the network camera 2 can also authenticate the network video recorder 1 and send a device authentication request reply message according to the above process.
[0114] After receiving the device authentication request reply message, network video recorder 1 can know whether network camera 1 and network camera 2 have successfully authenticated network video recorder 1; if network camera 1 has successfully authenticated network video recorder 1, network video recorder 1 can add network camera 1. Similarly, if network camera 2 has successfully authenticated network video recorder 1, network video recorder 1 can add network camera 2.
[0115] In another example, the first electronic device is a doorbell companion 1, and each second electronic device includes a second electronic device 1 and a second electronic device 2, respectively. The first electronic device 1 is a doorbell 1, and the second electronic device 2 is a doorbell 2.
[0116] During the factory delivery stage, the factory (staff) can determine the pairing relationships of each set and send (or upload) each set pairing relationship to the server; after receiving each set pairing relationship, the server can generate a unified device password for the first electronic device and each second electronic device in the set pairing relationship; thereafter, the server can save each set pairing relationship and the corresponding device password in a local storage module.
[0117] During the initial installation phase, users can power on Doorbell Companion 1, Doorbell 1, and Doorbell 2 and connect them to the network. After Doorbell Companion 1, Doorbell 1, and Doorbell 2 are powered on and connected to the network, they can send corresponding device password requests to the server to trigger the server to query and send the corresponding device password. The device password request may include the unique identifier of the device; in this example, Doorbell Companion 1 can send a first device password request to the server to trigger the server to query and send the device password of Doorbell Companion 1; Doorbell 1 and Doorbell 2 can send corresponding second device password requests to the server to trigger the server to query and send the corresponding device password.
[0118] After receiving the device password request, the server can query whether the unique identifier is included in each package pairing relationship based on the unique identifier in the device password request; if the unique identifier is queried, it can be determined that the device corresponding to the unique identifier (called the target device) has a pairing relationship (or a package pairing relationship) with other devices, and the package pairing relationship corresponding to the target device can be determined as the target package pairing relationship; thereafter, the server can query the unified device password corresponding to the target package pairing relationship.
[0119] After querying the unified device password corresponding to the pairing relationship of the target set, the server can send the device password to the target device.
[0120] After obtaining the corresponding device password, Doorbell Companion 1 can broadcast a device discovery message in the local area network to perform device discovery. After receiving the device discovery message broadcast by Doorbell Companion 1, Doorbell 1 and Doorbell 2 can reply with the corresponding discovery reply message; after receiving the discovery reply message sent by Doorbell 1 and Doorbell 2, Doorbell Companion 1 can send a device authentication request to Doorbell 1 and Doorbell 2 respectively based on the device password of Doorbell Companion 1, so as to trigger Doorbell 1 and Doorbell 2 to authenticate Doorbell Companion 1 respectively.
[0121] If the device password in the device authentication request is the same as the device password of Doorbell 1 itself, Doorbell 1 can confirm that the authentication of Doorbell Companion 1 is successful; if the device password in the device authentication request is different from the device password of Doorbell 1 itself, it can be confirmed that the authentication of Doorbell Companion 1 has failed; then, Doorbell 1 can generate a corresponding device authentication request reply message based on the authentication result of Doorbell Companion 1 and send it to Doorbell Companion 1. Similarly, Doorbell 2 can also refer to the above process to authenticate Doorbell Companion 1 and send a device authentication request reply message.
[0122] After receiving the device authentication request reply message, Doorbell Companion 1 can know whether Doorbell 1 and Doorbell 2 have successfully authenticated Doorbell Companion 1; if Doorbell 1 has successfully authenticated Doorbell Companion 1, Doorbell Companion 1 can add Doorbell 1. Similarly, if Doorbell 2 has successfully authenticated Doorbell Companion 1, Doorbell Companion 1 can add Doorbell 2.
[0123] In summary, the embodiment of the present application sends a first device password request to the server; wherein, the first device password request triggers the server to query and send the first device password, the first device password is the device password of the first electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; in the case of receiving the first device password, based on the first device password, the device authentication request is sent to each identified second electronic device; wherein, the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password. In the embodiment of the present application, the device passwords of the first electronic device and the second electronic device that have a pairing relationship are the same, therefore, the first electronic device only needs to know its own device password to request authentication from the second electronic device, thereby eliminating the need for the user to manually enter the password (of the second electronic device), effectively improving the user experience.
[0124] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0125] Corresponding to the device authentication method applied to a first electronic device described in the above embodiment, Figure 5 A structural diagram of an embodiment of a device authentication apparatus applied to a first electronic device provided in an embodiment of the present application is shown.
[0126] like Figure 5 As shown, in an embodiment of the present application, a device authentication apparatus applied to a first electronic device may include:
[0127] A first device password request sending module 501 is configured to send a first device password request to a server; wherein the first device password request triggers the server to query and send a first device password, the first device password is the device password of the first electronic device, the server stores various set pairing relationships, the set pairing relationship is the pairing relationship between the first electronic device and various second electronic devices, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0128] The device authentication request sending module 502 is used to send the device authentication request to each identified second electronic device based on the first device password when the first device password is received; wherein the device authentication request includes the first device password, and each device authentication request triggers the second electronic device to authenticate the first electronic device based on the first device password.
[0129] like Figure 6 As shown, in a specific implementation of the embodiment of the present application, the first device password request sending module includes:
[0130] The identification encryption submodule 601 is used to encrypt the unique identification of the first electronic device to obtain a unique identification encrypted ciphertext;
[0131] A first device password request generating submodule 602, configured to generate the first device password request based on the unique identifier encrypted ciphertext;
[0132] The first device password request sending submodule 603 is used to send the first device password request to the server.
[0133] like Figure 7 As shown, in a specific implementation of the embodiment of the present application, the device further includes:
[0134] A first device password request reply message decryption module 701 is used to decrypt the first device password request reply message when receiving the first device password request reply message sent by the server to obtain a first device password request reply message in plain text;
[0135] A first device password extraction module 702, configured to extract the first device password from the first device password request reply message text;
[0136] A first device password storage module 703, used to store the first device password in a local storage module;
[0137] The first device password obtaining module 704 is configured to obtain the first device password from the local storage module.
[0138] like Figure 8 As shown, in a specific implementation of the embodiment of the present application, the device further includes:
[0139] The message broadcast module 801 is used to broadcast device discovery messages;
[0140] The device identification module 802 is configured to, upon receiving a device discovery reply message sent by the second electronic device, identify the second electronic device based on the device discovery reply message.
[0141] like Fig. 9 As shown, in a specific implementation of the embodiment of the present application, the device authentication request sending module includes:
[0142] A request generation submodule 901, configured to generate a device authentication request plaintext based on the first device password;
[0143] The request encryption submodule 902 is used to encrypt the plain text of the device authentication request to obtain the device authentication request;
[0144] The request sending submodule 903 is used to send the device authentication request to each of the second electronic devices.
[0145] like Fig.10 As shown, in a specific implementation of the embodiment of the present application, the device further includes:
[0146] The reply message receiving module 1001 is used to receive a device authentication request reply message sent by the second electronic device; wherein the device authentication request reply message indicates that the second electronic device successfully authenticates the first electronic device or fails to authenticate the first electronic device;
[0147] The device adding module 1002 is configured to send a device adding message to the second electronic device to add the second electronic device if the second electronic device successfully authenticates the first electronic device.
[0148] Corresponding to the device authentication method applied to the second electronic device described in the above embodiment, Fig.11 A structural diagram of an embodiment of a device authentication apparatus applied to a second electronic device provided in an embodiment of the present application is shown.
[0149] like Fig.11 As shown, in an embodiment of the present application, a device authentication apparatus applied to a second electronic device may include:
[0150] A second device password request sending module 1101 is configured to send a second device password request to a server; wherein the second device password request triggers the server to query and send a second device password, the second device password is the device password of the second electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device;
[0151] The authentication module 1102 is configured to, when receiving the second device password sent by the server, perform authentication on the first electronic device based on the device authentication request and the second device password to obtain an authentication result if a device authentication request sent by the first electronic device is received;
[0152] The request reply message sending module 1103 is used to generate a device authentication request reply message based on the authentication result, and send the authentication request reply message to the first electronic device.
[0153] like Fig.12 As shown, in a specific implementation of the embodiment of the present application, the authentication module includes:
[0154] The device authentication request decryption submodule 1201 is used to decrypt the device authentication request to obtain a plain text of the device authentication request;
[0155] A first device password extraction submodule 1202, configured to extract a first device password from the device authentication request plain text;
[0156] The authentication success determination submodule 1203 is used to determine that the authentication result is authentication success if the first device password is the same as the second device password;
[0157] The authentication failure determination submodule 1204 is configured to determine that the authentication result is an authentication failure if the first device password is different from the second device password.
[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0160] Fig.13 A schematic block diagram of an electronic device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0161] like Fig.13 As shown, the electronic device 13 of this embodiment includes: a processor 130, a memory 131, and a computer program 132 stored in the memory 131 and executable on the processor 130. When the processor 130 executes the computer program 132, the steps in the above-mentioned device authentication method embodiments are implemented, such as Figure 2Steps S201 to S202 shown in the example; or steps S301 to S303 shown in example 3. Alternatively, when the processor 130 executes the computer program 132, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 5 The functions of modules 501 to 502 are shown; for example Fig.11 The functions of modules 1101 to 1103 are shown.
[0162] Exemplarily, the computer program 132 may be divided into one or more modules / units, which are stored in the memory 131 and executed by the processor 130 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 132 in the electronic device 13.
[0163] Those skilled in the art will understand that Fig.13 It is only an example of the electronic device 13 and does not constitute a limitation of the electronic device 13. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 13 may also include input and output devices, network access devices, buses, etc.
[0164] The processor 130 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0165] The memory 131 may be an internal storage unit of the electronic device 13, such as a hard disk or memory of the electronic device 13. The memory 131 may also be an external storage device of the electronic device 13, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 13. Further, the memory 131 may also include both an internal storage unit of the electronic device 13 and an external storage device. The memory 131 is used to store the computer program and other programs and data required by the electronic device 13. The memory 131 may also be used to temporarily store data that has been output or is to be output.
[0166] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0167] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0168] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0169] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0172] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0173] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A device authentication method, characterized in that: Applied to a first electronic device, the method includes: Sending a first device password request to a server; wherein the first device password request triggers the server to query and send the first device password, the first device password is the device password of the first electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; When the first device password is received, the device authentication request is sent to each identified second electronic device based on the first device password; wherein the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password.
2. The device authentication method according to claim 1, characterized in that: The sending a first device password request to the server includes: Encrypting the unique identifier of the first electronic device to obtain a unique identifier encrypted ciphertext; Generate the first device password request based on the unique identifier encrypted ciphertext; Sending the first device password request to the server.
3. The device authentication method according to claim 1, characterized in that: After sending the first device password request to the server, the method further includes: Upon receiving the first device password request reply message sent by the server, decrypting the first device password request reply message to obtain a civilized text of the first device password request reply message; Extracting the first device password from the first device password request reply message text; Storing the first device password in a local storage module; Before sending the device authentication request to each identified second electronic device based on the first device password upon receiving the first device password, the method further includes: The first device password is obtained from the local storage module.
4. The device authentication method according to claim 1, characterized in that: Before sending the device authentication request to each identified second electronic device based on the first device password upon receiving the first device password, the method further includes: Broadcast device discovery message; When the device discovery reply message sent by the second electronic device is received, the second electronic device is identified based on the device discovery reply message.
5. The device authentication method according to claim 1, characterized in that: The sending the device authentication request to each identified second electronic device based on the first device password includes: Based on the first device password, generate a device authentication request plaintext; Encrypting the plain text of the device authentication request to obtain the device authentication request; The device authentication request is sent to each of the second electronic devices.
6. The device authentication method according to any one of claims 1 to 5, characterized in that: Also includes: receiving a device authentication request reply message sent by the second electronic device; wherein the device authentication request reply message indicates whether the second electronic device has successfully authenticated the first electronic device or whether the authentication has failed; If the second electronic device successfully authenticates the first electronic device, a device adding message is sent to the second electronic device to add the second electronic device.
7. A device authentication method, characterized in that: Applied to a second electronic device, the method includes: Sending a second device password request to a server; wherein the second device password request triggers the server to query and send a second device password, the second device password is the device password of the second electronic device, the server stores each set pairing relationship, the set pairing relationship is the pairing relationship between the first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; In the case of receiving the second device password sent by the server, if a device authentication request sent by the first electronic device is received, authenticating the first electronic device based on the device authentication request and the second device password to obtain an authentication result; A device authentication request reply message is generated based on the authentication result, and the authentication request reply message is sent to the first electronic device.
8. The device authentication method according to claim 7, characterized in that: The step of authenticating the first electronic device based on the device authentication request and the second device password to obtain an authentication result includes: Decrypting the device authentication request to obtain a plain text of the device authentication request; Extracting a first device password from the device authentication request plaintext; If the first device password is the same as the second device password, determining that the authentication result is successful authentication; If the first device password is different from the second device password, the authentication result is determined to be authentication failure.
9. A device authentication apparatus, characterized in that: Applied to a first electronic device, the device comprises: A first device password request sending module, configured to send a first device password request to a server; wherein the first device password request triggers the server to query and send a first device password, the first device password is a device password of the first electronic device, the server stores various set pairing relationships, the set pairing relationship is a pairing relationship between the first electronic device and various second electronic devices, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; A device authentication request sending module is used to send the device authentication request to each identified second electronic device based on the first device password when the first device password is received; wherein the device authentication request includes the first device password, and the device authentication request triggers each second electronic device to authenticate the first electronic device based on the first device password.
10. A device authentication apparatus, characterized in that: Applied to a second electronic device, the device comprises: A second device password request sending module, configured to send a second device password request to a server; wherein the second device password request triggers the server to query and send a second device password, the second device password is a device password of the second electronic device, the server stores each set pairing relationship, the set pairing relationship is a pairing relationship between a first electronic device and each second electronic device, and the device password of the first electronic device in the set pairing relationship is the same as the device password of each second electronic device; an authentication module, configured to, upon receiving the second device password sent by the server, perform authentication on the first electronic device based on the device authentication request and the second device password to obtain an authentication result if a device authentication request sent by the first electronic device is received; A request reply message sending module is used to generate a device authentication request reply message based on the authentication result, and send the authentication request reply message to the first electronic device.
11. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the device authentication method according to any one of claims 1 to 6 to be executed, or enables the device authentication method according to claim 7 or 8 to be executed.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the steps of the device authentication method according to any one of claims 1 to 6; or, the electronic device implements the steps of the device authentication method according to claim 7 or 8.