A method, device, equipment and medium for transmitting signature verification data

By adding interface files and configuring SPI registers in the SPI controller driver, SPI transmission is directly managed, which solves the problem of low SPI transmission efficiency in V2X, improves SM2 signature verification performance, and meets real-time verification requirements in high-load scenarios.

CN114567445BActive Publication Date: 2024-09-06CCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210191172.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2024-09-06
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

In V2X applications, SPI transmission efficiency and utilization are low, resulting in SM2 signature verification performance bottlenecks, which cannot meet the real-time verification requirements in high-load scenarios.

Method used

By adding the interface file to the SPI controller driver, configuring the SPI register, directly sending and receiving the data packets to be verified, and reading the working status of the security chip after the reception is completed, the verification results are obtained and the SPI controller is avoided. Drive to improve transmission efficiency and utilization.

Benefits of technology

It effectively improves SPI transmission efficiency and utilization, improves SM2 signature verification performance, meets V2X requirements for signature verification rate, and achieves more efficient data transmission and concurrent computing processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114567445B
    Figure CN114567445B
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for transmitting signature verification data, including: adding an interface file in the SPI controller driver in advance, and configuring the SPI register using the interface file, and then sending a number of signature data packets to be verified sent by the test program to the security chip in sequence through the SPI register; when it is detected that the security chip has received all the signature data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result; if the read result indicates that the working status of the security chip is a ready state, the signature verification result for the signature data packet to be verified returned by the security chip is obtained through the SPI register. The present application can effectively improve the SPI transmission rate and utilization by adding an interface file in the SPI controller driver, using the SPI register configured by the interface file to send and receive signature verification data, and sending a read instruction to the security chip after the security chip receives all the signature data packets to be verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a signature verification data transmission method, device, equipment and medium. Background Art

[0002] V2X (Vehicle to Everything), as a wireless communication technology for vehicles, is a new generation of information and communication technology that connects vehicles to everything. V stands for vehicle, and X stands for any object that interacts with the vehicle. Currently, X mainly includes vehicles (Vehicle to Vehicle, V2V), pedestrians (Vehicle to Pedestrian, V2P), roadside infrastructure (Vehicle to Infrastructure, V2I), and networks (Vehicle to Network, V2N). In V2X applications, high-speed SM2 signature verification performance is required to meet the real-time verification of external devices by vehicles. According to the current general requirements in the industry, in the PC5 message service model, when the number of vehicles around the vehicle reaches saturation of 200, the vehicle message sending rate of each node is 10 times / second, and the current node vehicle message arrival rate will reach 2000 times / second. Considering the processing loss of communication and business messages, 20% of computing redundancy needs to be reserved, and the SM2 signature verification interface performance of the SSF layer should not be less than 2400 times / second.

[0003] V2X functions are generally integrated into components such as Tbox, domain controller or antenna equipment. The main control chip of such equipment generally adopts NXP's automotive SOC chip in the industry. The communication interface provided by the main control SOC chip to the security chip is generally SPI (Serial Peripheral Interface). The security chip provides security computing services to the main control SOC chip through the SPI interface. The general process of security computing services is that the main control SOC chip sends the message to be processed to the security chip through SPI. After the security chip performs cryptographic operations, it sends the results to the main control SOC chip. At present, on the one hand, the main control SOC chip uses the Linux native SPIDEV driver to interact with the security chip. The SPIDEV driver uses the LinuxSPI driver framework, through SPI_Message to SPI_Transfer, and finally calls the SPI controller driver to send and receive with the security chip. In this way, it takes a long time to call the SPI driver, and the SPI controller of the commonly used NXP SOC chip drives the SPI transmission efficiency is not high, resulting in SPI transmission being the bottleneck of the SM2 operation rate. On the other hand, when the security chip processes the data packet to be verified, it generally adopts a one-send-one-receive simplex processing method. The reason is that the security chip needs to receive the data before performing cryptographic operations. This method ignores the duplex processing capability of the SPI and does not realize the concurrent processing of transmission and operation. Therefore, the SPI utilization efficiency is relatively low in this way, which also affects the operation rate of SM2.

[0004] In summary, how to improve the transmission efficiency and utilization of SPI for signature verification data in V2X is a problem that needs to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a signature verification data transmission method, device, equipment and medium that can improve the transmission efficiency and utilization rate of SPI for signature verification data in V2X. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a signature verification data transmission method, which is applied to a main control SOC chip in V2X, including:

