Data encryption transmission method and device based on cable, robot and medium
By deploying microcontrollers and memory in the communication cables of the robot system, generating and distributing communication key pairs, and encrypting and decrypting using the hardware resources of the main control and controlled ends, the problem of easy attack in communication cables is solved, and the communication cables are improved. Communication security and processing efficiency are achieved.
Patent Information
- Application Number
- CN202411105041.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-31
AI Technical Summary
Communication cables in robot systems are easily eavesdropped and tampered with by attackers, resulting in privacy data leakage and illegal control, and pose communication security risks.
Deploy microcontrollers and memory in the communication cable, generate communication key pairs by reading the stored root certificate, and distribute the public key to the master and private key to the controlled end, using the master and controlled end The hardware resources on the terminal are encrypted and decrypted to ensure the security of data transmission.
It improves the communication security of the robot system, prevents data leakage and illegal control, reduces the hardware requirements of the microcontroller, and improves processing efficiency and convenience.
Smart Images

Figure CN119232366A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robot communication technology, and in particular to a cable-based data encryption transmission method, device, robot and medium. Background Art
[0002] Communication cables are the carriers of data transmission. In the robot system architecture, the internal communication of the robot, such as the main control unit and the motion control unit, usually uses communication cables to transmit data. In this process, once an attacker infiltrates the communication link built by the above-mentioned communication cables, he can use the eavesdropping channel model to intercept the data transmitted on the communication link, and obtain private data by analyzing and forging the intercepted data. He may even send control instructions through the communication link to control the robot to perform dangerous actions such as injuring others or itself, thereby causing dangerous incidents. Summary of the invention
[0003] The embodiments of the present application provide a cable-based data encryption transmission method, device, robot and medium to ensure communication security and prevent incidents such as privacy data leakage and illegal control of robots.
[0004] The specific technical solutions provided by the embodiments of this application are as follows:
[0005] In a first aspect, an embodiment of the present application provides a cable-based data encryption transmission method, which is applied to a microcontroller deployed in the cable, wherein the cable also includes a memory storing a root certificate and a communication connection line, and the cable is used to connect a master terminal and a controlled terminal in a robot, and the method includes:
[0006] After determining that the cable is connected to both the master terminal and the controlled terminal, reading the root certificate in the memory;
[0007] Based on the root certificate, a communication key pair is generated for the master terminal and the controlled terminal to perform data encryption transmission;
[0008] The communication public key in the communication key pair is sent to the master terminal, and the communication private key in the communication key pair is sent to the controlled terminal, so that the master terminal and the controlled terminal perform data encryption transmission through the communication connection line based on the communication key pair.
[0009] In the above method of the present application, by deploying a microcontroller and a memory in the cable, the communication security between the master end and the controlled end is managed by the microcontroller, the communication security is improved, and the normal operation of the robot is ensured; further, a communication key pair for data encryption transmission between the master end and the controlled end is generated by the microcontroller, and the public key in the communication key pair is distributed to the master end, and the private key in the communication key pair is distributed to the controlled end, so as to realize data encryption transmission between the master end and the controlled end, and when sending data between the master end and the controlled end, the hardware resources of the master end and the controlled end are used to encrypt and decrypt the data to be transmitted, and the microcontroller does not participate in the specific encryption and decryption operations, and does not directly participate in data transmission, thereby improving processing efficiency and reducing the hardware requirements of the microcontroller.
[0010] In a possible implementation, the main control end is provided with a power supply interface, and after the cable is connected to the main control end, the method further includes:
[0011] authenticating the memory;
[0012] After determining that the identity authentication of the memory is passed, determining whether the encrypted transmission program file is abnormal based on the hash value of the encrypted transmission program file of the microcontroller;
[0013] If there is no abnormality, the interface driver is initialized, the interface state of the interface between the microprocessor and the memory, the first key transmission interface between the cable and the master control end, and the second key transmission interface between the cable and the controlled end are set to an enabled state, and the encryption transmission program file is loaded and run;
[0014] If there is an abnormality, or it is determined that the identity authentication of the memory has not passed, the encrypted transmission program file is deleted.
[0015] In the above method, after the microcontroller is powered on, the memory and the encrypted transmission program file are detected to ensure that the memory and the encrypted transmission program file have not been tampered with, thereby ensuring the security of the key generated by the subsequent operation of the encrypted transmission program file.
[0016] In a possible implementation, whether the cable is connected to the target end is determined in the following manner:
[0017] Obtaining the interface status of the target key transmission interface associated with the target end;
[0018] If it is determined that the interface state is an enabled state, determining that the cable is connected to the target end;
[0019] Among them, if the target end is the master end, the target key transmission interface associated with the target end is the first key transmission interface; if the target end is the controlled end, the target key transmission interface associated with the target end is the second key transmission interface.
[0020] In a possible implementation manner, sending the communication public key in the communication key pair to the master control end includes:
[0021] encrypting the communication public key in the communication key pair with the first session key and sending the encrypted key to the first key transmission interface of the master control end, wherein the first session key is generated by the master control end based on a preset key length and key generation method after authenticating the public key in the received first authentication key pair, and the first authentication key pair is generated by the microcontroller based on a first pseudo-random number;
[0022] The sending of the private key in the communication key to the controlled terminal includes:
[0023] The communication private key in the communication key pair is encrypted with a second session key and sent to the second key transmission interface of the controlled end, wherein the second session key is generated by the controlled end based on the key length and the key generation method after the public key in the received second authentication key pair is authenticated, and the second authentication key pair is generated by the microcontroller based on a second pseudo-random number.
[0024] In the above method, when the communication key is distributed, it is transmitted in an encrypted manner, which can prevent the communication key from being lost and causing the data to be intercepted and decrypted, etc., so as to ensure the security of communication.
[0025] In a possible implementation, the method further includes:
[0026] Start the key update timer;
[0027] When it is determined that the value of the key update timer reaches a threshold, generating a new communication key pair based on the root certificate;
[0028] The communication public key in the new communication key pair is encrypted with the first session key and sent to the first key transmission interface of the master terminal, and the communication private key in the new communication key pair is encrypted with the second session key and sent to the second key transmission interface of the controlled terminal;
[0029] Restart the key update timer.
[0030] In the above method, the communication key pair can be updated irregularly or periodically, thereby improving communication security, preventing eavesdropping on channels and / or other eavesdropping methods, analyzing patterns after intercepting data to crack data, causing information leakage, or being illegally controlled, etc.
[0031] In a possible implementation, generating a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate includes:
[0032] Based on the root certificate, generating at least two sets of communication key pairs;
[0033] encrypting a first communication public key in a communication key pair of one of the at least two groups and a first communication private key in a communication private key pair of another of the at least two groups with the first session key and sending the encrypted keys to the master control end, wherein the first communication public key is used by the master control end to encrypt data to be transmitted, and the first communication private key is used by the master control end to sign a summary of the encrypted data to be transmitted;
[0034] The first communication private key in one of the communication key pairs and the second communication public key in the other communication key pair are encrypted with the second session key and sent to the controlled end, wherein the first communication private key is used by the controlled end to decrypt the encrypted data that has passed the signature verification, and the second communication public key is used by the controlled end to decrypt the signature of the received data.
[0035] In the above method, communication security is further guaranteed through data signing and signature verification.
[0036] In a possible implementation, the memory is an electrically erasable programmable read-only memory.
[0037] In the above method, the memory adopts a read-only memory to ensure that the root file is not lost when the power is off, thereby improving non-volatility, reliability and security.
[0038] In a second aspect, an embodiment of the present application provides a cable-based data encryption transmission device, which is applied to a microcontroller deployed in the cable, wherein the cable also includes a memory storing a root certificate and a communication connection line, and the cable is used to connect a master terminal and a controlled terminal in a robot, and the device includes:
[0039] A reading module, configured to read the root certificate in the memory after determining that the cable is connected to both the master terminal and the controlled terminal;
[0040] A key generation module, used to generate a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate;
[0041] The key distribution module is used to send the communication public key in the communication key pair to the master terminal, and to send the communication private key in the communication key pair to the controlled terminal, so that the master terminal and the controlled terminal can perform data encryption transmission through the communication connection line based on the communication key pair.
[0042] In a possible implementation, the main control end is provided with a power supply interface, and after the cable is connected to the main control end, the reading module is further used to:
[0043] authenticating the memory;
[0044] After determining that the identity authentication of the memory is passed, determining whether the encrypted transmission program file is abnormal based on the hash value of the encrypted transmission program file of the microcontroller;
[0045] If there is no abnormality, the interface driver is initialized, the interface state of the interface between the microprocessor and the memory, the first key transmission interface between the cable and the master control end, and the second key transmission interface between the cable and the controlled end are set to an enabled state, and the encryption transmission program file is loaded and run;
[0046] If there is an abnormality, or it is determined that the identity authentication of the memory has not passed, the encrypted transmission program file is deleted.
[0047] In a possible implementation, the reading module is specifically configured to determine whether the cable is connected to the target end in the following manner:
[0048] Obtaining the interface status of the target key transmission interface associated with the target end;
[0049] If it is determined that the interface state is an enabled state, determining that the cable is connected to the target end;
[0050] Among them, if the target end is the master end, the target key transmission interface associated with the target end is the first key transmission interface; if the target end is the controlled end, the target key transmission interface associated with the target end is the second key transmission interface.
[0051] In a possible implementation, the key distribution module is specifically used to:
[0052] encrypting the communication public key in the communication key pair with the first session key and sending the encrypted key to the first key transmission interface of the master control end, wherein the first session key is generated by the master control end based on a preset key length and key generation method after authenticating the public key in the received first authentication key pair, and the first authentication key pair is generated by the microcontroller based on a first pseudo-random number;
[0053] The communication private key in the communication key pair is encrypted with a second session key and sent to the second key transmission interface of the controlled end, wherein the second session key is generated by the controlled end based on the key length and the key generation method after the public key in the received second authentication key pair is authenticated, and the second authentication key pair is generated by the microcontroller based on a second pseudo-random number.
[0054] In a possible implementation, the key distribution module is further used to:
[0055] Start the key update timer;
[0056] When it is determined that the value of the key update timer reaches a threshold, generating a new communication key pair based on the root certificate;
[0057] The communication public key in the new communication key pair is encrypted with the first session key and sent to the first key transmission interface of the master terminal, and the communication private key in the new communication key pair is encrypted with the second session key and sent to the second key transmission interface of the controlled terminal;
[0058] Restart the key update timer.
[0059] In a possible implementation, the key generation module is specifically used to:
[0060] Based on the root certificate, generating at least two sets of communication key pairs;
[0061] encrypting a first communication public key in a communication key pair of one of the at least two groups and a first communication private key in a communication private key pair of another of the at least two groups with the first session key and sending the encrypted keys to the master control end, wherein the first communication public key is used by the master control end to encrypt data to be transmitted, and the first communication private key is used by the master control end to sign a summary of the encrypted data to be transmitted;
[0062] The first communication private key in one of the communication key pairs and the second communication public key in the other communication key pair are encrypted with the second session key and sent to the controlled end, wherein the first communication private key is used by the controlled end to decrypt the encrypted data that has passed the signature verification, and the second communication public key is used by the controlled end to decrypt the signature of the received data.
[0063] In a possible implementation, the memory is an electrically erasable programmable read-only memory.
[0064] In a third aspect, an embodiment of the present application provides a robot, comprising: a master terminal, a controlled terminal, and a cable connecting the master terminal and the controlled terminal, wherein the cable comprises:
[0065] A memory for storing a root certificate, a computer program or instructions;
[0066] A microcontroller is used to execute the computer program or instructions in the memory so that any method in the first aspect described above is performed.
[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. When instructions in the storage medium are executed by a processor, the processor is enabled to execute any one of the methods described in the first aspect.
[0068] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program code, when the computer program code is run on a computer, enables the computer to execute the method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of the working principle of an eavesdropping channel model in two-end communication in the related art;
[0070] Figure 2 This is a schematic diagram of an application scenario of an optional cable-based data encryption transmission method in an embodiment of the present application;
[0071] Figure 3 A schematic diagram of an eavesdropping channel attack of a humanoid robot in the related art;
[0072] Figure 4 A schematic diagram of a process of a cable-based data encryption transmission method in an embodiment of the present application;
[0073] Figure 5 A schematic diagram of a two-end communication system architecture in an embodiment of the present application;
[0074] Figure 6 A schematic diagram of software configuration of a two-end communication system in some embodiments of the present application;
[0075] Figure 7 A schematic diagram of a process for determining a first session key in an embodiment of the present application;
[0076] Figure 8 A schematic diagram of a process for determining a second session key in an embodiment of the present application;
[0077] Fig. 9 A schematic diagram of a key update method in an embodiment of the present application;
[0078] Fig.10 This is a flow chart of another cable-based data encryption transmission method in an embodiment of the present application;
[0079] Fig.11 Schematic diagram of the logical architecture of a cable-based data encryption transmission device in an embodiment of the present application. DETAILED DESCRIPTION
[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0081] It should be noted that the terms "first", "second", "third", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0082] The following is a brief introduction to the design concept of the embodiments of the present application.
[0083] The present application relates to the field of robot communication technology, and mainly to a cable-based data encryption transmission method, device, robot and medium.
[0084] At present, in the two-end communication process, the transmitter encodes the information source through an encoder, and then transmits the encoded information source to the receiver through the main channel (such as a communication cable). The receiver then decodes the received encoded information source through a decoder to obtain the information source sent by the transmitter, so that the legitimate user obtains the information source. In the related art, in the above two-end communication process, such as Figure 1 As shown, an eavesdropping user can use the eavesdropping channel model to destroy the communication cables, or intercept the main channel data in other ways, that is, to create an eavesdropping channel, intercept the encoded source transmitted in the main channel through the eavesdropping channel, and then intercept the data by analyzing and decrypting, obtain privacy-sensitive data, or send illegal data by copying, forging, etc., illegally control terminal devices, and induce users to disclose private data.
[0085] In the robot system architecture, the internal communication of the robot usually uses communication cables to transmit data, such as control instructions, environmental data, etc. For example, in the humanoid robot system architecture, it is mainly divided into two parts, the "brain" and the "cerebellum", and the two parts generally use wired communication. This communication method can hardly avoid attacks on the main channel by eavesdropping on the channel model analysis and forging communication data packets. Once an attack occurs, it may lead to the leakage of privacy information such as images and 3D maps in the user's environment, or it may also cause the robot to be controlled to perform actions that hurt others or itself, resulting in dangerous events.
[0086] In view of this, in order to solve the communication security problem existing in the related art of using communication cables for data transmission, an embodiment of the present application provides a cable-based data encryption transmission method, which is applied to a microcontroller deployed in the cable, and the cable also includes a memory storing a root certificate and a communication connection line, and the cable is used to connect the master end and the controlled end in the robot. In the embodiment of the present application, after determining that the cable is connected to both the master end and the controlled end, the root certificate in the memory is read; based on the root certificate, a communication key pair for data encryption transmission between the master end and the controlled end is generated; the communication public key in the communication key pair is sent to the master end, and the communication private key in the communication key pair is sent to the controlled end, so that the master end and the controlled end can perform data encryption transmission through the communication connection line based on the communication key pair.
[0087] In this way, by deploying a microcontroller and a memory in the cable, the communication security between the master end and the controlled end can be managed by the microcontroller, thereby improving the communication security and ensuring the normal operation of the robot; further, a communication key pair for data encryption transmission between the master end and the controlled end is generated by the microcontroller, and the public key in the communication key pair is distributed to the master end, and the private key in the communication key pair is distributed to the controlled end. When data is sent between the master end and the controlled end, the hardware resources of the master end and the controlled end are used to encrypt and decrypt the data to be transmitted, and the microcontroller does not participate in specific encryption and decryption operations, does not directly participate in data transmission, and does not need to be connected to the Internet, thereby improving processing efficiency, flexibility and convenience.
[0088] A cable-based data encryption transmission method provided in an embodiment of the present application is applicable to robots, such as movable intelligent devices, multi-legged robots, mobile robots, humanoid / humanoid robots, bipedal robots, bionic humans, etc.
[0089] The following is a schematic diagram of an application scenario of an optional cable-based data encryption transmission method in an embodiment of the present application, in conjunction with the accompanying drawings. Figure 2 .like Figure 2As shown, the application scenario includes a humanoid robot 10, which includes a master end that can be regarded as a "brain", a controlled end that can be regarded as a "cerebellum", and an execution end that can be regarded as a "limb", wherein the execution end can also be regarded as a controlled end of the controlled end, and the controlled end can be regarded as a master end of the execution end. The above-mentioned master end, controlled end and execution end are usually independent of each other, and data is transmitted through a communication interface.
[0090] like Figure 3 As shown, the "brain" of the humanoid robot can be understood as the perception and decision-making system of the humanoid robot, the "cerebellum" of the humanoid robot can be understood as the motion execution system of the humanoid robot, and the "limbs" of the humanoid robot can be understood as the end effector of the humanoid robot for perceiving the environment and executing actions.
[0091] Specifically, the user issues a task to the humanoid robot 10, such as Figure 3 As shown, the humanoid robot 10 senses the environment through sensors such as radars deployed in its "limbs", acquires images and radar data, and feeds the images and radar data back to the "cerebellum". As the motion execution system of the humanoid robot, the "cerebellum" can perform data noise reduction and other processing on the received images and radar data, and feed the processed images and radar data back to the "brain". As the perception and decision-making system of the humanoid robot, the "brain" can build a topographic map of the environment where the humanoid robot is located based on the processed images and radar data, and make decisions and decompose tasks based on the topographic map and the received tasks, and convert them into control instruction data that can control the "cerebellum". The "cerebellum" performs motion planning, action balance and other calculations based on the control instruction data, and finally converts them into motor control instructions that can control the motors of the "limbs". The "limbs" drive the motors based on the motor control instructions to perform corresponding actions and complete tasks.
[0092] During the execution process, once an attacker infiltrates the communication link between the "brain" and the "cerebellum", he or she can use the eavesdropping channel model to intercept data for analysis, forge instructions, obtain privacy data such as the environment, or control the "cerebellum" to perform dangerous actions.
[0093] In some embodiments of the present application, the aforementioned cable equipped with a microcontroller and a memory is used between the "brain" and the "cerebellum", and the communication security between the "brain" and the "cerebellum" is achieved with the help of the microcontroller of the cable; the key generation and distribution of the master end and the controlled end are realized by the microcontroller, and when data is sent between the master end and the controlled end, the hardware resources of the master end and the controlled end are used to encrypt and decrypt the data to be transmitted, and the microcontroller does not participate in the specific encryption and decryption operations, thereby improving the processing efficiency and reducing the hardware requirements of the microcontroller.
[0094] Of course, the method provided in the embodiment of the present application is not limited to Figure 2 , Figure 3 The application scenario shown can also be used in other possible application scenarios, which are not limited in the embodiments of the present application.
[0095] After introducing the application scenarios of the embodiments of the present application and the working principle of implementing eavesdropping using the eavesdropping channel model, the preferred implementation modes of the present application are further described in detail below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.
[0096] See also Figure 4 As shown, the embodiment of the present application provides a cable-based data encryption transmission method, which is applied to a microcontroller deployed in a cable. The cable also includes a memory storing a root certificate and a communication connection line. The cable is used to connect a master end and a controlled end in a robot. The method may specifically include but is not limited to the following process:
[0097] Step 400: after determining that the cable is connected to both the master terminal and the controlled terminal, read the root certificate in the memory;
[0098] Step 410: Generate a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate;
[0099] Step 420: Send the communication public key in the communication key pair to the master end, and send the communication private key in the communication key pair to the controlled end, so that the master end and the controlled end perform data encryption transmission through the communication connection line based on the communication key pair.
[0100] In some embodiments of this application, refer to Figure 5 As shown, a two-end communication system may include a master end, a cable and a controlled end, wherein:
[0101] The main control end may include a central processing unit and a communication unit; wherein the communication unit may include a physical layer chip, a power supply interface and a key transmission interface; the physical layer chip may be used to realize robot communication and data transmission, and is responsible for converting data into signals that can be transmitted through physical media; the power supply interface may be used to provide power to the cable; the key transmission interface may be used to receive a key sent by the microcontroller of the cable for data encryption transmission between the controlled end and the controlled end;
[0102] The controlled end may include a central processing unit and a communication unit; wherein the communication unit may include a physical layer chip and a key transmission interface; compared with the communication unit of the control end, the communication unit of the controlled end may not include a power supply interface, and the functions of the physical layer chip and the key transmission interface are the same as those of the physical layer chip and the key transmission interface of the control end;
[0103] The cable may include a microcontroller, a memory and a communication connection line; wherein the memory may be used to store root certificates and computer programs or instructions, as well as data associated with data encryption transmission; the communication connection line may be used to connect to the physical layer chips of the two end interfaces of the master end and the controlled end to realize physical layer data transmission; the microcontroller is connected to the power supply interface of the master end to obtain power, and is connected to the key transmission interface of the master end and the controlled end, and is connected to the memory; the encryption transmission program file is burned or installed online in the microcontroller, which is used for device authentication, root certificate management, and key pair generation and distribution. Specifically, the microcontroller may be used to read the root certificate in the memory after determining that the cable is connected to both the master end and the controlled end, generate a communication key pair for data encryption transmission between the master end and the controlled end based on the root certificate, send the communication public key in the communication key pair to the master end, and send the communication private key in the communication key pair to the controlled end, so that the master end and the controlled end perform data encryption transmission through the communication connection line based on the communication key pair.
[0104] In some embodiments of the present application, data transmission can be carried out using a high-speed serial port, network or CAN bus communication method depending on the model of the physical layer chip.
[0105] In some embodiments of this application, refer to Figure 6 As shown, based on Figure 5 The system architecture shown, Figure 6 Schematic diagram of software configuration in some embodiments of the present application. Figure 6 As shown, after the cable is successfully connected, the microcontroller (MCU) is connected to the power supply interface, and the main control end powers the microcontroller. After the microcontroller is powered on, the boot program is started, and a power-on self-test (Power On Self Test, POST) is performed to authenticate the memory, such as detecting whether the memory can be found, such as detecting whether the memory can be found through the API endpoint, and detecting whether the serial number of the memory is consistent with the preset memory serial number.
[0106] If it is determined that the memory can be found and the serial number of the found memory is consistent with the preset memory serial number, it is determined that the identity authentication of the memory is passed, and then, based on the hash value of the encrypted transmission program file of the microcontroller, it is determined whether the encrypted transmission program file is abnormal, wherein, refer to Figure 6 As shown, when the microcontroller executes the encrypted transmission program file (also called the MCU control program), the microcontroller can have the functions of key generation, key update, and key distribution; the master end and the controlled end are installed with an interface driver, based on which the master end and the controlled end can have access security, such as key reading, and communication security, such as communication encryption and decryption and data signing.
[0107] Specifically, the encryption transmission program file is hashed to obtain a target hash value, and the target hash value is compared with the verification hash value. If the two are consistent, it means that there is no abnormality in the encryption transmission program file. Then, the interface driver is initialized, the interface status of the interface between the microprocessor and the memory, the first key transmission interface between the cable and the main control end, and the second key transmission interface between the cable and the controlled end are set to an enabled state, and the encryption transmission program file is loaded and run; at this time, the boot program transfers control of the microcontroller to the encryption transmission program.
[0108] If the target hash value is compared with the verification hash value and it is determined that the two are different, it means that there is an abnormality in the encryption transmission program file. The encryption transmission program file is deleted to prevent the encryption transmission program file from being leaked or tampered with. At this time, only standard communication can be carried out between the master end and the controlled end through the standard physical layer chip, and it does not have a security authentication function, that is, it does not have an encryption transmission function.
[0109] If it is determined that the identity authentication of the storage device has not passed, such as the storage device is not found, or the storage device is found but the serial number of the found storage device is inconsistent with the preset storage serial number, the encrypted transmission program file is deleted to prevent the risk of program leakage and tampering.
[0110] In some embodiments of the present application, after deleting the encrypted transmission program file, that is, executing the program self-destruction operation, the encrypted transmission program file can be re-burned into the microcontroller through a burning tool, or the cable-based encrypted transmission and security authentication functions can be restored by replacing the microcontroller and the memory.
[0111] In some embodiments of the present application, before executing step 400, whether the cable and the target end are connected can be determined in the following manner, and the interface status of the target key transmission interface associated with the target end can be obtained; if the interface status is determined to be enabled, it is determined that the cable and the target end are connected, wherein if the target end is a master control end, the target key transmission interface associated with the target end is a first key transmission interface, and if the target end is a controlled end, the target key transmission interface associated with the target end is a second key transmission interface.
[0112] In some embodiments of this application, refer to Figure 7 As shown, after the microcontroller determines that the cable is connected to both the master end and the controlled end, before executing step 400, the first session key used for subsequent key transmission with the master end can also be obtained through part or all of the following process to prevent:
[0113] Step 700: The microcontroller generates a first authentication key pair based on a first pseudo-random number.
[0114] The first pseudo-random number may be generated by a pseudo-random number generator, such as by using a Monte Carlo algorithm.
[0115] Step 701: The microcontroller sends the public key in the first authentication key pair to the main control end.
[0116] In some embodiments, when executing step 701, the microcontroller encrypts the public key in the first authentication key pair using a private encryption method and sends it to the first key transmission interface connected to the main control end and the cable. Specifically, a symmetric encryption algorithm (Advanced Encryption Standard, AES) key with a preset number of bits is randomly generated, such as a 128-bit AES key, the first half of the aforementioned public key is spliced with the randomly generated AES key, and then the spliced key is encrypted by AES with a fixed key to obtain a first ciphertext, the second half of the aforementioned public key is encrypted with the randomly generated AES key to obtain a second ciphertext, and the data obtained by merging the first ciphertext and the second ciphertext is sent to the main control end, wherein the merging method can be to splice the first ciphertext and the second ciphertext.
[0117] Step 702: The master control end authenticates the public key in the received first authentication key pair.
[0118] In some embodiments, when executing step 702, the master end uses the aforementioned private encryption method to decrypt the public key in the received first authentication key pair. If the decryption can be successfully performed, it is determined that the public key authentication in the received first authentication key pair is passed. If the decryption fails, it is determined that the public key authentication in the received first authentication key pair has failed, wherein the fixed key is pre-stored in the interface driver of the master end.
[0119] Specifically, when executing step 702, the main control end splits the public key in the first authentication key pair received from the microcontroller into a third ciphertext and a fourth ciphertext, and decrypts the third ciphertext with a fixed key. If the decryption is successful, the AES key randomly generated by the microcontroller and the first half of the public key can be obtained. Then, the fourth ciphertext is decrypted with the decrypted AES key. If the decryption is successful, the second half of the public key can be obtained. The first half of the decrypted public key is then concatenated with the second half of the public key to obtain the public key sent by the microcontroller, thereby achieving authentication of the public key.
[0120] Step 703: After determining that the public key in the received first authentication key pair has passed authentication, the master control end generates a first session key based on a preset key length and key generation method.
[0121] In some embodiments of the present application, the key length may be 128 bits, and the encryption method may be AES. Then, when executing step 703, a key with a key length of 128 bits is generated by an AES key generator, which is the first session key.
[0122] Step 704: The master end encrypts the first session key with the public key in the first authentication key pair and sends it to the microcontroller.
[0123] Step 705: The microcontroller uses the private key in the first authentication key pair to decrypt the received encrypted first session key to obtain the first session key.
[0124] In the specific implementation, when executing step 705, the microcontroller uses the private key in the first authentication key pair to decrypt the received encrypted first session key. If the decryption is successful, the first session key can be obtained. In this way, the public key in the first authentication key pair is used to encrypt and transmit the session key used for the subsequent session between the main control end and the microcontroller, thereby ensuring the communication security of the subsequent session process; if the decryption fails, it means that the received data is abnormal and can be directly discarded.
[0125] Similarly, in the specific embodiment, see Figure 8 As shown, after the microcontroller determines that the cable is connected to both the master end and the controlled end, before executing step 400, the second session key used for subsequent key transmission with the controlled end can also be obtained through part or all of the following processes:
[0126] Step 800: The microcontroller generates a second authentication key pair based on a second pseudo-random number.
[0127] The second pseudo-random number may also be generated by a pseudo-random number generator, such as by using a Monte Carlo algorithm.
[0128] Step 801: The microcontroller sends the public key in the second authentication key pair to the controlled end.
[0129] In some embodiments, when executing step 801, the microcontroller encrypts the public key in the second authentication key pair using a private encryption method and sends it to the second key transmission interface connected to the controlled terminal and the cable. The specific encryption method of the private encryption method is detailed in the above content and will not be repeated here.
[0130] Step 802: The controlled end authenticates the public key in the received second authentication key pair.
[0131] In some embodiments, when executing step 802, the controlled end uses the aforementioned private encryption method to decrypt the public key in the received second authentication key pair. If the decryption is successful, it is determined that the public key authentication in the received first authentication key pair is passed. If the decryption fails, it is determined that the public key authentication in the received first authentication key pair fails, wherein the fixed key is pre-stored in the interface driver of the controlled end. Specifically, when executing step 802, after receiving the public key in the second authentication key pair sent by the microcontroller, the controlled end uses a method similar to the aforementioned step 702 to process to verify the public key in the received second authentication key pair.
[0132] Step 803: After determining that the public key in the received second authentication key pair has passed authentication, the controlled end generates a second session key based on a preset key length and key generation method.
[0133] In some embodiments of the present application, the key length can still be selected as 128 bits, and the encryption method can still use AES. Then, when executing step 803, a key with a key length of 128 bits can be generated by an AES key generator, that is, the second session key.
[0134] Step 804: The controlled end encrypts the second session key with the public key in the second authentication key pair and sends it to the microcontroller.
[0135] Step 805: The microcontroller uses the private key in the second authentication key pair to decrypt the received encrypted second session key to obtain the second session key.
[0136] In some embodiments of the present application, the microcontroller uses the private key in the second authentication key pair to decrypt the received encrypted second session key when executing step 805. If the decryption is successful, the second session key can be obtained. In this way, the public key in the second authentication key pair is used to encrypt and transmit the session key used for subsequent sessions between the controlled end and the microcontroller, thereby ensuring the communication security of subsequent session processes. If the decryption fails, it means that there is an abnormality in the received data and it can be directly discarded.
[0137] In this way, the session keys between the master end and the microcontroller, and between the controlled end and the microcontroller are obtained. Then, in some embodiments of the present application, when executing step 420, the communication public key in the communication key pair can be encrypted with the first session key and sent to the first key transmission interface of the master end, wherein the first session key is generated by the master end based on the preset key length and key generation method after the public key in the received first authentication key pair is authenticated, and the first authentication key pair is generated by the microcontroller based on the first pseudo-random number; and the communication private key in the communication key pair is encrypted with the second session key and sent to the second key transmission interface of the controlled end, wherein the second session key is generated by the controlled end based on the key length and the aforementioned key generation method after the public key in the received second authentication key pair is authenticated, and the second authentication key pair is generated by the microcontroller based on the second pseudo-random number.
[0138] When distributing the communication key, the communication key is transmitted in an encrypted manner to prevent the communication key from being lost and causing the data to be intercepted, decrypted, etc. In some embodiments of the present application, when executing step 400, a communication key pair can be generated based on the root certificate using a public key encryption (Rivest-Shamir-Adleman, RSA, also called asymmetric (key) encryption) key generator.
[0139] In some embodiments of the present application, after the master end receives the communication public key in the communication key pair encrypted with the first session key and distributed by the microcontroller, the first session key can be used to decrypt the received communication public key encrypted with the first session key, thereby obtaining the communication public key, and based on the communication public key, the data to be transmitted can be encrypted, and then the encrypted data is sent to the controlled end through the cable; and the controlled end, after receiving the communication private key in the communication key pair encrypted with the second session key and distributed by the microcontroller, can use the second session key to decrypt the received communication private key encrypted with the second session key, thereby obtaining the communication private key, and based on the communication private key, the encrypted data received from the master end can be decrypted to obtain the specific instructions issued by the master end.
[0140] In some embodiments of the present application, after executing step 420, the communication key pair can be updated irregularly or periodically, and the new communication key pair can be transmitted to the master end and the controlled end using the aforementioned encryption, thereby preventing eavesdropping on the channel and / or other eavesdropping methods, analyzing the rules after intercepting data to crack data, causing information leakage, or being illegally controlled, etc.
[0141] For details, see Fig. 9 As shown, after the microcontroller distributes the generated communication key pair to the master terminal and the controlled terminal, the key update function can also be implemented by executing the following steps:
[0142] Step 900: Start a key update timer;
[0143] Step 910: When it is determined that the value of the key update timer reaches a threshold, a new communication key pair is generated based on the root certificate;
[0144] Step 920: encrypt the communication public key in the new communication key pair with the first session key and send it to the first key transmission interface of the master end, and encrypt the communication private key in the new communication key pair with the second session key and send it to the second key transmission interface of the controlled end;
[0145] Step 930: Restart the key update timer.
[0146] In some embodiments of the present application, in order to improve the communication security between the master terminal and the controlled terminal, when executing step 410, refer to Fig.10 As shown, the following steps may also be included but are not limited to:
[0147] Step 4101: Generate at least two communication key pairs based on the root certificate;
[0148] Step 4102: encrypting the first communication public key in the communication key pair of one of the at least two groups and the first communication private key in the communication private key pair of the other of the at least two groups with the first session key and sending them to the master control end, wherein the first communication public key is used by the master control end to encrypt the data to be transmitted, and the first communication private key is used by the master control end to sign the summary of the encrypted data to be transmitted;
[0149] Step 4103: Encrypt the first communication private key in one of the aforementioned communication key pairs and the second communication public key in the aforementioned other communication key pair with the second session key and send them to the controlled end, wherein the first communication private key is used by the controlled end to decrypt the encrypted data that has passed the signature verification, and the second communication public key is used by the controlled end to decrypt the signature of the received data.
[0150] For example, taking the generation of two groups of communication key pairs based on the root certificate as an example, the data encryption transmission between the master terminal and the controlled terminal is described in detail.
[0151] First, execute step 4101, the microcontroller randomly generates two sets of communication key pairs based on the root certificate, recorded as communication key pair 1 and communication key pair 2, where communication key pair 1 includes public key 1 and private key 1, and communication key pair 2 includes public key 2 and private key 2.
[0152] Then, when executing step 4102, the microcontroller can encrypt the public key 1 and the private key 2 with the first session key and send them to the master end, and encrypt the private key 1 and the public key 2 with the second session key and send them to the controlled end.
[0153] After receiving the encrypted public key 1 and private key 2, the master end uses the first session key to decrypt the encrypted public key 1 and private key 2 to obtain public key 1 and private key 2; after receiving the encrypted private key 1 and public key 2, the controlled end uses the second session key to decrypt the encrypted private key 1 and public key 2 to obtain private key 1 and public key 2. Specifically, the master end and the controlled end encrypt with the public key respectively, and after signing with the signature algorithm, secure data transmission is performed through the communication connection of the cable.
[0154] In some embodiments of the present application, when the master end has data to be transmitted, the master end encrypts the data with public key 1 to obtain ciphertext data, extracts the summary of the ciphertext data through algorithms such as hash, SHA1, SHA2, and encrypts the summary with private key 2 as a data signature, and then sends the ciphertext data and the data signature to the controlled end through the communication connection line of the cable.
[0155] After the controlled end receives the ciphertext data and data signature, it uses public key 2 to decrypt the data signature to obtain verification data, and extracts the summary of the received ciphertext data through hash, SHA1, SHA2 and other algorithms, and compares the extracted summary with the verification data to verify whether the received ciphertext data has been tampered with, that is, signature verification; if the signature verification passes, it means that the control end is a trusted device, and then the ciphertext data is decrypted with private key 1 to obtain the data sent by the control end. Figure 2 , Figure 3 As shown, after the humanoid robot "Xiao Cerebellum" obtains the data, since the signature verification is passed, it means that the sender of the data, that is, "Xiao Cerebellum", is a trustworthy device. Therefore, the corresponding motor control instructions are issued according to the data to drive the motor to perform the action.
[0156] In other embodiments of the present application, when the controlled end has data to be transmitted, the controlled end encrypts the data with public key 2 to obtain ciphertext data, extracts the summary of the ciphertext data through algorithms such as hash, SHA1, SHA2, and encrypts the summary with private key 1 as a data signature, and then sends the ciphertext data and the data signature to the master end through the communication connection line of the cable.
[0157] After the master receives the ciphertext data and data signature, it uses public key 1 to decrypt the data signature to obtain verification data, and extracts the summary of the received ciphertext data through hash, SHA1, SHA2 and other algorithms, and compares the extracted summary with the verification data to verify whether the received ciphertext data has been tampered with, that is, signature verification; if the signature verification passes, it means that the controlled end is a trusted device, and then the ciphertext data is decrypted with private key 2 to obtain the data sent by the controlled end to the master. Figure 2 , Figure 3 As shown, after the humanoid robot "brain" obtains the data, since the signature verification is passed, it means that the sender of the data, that is, the "brain", is a trustworthy device. Therefore, decisions are made based on the data.
[0158] Of course, the microcontroller can also use the first session key to encrypt private key 1 and public key 2 and send them to the master end, and use the second session key to encrypt public key 1 and private key 2 and send them to the controlled end, where the public key is used to encrypt and decrypt data, and the private key is used to encrypt and decrypt data, which is not specifically limited in this application.
[0159] Compared with a method in the related art that ensures communication security through a security chip, the security chip mainly includes a cryptographic processor, a permanent memory and a multi-functional memory, as well as external secure input and output, wherein the cryptographic processor has independent execution capability, can independently complete the authentication of the dual-end interface, and encrypt and decrypt the data to be transmitted, thereby achieving communication security; the cable-based data encryption transmission method in the present application generates a communication key pair for data encryption transmission between the master end and the controlled end through a microcontroller deployed in the cable, and distributes the communication key to the master end and the controlled end. When data is transmitted between the master end and the controlled end, the hardware resources of the master end and the controlled end are used to encrypt and decrypt the data to be transmitted, and the microcontroller does not participate in the specific encryption and decryption operations, thereby improving processing efficiency and reducing the hardware requirements of the microcontroller. In addition, the data encryption transmission method in the present application can be used off-grid, which improves the convenience of the solution. The encryption transmission program file in the microcontroller can be updated through networking or burning, etc., which is more flexible.
[0160] Furthermore, since the microcontroller of the cable does not directly participate in data transmission, a specific communication method can be selected according to the model of the physical layer chip of the master end and the controlled end, such as high-speed serial port, network or CAN bus communication method, so that the data transmission rate is not limited by the transmission rate of the security chip, thereby improving the transmission rate. Figure 2 , Figure 3 The humanoid robot shown has a communication bandwidth of more than 100 Mbps. The cable in this application can perfectly meet the communication requirements of the humanoid robot and has low cost.
[0161] Based on the same inventive concept, see Fig.11 As shown, in an embodiment of the present application, a cable-based data encryption transmission device is provided, which is applied to a microcontroller deployed in the cable, wherein the cable further includes a memory storing a root certificate and a communication connection line, and the cable is used to connect a master terminal and a controlled terminal in a robot, and the device includes:
[0162] A reading module 1110, configured to read the root certificate in the memory after determining that the cable is connected to both the master terminal and the controlled terminal;
[0163] The key generation module 1120 is used to generate a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate;
[0164] The key distribution module 1130 is used to send the communication public key in the communication key pair to the master terminal, and to send the communication private key in the communication key pair to the controlled terminal, so that the master terminal and the controlled terminal can perform data encryption transmission through the communication connection line based on the communication key pair.
[0165] In a possible implementation, the main control end is provided with a power supply interface, and after the cable is connected to the main control end, the reading module 1110 is further used to:
[0166] authenticating the memory;
[0167] After determining that the identity authentication of the memory is passed, determining whether the encrypted transmission program file is abnormal based on the hash value of the encrypted transmission program file of the microcontroller;
[0168] If there is no abnormality, the interface driver is initialized, the interface state of the interface between the microprocessor and the memory, the first key transmission interface between the cable and the master control end, and the second key transmission interface between the cable and the controlled end are set to an enabled state, and the encryption transmission program file is loaded and run;
[0169] If there is an abnormality, or it is determined that the identity authentication of the memory has not passed, the encrypted transmission program file is deleted.
[0170] In a possible implementation, the reading module 1110 is specifically configured to determine whether the cable is connected to the target end in the following manner:
[0171] Obtaining the interface status of the target key transmission interface associated with the target end;
[0172] If it is determined that the interface state is an enabled state, determining that the cable is connected to the target end;
[0173] Among them, if the target end is the master end, the target key transmission interface associated with the target end is the first key transmission interface; if the target end is the controlled end, the target key transmission interface associated with the target end is the second key transmission interface.
[0174] In a possible implementation, the key distribution module 1130 is specifically used to:
[0175] encrypting the communication public key in the communication key pair with the first session key and sending the encrypted key to the first key transmission interface of the master control end, wherein the first session key is generated by the master control end based on a preset key length and key generation method after authenticating the public key in the received first authentication key pair, and the first authentication key pair is generated by the microcontroller based on a first pseudo-random number;
[0176] The communication private key in the communication key pair is encrypted with a second session key and sent to the second key transmission interface of the controlled end, wherein the second session key is generated by the controlled end based on the key length and the key generation method after the public key in the received second authentication key pair is authenticated, and the second authentication key pair is generated by the microcontroller based on a second pseudo-random number.
[0177] In a possible implementation, the key distribution module 1130 is further configured to:
[0178] Start the key update timer;
[0179] When it is determined that the value of the key update timer reaches a threshold, generating a new communication key pair based on the root certificate;
[0180] The communication public key in the new communication key pair is encrypted with the first session key and sent to the first key transmission interface of the master terminal, and the communication private key in the new communication key pair is encrypted with the second session key and sent to the second key transmission interface of the controlled terminal;
[0181] Restart the key update timer.
[0182] In a possible implementation, the key generation module 1120 is specifically used to:
[0183] Based on the root certificate, generating at least two sets of communication key pairs;
[0184] encrypting a first communication public key in a communication key pair of one of the at least two groups and a first communication private key in a communication private key pair of another of the at least two groups with the first session key and sending the encrypted keys to the master control end, wherein the first communication public key is used by the master control end to encrypt data to be transmitted, and the first communication private key is used by the master control end to sign a summary of the encrypted data to be transmitted;
[0185] The first communication private key in one of the communication key pairs and the second communication public key in the other communication key pair are encrypted with the second session key and sent to the controlled end, wherein the first communication private key is used by the controlled end to decrypt the encrypted data that has passed the signature verification, and the second communication public key is used by the controlled end to decrypt the signature of the received data.
[0186] In a possible implementation, the memory is an electrically erasable programmable read-only memory.
[0187] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute any one of the methods in the above embodiments. Since the principle of solving the problem by the above computer-readable storage medium is similar to that of a cable-based data encryption transmission method, the implementation of the above computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0188] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0189] The present application is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0190] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0191] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0192] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A cable-based data encryption transmission method, characterized in that: The method is applied to a microcontroller deployed in the cable, wherein the cable further comprises a memory storing a root certificate and a communication connection line, and the cable is used to connect a master terminal and a controlled terminal in a robot. The method comprises: After determining that the cable is connected to both the master terminal and the controlled terminal, reading the root certificate in the memory; Based on the root certificate, a communication key pair is generated for the master terminal and the controlled terminal to perform data encryption transmission; The communication public key in the communication key pair is sent to the master terminal, and the communication private key in the communication key pair is sent to the controlled terminal, so that the master terminal and the controlled terminal perform data encryption transmission through the communication connection line based on the communication key pair.
2. The method according to claim 1, characterized in that The main control end is provided with a power supply interface. After the cable is connected to the main control end, the method further includes: authenticating the memory; After determining that the identity authentication of the memory is passed, determining whether the encrypted transmission program file is abnormal based on the hash value of the encrypted transmission program file of the microcontroller; If there is no abnormality, the interface driver is initialized, the interface state of the interface between the microprocessor and the memory, the first key transmission interface between the cable and the master control end, and the second key transmission interface between the cable and the controlled end are set to an enabled state, and the encryption transmission program file is loaded and run; If there is an abnormality, or it is determined that the identity authentication of the memory has not passed, the encrypted transmission program file is deleted.
3. The method according to claim 2, characterized in that Determine whether the cable is connected to the target end by: Obtaining the interface status of the target key transmission interface associated with the target end; If it is determined that the interface state is an enabled state, determining that the cable is connected to the target end; Among them, if the target end is the master end, the target key transmission interface associated with the target end is the first key transmission interface; if the target end is the controlled end, the target key transmission interface associated with the target end is the second key transmission interface.
4. The method according to claim 1, characterized in that The sending the communication public key in the communication key pair to the master control end includes: encrypting the communication public key in the communication key pair with the first session key and sending the encrypted key to the first key transmission interface of the master control end, wherein the first session key is generated by the master control end based on a preset key length and key generation method after authenticating the public key in the received first authentication key pair, and the first authentication key pair is generated by the microcontroller based on a first pseudo-random number; The sending of the private key in the communication key to the controlled terminal includes: The communication private key in the communication key pair is encrypted with a second session key and sent to the second key transmission interface of the controlled end, wherein the second session key is generated by the controlled end based on the key length and the key generation method after the public key in the received second authentication key pair is authenticated, and the second authentication key pair is generated by the microcontroller based on a second pseudo-random number.
5. The method according to claim 4, characterized in that The method further comprises: Start the key update timer; When it is determined that the value of the key update timer reaches a threshold, generating a new communication key pair based on the root certificate; The communication public key in the new communication key pair is encrypted with the first session key and sent to the first key transmission interface of the master terminal, and the communication private key in the new communication key pair is encrypted with the second session key and sent to the second key transmission interface of the controlled terminal; Restart the key update timer.
6. The method according to claim 4, characterized in that The step of generating a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate includes: Based on the root certificate, generating at least two sets of communication key pairs; encrypting a first communication public key in a communication key pair of one of the at least two groups and a first communication private key in a communication private key pair of another of the at least two groups with the first session key and sending the encrypted keys to the master control end, wherein the first communication public key is used by the master control end to encrypt data to be transmitted, and the first communication private key is used by the master control end to sign a summary of the encrypted data to be transmitted; The first communication private key in one of the communication key pairs and the second communication public key in the other communication key pair are encrypted with the second session key and sent to the controlled end, wherein the first communication private key is used by the controlled end to decrypt the encrypted data that has passed the signature verification, and the second communication public key is used by the controlled end to decrypt the signature of the received data.
7. The method according to any one of claims 1 to 6, characterized in that: The memory is an electrically erasable programmable read-only memory.
8. A cable-based data encryption transmission device, characterized in that: The device is applied to a microcontroller deployed in the cable, the cable also includes a memory storing a root certificate and a communication connection line, the cable is used to connect a master end and a controlled end in the robot, and the device includes: A reading module, configured to read the root certificate in the memory after determining that the cable is connected to both the master terminal and the controlled terminal; A key generation module, used to generate a communication key pair for data encryption transmission between the master terminal and the controlled terminal based on the root certificate; The key distribution module is used to send the communication public key in the communication key pair to the master terminal, and to send the communication private key in the communication key pair to the controlled terminal, so that the master terminal and the controlled terminal can perform data encryption transmission through the communication connection line based on the communication key pair.
9. A robot, characterized in that: include: A master terminal, a controlled terminal, and a cable connecting the master terminal and the controlled terminal, wherein the cable comprises: A memory for storing a root certificate, a computer program or instructions; A microcontroller is used to execute the computer program or instructions in the memory so that the method according to any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 7.
