Method of data transmission and communication device
By employing a two-step encryption process involving pre-encryption and XOR operation, combined with verification code, the problem of data security and real-time performance between digital biometric modules and automobiles in the automotive electronics field is solved. This achieves efficient and secure data transmission and enhances the anti-theft performance of automobiles.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-29
- Publication Date
- 2026-03-24
AI Technical Summary
In the field of automotive electronics, existing technologies make it difficult to guarantee the data security and real-time performance between digital biometric modules and vehicles, especially in CAN bus communication where they are vulnerable to replay and spoofing attacks.
A two-step encryption process, namely pre-encryption and XOR operation, is adopted. By pre-encrypting data during idle periods and performing XOR operation during transmission, combined with checksum verification, the security and real-time performance of data transmission are ensured.
It improves the security performance of CAN bus communication, enhances the anti-theft performance of automobiles, meets the high real-time transmission requirements, and effectively resists replay and spoofing attacks.
Smart Images

Figure CN115769678B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive electronics, and more specifically, to a method and communication device for data transmission. Background Technology
[0002] In recent years, digital biometric technologies such as facial recognition and fingerprint recognition have been widely used in scenarios such as unlocking and payment on mobile terminals such as mobile phones, and their advantages of convenience and security have been recognized by most people.
[0003] Technologies such as Bluetooth and Near Field Communication (NFC) are gradually maturing, and these technologies have been widely used to unlock digital devices.
[0004] Compared to the field of mobile communications, the development of automotive electronics is lagging behind. Currently, most cars still use traditional wireless radio frequency keys or even mechanical keys to unlock the vehicle.
[0005] When applying the aforementioned digital biometric technologies such as facial recognition and fingerprint recognition to the automotive electronics field, ensuring data security between the fingerprint recognition module and the vehicle is a pressing issue that needs to be addressed. Summary of the Invention
[0006] This application provides a data transmission method and communication device. Through this method and device, this application can ensure data security between fingerprint recognition and other identification modules and the vehicle, effectively solve the real-time problem of data during encrypted transmission, and effectively resist replay and forgery attacks, thereby enhancing the anti-theft performance of the vehicle.
[0007] In a first aspect, a method for data transmission is provided, comprising: a first device determining a first array, the first array including at least one random number; the first device determining first data based on the first array, the first data belonging to first memory data; the first device determining third data based on an XOR operation between the first memory data and second data, the second data being data to be transmitted; the first device determining a first checksum based on the remaining data length of the first memory data, the data length of the second data, and the third data, the first checksum being used to verify the correctness of the third data; and the first device sending the remaining data length of the first memory data, the data length of the second data, the third data, and the first checksum to a second device.
[0008] It should be understood that the remaining data length of the first memory data and the data length of the second data can be interpreted as an indication of the data length information of the first memory data and the second data. In other words, the data length of the first memory data or the data length of the second data can be interpreted as a numerical value indicating the remaining data length of the first memory data or the data length of the second data.
[0009] Through the above technical solution, this application combines a two-step encryption process of pre-encryption and XOR encryption, making the XOR encryption process independent of the data generation process (pre-encryption process). This allows sufficient pre-encrypted data to be stored in the first device during idle periods, ready for use. Each time a transmission task is executed, unique data is used for XOR encryption, achieving the same security as direct encryption. Furthermore, since this method only involves XOR operations in the transmission process, data can be quickly encrypted and sent, ensuring real-time data transmission. Through this technical solution, this application effectively achieves fast and efficient data encryption, improves the security performance of CAN bus communication, enhances the anti-theft performance of the vehicle, and meets its high real-time transmission requirements.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the data length of the first memory data is greater than or equal to the data length of the second data.
[0011] Through the above technical solution, this application can ensure that the length of the first memory data is greater than the length of the second data before performing XOR encryption on the first memory data and the second data. This can enhance the anti-theft performance of the car, enhance the data security between them, and also enhance the efficiency of data communication.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the first memory data includes the second memory data and the first data. Before the first device determines the first array, the method further includes: the first device determining that the data length of the second memory data is less than a threshold.
[0013] Through the above technical solution, this application can realize that when the data length of the second memory data of the first device is lower than a certain threshold, the first device can immediately fill in the data length of the memory data of the first device, thereby also pre-encrypting enough data to meet the real-time data transmission requirements.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, after the first device determines the first array, the method further includes: the first device sending a pre-encryption command to the second device, the pre-encryption command being used to instruct the second device to perform a pre-encryption process, the pre-encryption command including the data length of the first array and the second memory data.
[0015] Through the above technical solution, this application enables the first device and the second device to start the pre-encryption process simultaneously, thereby ensuring that the first device and the second device remain synchronized in the encryption process, and thus enhancing the communication security and data security between the first device and the second device.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first device receiving first indication information from the second device, the first indication information being used to indicate whether the second device has completed the pre-encryption process.
[0017] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate the completion of the pre-encryption process, thereby enhancing the communication efficiency between the first device and the second device, which is conducive to the first device executing subsequent processes or methods, and thus enhancing the communication security between the first device and the second device.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first device receiving second indication information from the second device, the second indication information being used to indicate whether the second device has correctly received the second data.
[0019] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate that the plaintext has been correctly received, thereby enhancing the communication efficiency between the first device and the second device.
[0020] In a second aspect, a data transmission method is provided, comprising: a second device receiving a pre-encryption command from a first device, the pre-encryption command being used to instruct the second device to perform a pre-encryption process, the pre-encryption command including a first array and a data length of second memory data of the first device, the first array including at least one random number; the second device determining first data based on the first array, the first data belonging to third memory data; and the second device sending first indication information to the first device, the first indication information being used to indicate whether the second device has completed the pre-encryption process.
[0021] Through the above technical solution, this application combines a two-step encryption process of pre-encryption and XOR encryption, making the XOR encryption process independent of the data generation process (pre-encryption process). This allows sufficient pre-encrypted data to be stored in the first device during idle periods, ready for use. Each time a transmission task is executed, unique data is used for XOR encryption, achieving the same security as direct encryption. Furthermore, since this method only involves XOR operations in the transmission process, data can be quickly encrypted and sent, ensuring real-time data transmission. Through this technical solution, this application effectively achieves fast and efficient data encryption, improves the security performance of CAN bus communication, enhances the anti-theft performance of the vehicle, and meets its high real-time transmission requirements.
[0022] In conjunction with the second aspect, in some implementations of the second aspect, the third memory data includes the fourth memory data and the first data. Before the second device determines the first data based on the first array, the method further includes: the second device determining that the fourth memory data of the second device has the same data length as the second memory data.
[0023] Through the above technical solution, this application can ensure that the pre-encryption process initiated by the first device and the second device is correct, and can also serve the purpose of data verification, enhance the ability to resist replay attacks, and thus enhance the anti-theft performance of the car.
[0024] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: the second device receiving from the first device the remaining data length of the first memory data, the data length of the second data, the third data, and a first check code, wherein the second data is the data to be transmitted, and the first check code is used to verify the correctness of the third data; the second device determining a second check code based on the remaining data length of the first memory data, the data length of the second data, and the third data; the second device verifying the first check code and the second check code, wherein if the first check code and the second check code are the same, the second device determines the relationship between the data length of the third memory data and the data length of the second memory data; or, if the first check code and the second check code are different, the second device reports a verification failure to the first device.
[0025] Through the above technical solution, this application enables the second device to determine a second check code based on the remaining data length of the first memory data, the data length of the second data, and the third data sent by the first device after receiving the first device. This allows the second device to verify whether the data received by the second device has been tampered with or interfered with, thereby enhancing the communication security and data security between the first and second devices. It also verifies the identity of the first device and enhances the anti-theft performance of the car.
[0026] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: if the difference in data length between the third memory data and the second memory data is the same as the data length of the second data, the second device determines the second data based on the XOR operation between the third memory data and the third data; or, if the difference in data length between the third memory data and the second memory data is different from the data length of the second data, the second device re-executes the pre-encryption process.
[0027] Through the above technical solution, this application can ensure the correctness of the encryption and decryption communication process and prevent replay attacks, thereby enhancing the anti-theft performance of the car.
[0028] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: the second device sending second indication information to the first device, the second indication information being used to indicate whether the second device has correctly received the second data.
[0029] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate that the plaintext has been correctly received, thereby enhancing the communication efficiency between the first device and the second device.
[0030] Thirdly, a communication device is provided, comprising: a processing unit configured to determine a first array, the first array including at least one random number; the processing unit further configured to determine first data based on the first array, the first data belonging to first memory data; the processing unit further configured to determine third data based on an XOR operation between the first memory data and second data, the second data being data to be transmitted; the processing unit further configured to determine a first check code based on the remaining data length of the first memory data, the data length of the second data, and the third data, the first check code being used to verify the correctness of the third data; and a transceiver unit configured to send the remaining data length of the first memory data, the data length of the second data, the third data, and the first check code to a second device.
[0031] In conjunction with the third aspect, in some implementations of the third aspect, the data length of the first memory data is greater than or equal to the data length of the second data.
[0032] In conjunction with the third aspect, in some implementations of the third aspect, the first memory data includes the second memory data and the first data, and the processing unit is further configured to: determine that the data length of the second memory data is less than a threshold.
[0033] In conjunction with the third aspect, in some implementations of the third aspect, the transceiver unit is also used to: send a pre-encryption command to the second device, the pre-encryption command being used to instruct the second device to perform a pre-encryption process, the pre-encryption command including the data length of the first array and the second memory data.
[0034] In conjunction with the third aspect, in some implementations of the third aspect, the transceiver unit is also used to: receive first indication information from the second device, the first indication information being used to indicate whether the second device has completed the pre-encryption process.
[0035] In conjunction with the third aspect, in some implementations of the third aspect, the transceiver unit is further configured to: receive second indication information from the second device, the second indication information being used to indicate whether the second device has correctly received the second data.
[0036] Fourthly, a communication device is provided, comprising: a transceiver unit configured to receive a pre-encryption command from a first device, the pre-encryption command being used to instruct a second device to perform a pre-encryption process, the pre-encryption command including a first array and a data length of second memory data of the first device, the first array including at least one random number; a processing unit configured to determine first data based on the first array, the first data belonging to third memory data; and the transceiver unit further configured to send first indication information to the first device, the first indication information being used to instruct the second device whether the pre-encryption process has been completed.
[0037] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the third memory data includes the fourth memory data and the first data, and the processing unit is further configured to: determine that the fourth memory data of the second device has the same data length as the second memory data.
[0038] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is further configured to receive from the first device the remaining data length of the first memory data, the data length of the second data, the third data, and a first checksum, wherein the second data is the data to be transmitted, and the first checksum is used to verify the correctness of the third data; the processing unit is further configured to determine a second checksum based on the remaining data length of the first memory data, the data length of the second data, and the third data; the processing unit is further configured to verify the first checksum and the second checksum, wherein if the first checksum and the second checksum are the same, the processing unit is further configured to determine the relationship between the data lengths of the third memory data and the second memory data; or, if the first checksum and the second checksum are different, the transceiver unit is further configured to report a verification failure to the first device.
[0039] In conjunction with the fourth aspect, in some implementations of the fourth aspect, if the difference between the data lengths of the third memory data and the second memory data is the same as the data length of the second data, the processing unit is further used to determine the second data based on the XOR operation between the third memory data and the third data; or, if the difference between the data lengths of the third memory data and the second memory data is different from the data length of the second data, the processing unit is further used to re-execute the above-mentioned pre-encryption process.
[0040] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is further configured to: send a second indication message to the first device, the second indication message being used to indicate whether the second device has correctly received the second data.
[0041] Fifthly, a computer-readable storage medium is provided, storing instructions that, when executed on a computer, cause the computer to perform a communication method as described in any one of the first aspects and any possible implementations of the first aspect, or cause the computer to perform a communication method as described in any one of the second aspects and any possible implementations of the second aspect.
[0042] In a sixth aspect, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to perform the method as described in any one of the first aspects and any possible implementations of the first aspect.
[0043] In a seventh aspect, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to perform the method as described in any one of the second aspect and any possible implementation thereof.
[0044] Eighthly, a communication device is provided, comprising: a processor and a memory, the processor being coupled to the memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory to cause the communication device to perform a communication method as described in any one of the first aspects and any possible implementations of the first aspect, or to cause the communication device to perform a communication method as described in any one of the second aspects and any possible implementations of the second aspect. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the interaction between a car and an external recognition module provided in this application.
[0046] Figure 2 This is a schematic flowchart of a data transmission method provided in this application.
[0047] Figure 3 This is a schematic flowchart illustrating another data transmission method provided in this application.
[0048] Figure 4 This is a schematic block diagram of a communication device provided in this application.
[0049] Figure 5 This is a schematic block diagram of another communication device provided in this application. Detailed Implementation
[0050] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0051] Facial recognition, fingerprint recognition, Bluetooth, and other new technologies have achieved rapid development in the field of mobile communications. However, the development and application of these technologies in the field of automotive electronics have lagged behind. The reasons for this can be summarized as follows:
[0052] Firstly, cars are more valuable than mobile devices such as smartphones, so their safety requirements are also higher.
[0053] Traditional technologies such as wireless radio frequency communication have been deeply rooted in the automotive electronics field for many years and have undergone years of verification. Therefore, their technology is relatively more mature and more reliable.
[0054] Secondly, most of the aforementioned modules connect to the vehicle via the Controller Area Network (CAN) bus. Messages transmitted via the CAN bus are broadcast in plaintext, which cannot effectively guarantee data security between the identification modules and the vehicle. Experiments have already demonstrated that attackers can access the electronic control unit (ECU) connected to the network via the CAN bus.
[0055] If the data transmitted on the CAN bus by the aforementioned fingerprint recognition and other identification modules is illegally intercepted and read, it may be replayed or forged by intruders to attack the vehicle, thereby threatening the vehicle's property security.
[0056] One current encryption method for automotive CAN buses first pads the data to be transmitted, dividing it into several data blocks and adding a parity bit at the end. Then, it uses the Advanced Encryption Standard (AES) encryption algorithm to encrypt the data blocks before transmission. The receiver uses the parity bit to ensure data integrity and decrypts the data by extracting and reassembling it based on time and sequence identifiers and reverse engineering. However, this method lacks protection against replay attacks and authentication of the data sender, and it cannot guarantee real-time information transmission.
[0057] In view of the above problems, this application proposes a data transmission method and communication device that can be applied to the encryption of communication data on an in-vehicle CAN bus. After identification modules such as digital biometric identification are connected to the vehicle, these modules need to perform encrypted communication of critical data with the original in-vehicle control unit via the CAN bus. Therefore, this application can achieve fast and effective data encryption, improve the security performance of CAN bus communication, enhance the anti-theft performance of the entire vehicle, and also meet its high real-time transmission requirements.
[0058] It should be noted that the data transmission method provided in this application is a CAN bus communication security mechanism based on a software system. It can be applied to different vehicle ECUs, meet the real-time requirements of information transmission and the relevant limitations of CAN bus communication, and achieve effective security protection for vehicle ECUs at low cost.
[0059] Figure 1 This application provides a schematic diagram illustrating the interaction between a car and a recognition module.
[0060] It should be understood that, Figure 1 As shown in the interactive diagram, the security of the data transmitted between the identification module and the car needs to be guaranteed to ensure that the car is not attacked or stolen.
[0061] It should be understood that, Figure 1 In the interactive diagram shown, the identification module can be a face recognition module, a fingerprint recognition module, a Bluetooth module, or other modules with identification functions or similar identification functions, or modules involved in CAN bus communication security, etc. This application does not make specific limitations in this regard.
[0062] The following text will provide a unified explanation of some concepts or steps related to the technical solution of this application, and will not repeat them in the subsequent text.
[0063] It should be understood that AES is a block cipher standard used to replace the original data encryption standard (DES), and it has been widely adopted and used worldwide. AES has become one of the most popular algorithms in symmetric key encryption.
[0064] It should be understood that a random number generator refers to a random number generation algorithm certified by the State Cryptography Administration, which uses physical random numbers as seeds to ensure randomness.
[0065] It should be understood that the extended algorithm refers to using the linear shift register recommended by the AES standard to extend the random number to a specified length before storing it, thereby ensuring the randomness and uniqueness of the data.
[0066] It should be understood that the data pre-encryption method refers to using the AES advanced encryption algorithm to encrypt the expanded data, obtain the pre-encrypted result, and store it in memory.
[0067] It should be understood that the XOR encryption process refers to a process performed before data is sent, which is a step in which the pre-encrypted data is XORed with the data to be sent.
[0068] It should be understood that the check code is generated by methods such as longitudinal redundancy check, checksum and / or cyclic redundancy check.
[0069] The following will combine Figure 2 This application describes a data transmission method. Specifically, as follows... Figure 2 As shown.
[0070] It should be understood that, Figure 2In the data transmission method shown, the execution subject of the method is the sending end, that is, the first device, or it can be understood as the data sending controller, or it can be the identification module. This application does not make any specific limitation in this regard.
[0071] S210, determine a first array, which includes at least one random number.
[0072] S220, determine the first data based on the first array, the first data belonging to the first memory data of the first device.
[0073] It should be understood that the first device determines the first data based on the first array, specifically including the following process: the first device expands the first array, and the expansion algorithm can be referred to in the foregoing description, which will not be repeated here; then, the first device encrypts the expanded first array to determine the first data, and saves the first data into memory, and the encryption algorithm can be referred to in the foregoing description, which will not be repeated here.
[0074] It should be understood that the first data belongs to the first memory data of the first device. The first memory data can be understood as the organic composition of the original or initial memory data or the memory data before a certain moment (starting the pre-encryption process) stored by the first device before expanding and encrypting the first array, and the first data obtained after expanding and encrypting the first array.
[0075] It should be understood that the first memory data may also include other components besides the initial or original memory data and the first data mentioned above, and this application does not specifically limit this.
[0076] S230, based on the XOR operation between the first memory data and the second data, the third data is determined, and the second data is the data to be transmitted.
[0077] It should be understood that the first device determines the third data based on the XOR operation between the first memory data and the second data. Specifically, the first device sequentially reads data bits of the same length as the second data from the first memory data, and then performs a bitwise XOR operation between the data bits of the same length as the second data and the second data to determine the third data. The second data is the data to be transmitted received by the first device, and the third data is the encrypted data of the second data, that is, the data or ciphertext that the first device needs to transmit to the second device.
[0078] S240, based on the remaining data length of the first memory data, the data length of the second data, and the third data, a first check code is determined, which is used to verify the correctness of the third data.
[0079] It should be understood that the first device determines a first check code based on the remaining data length of the first memory data, the data length of the second data, and the third data. The first check code is used to indicate whether the third data is correct, has been tampered with, or has been interfered with.
[0080] The remaining data length of the first memory data can be understood as follows: The first device sequentially reads data bits of the same length as the second data from the first memory data, and then performs an XOR operation with the second data. After the XOR operation is completed, the first memory data will still have some data remaining. Based on the remaining data of the first memory data, the data length of the second data, and the third data, the first device generates or determines a first check code, which is then used to determine whether the third data is correct.
[0081] This application uses the remaining data length in the first memory data as a counter and uses a checksum to verify the data transmission process. Combined with an encryption mechanism, it can effectively resist attacks such as replay and forgery in CAN bus communication and improve the security of critical data transmission.
[0082] S250, send the remaining data length of the first memory data, the data length of the second data, the third data, and the first checksum to the second device.
[0083] It should be understood that the remaining data length of the first memory data and the data length of the second data, or the data length of the second memory data, can be interpreted as an indication of the data length information of the first memory data or the second data. In other words, the data length of the first memory data or the data length of the second data can be understood as a numerical value used to indicate the remaining data length of the first memory data or the data length of the second data. For example, the remaining data length of the first memory data can be a numerical value, such as 8, which represents the remaining 8 bits of data length after the first memory data undergoes an XOR operation. This will be explained uniformly here and will not be elaborated further below.
[0084] As one possible implementation, before the first device determines the first array, the first device can also detect the data length of the second memory data of the first device during the idle time period of the first device, and can also determine that the data length of the second memory data is less than a threshold.
[0085] Specifically, when the first device determines that the length of the second memory data is less than a threshold, the first device enables the pre-encryption algorithm or initiates the pre-encryption process. In other words, it determines the first array and determines the first data based on the first array.
[0086] It should be understood that the second memory data can be interpreted as the initial or original memory data of the first device described above before the first array is determined, or before a certain moment (when the pre-encryption process is started).
[0087] Through the above technical solution, this application can realize that when the data length of the second memory data of the first device is lower than a certain threshold, the first device can immediately fill in the data length of the memory data of the first device, thereby also pre-encrypting enough data to meet the real-time data transmission requirements.
[0088] As one possible implementation, before the first device determines the third data based on the XOR operation between the first memory data and the second data, the first device needs to determine that the length of the first memory data is greater than or equal to the length of the second data. Alternatively, the length of the first memory data is greater than or equal to the length of the second data.
[0089] The first device determines that the data length of the first memory data is greater than or equal to the data length of the second data, including the following two cases:
[0090] Scenario #A: After receiving the second data, if the first device directly determines that the length of the first memory data is greater than or equal to the length of the second data, then the first device can directly perform the encrypted transmission process of the communication data.
[0091] Scenario #B: After receiving the second data, if the first device determines that the length of the first memory data obtained through the pre-encryption process is less than the length of the second data, the first device will repeat the above pre-encryption process to obtain a new length of the first memory data, so that the length of the first memory data is greater than or equal to the length of the second data, and then the encrypted transmission of the communication data will be performed.
[0092] Through the above technical solution, this application can ensure that the length of the first memory data is greater than the length of the second data before performing XOR encryption on the first memory data and the second data. This can enhance the anti-theft performance of the car, enhance the data security between them, and also enhance the efficiency of data communication.
[0093] As one possible implementation, after the first device determines the first array, the first device can also send a pre-encryption command to the second device. The pre-encryption command is used to instruct the second device to perform a pre-encryption process. The pre-encryption command includes the data length of the first array and the second memory data of the first device.
[0094] Specifically, if the first device determines that the second memory data is abnormal, the pre-encryption command may also include a first length, which indicates the maximum length of data that can be stored in the memory of the first or second device.
[0095] As one possible implementation, the first length can be predefined or preset.
[0096] At this point, the data length of the second memory data included in the pre-encryption command is -1, and the specific meaning of -1 can be understood as the second memory data being abnormal.
[0097] More specifically, after determining the first array, the first device will clear the second memory data, and then the first device will expand the first array to the maximum length indicated by the first length.
[0098] Alternatively, if the first device determines that the second memory data is normal, the first device will proceed with the pre-encryption process normally, that is, determine the first array and determine the first data based on the first array.
[0099] At this point, the pre-encryption command may also include a second length, which is used to indicate the data length of the first data, or to indicate the data length of the array obtained after expanding the first array.
[0100] As one possible implementation, the second length can be predefined or preset.
[0101] Through the above technical solution, this application enables the first device and the second device to start the pre-encryption process simultaneously, thereby ensuring that the first device and the second device remain synchronized in the encryption process, and thus enhancing the communication security and data security between the first device and the second device.
[0102] As one possible implementation, the first device may also receive first instruction information from the second device, which is used to instruct the second device to complete the pre-encryption process.
[0103] Alternatively, the first instruction information can be used to indicate that the second device failed to complete the pre-encryption process correctly, in which case the first device will repeat the above steps or methods.
[0104] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate the completion of the pre-encryption process, thereby enhancing the communication efficiency between the first device and the second device, which is conducive to the first device executing subsequent processes or methods, and thus enhancing the communication security between the first device and the second device.
[0105] As one possible implementation, the first device may also receive second instruction information from the second device, which is used to instruct the second device to correctly receive the second data.
[0106] Alternatively, the second indication information can be used to indicate that the second device failed to receive the second data correctly, in which case the first device will repeat the above steps or methods.
[0107] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate that the plaintext has been correctly received, thereby enhancing the communication efficiency between the first device and the second device.
[0108] It should be noted that, in the embodiments of this application, the first memory data and the second memory data are used to indicate the memory data stored by the first device before and after pre-encryption. For example, if the first memory data obtained by the first device after starting pre-encryption is the second memory data before the next pre-encryption process starts, then after the next pre-encryption process starts, the first device will obtain the new first memory data.
[0109] Through the above technical solution, this application combines a two-step encryption process of pre-encryption and XOR operation encryption, making the XOR encryption process independent of the data generation process (pre-encryption process). This allows sufficient pre-encrypted data to be stored in the first device during idle periods, ready for use. Each time a transmission task is executed, unique data is used for XOR encryption, achieving the same security as direct encryption. Furthermore, since this method only involves XOR operations in the transmission process, data can be encrypted and sent quickly, ensuring real-time data transmission.
[0110] Through the above technical solution, this application can effectively encrypt data quickly and efficiently, improve the security performance of CAN bus communication, enhance the anti-theft performance of the whole vehicle, and also meet its high real-time transmission requirements.
[0111] The following will combine Figure 3 Another data transmission method provided in this application is described. Specifically, as follows... Figure 3 As shown.
[0112] It should be understood that, Figure 3 In the data transmission method shown, the subject of the method is the receiving end, that is, the second device, or it can be understood as the data receiving controller. This application does not make any specific limitation in this regard.
[0113] S310, Receive a pre-encryption command, the pre-encryption command being used to instruct the second device to perform a pre-encryption process, the pre-encryption command including a first array and the data length of the second memory data of the first device, the first array including at least one random number.
[0114] S320, determine the first data based on the first array, and the first data belongs to the third memory data.
[0115] S330, send first indication information, the first indication information being used to indicate whether the second device has completed the pre-encryption process.
[0116] It should be understood that the second device determines the first data based on the first array, specifically including the following process: the second device expands the first array, and the expansion algorithm can be referred to in the above description, which will not be repeated here; then, the second device encrypts the expanded first array to determine the first data, and saves the first data into memory, and the encryption algorithm can be referred to in the above description, which will not be repeated here.
[0117] It should be understood that the first data belongs to the third memory data, which can be understood as the organic composition of the original or initial memory data or the memory data before a certain moment (when the pre-encryption process is executed) saved by the second device before expanding and encrypting the first array, and the first data obtained after expanding and encrypting the first array.
[0118] It should be understood that the third memory data may also include other components besides the initial or original memory data and the first data mentioned above, and this application does not specifically limit this.
[0119] As one possible implementation, before the second device determines the first data based on the first array, the second device determines that the data length of the fourth memory data of the second device is the same as the data length of the second memory data. Specifically, this includes the following three cases:
[0120] Scenario #C: If the second device determines that the length of the fourth memory data is the same as the length of the second memory data, the pre-encryption command sent by the first device to the second device can also carry a second length. The second length is used to indicate the threshold of the length of the first data obtained by the second device after expanding the first array. The second device expands the first array to the specified length according to the second length, then calls the AES-128 algorithm to encrypt the expanded first array, and stores the encryption result in memory, thereby completing the memory data to the specified length.
[0121] Scenario #D: If the second device determines that the length of the second memory data carried in the pre-encryption command is -1, the second device will clear its fourth memory data to make it consistent with the length of the second memory data. The pre-encryption command may also include a first length, which is used to indicate the maximum threshold of memory data in the first or second device. Based on the information carried in the pre-encryption command, the second device expands the first array to the specified length, then calls the AES-128 algorithm to encrypt the expanded first array, and stores the encryption result in memory, thereby completing the memory data to the specified length, such as the first length.
[0122] Scenario #E: If the data length information of the second memory data included in the second determination pre-encryption command does not belong to any of the above situations, the second device will send an error code to the first device, that is, indicating that the memory data does not match. After receiving the feedback, the first device can restart the above process.
[0123] Through the above technical solution, this application can ensure that the pre-encryption process initiated by the first device and the second device is correct, and can also serve the purpose of data verification, enhance the ability to resist replay attacks, and thus enhance the anti-theft performance of the car.
[0124] It should be understood that the algorithms or functions used by the first device in expanding and encrypting the first array are consistent with those used by the second device in expanding and encrypting the first array. This can enhance the anti-theft performance of the car and enhance the communication security between the identification module and the car, that is, data security.
[0125] It should be understood that, in the embodiments of this application, the fourth memory data may refer to the memory data saved by the second device before receiving the pre-encryption command, or it may be understood as the original or initial memory data.
[0126] It should be understood that, in the embodiments of this application, the third memory data refers to the new memory data obtained by the second device after receiving the pre-encryption command, expanding and encrypting the first array, and saving the resulting encryption result (first data) into memory. In other words, it can be understood as obtaining third memory data, which can be understood as including the fourth memory data and the first data.
[0127] As one possible implementation, the second device also receives from the first device the remaining data length of the first memory data, the data length of the second data, the third data, and the first checksum.
[0128] Specifically, after receiving the aforementioned data, the second device first verifies the received data. The specific process is as follows: the second device determines a second checksum based on the remaining data length of the first memory data, the data length of the second data, and the third data, and then checks the first checksum against the second checksum.
[0129] If the first checksum and the second checksum are consistent, the second device further compares the data length of the third memory data of the second device with the data length of the second memory data of the first device. For example, if the data length of the third memory data is greater than the data length of the second memory data, the second device determines whether the difference between the two is consistent with the data length of the second data. If they are consistent, the second device sequentially reads data bits of the same length as the third memory data and performs a bitwise XOR operation with the third data to obtain the second data, or in other words, obtains the plaintext. If they are inconsistent, the second device reports an error code mismatch to the first device, returns an error, and re-executes the pre-encryption command, that is, repeats the above pre-encryption process.
[0130] If the first verification code and the second verification code do not match, the second device returns a data verification failure to the first device and ignores the data.
[0131] Through the above technical solution, this application enables the second device to determine a second check code based on the remaining data length of the first memory data, the data length of the second data, and the third data sent by the first device after receiving the first device. This allows the second device to verify whether the data received by the second device has been tampered with or interfered with, thereby enhancing the communication security and data security between the first and second devices. It also verifies the identity of the first device and enhances the anti-theft performance of the car.
[0132] As one possible implementation, the second device may also send a second instruction message to the first device, which is used to instruct the second device to correctly receive the second data.
[0133] Alternatively, the second indication information can also be used to indicate that the second device failed to receive the second data correctly.
[0134] Through the above technical solution, this application can enable the second device to send instruction information to the first device to indicate that the plaintext has been correctly received, thereby enhancing the communication efficiency between the first device and the second device.
[0135] As one possible implementation, the first device performs corresponding operations based on the error code fed back by the second device. If the memory data does not match, the current memory data is cleared and the pre-encryption instruction is re-executed; if the data is abnormal, the data transmission command is re-executed.
[0136] It should be noted that, in the embodiments of this application, the third memory data and the fourth memory data are used to indicate the memory data stored by the second device before and after pre-encryption. For example, if the third memory data obtained by the second device after starting pre-encryption is the fourth memory data before the next pre-encryption process starts, then the second device will obtain new third memory data after the next pre-encryption process starts.
[0137] Through the above technical solution, this application combines a two-step encryption process of pre-encryption and XOR operation encryption, making the XOR encryption process independent of the data generation process (pre-encryption process). This allows sufficient pre-encrypted data to be stored in the first device during idle periods, ready for use. Each time a transmission task is executed, unique data is used for XOR encryption, achieving the same security as direct encryption. Furthermore, since this method only involves XOR operations in the transmission process, data can be encrypted and sent quickly, ensuring real-time data transmission.
[0138] Through the above technical solution, this application can effectively encrypt data quickly and efficiently, improve the security performance of CAN bus communication, enhance the anti-theft performance of the whole vehicle, and also meet its high real-time transmission requirements.
[0139] It should be noted that the data transmission method provided in this application can be implemented based on a software system. By adding a corresponding software program to the vehicle ECU, the security protection of CAN bus communication data can be achieved. It has the advantages of low cost, strong adaptability and no dependence on hardware devices.
[0140] It should be noted that this application is designed based on the AES-128 encryption algorithm given in the internationally recognized Advanced Encryption Algorithm Standard. The algorithm is efficient, concise, and has a high level of encryption security.
[0141] It should be noted that, compared to other encryption methods, this application uses a two-step encryption process of pre-encryption and bitwise XOR encryption, making the encryption process and data generation process independent. When the controller detects an idle period, sufficient data can be pre-encrypted and stored in the controller for later use. Each time a transmission task is executed, unique data is used for XOR encryption, achieving the same security as direct encryption. Furthermore, since this method only involves XOR operations in the transmission process, data can be quickly encrypted and sent, ensuring real-time data transmission.
[0142] It should be noted that this application uses the remaining data length in memory as a counter and uses a checksum to verify the data transmission process. Combined with an encryption mechanism, it can effectively resist attacks such as replay and forgery in CAN bus communication and improve the security of critical data transmission.
[0143] It should be noted that this application uses the exact same functions in the encryption and decryption processes, without requiring additional decryption algorithms, thus reducing the memory footprint of the controller.
[0144] It should be noted that the random number expansion algorithm used in this application is based on a linear feedback shift register design, which ensures the randomness and uniqueness of the expanded data. Using a random number of length m, it can expand to data of length n≤2m bits, which can ensure that there is enough usable data in memory.
[0145] It should be noted that this application is based on the AES-128 algorithm, which can achieve high efficiency and simplicity, high encryption security level, fast and stable operation under the limitations of CAN bus communication, and the encryption and decryption functions are exactly the same, without the need for an additional decryption algorithm, thereby reducing the memory occupation of the controller. At the same time, this application can realize that the data encryption algorithm can be performed before the data to be encrypted arrives, and both data encryption and decryption can be implemented by bitwise XOR operation, which improves the efficiency of data encryption.
[0146] It should be noted that the data transmission method provided in this application can be widely applied to vehicle controllers, including, for example, electronic door systems, electronic ignition control systems, facial recognition devices, fingerprint recognition devices, etc., and this application does not specifically limit it.
[0147] The following will combine Figure 4 and Figure 5 The communication device provided in this application is described.
[0148] It should be understood that in the foregoing method embodiments, the first device and the second device are both two components or modules of the vehicle, one of which is a transmitter or transmitter module and the other is a receiver or receiver module.
[0149] Figure 4 This is a schematic block diagram of the communication device 400 provided in this application. As shown, the communication device 400 may include a transceiver unit 410 and a processing unit 420.
[0150] In one possible design, the communication device 400 can be the first device in the above method embodiment, or it can be a chip used to implement the functions of the first device in the above method embodiment.
[0151] It should be understood that the communication device 400 may correspond to the first device in the method embodiment of this application, and the communication device 400 may include a unit for performing the method executed by the first device in the aforementioned method embodiment.
[0152] It should be understood that each unit in the communication device 400 and the other operations and / or functions described above are for implementing the corresponding processes shown in the above figures.
[0153] It should be understood that the specific process of each unit performing the above-mentioned corresponding steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0154] As an example, the communication device 400 is capable of implementing the actions, steps, or methods related to the first device in S201, S202, and S203 of the aforementioned method embodiments.
[0155] It should be understood that the above content is only for illustrative purposes. The communication device 900 can also implement other steps, actions or methods related to the second device in the above method embodiments, which will not be repeated here.
[0156] It should be understood that the communication device 400 may correspond to the second device in the method embodiments of this application, and the communication device 400 may include a unit for performing the method performed by the second device in the above method embodiments.
[0157] Furthermore, each unit in the communication device 400 and the other operations and / or functions described above are respectively for implementing the corresponding processes in the above method embodiments.
[0158] It should be understood that the specific process of each unit performing the above-mentioned corresponding steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0159] As an example, the communication device 400 can implement the actions, steps or methods related to the second device in S301 and S302 of the aforementioned method embodiments, and can also implement the actions, steps or methods related to the second device in the aforementioned method embodiments.
[0160] It should be understood that the above content is only for illustrative purposes. The communication device 400 can also implement other steps, actions or methods related to the second device in the above method embodiments, which will not be repeated here.
[0161] Optionally, the communication device 400 further includes a storage unit 430 for storing instructions.
[0162] Figure 5 This is a schematic block diagram of a communication device 500 provided in an embodiment of this application. As shown, the communication device 500 includes at least one processor 510 and a transceiver 520.
[0163] The processor 510 is coupled to a memory and is used to execute instructions stored in the memory to control the transceiver 520 to send and / or receive signals.
[0164] Optionally, the communication device 500 also includes a memory 530 for storing instructions.
[0165] It should be understood that the processor 510 and memory 530 can be combined into a processing device, and the processor 510 is used to execute the program code stored in memory 530 to achieve the above functions.
[0166] In practice, the memory 530 can be integrated into the processor 510 or independent of the processor 510.
[0167] It should also be understood that transceiver 520 may include a receiver (or receiver unit) and a transmitter (or transmitter unit).
[0168] Transceiver 520 may further include antennas, and the number of antennas may be one or more. Transceiver 1020 may have a communication interface or interface circuitry.
[0169] When the communication device 500 is a chip, the chip includes a transceiver unit and a processing unit. The transceiver unit can be an input / output circuit or a communication interface; the processing unit can be a processor, microprocessor, or integrated circuit integrated on the chip.
[0170] This application also provides a processing apparatus, including a processor and an interface. The processor can be used to execute the methods described in the above method embodiments.
[0171] It should be understood that the aforementioned processing device can be a chip. For example, the processing device can be a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system-on-chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0172] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.
[0173] The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0174] The software module can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the field. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0175] This application also provides a computer-readable storage medium storing computer instructions for implementing the method executed by the first device in the above method embodiments.
[0176] For example, when the computer program is executed by the computer, it enables the computer to implement the method executed by the first device in the above method embodiments.
[0177] This application also provides a computer-readable storage medium storing computer instructions for implementing the method executed by the second device in the above method embodiments.
[0178] For example, when the computer program is executed by the computer, it enables the computer to implement the method executed by the second device in the above method embodiments.
[0179] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the method described in the above method embodiments, executed by the first device or the second device.
[0180] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the explanations and beneficial effects of the relevant content in any of the communication devices provided above can be referred to the corresponding method embodiments provided above, and will not be repeated here.
[0181] This application does not impose any particular limitation on the specific structure of the execution subject of the method provided in this application embodiment. As long as it is possible to communicate according to the method provided in this application embodiment by running a program that records the code of the method provided in this application embodiment. For example, the execution subject of the method provided in this application embodiment can be a first device or a second device, or a functional module in the first device or the second device that can call and execute a program.
[0182] Various aspects or features of this application may be implemented as methods, apparatus, or articles of manufacture using standard programming and / or engineering techniques. As used herein, the term "article of manufacture" may encompass a computer program accessible from any computer-readable device, carrier, or medium.
[0183] The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media.
[0184] Available media (or computer-readable media) may include, but are not limited to: magnetic media or magnetic storage devices (e.g., floppy disks, hard disks (such as portable hard disks), magnetic tapes), optical media (e.g., optical discs, compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.), or semiconductor media (e.g., solid-state disks (SSDs), USB flash drives, read-only memory (ROM), random access memory (RAM), and various other media capable of storing program code).
[0185] The various storage media described herein may represent one or more devices and / or other machine-readable media used for storing information. The term "machine-readable media" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.
[0186] It should be understood that the memory mentioned in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0187] Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM). For example, RAM can be used as an external cache.
[0188] By way of example and not limitation, RAM can include a variety of forms, such as: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0189] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) can be integrated into the processor.
[0190] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0191] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways.
[0192] For example, the device embodiments described above are merely illustrative. For example, the division of the above units is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0193] Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or other forms.
[0194] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement the solution provided in this application, depending on actual needs.
[0195] In addition, the functional units in the various embodiments of this application can be integrated into one unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0196] In the above embodiments, it can be implemented entirely or partially by software, hardware, firmware, or any combination thereof.
[0197] When implemented using software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions.
[0198] When computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0199] For example, a computer can be a personal computer, a server, or a network device. Computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0200] For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. For information on computer-readable storage media, please refer to the description above.
[0201] It should be understood that in the embodiments of this application, the designations "first", "second", etc. are only for distinguishing different objects, such as different devices, and do not constitute a limitation on the scope of the embodiments of this application. The embodiments of this application are not limited thereto.
[0202] It should also be understood that in this application, "when," "if," and "if" all refer to the device making a corresponding action under certain objective circumstances, and are not time-limited, nor do they require the device to make a judgment action when it implements the action, nor do they imply any other limitations.
[0203] It should also be understood that in the embodiments of this application, "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0204] It should also be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0205] As used in this specification, the terms "component," "module," "system," etc., refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process and / or an execution thread, and components may be located on one computer and / or distributed across two or more computers.
[0206] Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0207] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0208] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0209] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0210] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0211] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0212] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0213] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for data transmission, characterized in that, The method is applied in the automotive field, including: The first device determines a first array, the first array including at least one random number; The first device determines the first data based on the first array, and the first data belongs to the first memory data; The first device determines the third data based on the XOR operation between the first memory data and the second data, where the second data is the data to be transmitted. The first device determines a first check code based on the remaining data length of the first memory data, the data length of the second data, and the third data. The first check code is used to verify whether the third data is correct. The first device sends the remaining data length of the first memory data, the data length of the second data, the third data, and the first checksum to the second device; The first device and the second device are devices in the automotive field.
2. The method according to claim 1, characterized in that, The length of the first memory data is greater than or equal to the length of the second data.
3. The method according to claim 1 or 2, characterized in that, The first memory data includes the second memory data and the first data. Before the first device determines the first array, the method further includes: The first device determines that the length of the second memory data is less than a threshold.
4. The method according to claim 1 or 2, characterized in that, After the first device determines the first array, the method further includes: The first device sends a pre-encryption command to the second device. The pre-encryption command is used to instruct the second device to perform a pre-encryption process. The pre-encryption command includes the data length of the first array and the second memory data.
5. The method according to claim 4, characterized in that, The method further includes: The first device receives a first indication information from the second device, the first indication information being used to indicate whether the second device has completed the pre-encryption process.
6. The method according to claim 1 or 2, characterized in that, The method further includes: The first device receives a second indication information from the second device, the second indication information being used to indicate whether the second device has correctly received the second data.
7. A method for data transmission, characterized in that, The method is applied in the automotive field, including: The second device receives the remaining data length of the first memory data, the data length of the second data, the third data, and the first check code from the first device. The second data is the data to be transmitted. The first check code is used to verify whether the third data is correct. The third data is determined based on the XOR operation between the first memory data and the second data. The first memory data includes the first data, which is determined based on the first array. The first array includes at least one random number. The second device determines the second checksum based on the remaining data length of the first memory data, the data length of the second data, and the third data; The second device verifies the first verification code against the second verification code; in, If the first checksum is the same as the second checksum, the second device determines the relationship between the data lengths of the third memory data and the second memory data of the first device, wherein the third memory data includes the first data; or... If the first verification code is different from the second verification code, the second device reports a verification failure to the first device.
8. The method according to claim 7, characterized in that, The length of the first memory data is greater than or equal to the length of the second data.
9. The method according to claim 7 or 8, characterized in that, The method further includes: The second device receives a pre-encryption command from the first device. The pre-encryption command instructs the second device to perform a pre-encryption process. The pre-encryption command includes the data lengths of the first array and the second memory data. The second device determines the first data based on the first array; The second device sends a first indication message to the first device, the first indication message being used to indicate whether the second device has completed the pre-encryption process.
10. The method according to claim 9, characterized in that, The third memory data includes the fourth memory data and the first data. Before the second device determines the first data based on the first array, the method further includes: The second device determines that the fourth memory data has the same data length as the second memory data.
11. The method according to claim 9, characterized in that, The method further includes: If the difference in data length between the third memory data and the second memory data is the same as the data length of the second data, the second device determines the second data based on the XOR operation between the third memory data and the third data; or, If the difference in length between the third memory data and the second memory data is different from the length of the second data, then the second device re-executes the pre-encryption process.
12. The method according to claim 11, characterized in that, The method further includes: The second device sends a second indication message to the first device, the second indication message being used to indicate whether the second device has correctly received the second data.
13. A communication device, characterized in that, The communication device is a device used in the automotive field, including: A processing unit is configured to determine a first array, wherein the first array includes at least one random number; The processing unit is further configured to determine first data based on the first array, wherein the first data belongs to first memory data; The processing unit is further configured to determine third data based on the XOR operation between the first memory data and the second data, wherein the second data is the data to be transmitted; The processing unit is further configured to determine a first check code based on the remaining data length of the first memory data, the data length of the second data, and the third data, wherein the first check code is used to verify whether the third data is correct. The transceiver unit is used to send the remaining data length of the first memory data, the data length of the second data, the third data, and the first check code to the second device.
14. The apparatus according to claim 13, characterized in that, The length of the first memory data is greater than or equal to the length of the second data.
15. The apparatus according to claim 13 or 14, characterized in that, The first memory data includes the second memory data and the first data. The processing unit is further configured to: It is determined that the length of the second memory data is less than the threshold.
16. The apparatus according to claim 13 or 14, characterized in that, The transceiver unit is further configured to: A pre-encryption command is sent to the second device, the pre-encryption command being used to instruct the second device to perform a pre-encryption process, the pre-encryption command including the data length of the first array and the second memory data.
17. The apparatus according to claim 16, characterized in that, The transceiver unit is further configured to: Receive a first indication message from the second device, the first indication message being used to indicate whether the second device has completed the pre-encryption process.
18. The apparatus according to claim 13 or 14, characterized in that, The transceiver unit is further configured to: Receive a second indication message from the second device, the second indication message being used to indicate whether the second device has correctly received the second data.
19. A communication device, characterized in that, The communication device is a device used in the automotive field, including: The transceiver unit is used to receive the remaining data length of the first memory data, the data length of the second data, the third data, and the first check code from the first device. The second data is the data to be transmitted. The first check code is used to verify whether the third data is correct. The third data is determined based on the XOR operation between the first memory data and the second data. The first memory data includes the first data, which is determined based on the first array. The first array includes at least one random number. The processing unit is configured to determine a second check code based on the remaining data length of the first memory data, the data length of the second data, and the third data; The processing unit is also used to verify the first verification code and the second verification code; in, If the first checksum is the same as the second checksum, the processing unit is further configured to determine the relationship between the data lengths of the third memory data and the second memory data of the first device, wherein the third memory data includes the first data; or... If the first verification code is different from the second verification code, the transceiver unit is also used to report a verification failure to the first device.
20. The apparatus according to claim 19, characterized in that, The length of the first memory data is greater than or equal to the length of the second data.
21. The apparatus according to claim 19 or 20, characterized in that, The transceiver unit is further configured to receive a pre-encryption command from the first device, the pre-encryption command being used to instruct the communication device to perform a pre-encryption process, the pre-encryption command including the data length of the first array and the second memory data; The processing unit is further configured to determine the first data based on the first array; The transceiver unit is further configured to send a first indication message to the first device, the first indication message being used to indicate whether the communication device has completed the pre-encryption process.
22. The apparatus according to claim 21, characterized in that, The third memory data includes the fourth memory data and the first data. The processing unit is also used to determine that the fourth memory data and the second memory data have the same data length.
23. The apparatus according to claim 21, characterized in that, If the difference in data length between the third memory data and the second memory data is the same as the data length of the second data, the processing unit is further configured to determine the second data based on the XOR operation between the third memory data and the third data; or, If the difference in length between the third memory data and the second memory data is different from the length of the second data, the processing unit is further configured to re-execute the pre-encryption process.
24. The apparatus according to claim 23, characterized in that, The transceiver unit is further configured to send a second indication message to the first device, the second indication message being used to indicate whether the communication device has correctly received the second data.
25. A computer-readable storage medium, characterized in that, The computer stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 6 or the method as described in any one of claims 7 to 12.
26. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 6.
27. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 7 to 12.
28. A communication device, characterized in that, include: A processor and a memory, the processor being coupled to the memory for storing a computer program, the processor being configured to execute the computer program stored in the memory to cause the communication device to perform the method as claimed in any one of claims 1 to 6, or to cause the communication device to perform the method as claimed in any one of claims 7 to 12.
Citation Information
Patent Citations
Data transmission method, system and terminals
CN102624515A
Data transfer method, communication system and storage medium
US6038321A