[0007] Add an interface file in the SPI controller driver in advance, and use the interface file to configure the SPI register, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register;

[0008] When it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result;

[0009] If the reading result indicates that the working state of the security chip is a ready state, the signature verification result for the data packet to be verified returned by the security chip is obtained through the SPI register.

[0010] Optionally, the step of sending a number of signature-to-be-verified data packets sent by the test program to the security chip in sequence through the SPI register includes:

[0011] Performing a write operation based on the interface file through the test program so that the SPI register acquires a number of data packets to be verified sent by the test program, and sequentially sends the number of data packets to be verified to the security chip;

[0012] Correspondingly, obtaining the signature verification result for the data packet to be verified returned by the security chip through the SPI register includes:

[0013] The test program performs a read operation based on the interface file, so that the SPI register reads the signature verification result for the data packet to be verified returned by the security chip, and sends the signature verification result to the test program.

[0014] Optionally, before sending a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register, the method further includes:

[0015] The signature verification operation command, the signature verification data segment and the check code are encapsulated to obtain the data packet to be verified; wherein the signature verification data segment includes the signature verification instruction.

[0016] Optionally, after sending a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register, the method further includes:

[0017] The security chip returns a response message to the main control SOC chip to indicate that it has received all the data packets to be verified, so that the main control SOC chip determines that the security chip has received all the data packets to be verified based on the response information; and, in the process of receiving the data packets to be verified, the security chip parses each received data packet to be verified in turn to obtain the verification data segment corresponding to each data packet to be verified; and performs corresponding verification operation on each verification data segment based on the verification instruction in the verification data segment to obtain the verification result.

[0018] Optionally, the signature verification data transmission method further includes:

[0019] The working state is set to a busy state during the signature verification operation, and the working state is set to a ready state after the signature verification operation is completed.

[0020] Optionally, after sending a read instruction for reading the working status of the security chip to the security chip to obtain a read result, the method further includes:

[0021] If the read result indicates that the working state of the security chip is the busy state, the step of sending a read instruction for reading the working state of the security chip to the security chip is re-executed at every preset time interval until the read result is the ready state.

[0022] Optionally, sending a read instruction for reading the working status of the security chip to the security chip to obtain a read result includes:

[0023] If there are multiple data packets to be verified, a read instruction for reading the working status of the security chip performing signature verification operation on the last data packet to be verified is sent to the security chip to obtain a corresponding read result.

[0024] In the second aspect, the present application discloses a signature verification data transmission device, which is applied to a main control SOC chip in V2X, including:

[0025] A data sending module is used to add an interface file in the SPI controller driver in advance, configure the SPI register using the interface file, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register;

[0026] an instruction sending module, configured to send a read instruction for reading the working status of the security chip to the security chip when detecting that the security chip has received all the data packets to be verified, so as to obtain a read result;

[0027] The data acquisition module is used for acquiring the signature verification result of the data packet to be verified returned by the security chip through the SPI register if the reading result indicates that the working state of the security chip is a ready state.

[0028] In a third aspect, the present application discloses an electronic device, comprising:

[0029] Memory, used to store computer programs;

[0030] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed signature verification data transmission method.

[0031] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed signature verification data transmission method are implemented.

[0032] It can be seen that the present application adds an interface file in the SPI controller driver in advance, and uses the interface file to configure the SPI register, and then sends a number of data packets to be verified sent by the test program to the security chip through the SPI register in sequence; when it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working state of the security chip is sent to the security chip to obtain a read result; if the read result is a characterization that the working state of the security chip is in a ready state, the verification result of the data packet to be verified returned by the security chip is obtained through the SPI register. It can be seen that the present application completes the sending and receiving of the verification data by adding an interface file in the SPI controller driver and using the SPI register configured by the interface file. In this way, the SPI controller driver can be avoided, thereby reducing the system overhead of the main control SOC chip; and when sending data, a number of data packets to be verified sent by the test program are sent to the security chip through the SPI register in sequence, and a read instruction is sent to the security chip after detecting that the security chip has received all the data packets to be verified. In this way, the above technical solution can effectively improve the transmission efficiency and utilization rate of SPI. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0034] Figure 1 This is a flow chart of a signature verification data transmission method disclosed in this application;

