Secure communication method, robot, server and storage medium
By using certificate signature requests and trusted spaces between the robot and the server, the problem of how to establish a secure communication connection is solved, and secure communication between the robot and the server is realized to prevent data leakage.
Patent Information
- Application Number
- CN202311208876.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-03-18
AI Technical Summary
How to establish a secure communication connection between a robot and a server to prevent data breaches and unauthorized access.
By using the robot's unique identity and key pair generated by the public-private key generator, a certificate signing request is generated, a certificate is requested from the server, and a certificate is stored in a trusted space, ensuring that only a robot holding a valid certificate can establish a communication connection with the server.
Secure communication between robots and servers is realized, ensuring that only trusted robots can communicate with servers, avoiding data breaches and unauthorized access.
Smart Images

Figure CN119652527A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication security technology, and more specifically, to a secure communication method, a robot, a server, and a non-volatile computer-readable storage medium. Background Art
[0002] At present, for robot manufacturers, in addition to selling robots, when the robots perform tasks, they also communicate with the manufacturer's servers to help the robots perform various tasks. Therefore, how to establish a communication connection between the robot and the server to ensure the security of communication between the robot and the server is an urgent problem that needs to be solved. Summary of the invention
[0003] The embodiments of the present application provide a secure communication method, a robot, a server, and a non-volatile computer-readable storage medium, which can request a certificate matching the robot through a key pair and the robot's identification, and store it in a trusted space to ensure the security of the certificate. When the robot communicates, it can only establish a communication connection with the server if it has a certificate issued by the server, thereby achieving secure communication between the robot and the server.
[0004] A secure communication method for a robot according to one embodiment of the present application includes generating a certificate signing request based on the robot's identification and a key pair generated by a public-private key generator; sending the certificate signing request to a server to obtain a certificate from the server; upon receiving the certificate sent by the server, storing the certificate in the robot's trusted space through a preset key management service; and responding to the server, obtaining the certificate from the trusted space through the key management service, and establishing a communication connection with the server based on the certificate.
[0005] In some embodiments, the trusted space also stores a verification password. Before obtaining the certificate from the trusted space through the key management service, the method also includes: receiving a first password entered by a user; obtaining the verification password from the trusted space; determining whether the first password is the same as the verification password; and if so, executing the step of obtaining the certificate from the trusted space through the key management service.
[0006] In some embodiments, establishing a communication connection with the server based on the certificate includes: sending the certificate to the server so that the server verifies the certificate; and establishing a communication connection with the server upon receiving information sent by the server indicating successful certificate verification.
[0007] In some embodiments, the certificate includes: the key pair; the method also includes: storing the key pair in the trusted space of the robot through the key management service; after establishing the communication connection, the method also includes: obtaining the public key in the key pair from the trusted space; encrypting the first original communication data using the public key to generate first encrypted communication data; sending the first encrypted communication data to the server, so that the server decrypts the first encrypted communication data using the private key in the certificate to obtain the first original communication data; after establishing the communication connection, the method also includes: upon receiving the second encrypted communication data sent by the server, obtaining the private key in the key pair from the trusted space, wherein the second encrypted communication data is obtained by the server encrypting the second original data using the public key in the certificate; decrypting the second encrypted communication data using the private key to obtain the second original data.
[0008] A secure communication method for a server in another embodiment of the present application includes receiving a certificate signing request sent by a robot, wherein the certificate signing request includes an identifier of the robot and a key pair generated by a public-private key generator; verifying whether the identifier of the robot is any preset identifier; if so, generating a certificate based on the key pair and sending the certificate to the robot; and establishing a communication connection with the robot based on the certificate.
[0009] In some embodiments, establishing a communication connection with the robot based on the certificate includes: upon receiving the certificate sent by the robot, verifying whether the certificate is valid; if so, sending information indicating successful certificate verification to the robot and establishing a communication connection with the robot.
[0010] In some embodiments, the certificate includes the key pair; after establishing the communication connection, the method further includes: upon receiving the first encrypted communication data sent by the robot, decrypting the first encrypted communication data by using the private key in the certificate to obtain the first original communication data, wherein the first encrypted communication data is obtained by the robot encrypting the first original communication data by using the public key in the trusted space of the robot; after establishing the communication connection, the method further includes: encrypting the second original communication data by using the public key in the certificate to generate the second encrypted communication data; sending the second encrypted communication data to the robot so that the robot decrypts the second encrypted communication data by using the private key in the trusted space to obtain the second original communication data.
[0011] The robot of the embodiment of the present application includes a generation module, a sending module, a storage module and a connection module. The generation module is used to generate a certificate signing request according to the robot's identification and the key pair generated by the public-private key generator; the sending module is used to send the certificate signing request to the server to obtain the certificate from the server; the storage module is used to store the certificate in the robot's trusted space through a preset key management service when receiving the certificate sent by the server; the connection module is used to respond to the server, obtain the certificate from the trusted space through the key management service, and establish a communication connection with the server according to the certificate.
[0012] The server of the embodiment of the present application includes a receiving module and a verification module. The receiving module is used to receive a certificate signing request sent by a robot, and the certificate signing request includes the robot's identification and a key pair generated by a public-private key generator; the verification module is used to verify whether the robot's identification is any preset identification, and if so, to generate a certificate according to the key pair, send the certificate to the robot, and establish a communication connection with the robot according to the certificate.
[0013] The robot of the embodiment of the present application includes a processor, a memory and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the secure communication method of the robot described in any of the above embodiments.
[0014] The server of an embodiment of the present application includes a processor, a memory and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the secure communication method of the server described in any of the above embodiments.
[0015] The non-volatile computer-readable storage medium of the embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the processor executes the secure communication method described in any of the above embodiments.
[0016] The secure communication method, robot, server and computer-readable storage medium of the implementation mode of the present application generate a certificate signing request based on the unique identification of the robot (such as the number of the robot) and the key pair randomly generated by the public-private key generator (generally including the corresponding public key and private key) to request the server to issue a certificate. After receiving the certificate signing request, the server can verify whether the identification matches the server. After the verification is passed (such as the identification is pre-stored in the server), it can be determined that the two match, thereby determining that the robot is trustworthy. The server can generate a certificate, which can be associated with the identification and key pair. After the robot receives the certificate issued by the server, it can store the certificate in the robot's trusted space to prevent the certificate from being leaked and ensure the security of the certificate. At the same time, the robot's possession of the certificate means that the robot has the authority to establish a communication connection with the server, thereby preventing other untrusted robots without corresponding certificates from establishing a connection with the server, ensuring the communication security between the robot and the server, and avoiding data leakage of the server.
[0017] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0019] Figure 1 It is a structural schematic diagram of a communication system of a secure communication method in certain embodiments of the present application;
[0020] Figure 2 is a flowchart of a secure communication method for a robot according to certain embodiments of the present application;
[0021] Figure 3 is a flowchart of a secure communication method for a robot according to certain embodiments of the present application;
[0022] Figure 4 is a flowchart of a secure communication method for a robot according to certain embodiments of the present application;
[0023] Figure 5 is a flowchart of a secure communication method for a robot according to certain embodiments of the present application;
[0024] Figure 6 It is a flowchart of a secure communication method of a server in certain embodiments of the present application;
[0025] Figure 7 It is a flowchart of a secure communication method of a server in certain embodiments of the present application;
[0026] Figure 8 It is a flowchart of a secure communication method of a server in certain embodiments of the present application;
[0027] Fig. 9 is a flowchart of a secure communication method in certain embodiments of the present application;
[0028] Fig.10 is a schematic diagram of a module of a robot according to some embodiments of the present application;
[0029] Fig.11 is a module schematic diagram of a server in some embodiments of the present application;
[0030] Fig.12 It is a scenario schematic diagram of a secure communication method in certain embodiments of the present application;
[0031] Fig.13 It is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in certain embodiments of the present application. DETAILED DESCRIPTION
[0032] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0033] To facilitate understanding of this application, the terms appearing in this application are explained below:
[0034] gRPC (Google Remote Procedure Call) protocol: The gRPC protocol uses HTTP / 2 as the communication protocol and transmits data based on binary streams. Compared with HTTP / 1.1, HTTP / 2 has lower latency and higher throughput, supports multiplexing, header compression, flow control and other features, and provides more efficient data transmission.
[0035] X.509 certificate is a commonly used Public Key Infrastructure (PKI) standard for authentication and encryption in network communications. In X.509 certificates, several integer fields are used. Here are some common integer fields used in X.509 certificates:
[0036] 1. Serial Number: Each X.509 certificate has a unique serial number, which is used to identify the uniqueness of the certificate. The serial number is a positive integer.
[0037] 2. Public Key Exponent: When a public key is included in a certificate, the public key exponent is the exponent used to encrypt and decrypt data. It is usually a small prime number.
[0038] 3. Signature Algorithm Identifier: An integer value used to identify the signature algorithm. This value indicates the type of algorithm used to generate and verify the certificate signature.
[0039] 4. Version Number: Used to indicate the X.509 version of the certificate. The version number is usually an integer, for example, 0 represents X.509v1, 1 represents X.509v2, and 2 represents X.509v3.
[0040] 5. Public Key Length: When a public key is included in a certificate, the public key length indicates the number of bits in the public key. It is a positive integer that indicates the strength and key length of the public key.
[0041] These integer fields play a key role in the encoding and parsing of X.509 certificates, helping to ensure the integrity and security of the certificates.
[0042] PKI is an architecture and framework based on asymmetric encryption algorithms that manages and verifies the creation, distribution, and revocation of digital certificates to ensure secure communication and identity authentication. A PKI system typically includes the following main components:
[0043] 1. Public key encryption algorithm: PKI uses an asymmetric encryption algorithm, which includes a public key and a private key. The public key is used to encrypt data and verify signatures, and the private key is used to decrypt data and generate signatures.
[0044] 2. Digital Certificate: A digital certificate is a core component of PKI. It is a digital file containing a public key and related identity information, issued by a certificate authority (CA). Certificates can be used to verify identity, encrypt and sign data, and establish secure communications.
[0045] 3.CA is the authority responsible for issuing and managing digital certificates. It verifies the identity of the certificate applicant and signs its public key with its own private key to create a digital certificate. A trusted CA can build a chain of trust so that the verification of the certificate can be traced back to the root CA.
[0046] 4. Registration Authority (RA): RA is an entity that works with CA and is responsible for verifying the identity of the certificate requester and submitting their identity information to CA. RA plays the role of an intermediary in the certificate issuance process.
[0047] 5. Certificate repository: A certificate repository is a centralized or distributed storage system for storing and retrieving digital certificates. It provides a public access point so that the verifying party can obtain and verify the required digital certificates.
[0048] The certificates of the secure communication method of the present application can be generated and managed by using PKI, and the security and trust of the communication can be enhanced, achieving the following goals:
[0049] Authentication: Through digital certificates, PKI can verify the identities of both communicating parties, ensuring that communications are conducted with legitimate and trusted entities.
[0050] Encryption: PKI provides encryption algorithms and public key exchange mechanisms to protect the confidentiality and privacy of sensitive data.
[0051] Digital signature: PKI can use private keys to generate digital signatures to verify the integrity and authenticity of data.
[0052] Digital certificate revocation: PKI allows CAs to revoke digital certificates when necessary to ensure that invalid certificates are no longer used.
[0053] The following first introduces the application scenarios of the technical solution of this application. Figure 1 As shown, it is a schematic diagram of an application scenario of a secure communication method provided in an embodiment of the present application. The application scenario involves a robot 100 and a server 200, and the robot 100 can communicate with the server 200.
[0054] Figure 1 One robot 100 and one server 200 are shown by way of example, but other numbers of robots 100 and servers 200 may actually be included, and the embodiments of the present application are not limited to this.
[0055] In some possible implementations, Figure 1 The server 200 in the example may be an independent physical server 200, or a server 200 cluster or distributed system composed of multiple physical servers 200, or a cloud server 200 that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The embodiments of the present application do not limit this.
[0056] Optionally, in the embodiment of the present application, the robot 100 may be a type of device that has a rich human-computer interaction mode, has the ability to access the Internet, is usually equipped with various operating systems, and has strong processing capabilities.
[0057] For example, the robot 100 may be an autonomous mobile robot (AMR), an automated guided vehicle (AGV), a gripper, a tractor, a forklift, a reach stacker, a warehouse robot, or other mobile device.
[0058] In one achievable manner, the server 200 and the robot 100 may interactively execute the secure communication method provided in the embodiment of the present application, or the secure communication method provided in the embodiment of the present application may be executed by the robot 100 or the server 200.
[0059] The secure communication method of this application will be described in detail below:
[0060] See also Figure 1 and Figure 2 , the embodiment of the present application provides a robot security communication method, the security communication method comprising:
[0061] Step 011: Generate a key pair based on the identification of the robot 100 and the public and private key generator, and generate a certificate signing request;
[0062] Specifically, each robot 100 has a unique device identification (such as a number) when it leaves the factory. For the manufacturer of the robot 100, the identification of each robot 100 produced is stored for subsequent verification of whether the robot 100 in communication is a robot 100 produced by the manufacturer. Only the robot 100 produced by the manufacturer can communicate with the server 200 provided by the manufacturer, that is, the robots 100 and the server 200 corresponding to the same manufacturer can trust each other and communicate.
[0063] In order to encrypt data during communication, a public-private key generator can be used to generate a key pair, which is the corresponding public key and private key. Data encrypted by the public key needs to be decrypted by the corresponding private key to obtain the original data before encryption. Among them, the public-private key generator can generate a key pair based on a specific algorithm, such as generating a key pair based on the RSA algorithm, to improve the security of the key.
[0064] Then, the identifier and key pair are aggregated to generate a certificate signing request (CSR) for applying for a certificate. It is understood that the certificate signing request may also include other information, such as the company name, location, manufacturer name, etc. of the robot 100, which can be used to assist in verifying whether the robot 100 is credible. For example, when the company name, location and / or manufacturer name do not match the preset information, it is also confirmed that the robot 100 is not credible.
[0065] Step 012: Send a certificate signing request to the server 200 to obtain a certificate from the server 200;
[0066] After that, the certificate signing request can be sent to the server 200 (e.g., the cloud server 200 may include a PKI server 200 for implementing certificate generation and management), and the PKI server 200 processes the certificate signing request and verifies whether the robot 100 requesting the certificate is credible. If the identification of the robot 100 is located in the identification library of the PKI server 200 (the identifications of all robots 100 produced by the manufacturer are stored in the identification library), that is, the identification of the robot 100 is any preset identification, then it can be determined that the robot 100 is produced by the manufacturer and is credible, and it is determined that the certificate signing request verification is passed, and then a certificate is generated, and the certificate can include a key pair, and then the certificate is sent to the robot 100. If the identification of the robot 100 is not any preset identification, it can be determined that the robot 100 is not produced by the manufacturer and is untrustworthy, and it is determined that the certificate signing request verification fails. At this time, the server 200 refuses to issue a certificate to the robot 100.
[0067] When the robot 100 obtains the certificate, it is considered that the robot 100 has the authority to communicate with the server 200, which ensures that only the robot 100 trusted by the server 200 can communicate with the server 200, ensuring the communication security between the robot 100 and the server 200.
[0068] Step 013: upon receiving the certificate sent by the server 200, the certificate is stored in the trusted space of the robot 100 through a preset key management service;
[0069] Specifically, since the certificate represents the authority of the robot 100 to establish a communication connection with the server 200, the security of the certificate is of vital importance, and the certificate in the robot 100 needs to be stored in a secure storage area.
[0070] Currently, a trusted space (TrustZone) exists on the hardware to prevent the effective resources of the device from being copied, destroyed or tampered with, to prevent malicious attacks on assets including tangible and intangible assets, to prevent malware, hardware monitoring, hardware intervention, etc. from destroying or obtaining device information.
[0071] TrustZone protects the processor bus, peripherals and other system levels while reducing additional resource overhead. TrustZone divides the software and hardware into a secure area and a normal area. The normal area devices cannot access the secure area devices, storage space, etc.
[0072] Therefore, the certificate can be stored in a secure area in the trusted space, thereby preventing software or hardware outside the secure area from accessing the secure area, ensuring the security of the certificate, and then setting the key management service to the secure area, thereby ensuring that the robot 100 can only access the secure area through the key management service. Before establishing a communication connection with the server 200 based on the certificate, when it is necessary to obtain the certificate, the key management service can be run, and then the secure area of the trusted space can be accessed to obtain the certificate.
[0073] Optionally, in order to prevent the key pair from being leaked, the key pair including the public key and the private key may also be stored in a secure area.
[0074] In this way, the certificate is stored in the trusted space set up at the hardware level, thereby achieving protection of the certificate at the hardware level.
[0075] Step 014: Respond to the server 200, obtain the certificate from the trusted space through the key management service, and establish a communication connection with the server based on the certificate.
[0076] Specifically, when the robot 100 wants to communicate securely with the server 200 in the future, it can first obtain a certificate from the trusted space through the key management service, and then the robot 100 can establish a communication connection with the server 200 based on the certificate, such as establishing a two-way authentication communication connection to improve communication security. Specifically, communication can be achieved through two-way authentication such as MTLS (Twoway TLS / Mutual TLS).
[0077] When sending data in subsequent communications, the public key in the certificate is used for encryption, and then the server 200 decrypts the data based on the private key in the certificate to obtain the original data before encryption, thereby achieving secure communication between the robot 100 and the server 200.
[0078] The secure communication method of the embodiment of the present application generates a certificate signing request based on the unique identification of the robot 100 (such as the number of the robot 100) and the key pair randomly generated by the public-private key generator (generally including the corresponding public key and private key) to request the server 200 to issue a certificate. After receiving the certificate signing request, the server 200 can verify the identification to see whether it matches the server 200. After the verification is passed (such as the identification is pre-stored in the server 200), it can be determined that the two match, thereby determining that the robot 100 is trustworthy, and the server 200 can generate a certificate, which can be associated with the identification and the key pair. After the robot 100 receives the certificate issued by the server 200, the certificate can be stored in the trusted space of the robot 100 to prevent the certificate from being leaked and ensure the security of the certificate. At the same time, the robot 100 having the certificate means that the robot 100 has the authority to establish a communication connection with the server 200, thereby preventing other untrustworthy robots 100 without corresponding certificates from establishing a connection with the server 200, ensuring the communication security between the robot 100 and the server 200, and avoiding the data leakage of the server 200.
[0079] See also Figure 1 and Figure 3 In some implementations, the trusted space further stores a verification password, and before obtaining the certificate from the trusted space through the key management service, the secure communication method further includes:
[0080] Step 015: receiving a first password input by a user;
[0081] Step 016: Obtain the verification password from the trusted space;
[0082] Step 017: Determine whether the first password and the verification password are the same;
[0083] If yes, the step of obtaining the certificate from the trusted space through the key management service is performed.
[0084] Step 018: If not, refusing to obtain the certificate from the trusted space;
[0085] Specifically, in order to further ensure the security of the certificate, when running the key management service, password verification can also be set, such as displaying a password input interface, obtaining the first password entered by the user in the input interface, and then obtaining the verification password from the trusted space. If the first password entered is the same as the verification password pre-stored in the security area, the password verification is passed, indicating that the user of the robot 100 authorizes the robot to access the trusted space, and the robot 100 is allowed to obtain the certificate to communicate with the server 200. If the first password entered is not the same as the verification password pre-stored in the security area, the password verification fails, indicating that the user performing the password verification is not the user of the robot 100, and the robot 100 is denied to obtain the certificate from the trusted space to communicate with the server 200.
[0086] This prevents the robot 100 from being illegally controlled to run the key management service without the authorization of the user of the robot 100, thereby preventing the robot 100 from communicating with the server 200 through the trusted robot 100, further ensuring the communication security between the robot 100 and the server 200.
[0087] Optionally, in addition to using the trusted space to store security data such as certificates and verification passwords, the key management service can also implement encrypted storage through Java Keystore. Java Keystore is a mechanism for storing keys and certificates in the Java platform. It is an encrypted file used to store information such as private keys, public keys, and certificates. The main function of JavaKeystore is to protect sensitive information and prevent information leakage and tampering. The keys and certificates stored in the Java Keystore are encrypted and can only be accessed and used with the correct password (such as the verification password). Java Keystore supports multiple encryption algorithms, and users can choose different encryption algorithms and password strengths according to their needs.
[0088] In this way, the certificate is protected in all directions through both software (Java Keystore) and hardware (trusted space), thereby improving the security of the certificate.
[0089] See also Figure 1 and Figure 4 In some implementations, step 014: establishing a communication connection with the server 200 according to the certificate includes:
[0090] Step 0141: Send the certificate to the server 200 so that the server 200 verifies the certificate.
[0091] Step 0142: upon receiving the certificate verification success information sent by the server 200, a communication connection is established with the server 200.
[0092] Specifically, before establishing a connection with the server 200, the server 200 needs to verify the validity of the certificate of the robot 100. When the robot 100 sends a request to establish a connection, it will send the certificate to the server 200 together. Then the server 200 verifies the certificate, for example, verifies the certificate number, and determines whether the certificate is issued by the server 200. If it is issued by the server 200, it means that the robot 100 holding the certificate is credible, and it is determined that the verification is passed, that is, the certificate is valid. If it is not issued by the server 200, it means that the robot 100 holding the certificate is not credible, and it is determined that the verification fails, that is, the certificate is invalid. In the case of passing the certificate verification, the server 200 agrees to establish a communication connection with the robot 100, and the server 200 will send a message of successful certificate verification to the robot 100, thereby establishing a communication connection with the robot 100. In the case of failing the certificate verification, if the certificate is not issued by the server 200, the server 200 will refuse to establish a communication connection, preventing the server 200 from establishing a communication connection with the untrustworthy robot 100 and avoiding data leakage.
[0093] See also Figure 1 and Figure 5 In some embodiments, the certificate includes a key pair; the secure communication method further includes:
[0094] Step 018: Store the key pair in the trusted space of the robot 100 through the key management service;
[0095] After establishing the communication connection, the secure communication method further includes:
[0096] Step 019: Obtain the public key in the key pair from the trusted space;
[0097] Step 020: Encrypt the first original communication data using the public key to generate first encrypted communication data;
[0098] Step 021: Sending first encrypted communication data to the server, so that the server decrypts the first encrypted communication data using the private key in the certificate to obtain first original communication data;
[0099] After establishing the communication connection, the method further includes:
[0100] Step 022: upon receiving the second encrypted communication data sent by the server, obtaining a private key in the key pair from the trusted space, wherein the second encrypted communication data is obtained by the server encrypting the second original data using the public key in the certificate;
[0101] Step 023: Decrypt the second encrypted communication data using the private key to obtain the second original data.
[0102] Specifically, in order to ensure communication security, the encryption key pair can be stored in the trusted space during the communication process. Then, after the communication connection is established, the robot 100 can interact with the server 200 for data.
[0103] When the robot 100 sends data to the server 200, the robot 100 first obtains the public key of the key pair from the trusted space, and then encrypts the first original communication data to be transmitted by the public key, generates the first encrypted communication data, and sends it to the server 200. After receiving the first encrypted communication data, the server 200 will decrypt the first encrypted communication data according to the private key in the certificate (when establishing a communication connection, the robot 100 will send the certificate to the server 200), thereby obtaining the first original communication data before encryption.
[0104] When the server 200 sends data to the robot 100, the server 200 encrypts the second original communication data to be transmitted through the public key of the certificate, generates second encrypted communication data, and sends it to the robot 100. After receiving the second encrypted communication data, the robot 100 obtains the key pair from the trusted space, and then decrypts the second encrypted communication data according to the private key in the key pair, thereby obtaining the second original communication data before encryption.
[0105] In this way, the connection is established only after the certificate is used to ensure that the communicating parties are trustworthy, and then the data security during the data transmission process is guaranteed through the cooperation of public key encryption and private key decryption, thereby further improving the communication security between the robot 100 and the server 200.
[0106] See also Figure 1 and Figure 6 , a secure communication method of a server 200 according to another embodiment of the present application is applied to the server 200, the method comprising:
[0107] Step 031: receiving a certificate signing request sent by the robot 100, the certificate signing request including the identification of the robot 100 and a key pair generated by a public-private key generator;
[0108] Step 032: Verify whether the identification of the robot 100 is any preset identification; and
[0109] Step 033: If yes, generate a certificate based on the key pair and send the certificate to the robot 100;
[0110] Step 034: Establish a communication connection with the robot 100 according to the certificate;
[0111] Step 035: If no, refuse to issue the certificate.
[0112] Among them, for the description of step 031, step 032, step 033, step 034 and step 035, please refer to the description of step 011, step 012, step 013 and step 014, which will not be repeated here.
[0113] See also Figure 1 and Figure 7 In some embodiments, step 034 includes:
[0114] Step 0341: upon receiving the certificate sent by the robot 100, verify whether the certificate in the request is valid;
[0115] Step 0342: If so, send the certificate verification success information to robot 100 and establish a communication connection with robot 100.
[0116] Step 0343: If not, refuse to establish a communication connection with the robot 100.
[0117] Among them, the descriptions of step 0341, step 0342 and step 0343 can be found in the descriptions of step 0141 and step 0142, which will not be repeated here.
[0118] See also Figure 1 and Figure 8 In some implementations, the certificate includes a key pair; after establishing the communication connection, the secure communication method further includes:
[0119] Step 036: upon receiving the first encrypted communication data sent by the robot 100, the first encrypted communication data is decrypted by using the private key in the certificate to obtain the first original communication data, wherein the first encrypted communication data is obtained by the robot 100 encrypting the first original communication data by using the public key in the robot's trusted space;
[0120] After establishing the communication connection, the method further includes:
[0121] Step 037: Encrypt the second original communication data using the public key in the certificate to generate second encrypted communication data;
[0122] Step 038: Send the second encrypted communication data to the robot 100, so that the robot 100 decrypts the second encrypted communication data through the private key of the trusted space to obtain the second original communication data.
[0123] Among them, steps 036, 037 and 038 please refer to the descriptions of steps 018, 019, 020, 021, 022 and 023, which will not be repeated here.
[0124] See also Figure 1 and Fig. 9,To facilitate understanding of the secure communication method of the present application, the secure communication method is described below from an overall perspective. The secure communication method includes: Step S1: the robot 100 generates a certificate signing request;
[0125] Step S2: Send a certificate signing request to the server 200;
[0126] Step S3: The server 200 verifies the signature request;
[0127] Step S4: After verification, the server 200 issues a certificate;
[0128] Step S5: After the verification fails, the server 200 refuses to issue a certificate;
[0129] Step S6: After receiving the certificate, the robot 100 stores the certificate and the key pair in the trusted space;
[0130] Step S7: The robot 100 receives the password input by the user, and obtains the certificate from the trusted space after the password is verified;
[0131] Step S8: Send the certificate to the server 200;
[0132] Step S9: The server 200 verifies whether the certificate is valid;
[0133] Step S10: When the certificate is valid, send verification success information to the robot 100;
[0134] Step S11: establishing a communication connection between the robot 100 and the server 200;
[0135] Step S12: When the certificate is invalid, the server 200 refuses to establish a communication connection;
[0136] Step S13: The robot 100 obtains the public key of the key pair from the trusted space, encrypts the first original communication data using the public key, and generates the first encrypted communication data
[0137] Step S14: Sending the first encrypted communication data to the server 200;
[0138] Step S15: the server 200 decrypts the first encrypted communication data according to the private key in the certificate to obtain the first original communication data;
[0139] Step S16: the server 200 encrypts the second original communication data according to the public key in the certificate to obtain second encrypted communication data;
[0140] Step S17: Sending the second encrypted communication data to the robot 100;
[0141] Step S18: The robot 100 obtains the private key of the key pair from the trusted space, and decrypts the second encrypted communication data using the private key to obtain the second original communication data.
[0142] It can be understood that, for steps S1 to S18, please refer to the aforementioned description of the various steps of the secure communication method for the robot 100 and the aforementioned description of the various steps of the secure communication method for the server 200, which will not be repeated here.
[0143] See also Fig.10 In order to facilitate better implementation of the secure communication method of the robot 100 of the embodiment of the present application, the embodiment of the present application also provides a robot 100. The robot 100 may include a generation module 11, a sending module 12, a storage module 13 and a connection module 14. The generation module 11 is used to generate a certificate signing request according to the identification of the robot and the key pair generated by the public-private key generator; the sending module 12 is used to send a certificate signing request to the server to obtain a certificate from the server; the storage module 13 is used to store the certificate in the trusted space of the robot through a preset key management service when receiving the certificate sent by the server; and the connection module 14 is used to respond to the server, obtain the certificate from the trusted space through the key management service, and establish a communication connection with the server according to the certificate.
[0144] In some embodiments, the robot 100 further includes an input module, a first acquisition module, and a judgment module. The input module is used to receive a first password input by a user; the first acquisition module is used to obtain the verification password from the trusted space; the judgment module is used to determine whether the first password is the same as the verification password; if so, the step of obtaining the certificate from the trusted space through the key management service is performed.
[0145] In some implementations, the connection module 14 is specifically configured to send the certificate to the server so that the server verifies the certificate; and upon receiving the certificate verification success information sent by the server, establish a communication connection with the server.
[0146] In some embodiments, the storage module 13 is further used to store the key pair in the trusted space of the robot through the key management service. The robot 100 also includes a second acquisition module, a first encryption module and a data sending module, wherein the second acquisition module is used to obtain the public key in the key pair from the trusted space. The first encryption module is used to encrypt the first original communication data using the public key to generate the first encrypted communication data; the data sending module is used to send the first encrypted communication data to the server, so that the server decrypts the first encrypted communication data using the private key in the certificate to obtain the first original communication data.
[0147] The robot 100 further includes a third acquisition module and a first decryption module. The third acquisition module is used to acquire the private key in the key pair from the trusted space when receiving the second encrypted communication data sent by the server, wherein the second encrypted communication data is obtained by the server encrypting the second original data using the public key in the certificate; and the first decryption module is used to decrypt the second encrypted communication data using the private key to obtain the second original data.
[0148] See also Fig.11 In order to better implement the secure communication method of the server 200 of the embodiment of the present application, the embodiment of the present application also provides a server 200. The server 200 includes a receiving module 31 and a verification module 32. The receiving module 31 is used to receive a certificate signing request sent by the robot, and the certificate signing request includes the robot's identifier and a key pair generated by a public-private key generator; the verification module 32 is used to verify whether the robot's identifier is any preset identifier. If so, a certificate is generated according to the key pair, and the certificate is sent to the robot, and a communication connection is established with the robot according to the certificate.
[0149] In some embodiments, the verification module 32 is specifically used to verify whether the certificate is valid when receiving the certificate sent by the robot; if so, send a certificate verification success message to the robot and establish a communication connection with the robot.
[0150] In some embodiments, the server 200 further includes a second decryption module. The second decryption module is used to, upon receiving the first encrypted communication data sent by the robot, decrypt the first encrypted communication data using the private key in the certificate to obtain the first original communication data, wherein the first encrypted communication data is obtained by the robot encrypting the first original communication data using the public key in the trusted space of the robot.
[0151] In some embodiments, the server 200 further includes a second encryption module and an information sending module. The second encryption module is used to encrypt the second original communication data using the public key in the certificate to generate second encrypted communication data; the information sending module is used to send the second encrypted communication data to the robot, so that the robot decrypts the second encrypted communication data using the private key in the trusted space to obtain the second original communication data.
[0152] In the above text, the robot 100 and the server 200 are described from the perspective of functional modules in conjunction with the accompanying drawings. The functional modules can be implemented in hardware form, can be implemented in software form, or can be implemented in combination with hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware coding processor to execute, or can be executed by a combination of hardware and software modules in the coding processor. Optionally, 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, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in conjunction with its hardware.
[0153] Please refer again Figure 1 The robot 100 of the embodiment of the present application includes a processor 10, a memory 30 and a computer program, wherein the computer program is stored in the memory 30 and executed by the processor 10, and the computer program includes instructions for executing the security communication method applied to the robot 100 of any of the above-mentioned embodiments.
[0154] Please refer again Figure 1 The server 200 of the implementation mode of the present application includes a processor 210, a memory 220 and a computer program, wherein the computer program is stored in the memory 220 and executed by the processor 210, and the computer program includes instructions for executing the secure communication method applied to the server 200 of any of the above-mentioned implementation modes.
[0155] Please refer again Figure 1 The communication system 1000 of the embodiment of the present application is composed of a robot 100 and a server 200, and the robot 100 can communicate securely with the server 200.
[0156] See also Fig.12 When the robot 100 triggers a communication demand, the communication service (such as Fig.12 The Iot thingservice in the Fig.12 If the certificate already exists, the certificate can be obtained and a communication connection with the server 200 can be established based on the certificate. If the certificate does not exist, the device controls the service (such as Fig.12The secbot in the example above requests a certificate from PKI through the gRPC protocol, and sends a CSR generated based on its own identity and a randomly generated key pair to PKI. PKI can issue a certificate after verifying the identity. The device control service can store the certificate in the key management service (specifically, the trusted space corresponding to the key management service). At this time, the communication service can poll the existence of the certificate to obtain the certificate. The robot 100 can establish a two-way authentication (such as MTLS) communication connection with the server 200 through the certificate, such as establishing a communication connection based on the Message Queuing Telemetry Transport (MQTT) protocol, which can ensure that both parties in the communication are trustworthy, thereby ensuring the communication security between the robot 100 and the server 200.
[0157] See also Fig.13 The embodiment of the present application also provides a computer-readable storage medium 300 on which a computer program 310 is stored. When the computer program 310 is executed by a processor 320, the steps of the secure communication method of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.
[0158] In the description of this specification, the descriptions with reference to the terms "certain embodiments", "in an example", "exemplarily", etc., mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0159] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0160] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A robot secure communication method, characterized in that: include: Generate a certificate signing request based on the robot's identifier and a key pair generated by a public-private key generator; Sending a certificate signing request to a server to obtain a certificate from the server; Upon receiving the certificate sent by the server, storing the certificate in the trusted space of the robot through a preset key management service; and In response to the server, the certificate is obtained from the trusted space through the key management service, and a communication connection is established with the server according to the certificate.
2. The secure communication method according to claim 1, characterized in that: The trusted space also stores a verification password. Before obtaining the certificate from the trusted space through the key management service, the method further includes: receiving a first password input by a user; Obtaining the verification password from the trusted space; Determining whether the first password is the same as the verification password; If yes, the step of obtaining the certificate from the trusted space through the key management service is performed.
3. The secure communication method according to claim 1 or 2, characterized in that: The establishing a communication connection with the server according to the certificate comprises: Sending the certificate to the server so that the server verifies the certificate; When the certificate verification success information sent by the server is received, a communication connection is established with the server.
4. The secure communication method according to claim 3, characterized in that: The certificate includes: the key pair; The method further comprises: storing the key pair in a trusted space of the robot via the key management service; After establishing the communication connection, the method further includes: Obtaining a public key in the key pair from the trusted space; Encrypting the first original communication data using the public key to generate first encrypted communication data; Sending the first encrypted communication data to the server, so that the server decrypts the first encrypted communication data using the private key in the certificate to obtain the first original communication data; After establishing the communication connection, the method further includes: Upon receiving second encrypted communication data sent by the server, obtaining a private key in the key pair from the trusted space, wherein the second encrypted communication data is obtained by the server encrypting second original data using the public key in the certificate; The second encrypted communication data is decrypted using the private key to obtain the second original data.
5. A secure communication method for a server, characterized in that: The method comprises: Receiving a certificate signing request sent by the robot, wherein the certificate signing request includes an identifier of the robot and a key pair generated by a public-private key generator; Verifying whether the robot's identifier is any preset identifier; If yes, generating a certificate based on the key pair, and sending the certificate to the robot; A communication connection is established with the robot according to the certificate.
6. The secure communication method according to claim 5, characterized in that: The step of establishing a communication connection with the robot according to the certificate comprises: Upon receiving the certificate sent by the robot, verifying whether the certificate is valid; If so, a certificate verification success message is sent to the robot, and a communication connection is established with the robot.
7. The secure communication method according to claim 6, characterized in that: The certificate includes: the key pair; after establishing the communication connection, the method further includes: Upon receiving first encrypted communication data sent by the robot, decrypting the first encrypted communication data by using the private key in the certificate to obtain first original communication data, wherein the first encrypted communication data is obtained by the robot encrypting the first original communication data by using the public key in the trusted space of the robot; After establishing the communication connection, the method further includes: Encrypting the second original communication data using the public key in the certificate to generate second encrypted communication data; The second encrypted communication data is sent to the robot, so that the robot decrypts the second encrypted communication data by using the private key in the trusted space to obtain the second original communication data.
8. A robot, characterized in that: include: A generation module, used to generate a certificate signing request according to the robot's identifier and a key pair generated by a public-private key generator; A sending module, used for sending a certificate signing request to a server to obtain a certificate from the server; A storage module, configured to store the certificate in the trusted space of the robot through a preset key management service when receiving the certificate sent by the server; and A connection module is used to respond to the server, obtain the certificate from the trusted space through the key management service, and establish a communication connection with the server according to the certificate.
9. A server, characterized in that: include: A receiving module, used to receive a certificate signing request sent by the robot, wherein the certificate signing request includes an identifier of the robot and a key pair generated by a public-private key generator; The verification module is used to verify whether the identification of the robot is any preset identification. If yes, a certificate is generated according to the key pair, and the certificate is sent to the robot, and a communication connection is established with the robot according to the certificate.
10. A robot, characterized in that: include: Processor, memory; and A computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the secure communication method according to any one of claims 1 to 4.
11. A server, characterized in that: include: Processor, memory; and A computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the secure communication method according to any one of claims 5 to 7.
12. A non-volatile computer-readable storage medium containing a computer program, wherein when the computer program is executed by a processor, the processor executes the secure communication method according to any one of claims 1 to 7.