[0035] Figure 2 A communication connection diagram between an existing main control SOC chip and a security chip disclosed in this application;

[0036] Figure 3 A specific read instruction sending flow chart disclosed in this application;

[0037] Figure 4 This is a flow chart of a specific signature verification data transmission method disclosed in this application;

[0038] Figure 5 This is a specific signature verification data transmission process diagram disclosed in this application;

[0039] Figure 6 A specific data reading and writing flow chart disclosed in this application;

[0040] Figure 7 An existing data reading and writing flow chart disclosed in this application;

[0041] Figure 8 This is a flow chart of a specific signature verification data transmission method disclosed in this application;

[0042] Fig. 9 A flowchart of the transmission and signature verification operation of multiple data packets to be verified disclosed in this application;

[0043] Fig.10 This is an existing SM2 signature verification data transmission waveform diagram disclosed in this application;

[0044] Fig.11 A schematic diagram of an existing specific waveform interval time disclosed in this application;

[0045] Fig.12 This is an improved SM2 signature verification data transmission waveform diagram disclosed in this application;

[0046] Fig.13 This is a schematic diagram of an improved specific waveform interval time disclosed in the present application;

[0047] Fig.14 This is a schematic diagram of the structure of a signature verification data transmission device disclosed in this application;

[0048] Fig.15 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] In V2X applications, when the main control SOC chip and the security chip send and receive data, on the one hand, the main control SOC chip uses the Linux native SPIDEV driver to interact with the security chip. The SPIDEV driver uses the Linux SPI driver framework, through SPI_Message to SPI_Transfer, and finally calls the SPI controller driver to send and receive with the security chip. In this way, the SPI driver call is time-consuming, and the SPI controller driver of the commonly used NXP SOC chip has low SPI transmission efficiency; on the other hand, when the security chip processes the data packet to be verified, it generally adopts a simplex processing method of one send and one receive, because the security chip needs to perform cryptographic operations after receiving the data. This method ignores the duplex processing capability of SPI and does not realize the concurrent processing of transmission and operation. Therefore, the SPI utilization efficiency is relatively low in this way. For this reason, the embodiment of the present application discloses a method, device, equipment and medium for transmitting signature data, which can improve the transmission efficiency and utilization rate of SPI for the signature data in V2X.

[0051] See also Figure 1 As shown, the embodiment of the present application discloses a signature verification data transmission method, the method comprising:

[0052] Step S11: add an interface file in the SPI controller driver in advance, and use the interface file to configure the SPI register, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register.

[0053] Figure 2 A communication connection diagram between an existing main control SOC chip and a security chip is disclosed. In V2X applications, the security chip is connected to the main control SOC chip as an SPI Slave, and a firmware program is run in the security chip. The test program on the main control SOC side accesses the SPI device file through the system interface to interact with the security chip. The SPI in the figure is a standard SPI interface with four signal lines, MOSI, MISO, CS, and CLK. It can be a single-channel or multi-channel SPI. IO is some GPIO pins, including status pins, wake-up pins, and reset pins. The Linux native SPI controller driver is used on the main control SOC side to interact with the security chip. In this embodiment, by adding an interface file to the SPI controller driver in advance, and then using the interface file to configure the SPI register, the SPI register can be directly controlled to send a number of data packets to be verified sent by the test program to the security chip. In this way, the SPI controller driver can be avoided, thereby reducing the system overhead of the main control SOC chip.

[0054] Step S12: When it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result.

[0055] In this embodiment, after detecting that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip. It should be pointed out that the working status of the security chip includes a ready state and a busy state. The security chip mainly performs a signature verification operation. Therefore, the above-mentioned signature verification data transmission method also includes: setting the working state to a busy state during the signature verification operation, and setting the working state to a ready state after the signature verification operation is completed. In addition, in addition to sending a read instruction to the security chip to read the working status of the security chip, the embodiment of the present application can also obtain the working status of the security chip by means of GPIO.

[0056] Step S13: If the reading result indicates that the working state of the security chip is the ready state, the signature verification result for the data packet to be verified returned by the security chip is obtained through the SPI register.

[0057] In this embodiment, in a specific embodiment, if the reading result indicates that the working state of the security chip is ready, it means that the security chip has completed the signature verification operation, and the signature verification result for the data packet to be verified returned by the security chip is obtained through the SPI register.

[0058] In another specific embodiment, after the above-mentioned step of sending a read instruction for reading the working status of the security chip to the security chip to obtain a read result, it also includes: if the read result indicates that the working status of the security chip is the busy state, then re-executing the step of sending a read instruction for reading the working status of the security chip to the security chip at every preset time interval until the read result is the ready state. Figure 3 A specific read instruction sending flow chart disclosed in the present application, that is, if the read result indicates that the working state of the security chip is busy, it means that the security chip is still in the signature verification operation process, and then a read instruction for reading the working state of the security chip is resent to the security chip at regular intervals until the read result indicates that the working state of the security chip is ready, and then the signature verification result is read from the security chip.

[0059] It can be seen that the present application adds an interface file in the SPI controller driver in advance, and uses the interface file to configure the SPI register, and then sends a number of data packets to be verified sent by the test program to the security chip through the SPI register in sequence; when it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working state of the security chip is sent to the security chip to obtain a read result; if the read result is a characterization that the working state of the security chip is in a ready state, the verification result of the data packet to be verified returned by the security chip is obtained through the SPI register. It can be seen that the present application completes the sending and receiving of the verification data by adding an interface file in the SPI controller driver and using the SPI register configured by the interface file. In this way, the SPI controller driver can be avoided, thereby reducing the system overhead of the main control SOC chip; and when sending data, a number of data packets to be verified sent by the test program are sent to the security chip through the SPI register in sequence, and a read instruction is sent to the security chip after detecting that the security chip has received all the data packets to be verified. In this way, the above technical solution can effectively improve the transmission efficiency and utilization rate of SPI.

[0060] See also Figure 4 As shown, the embodiment of the present application discloses a specific signature verification data transmission method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0061] Step S21: Add an interface file in the SPI controller driver in advance, and use the interface file to configure the SPI register, and then perform a write operation based on the interface file through the test program, so that the SPI register obtains a number of data packets to be verified sent by the test program, and sends a number of the data packets to be verified to the security chip in sequence.

[0062] In this embodiment, the interface file added in the SPI controller driver can be specifically a SPI read-write interface file, and the user space program can directly read and write the interface. In the read-write interface, the SPI register is directly controlled without going through the Linux SPI controller driver to realize data transmission and reception. Figure 5 This is a specific signature verification data transmission flow chart disclosed in an embodiment of the present application. It can be understood that when writing data, the write operation is first performed based on the interface file through the test program, and then the SPI register obtains a certain number of data packets to be verified written by the test program, and then the data transmission is started to send these data packets to the security chip.

[0063] Step S22: When it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result.

[0064] Step S23: If the reading result indicates that the working state of the security chip is in the ready state, a read operation is performed based on the interface file through the test program, so that the SPI register reads the verification result of the data packet to be verified returned by the security chip, and sends the verification result to the test program.

[0065] In this embodiment, it can be understood that, see Figure 5 As shown, when the working state of the security chip is ready, data is read. First, the test program performs a read operation based on the interface file, and then the SPI register starts data reception, and reads the verification result of the data packet to be verified returned by the security chip, and sends the verification result to the test program.

[0066] After adopting the technical solution disclosed in the embodiment of this application, Figure 6 A specific data reading and writing process is disclosed. Figure 7 This is the existing data reading and writing flow chart. Figure 7 In the system, it takes about 50us from the VFS interface call to the start of SPI data transmission and reception, and the time consumption is mainly in the sys_sync interface. Figure 6 After the process in, one signature verification can reduce the time by about 45us. Among them, the Sysfs interface is the read and write interface of the user space in the interface file added in this embodiment, which is used to interact with the device.

[0067] For a more specific processing procedure of the above step S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0068] It can be seen that in this application, the test program first performs a write operation based on a pre-configured interface file, so that the SPI register obtains a number of data packets to be verified sent by the test program, and sends a number of data packets to be verified to the security chip in sequence, and when the working state of the security chip is ready, the test program first performs a read operation based on the interface file, so that the SPI register reads the verification result of the data packet to be verified returned by the security chip, and sends the verification result to the test program. By adding the technical solution of the interface file in the SPI controller driver, the transmission efficiency of the SPI can be effectively improved.

[0069] See also Figure 8As shown, the embodiment of the present application discloses a specific signature verification data transmission method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, it includes:

[0070] Step S31: add an interface file in the SPI controller driver in advance, and use the interface file to configure the SPI register, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register.

[0071] In this embodiment, before sending the plurality of signature verification data packets sent by the test program to the security chip in sequence through the SPI register, the method further includes: encapsulating the signature verification operation command, the signature verification data segment and the check code to obtain the signature verification data packet; wherein the signature verification data segment includes the signature verification instruction. That is, the main control SOC chip needs to encapsulate the signature verification operation command, the signature verification data segment and the check code in a prescribed format to obtain the signature verification data packet.

[0072] Step S32: the security chip returns a response message to the main control SOC chip to indicate that it has received all the data packets to be verified, so that the main control SOC chip determines that the security chip has received all the data packets to be verified based on the response information; and, in the process of receiving the data packets to be verified, the security chip parses each received data packet to be verified in turn to obtain the verification data segment corresponding to each data packet to be verified; and performs corresponding verification operation on each verification data segment based on the verification instruction in the verification data segment to obtain the verification result.

[0073] In this embodiment, after receiving all the data packets to be verified, the security chip needs to return a response message to the main control SOC chip, so that the main control SOC chip can determine that the security chip has received all the data packets to be verified based on the response message. In addition, in the process of receiving the data packets to be verified, the security chip needs to parse each of the received data packets to be verified in turn, and perform a verification operation on the verification data segments obtained by the parsing according to the verification instruction to obtain the verification result. Specifically, after receiving the first data packet to be verified, the security chip starts the operation, and can continue to receive subsequent data packets to be verified, so as to realize the concurrent processing of SPI transmission and algorithm operation, which can effectively improve the operation performance and the utilization rate of SPI.

[0074] Step S33: When it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result.

[0075] In this embodiment, the main control SOC chip obtains whether the signature verification instruction has been executed through the read instruction. After the signature verification instruction is executed, the working state of the security chip changes from the busy state to the ready state, and the corresponding read result is the ready state. It should be pointed out that the above-mentioned sending of the read instruction for reading the working state of the security chip to the security chip to obtain the read result may specifically include: if the number of the data packets to be verified is multiple, sending a read instruction for reading the working state of the security chip for performing signature verification operation on the last data packet to be verified to the security chip to obtain the corresponding read result. That is, when the number of data packets to be verified is more than one, it is only necessary to query the working state of the security chip for performing signature verification operation on the last data packet to be verified. For example, Fig. 9 A flow chart of transmission and signature verification operation of multiple data packets to be verified is disclosed. When the number of data packets to be verified is 4, each data packet to be verified is recorded as a job, namely Job0, Job1, Job2, and Job3. Job0, Job1, Job2, and Job3 are transmitted to the security chip. Each data packet to be verified includes an SSI Bridge write instruction, a signature verification data segment, and a CRC32 checksum. When the security chip receives job0, it starts to perform signature verification operation for the signature verification instruction of job0, and continues to receive job1 at the same time, so as to realize the concurrent processing of receiving data and signature verification operation, and when performing the signature verification operation, it is ensured that Job0, Job1, Job2, and Job3 are operated in sequence. When the transmission of Job3 is completed, it means that the transmission of the four data packets to be verified is completed. At this time, a read instruction is sent to the security chip to query the working status of the security chip. Since the security chip performs signature verification on Job0, Job1, Job2, and Job3 in sequence, the main control SOC only needs to query the status of Job3. When the main control SOC chip queries that the working status of the security chip for Job3 is ready, it starts to read the signature verification result.

[0076] Step S34: if the reading result indicates that the working state of the security chip is the ready state, the signature verification result for the data packet to be verified returned by the security chip is obtained through the SPI register.

[0077] For a more specific processing procedure of the above step S34, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0078] It can be seen that in this application, the data packet to be verified is obtained by encapsulating the verification operation command, the verification data segment and the check code; in the process of receiving a number of data packets to be verified, the security chip parses each of the received data packets to be verified in turn, and performs the verification operation on the parsed verification data segment according to the verification instruction to obtain the verification result, and the security chip starts the operation after receiving the first data packet to be verified, and can continue to receive subsequent data packets to be verified, so as to realize the concurrent processing of SPI transmission and algorithm operation, and can effectively improve the operation performance and utilization rate of SPI. In addition, when the number of data packets to be verified is more than one, it is only necessary to query the working status of the security chip for the verification operation of the last data packet to be verified.

[0079] Taking the SM2 signature verification operation as an example, before the technical solution in this application is adopted, for the data segment of APDU (16 bytes) + KeyData (64 bytes) + Msg (32 bytes) + RS (64 bytes), the transmission waveform is shown in FIG. Fig.10 As shown in the above data segment signature verification process, the transmission time of the main control SOC chip to send the data packet to be verified is 279us, the execution time of the signature verification command is 377us, and the transmission time of the response data packet is 123us, with a total time of 779us. The cycle test is repeated 1000 times, which takes about 787ms, and the signature verification performance is 1271 times / second. According to this driving scheme, the interval time between SCK (serial clock) in the SPI waveform is relatively long. Taking NXP's i.MX8M SOC as an example, the specific analysis is as follows:

[0080] When sending and receiving data, in DMA (Direct Memory Access) mode, such as Fig.11 As shown, the interval between every 16 bytes is 8us, the minimum interval between each byte is 220ns, and there is an indefinite interval every 64 bytes, in order to ensure that the FIFO data is sent and received. From the VFS interface call to the start of SPI data transmission and reception, the system takes about 50us, which is the CPU overhead of VFS to the SPI controller to send data. Based on the above characteristics, taking the signature verification command as an example, the master end sends data: APDU (16 bytes) + KeyData (64 bytes) + Msg (32 bytes) + RS (64 bytes) = 176 bytes, and the transmission time is 279us. Adding the transmission time of the response packet, the SPI transmission time of a signature verification operation is more than 400us. This causes SPI transmission to become the performance bottleneck of the signature verification interface of the master SOC chip.

[0081] After adopting the technical solution of the present application, the transmission waveform diagram and the interval diagram between bytes are as follows: Fig.12 and Fig.13 As shown in the figure, during the data transmission and reception process, the interval between every 64 bytes is 8us, which reduces the transmission time of 64 bytes by 24us compared with the original driver solution; the interval between every 4 bytes is 220ns, which reduces the transmission time of every 4 bytes by 660ns compared with the original driver; because the data transmission and reception does not pass through the Linux SPI driver framework, the SPI controller register is directly operated to reduce the system scheduling overhead and reduce the time by about 45us. After optimization, the transmission time of APDU (16 bytes) + KeyData (64 bytes) + Msg (32 bytes) + RS (64 bytes) = 176 bytes is 157us. In the whole, the transmission time of the last signature verification operation is changed from the original 402us to 253us. The transmission efficiency is improved by 60%.

[0082] In addition, by adopting a multi-data packet sending scheme, concurrent data of SPI transmission and signature verification operation can be realized. After testing, it can be obtained that the SM2 signature verification performance is increased from the original 1200 times / second to 2600 times / second. It can meet the V2X requirements for signature verification rate. It can be seen that through the technical solution of this application, the transmission efficiency and utilization rate of SPI can be effectively improved, and the V2X requirements for signature verification rate can be met.

[0083] See also Fig.14 As shown, the embodiment of the present application discloses a signature verification data transmission device, which is applied to a main control SOC chip in V2X. The device includes:

[0084] The data sending module 11 is used to add an interface file in the SPI controller driver in advance, configure the SPI register using the interface file, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register;

[0085] The instruction sending module 12 is used to send a read instruction for reading the working status of the security chip to the security chip when it is detected that the security chip has received all the data packets to be verified, so as to obtain a read result;

[0086] The data acquisition module 13 is configured to acquire, through the SPI register, a signature verification result for the data packet to be verified returned by the security chip if the reading result indicates that the working state of the security chip is a ready state.

[0087] It can be seen that the present application adds an interface file in the SPI controller driver in advance, and uses the interface file to configure the SPI register, and then sends a number of data packets to be verified sent by the test program to the security chip through the SPI register in sequence; when it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working state of the security chip is sent to the security chip to obtain a read result; if the read result is a characterization that the working state of the security chip is in a ready state, the verification result of the data packet to be verified returned by the security chip is obtained through the SPI register. It can be seen that the present application completes the sending and receiving of the verification data by adding an interface file in the SPI controller driver and using the SPI register configured by the interface file. In this way, the SPI controller driver can be avoided, thereby reducing the system overhead of the main control SOC chip; and when sending data, a number of data packets to be verified sent by the test program are sent to the security chip through the SPI register in sequence, and a read instruction is sent to the security chip after detecting that the security chip has received all the data packets to be verified. In this way, the above technical solution can effectively improve the transmission efficiency and utilization rate of SPI.

[0088] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the signature verification data transmission method performed by a computer device disclosed in any of the aforementioned embodiments.

[0089] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the computer device 20; the communication interface 24 can create a data transmission channel between the computer device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0090] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0091] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0092] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the computer device 20 to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the signature verification data transmission method performed by the computer device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can also further include a computer program that can be used to complete other specific tasks. In addition to data received by the computer device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0093] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps performed in the signature verification data transmission process disclosed in any of the aforementioned embodiments are implemented.

[0094] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0095] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0096] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0098] The above describes in detail a signature verification data transmission method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A signature verification data transmission method, applied to the main control SOC chip in V2X, characterized in that: include: Add an interface file in the SPI controller driver in advance, and use the interface file to configure the SPI register, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register; When it is detected that the security chip has received all the data packets to be verified, a read instruction for reading the working status of the security chip is sent to the security chip to obtain a read result; If the reading result indicates that the working state of the security chip is in the ready state, obtaining the signature verification result of the data packet to be verified returned by the security chip through the SPI register; The sending of a read instruction for reading the working status of the security chip to the security chip to obtain a read result includes: If there are multiple data packets to be verified, a read instruction for reading the working status of the security chip performing signature verification operation on the last data packet to be verified is sent to the security chip to obtain a corresponding read result.

2. The signature verification data transmission method according to claim 1, characterized in that: The step of sequentially sending a number of signature verification data packets sent by the test program to the security chip through the SPI register includes: Performing a write operation based on the interface file through the test program so that the SPI register acquires a number of data packets to be verified sent by the test program, and sequentially sends the number of data packets to be verified to the security chip; Correspondingly, obtaining the signature verification result for the data packet to be verified returned by the security chip through the SPI register includes: The test program performs a read operation based on the interface file, so that the SPI register reads the signature verification result for the data packet to be verified returned by the security chip, and sends the signature verification result to the test program.

3. The signature verification data transmission method according to claim 1, characterized in that: Before sending a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register, the method further includes: The signature verification operation command, the signature verification data segment and the check code are encapsulated to obtain the data packet to be verified; wherein the signature verification data segment includes the signature verification instruction.

4. The signature verification data transmission method according to claim 3, characterized in that: After the plurality of signature verification data packets sent by the test program are sequentially sent to the security chip through the SPI register, the method further includes: The security chip returns a response message to the main control SOC chip to indicate that it has received all the data packets to be verified, so that the main control SOC chip determines that the security chip has received all the data packets to be verified based on the response message; and, in the process of receiving the data packets to be verified, the security chip parses each received data packet to be verified in turn to obtain the verification data segment corresponding to each data packet to be verified; and performs corresponding verification operation on each verification data segment based on the verification instruction in the verification data segment to obtain the verification result.

5. The signature verification data transmission method according to claim 4, characterized in that: Also includes: The working state is set to a busy state during the signature verification operation, and the working state is set to a ready state after the signature verification operation is completed.

6. The signature verification data transmission method according to claim 5, characterized in that: After sending a read instruction for reading the working status of the security chip to the security chip to obtain a read result, the method further includes: If the read result indicates that the working state of the security chip is the busy state, the step of sending a read instruction for reading the working state of the security chip to the security chip is re-executed at every preset time interval until the read result is the ready state.

7. A signature verification data transmission device, applied to the main control SOC chip in V2X, characterized in that: include: A data sending module is used to add an interface file in the SPI controller driver in advance, configure the SPI register using the interface file, and then send a number of signature verification data packets sent by the test program to the security chip in sequence through the SPI register; an instruction sending module, configured to send a read instruction for reading the working status of the security chip to the security chip when detecting that the security chip has received all the data packets to be verified, so as to obtain a read result; A data acquisition module, configured to acquire, through the SPI register, a signature verification result of the data packet to be verified returned by the security chip if the reading result indicates that the working state of the security chip is a ready state; Among them, the instruction sending module is specifically used to send a read instruction for reading the working status of the security chip performing signature verification operation on the last data packet to be verified to the security chip if there are multiple data packets to be verified, so as to obtain a corresponding reading result.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the signature verification data transmission method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the signature verification data transmission method according to any one of claims 1 to 6 are implemented.