Data check method, device and system

Through the CRC verification methods of adaptive selection vectorization calculation, hardware CRC and table lookup calculation, the problem of slow calculation speed of existing CRC algorithms is solved, more efficient data verification is achieved, and a variety of CRC algorithm needs is adapted to the needs of various CRC algorithms, and system performance is improved.

WO2025167359A1PCT designated stage Publication Date: 2025-08-14YINWANG INTELLIGENT TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2024/141486
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-07
Filing Date
2024-12-23
Publication Date
2025-08-14

AI Technical Summary

Technical Problem

The existing CRC algorithms have slow computing speed and strong computing dependencies, making it difficult to meet the needs of rapidly developing information technology scenarios.

Method used

Provide a data verification method, which supports multiple CRC algorithms. By obtaining operating environment information and verification information, the optimal verification method is adaptively selected, including vectorized calculation, hardware CRC and table lookup calculation, and optimized the CRC verification process.

Benefits of technology

It improves the CRC calculation speed, optimizes the data verification efficiency, adapts to different CRC algorithm needs, and improves the system's computing performance and portability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024141486_14082025_PF_FP_ABST
    Figure CN2024141486_14082025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a data check method, device and system, which are applied to the field of communications. The method comprises: obtaining operation environment information, check information and data to be checked; on the basis of the operation environment information and the check information, matching a target check mode, wherein the target check mode is one of a first check mode, a second check mode and a third check mode, the first check mode completes cyclic redundancy check (CRC) calculation on the basis of vectorization calculation, the second check mode completes the CRC calculation on the basis of a hardware CRC, and the third check mode completes the CRC calculation on the basis of a look-up table; and checking said data on the basis of the target check mode. The present application can support various CRC algorithms, and adaptively provide an optimal check mode on the basis of system information, thereby increasing the calculation speed, and optimizing data check.
Need to check novelty before this filing date? Find Prior Art

Description

Data verification method, device and system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 7, 2024, with application number 202410175917.9 and application name “Data Verification Method, Device and System”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communications, and in particular to a data verification method, device, and system. Background Art

[0003] Currently, a cyclic redundancy check (CRC) is commonly used for data verification to determine the integrity and reliability of data transmission or storage. With the rapid development of information technology and the continuous expansion of its application scenarios, the types of CRC algorithms are increasing, and the performance requirements for CRC algorithms are also becoming increasingly higher. However, the calculation principle of the CRC algorithm is modulo-2 division, which means that the CRC algorithm needs to be calculated bit by bit. Moreover, the data calculation is sequential and must be calculated in order from high to low bits. The result of each calculation will also affect the next calculation, resulting in excessive calculation times, strong dependence between data, and slow calculation speed.

[0004] Therefore, how to improve computing speed and optimize data verification has become a technical problem that needs to be solved urgently. Summary of the Invention

[0005] The present application provides a data verification method, device and system that can support multiple CRC algorithms, adaptively provide the optimal verification method based on system information, improve calculation speed, and optimize data verification.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, the present application provides a data verification method, which includes: obtaining operating environment information, verification information and data to be verified; matching a target verification method based on the operating environment information and the verification information; the target verification method is one of a first verification method, a second verification method and a third verification method; the first verification method completes a cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification method completes a CRC calculation based on hardware CRC, and the third verification method completes a CRC calculation based on a table lookup; and according to the target verification method, verifying the data to be verified.

[0008] In this application, multiple CRC algorithms are supported. The optimal and most efficient CRC verification method supported by the system in the current scenario is adaptively selected according to the current operating environment and the CRC algorithm selected by the user. Efficient calculations are performed based on this CRC verification method to improve the calculation speed.

[0009] According to the first aspect, the operating environment information includes the vector instruction set and / or hardware CRC information supported by the current operating environment; the check information includes the CRC algorithm parameters to be used.

[0010] In some examples, the operating environment information is basic information that enables the application to run normally on the operating system and hardware devices. The operating environment information includes the vector instruction set supported by the current operating environment, hardware CRC information, operating system, processor architecture, system configuration information, hardware device information, network environment information, etc.

[0011] In some examples, the hardware CRC information includes hardware CRC interface information supported by the current operating environment.

[0012] In a possible implementation, the operating environment information is dynamically acquired according to instructions.

[0013] In another possible implementation, predefined operating environment information is determined.

[0014] In some examples, the checksum information includes CRC algorithm parameters to be used, including polynomial length, polynomial definition, initial value, whether the input is inverted, whether the output is inverted, and the XOR value of the result.

[0015] In one possible implementation, the check information is determined in response to a CRC algorithm selected by the user.

[0016] According to the first aspect, or any implementation method of the first aspect above, when the target verification method is the first verification method, the data to be verified is verified according to the target verification method, including: generating a target vector instruction set based on the vector instruction set supported by the current operating environment; the target vector instruction set is a vector instruction set that can complete the CRC calculation; and verifying the data to be verified according to the target vector instruction and the verification information.

[0017] In this application, a computational framework corresponding to vectorized calculations is constructed. As long as the vector instruction set supported by the current operating environment is used, the corresponding target vector instruction can be obtained according to the computational framework to perform vectorized CRC calculations for any CRC algorithm. The computational framework can be applied to different vector instruction sets and different CRC algorithms. During the computational process, the user only needs to provide parameters such as the initial value of the CRC algorithm, whether the output is inverted, and the XOR value of the result. The eigenvalues ​​are pre-calculated based on the polynomial in the checksum information, and the user-provided parameters are then brought into the computational framework to obtain the calculation results of the user-selected CRC algorithm, thereby optimizing the checksum method.

[0018] According to the first aspect, or any implementation of the first aspect above, a target vector instruction set is generated based on the vector instruction set supported by the current operating environment, including: combining the vector instruction set supported by the current operating environment to obtain the target vector instruction set, the target vector instruction set including carry-less multiplication operation instructions and exclusive-OR operation instructions.

[0019] In this application, when performing vectorized operations, the vector instruction set is based on the operation framework, which can meet the requirements of different CRC algorithms and achieve efficient calculations in the current operating environment. Moreover, the operation framework is highly versatile and can be applied to any platform or device that supports the basic vector instruction set, making it highly applicable.

[0020] According to the first aspect, or any implementation of the first aspect above, when the vector instruction set supported by the current operating environment does not include a carry-less multiplication operation instruction; combining the vector instruction set supported by the current operating environment to obtain the target vector instruction set includes: combining the vector instruction set supported by the current operating environment to obtain the carry-less multiplication operation instruction; generating the target vector instruction set based on the carry-less multiplication operation instruction and the exclusive-OR operation instruction in the vector instruction set supported by the current operating environment.

[0021] In this application, the advanced vector operation instructions required for CRC calculation, that is, carry-less multiplication operation instructions, are obtained according to the combination of the basic vector instruction set, so as to perform vectorized CRC calculation later, improve the calculation efficiency and performance, and also improve the reusability and portability of the code.

[0022] According to the first aspect, or any implementation of the first aspect above, the vector instruction set supported by the current operating environment includes a carry-less multiplication instruction, but the data length that can be processed by the vector register indicated by the carry-less multiplication instruction is lower than the polynomial length in the verification information; according to the target vector instruction and the verification information, the data to be verified is verified, including: performing segmented processing according to the target vector instruction and the verification information, and verifying the data to be verified.

[0023] In this application, a fixed-length vector register can process longer CRC polynomials through segmented processing.

[0024] According to the first aspect, or any implementation of the first aspect above, the verification information includes a polynomial length; the first verification method includes a preset polynomial length; the method also includes: normalizing the polynomial length in the verification information according to the preset polynomial length, and the processed polynomial length is the same as the preset polynomial length.

[0025] In this application, the normalized polynomials have the same length, and the same calculation framework can be used to calculate different CRC algorithms, thereby improving the versatility of the calculation framework.

[0026] According to the first aspect, or any implementation method of the above first aspect, the verification information also includes whether the input data is reversed, and the first verification method also includes a first preset processing framework and a second preset processing framework; the first preset processing framework is a pre-set CRC calculation framework when the input data is reversed; the second preset processing framework is a pre-set CRC calculation framework when the input data is not reversed; according to the target vector instruction and the verification information, the data to be verified is verified, including: if the verification information includes the inversion of the input data, then the data to be verified is verified according to the target vector instruction and the first preset processing framework; if the verification information includes that the input data is not reversed, then the data to be verified is verified according to the target vector instruction and the second preset processing framework.

[0027] In this application, for differentiated operation methods, corresponding processing frameworks are set to better adapt to different CRC algorithm requirements, improve calculation efficiency, and ensure the universality and consistency of the operation framework.

[0028] According to the first aspect, or any implementation of the first aspect above, when the target verification method is the second verification method, the data to be verified is verified according to the target verification method, including: verifying the data to be verified based on the hardware CRC indicated by the hardware CRC information.

[0029] In this application, when the target verification method is determined to be the second verification method, high-speed CRC calculation is performed according to the hardware CRC, which can fully utilize the computing power of the hardware and improve the computing efficiency and performance.

[0030] According to the first aspect, or any implementation method of the first aspect above, when the target verification method is the third verification method, the data to be verified is verified according to the target verification method, including: generating a lookup table according to the preset bit and the verification information, and verifying the data to be verified according to the lookup table.

[0031] In this application, when the target verification method is the third verification method, the verification is completed by looking up a table. The table lookup method is efficient and flexible and is suitable for the calculation requirements of different CRC polynomial lengths.

[0032] According to the first aspect, or any implementation method of the first aspect above, matching the target verification method according to the operating environment information and the verification information, including: determining whether the operating environment information includes the hardware CRC information; if it is determined that the operating environment information includes the hardware CRC information, and the hardware CRC information corresponds to the CRC algorithm parameters to be used, then determining that the target verification method is the second verification method.

[0033] According to the first aspect, or any implementation method of the first aspect above, the operating environment information does not include the hardware CRC information; or, if the operating environment information includes the hardware CRC information, but the hardware CRC information and the CRC algorithm parameters to be used do not correspond; according to the operating environment information and the verification information, matching the target verification method, including: determining whether the operating environment information includes the vector instruction set; if it is determined that the operating environment information includes the vector instruction set, and the data length of the data to be verified meets the preset threshold value, then determining that the target verification method is the first verification method.

[0034] In some examples, the preset threshold value is a preset minimum data length of data that can be verified by the first verification method.

[0035] According to the first aspect, or any implementation method of the first aspect above, the operating environment information does not include the vector instruction set; or, the operating environment information includes the vector instruction set, but the data length of the data to be verified does not meet the preset threshold value; according to the operating environment information and the verification information, matching the target verification method includes: determining that the target verification method is the third verification method.

[0036] In this application, the most efficient verification method currently available is adaptively determined based on various types of information supported by the current environmental information and the verification information selected by the user, which is conducive to improving the calculation speed.

[0037] According to the first aspect, or any implementation method of the first aspect above, matching the target verification method according to the operating environment information and the verification information, including: determining the matching target verification method according to the operating environment information, the verification information and a preset priority; the preset priority is a pre-set selection order of different verification methods.

[0038] In this application, the optimal and most efficient verification method supported by the current scenario is determined based on the operating environment information, verification information and the length of the data to be verified, so as to improve the data verification efficiency.

[0039] In a second aspect, the present application provides a data verification system. The data verification system includes: an acquisition module for acquiring operating environment information, verification information, and data to be verified; a matching module for matching a target verification method based on the operating environment information and the verification information; the target verification method is one of a first verification method, a second verification method, and a third verification method; the first verification method performs cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification method performs CRC calculation based on hardware CRC, and the third verification method performs CRC calculation based on table lookup; and a verification module for verifying the data to be verified according to the target verification method.

[0040] In a third aspect, the present application provides a data verification device, which includes: a processor and a memory, the memory being coupled to the processor, the memory being used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, the data verification device executes the method of the first aspect and any one of the embodiments of the first aspect.

[0041] In a fourth aspect, a vehicle comprises the data verification system as described in the second aspect or the data verification device as described in the third aspect.

[0042] Exemplary vehicles include cars, trucks, motorcycles, buses, lawn mowers, recreational vehicles, amusement park vehicles, construction equipment, trams, golf carts, trains, etc., which are not particularly limited in this application. The power of the above-mentioned vehicles can be provided by gasoline, diesel, electricity, solar energy, or hydrogen energy.

[0043] In a fifth aspect, the present application provides a chip system comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions, and the at least one processor is used to execute the method of the first aspect and any one of the embodiments of the first aspect.

[0044] In a sixth aspect, the present application provides a computer-readable storage medium, which includes a computer program. When the computer program runs on a computer, the computer executes the method of the first aspect and any one of the embodiments of the first aspect.

[0045] The technical effects corresponding to the second to sixth aspects and any implementation method of each aspect can be referred to the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] FIG1 is an interactive flow chart of a communication scenario provided in an embodiment of the present application;

[0047] FIG2 is a schematic diagram of a data verification development interface provided in an embodiment of the present application;

[0048] FIG3 is a schematic diagram of a system architecture for a data verification application scenario provided by an embodiment of the present application;

[0049] FIG4 is a schematic diagram of a data verification system architecture according to an embodiment of the present application;

[0050] FIG5 is a schematic diagram of the hardware structure of a data verification device provided in an embodiment of the present application;

[0051] FIG6 is a schematic diagram of the vehicle structure provided in an embodiment of the present application;

[0052] FIG7 is a flow chart of a data verification method according to an embodiment of the present application;

[0053] FIG8 is a schematic diagram of a data verification scenario according to an embodiment of the present application;

[0054] FIG9 is a second schematic diagram of a data verification scenario provided in an embodiment of the present application;

[0055] FIG10 is a second schematic diagram of the data verification system architecture provided in an embodiment of the present application;

[0056] FIG11 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0058] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features.

[0059] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0060] For ease of understanding, the technical terms involved in the embodiments of this application are first introduced below.

[0061] Cyclic redundancy check (CRC) is a data verification method widely used in communications, storage, and functional safety. It operates by performing a polynomial calculation on the data. The sender and receiver pre-agreed on a CRC algorithm to determine the polynomial used for verification. The sender uses a specific polynomial as the divisor and the data to be protected (also described as the original data) as the dividend. The two are divided modulo 2, and the remainder is appended to the protected data as the CRC checksum and sent to the receiver. The receiver then applies the polynomial to the received data to ensure the accuracy and integrity of the data transmission.

[0062] For example, Figure 1 shows an interactive flow chart of CRC in a communication scenario. The sender processes the data to be transmitted layer by layer through communication components 1 through n, and then sends the processed data to the receiver via a communication link. (N is a positive integer.) The receiver parses the data layer by layer through communication components n through 1, ultimately receiving the data from the sender.

[0063] For example, communication component 1 on the transmitter and communication component 1 on the receiver, communication component x on the transmitter and communication component x on the receiver, and communication component n on the transmitter and communication component n on the receiver are located at the same communication layer. The transmitter and receiver determine that communication component x in the communication layer will perform data verification. This means using CRC to protect and verify the data and determining a CRC algorithm. Communication component x on the transmitter side calculates a CRC checksum based on a polynomial in a predetermined CRC algorithm for the original data sent from the previous communication layer (e.g., communication component x-1, not shown in Figure 1), appends the CRC checksum to the original data, and then processes it through other communication components and sends it to the receiver via the communication link. Communication component x on the receiver side calculates a CRC checksum based on a polynomial in a predetermined CRC algorithm for the data sent from the previous communication layer (e.g., communication component x+1, not shown in Figure 1), and compares the calculated CRC checksum with the CRC checksum in the received data. If they match, it is determined that the original data has not been altered during transmission at communication component x and below, and is therefore complete and reliable. If there is any inconsistency, it means that the original data has been destroyed or tampered with during the transmission process of communication component x and the transmission layer below, and the data is unreliable.

[0064] The CRC algorithm is a checksum commonly used to detect errors in data transmission or storage. A CRC algorithm consists of six parameters: polynomial length (width), polynomial definition (poly), initial value (init), input inversion (refin), output inversion (refont), and the XOR value of the result (xorout). If two CRC algorithms have the same six parameters, they are considered the same CRC algorithm. If any of the six parameters differ between two CRC algorithms, they are considered different algorithms.

[0065] The polynomial length refers to the number of bits in the polynomial used in the CRC algorithm. For example, the polynomial length in the 32-bit cyclic redundancy check (CRC-32) used in Ethernet (also referred to as Ethernet CRC32) is 32. The polynomial definition refers to the polynomial used in the CRC algorithm. This polynomial is typically fixed. For example, the generator polynomial used in CRC-32 is x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. The initial value refers to the initial value pre-agreed in the CRC algorithm, the same as the polynomial length, used to calculate the checksum. This initial value is typically a binary number; for example, the initial value in CRC-32 is 0xFFFFFFFF. Before performing modulo-2 division, the input data is first XORed with the initial value, and then the XOR result is divided modulo-2. Input Inversion specifies whether the input data is inverted before calculating the CRC checksum. If this parameter is 1, the input data is inverted; if it is 0, it is not. Output Inversion specifies whether the calculated CRC checksum is inverted after calculation. If this parameter is 1, the calculated CRC checksum is inverted; if it is 0, it is not. The resulting XOR value is used to calculate the final CRC checksum. The calculated CRC checksum is XORed with the resulting XOR value to obtain the final CRC checksum. This resulting XOR value is typically a binary number; for example, the resulting XOR value for CRC-32 is 0xFFFFFFFF.

[0066] It is understandable that different values ​​of any of the above CRC algorithm parameters will result in different CRC check codes. Therefore, when using the CRC algorithm, calculations must be performed according to the corresponding parameters to ensure the reliability and integrity of data transmission.

[0067] CRC verification is applicable to any scenario where data needs to be verified. Moreover, with the rapid development of information technology and the continuous expansion of scenarios, the same operating system can use different data communication protocols, the same operating system can also be applied to different application scenarios, the same operating system can also implement different functions, and the same operating system can also meet different CRC verification requirements. Therefore, the same operating system needs to use a variety of different CRC algorithms during operation to meet the different verification requirements of upper-layer protocol components and applications in the operating system. In order to facilitate the use of CRC algorithms by upper-layer protocol components and applications in the operating system, the operating system usually provides a CRC library or CRC module. The CRC library or CRC module contains a variety of common CRC algorithms, or specific CRC algorithms used by upper-layer protocol components and / or applications, so that upper-layer protocol components and applications can use it, and provide support for arbitrary CRC algorithms to complete CRC calculations of arbitrary polynomial lengths, arbitrary polynomial definitions, and arbitrary input and output processing.

[0068] For example, taking the in-vehicle communication scenario as an example, there are many types of CRC algorithms. Different communication components, protocol components and applications in the in-vehicle system may use different CRC algorithms to provide the in-vehicle system with basic data reliability verification capabilities and communication function security guarantees.

[0069] The CRC algorithms involved in vehicle communication scenarios include the following: Common CRC algorithms, including but not limited to industry-standard algorithms and algorithms used by common communication protocols; Custom CRC algorithms, including but not limited to CRC algorithms used by custom application software.

[0070] For example, commonly used CRC algorithms include: seven CRC algorithms (CRC-8, CRC-8H2F, CRC-16, CRC-32, CRC-32C, CRC-64, and CRC-64-WEIGHTED) required by the automotive open system architecture (AUTOSAR) for Ethernet communication and controller area network (CAN); three CRC algorithms (CRC-32, CRC-16, and CRC-8) used by the data distribution service (DDS) communication protocol; four CRC algorithms (CRC-6, CRC-10, CRC-16, and CRC-32) required by the International Telecommunication Union (ITU); a CRC algorithm (CRC-16) used by the serial communication protocol (Modbus); a CRC algorithm (CRC-16) used by the electronic product code (EPC) network protocol; and robust header compression. compression (RoHC) standard; a CRC algorithm (CRC-16) used by the serial communication protocol (Xmodem protocol); a CRC algorithm (CRC-16) used by the Distributed Network Protocol (DNP); a CRC algorithm (CRC-7) used in secure digital cards (SD cards) or multimedia cards (MMC); a CRC algorithm (CRC-32) used by the Moving Picture Experts Group (MPEG) protocol; and two CRC algorithms (CRC-5 and CRC-16) used by the Universal Serial Bus (USB) protocol.

[0071] For example, customized CRC algorithms include: special CRC algorithms required when connecting to special third-party chips (such as CRC-8 / MAXIM and CRC-16 / MAXIM of Maxim chips), unconventional CRC lengths, customized CRC polynomials, or CRC algorithms that differ from the calculation input and output processing of general protocol CRCs (such as CRC-16 / CCITT and CRC-16 / CCITT-FALSE).

[0072] It should be understood that the CRC algorithm uses the "modulo-2 division" calculation method, dividing the data to be protected bit by bit (which can also be understood as bits) to determine the remainder, eliminating only 1 bit of data at a time. When using CRC to check data with long data lengths, the amount of calculation is large. Moreover, the division operation has a natural dependence on the order of operations, and the operation needs to be performed in sequence from high to low bits. The calculation of each bit in the CRC algorithm depends on the calculation result of the previous bit, and the division calculation cannot be parallelized and optimized. This results in slow calculation speed when checking data with CRC.

[0073] In some examples, a table lookup method is used to optimize the calculation speed during CRC verification. Specifically, all possible "modulo-2 division" calculation results of the dividend of a predetermined length (such as 8 bits) are pre-calculated and stored in a table that can be directly queried, so that the calculation results can be directly obtained by looking up the table during the calculation process, so as to eliminate the data of the preset length at one time and reduce the number of calculations. The optimized table lookup method CRC calculation can further improve the calculation efficiency. For example, the extended table lookup method covers a wider range of dividends by adding more pre-calculated results, thereby reducing the number of queries and improving the calculation speed. The parallel table lookup of segmented data is to divide the data into multiple segments, and perform table lookup calculations on each segment separately, thereby eliminating data in parallel and improving the processing speed.

[0074] However, the essence of this table lookup method is to trade space for time. By storing a table, it optimizes the elimination of one bit of data at a time to the elimination of multiple bits at a time, but it does not solve the dependency problem of division operations. Moreover, the extra space occupied by the table leads to high system overhead and extended processing time, which affects system performance.

[0075] In other examples, hardware CRC is used to optimize the calculation speed during CRC verification. Specifically, hardware CRC calculation is a technology that uses the CRC calculation interface of the chip to complete the CRC calculation of a specific CRC algorithm model. That is, the dedicated hardware module or instruction set on the chip is directly used to perform CRC calculations. Normally, the input data of the hardware CRC interface are mostly basic data types, such as integer, character, etc., and the length does not exceed 64 bits (i.e., 8 bytes). If the input data length exceeds the length corresponding to the basic data type, the input data is split and the hardware CRC interface is called multiple times to calculate the final calculation result of the input data.

[0076] The above hardware CRC calculation has a faster calculation speed than the table lookup method. However, the hardware CRC can execute a small number of CRC algorithms, and a chip usually only has one or two CRC algorithms. For example, the chip of the mobile hardware platform (advanced RISC machine, ARM) (can also be described as ARM architecture or ARM platform) provides hardware CRCs of CRC-32C / Castagnoli and CRC-32 / IEEE-802.3. The hardware CRC only provides support capabilities for the CRC algorithms it supports. The hardware CRC algorithms provided by different chips are also different. When the same software is written on different hardware CRC platforms, the performance and support of different hardware platforms need to be considered. The calculation capability of the hardware CRC is called through specific instructions or interfaces, resulting in poor portability of the hardware CRC. In addition, when the software uses the hardware CRC, it is strongly dependent on the hardware resources of the chip, which affects the system performance.

[0077] In order to solve the technical problems described above, an embodiment of the present application provides a data verification method. The method includes: obtaining operating environment information, verification information and data to be verified; matching a target verification method according to the operating environment information and the verification information; the target verification method is one of a first verification method, a second verification method and a third verification method; the first verification method completes cyclic redundancy check CRC calculation based on vectorized calculation, the second verification method completes CRC calculation based on hardware CRC, and the third verification method completes CRC calculation based on table lookup; according to the target verification method, the data to be verified is verified. The method provided in the embodiment of the present application supports multiple CRC algorithms, adaptively provides the optimal verification method based on system information, improves calculation speed, and optimizes data verification.

[0078] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0079] The data verification methods provided in the embodiments of this application can be applied to both the product operation phase and the product development phase. The data verification methods provided in the embodiments of this application can be applied to data communication scenarios, data storage scenarios, file verification scenarios, network protocol verification scenarios, functional safety testing scenarios, data encryption scenarios, and other application scenarios requiring data verification. The embodiments of this application do not impose any specific restrictions on the application phases and application scenarios of data verification.

[0080] Specifically, during the product development stage, the data verification method provided in the embodiments of the present application can be applied to the development process of CRC-related communication, storage, functional safety and other products, so that developers can integrate CRC calculation programs suitable for specific application scenarios into the product, test and verify them, and finally integrate them into the product.

[0081] Exemplary, as shown in Figure 2, is a CRC product function configuration interface in the development phase. The configuration interface contains options for different functions related to the CRC function. Developers can arbitrarily combine the functions of the CRC product according to the options provided by the configuration interface, and generate corresponding CRC calculation programs according to the combined functions. For example, if the developer chooses to turn on the CRC function, then the developer can further input information related to the CRC algorithm parameter model (such as parameter model name, polynomial, initial value, result XOR value, whether the input data is reversed and whether the output data is reversed, etc.) to generate the CRC calculation program corresponding to the CRC algorithm. Alternatively, if the developer chooses to turn on the CRC algorithm preferred function, then the developer can further input information related to the CRC algorithm preferred function (such as operating environment information, chip model, instruction set, hardware CRC information) to generate hardware CRC or software vector CRC calculation programs. The configuration interface can also include an operation mode priority, pre-calculation based on the set priority, and the pre-calculation results are stored according to the generated result storage path so that the product can directly call the pre-calculation results according to the generated result storage path.

[0082] Specifically, during the product operation phase, the data verification method provided by the embodiment of the present application can be applied to the operation process of CRC-related communication, storage, functional safety and other products, so that the product can provide CRC verification functions for other applications, protocol components, etc. in the system. For example, taking the vehicle-mounted communication scenario as an example, Figure 3 shows a system architecture diagram of the vehicle-mounted communication system, including the application layer, operating system layer, hardware adaptation layer (hardware abstraction layer, HAL) and hardware layer. The application layer includes the system's own system applications (application, APP) and / or third-party applications (which can also be described as applications). The operating system layer includes a CRC module, a communication management component, a communication protocol component, a storage module, and a functional safety component.

[0083] Among them, system applications can also be called embedded applications. Embedded applications are applications that are part of the functions implemented by the terminal device. Third-party applications can also be called downloadable applications. A downloadable application is an application that can provide its own Internet Protocol Multimedia Subsystem (IMS) connection. The downloadable application can be an application pre-installed in the terminal device or can be an application downloaded and installed by the user on the terminal device. System applications and third-party applications can also be described as applications, which are used to implement specific functions or provide specific services.

[0084] The CRC module provides CRC checking for each component and application. The communication management component manages communication between processes and threads. The communication protocol component manages and implements network communication between computers. The storage module manages data storage within the system and on external storage devices. The functional safety component detects potential system failures, handles errors, and ensures reliable system operation.

[0085] When the components of the application and operating system layers of the in-vehicle communication system are running, they utilize the CRC module's CRC calculation and verification capabilities through function calls or interfaces to implement their corresponding functions. For example, the communication management component calls the CRC module to verify whether the data being transmitted is correct. The storage module calls the CRC module to verify whether the stored data is corrupted.

[0086] The data verification method in the embodiment of the present application can be applied to various devices and / or various systems using the CRC function. The types of devices are rich and varied, and the devices may include various means of transportation such as new energy vehicles, electric vehicles, buses, and cars. Various electronic devices such as mobile phones, tablet computers, personal computers (PCs), and wearable devices may also be included. The system may include a communication system, a storage system, a control system, an embedded system, a smart home system, an edge computing system, a cloud service system, an autonomous driving system, an Internet of Things system, and the like. The embodiment of the present application does not place any special restrictions on the specific form of the device or system.

[0087] For example, referring to FIG4 , FIG4 shows a schematic diagram of the architecture of a data verification system 40 provided in an embodiment of the present application. As shown in FIG4 , the data verification system 40 includes a detection device 41 and a data verification device 42. The detection device 41 and the data verification device 42 are connected and communicate with each other. The detection device 41 and the data verification device 42 are integrated on the same chip.

[0088] In an embodiment of the present application, the detection device 41 is used to detect operating environment information, verify information and data to be verified, and send the detected information to the data verification device 42 so that the data verification device 42 performs data verification.

[0089] In an embodiment of the present application, a data verification device 42 is used to execute the data verification method provided by the present application. Specifically, the device 42 obtains operating environment information, verification information, and data to be verified from the detection device 41; matches a target verification method based on the operating environment information and the verification information; the target verification method is one of a first verification method, a second verification method, and a third verification method; the first verification method performs cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification method performs CRC calculation based on hardware CRC, and the third verification method performs CRC calculation based on table lookup; and the data to be verified is verified according to the target verification method.

[0090] Below, the technical solutions in the embodiments of the present application are described by taking the vehicle communication scenario as an example.

[0091] Optionally, data verification device 42 may be an intelligent driving computing platform. This platform implements intelligent driving, decision-making, planning, and control functions and is a core component of the entire vehicle. This platform interacts with various components in the vehicle, acquiring real-time data from each component and controlling its operation. This is not a limitation in the present embodiment.

[0092] Optionally, the data verification device 42 may be a server. The server may be a Linux server, a Windows server, or other server device that can provide simultaneous access to multiple devices. It may also be a server cluster consisting of multiple regions, multiple computer rooms, and multiple servers. As an example, the data verification device 42 may be a server of an intelligent transportation system, such as a physical server or a cloud server, but this embodiment of the application is not limited to this.

[0093] It is understood that the data verification device 42 is used to verify local data. For example, the intelligent driving computing platform is used to verify data used for communication or storage in the computing platform. Alternatively, the server is used to verify data used for communication or storage in the server.

[0094] It should be understood that the above description of the data verification system 40 is merely an example, and the embodiment of the present application does not specifically limit the specific form and implementation method of the data verification system 40.

[0095] It is understandable that the various modules in the above-mentioned data verification system are divided according to functional logic, and may actually be divided in other ways. In addition, the above-mentioned modules can be named by other names. In addition, each module can be implemented by hardware, or by software, or by a combination of hardware and software. Whether a specific module is implemented in the form of hardware, software, or a combination of hardware and software depends on the specific application and design constraints of the technical solution. Different modules can be implemented by different hardware, and multiple modules can also be implemented by the same hardware. The embodiments of the present application do not specifically limit this.

[0096] It can be understood that the system architecture and business scenarios described in this application are intended to more clearly illustrate the technical solutions of this application, and do not constitute the sole limitation on the technical solutions provided by this application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided by this application are also applicable to similar technical problems.

[0097] Refer to FIG5 , which shows a hardware structure of a data verification device 42 provided in an embodiment of the present application.

[0098] As shown in FIG5 , the data verification device 42 includes a processor 51 , a memory 52 , a communication interface 53 , and a bus 54 . The processor 51 , the memory 52 , and the communication interface 53 may be connected via the bus 54 .

[0099] The processor 51 is used to manage and control the data verification device 42 and / or to execute the data verification method described below. The memory 52 is used to store program code and data of the data verification device 42. The communication interface 53 is used to support communication between the data verification device 42 and other network entities.

[0100] The processor 51 (or controller) is the control center of the data verification device 42 and can implement or execute various exemplary logic blocks, unit modules and circuits described in conjunction with the disclosure of this application. The processor or controller can be a general-purpose central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor. The processor 51 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc.

[0101] As an example, the processor 51 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 5 .

[0102] The memory 52 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or a flash memory, a hard disk or a solid-state drive; it can also be an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory 52 can also include a combination of the above-mentioned types of memories. In one possible implementation, the memory 52 can exist independently of the processor 51. The memory 52 can be connected to the processor 51 via a bus 54 for storing data, instructions or program codes. When the processor 51 calls and executes the instructions or program codes stored in the memory 52, the data verification method provided in the embodiment of the present application can be implemented.

[0103] In another possible implementation, the memory 52 may also be integrated with the processor 51 .

[0104] The communication interface 53 is used to connect the data verification device 42 to other devices via a communication network. The communication network can be a transceiver circuit, Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 53 can include a receiving unit for receiving data and a sending unit for sending data.

[0105] Bus 54 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG5 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0106] It should be pointed out that the structure shown in FIG5 does not constitute a limitation on the data verification device 42. In addition to the components shown in FIG5, the data verification device 42 may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0107] FIG6 is a schematic diagram of the structure of a vehicle 600 provided in an embodiment of the present application. Referring to FIG6 , vehicle 600 may include various subsystems, such as a travel system 610, a sensor system 620, a control system 630, one or more peripheral devices 640, a power supply 650, a computer system 660, and a user interface 670. Optionally, vehicle 600 may include more or fewer subsystems, and each subsystem may include multiple components. Furthermore, each subsystem and component of vehicle 600 may be interconnected via wired or wireless connections.

[0108] Propulsion system 610 may include components that provide powered motion for vehicle 600. Engine 611 may be an electric motor or other types of engine combinations. Engine 611 converts energy source 612 into mechanical energy. Examples of energy source 612 include solar panels, batteries, and other sources of electricity. Transmission 613 may transmit mechanical power from engine 611 to wheels 614.

[0109] The sensor system 620 may include a number of sensors that sense information about the environment surrounding the vehicle 600. For example, the sensor system 620 may include a positioning system 621, such as a global positioning system (GPS), a BeiDou system, or other positioning systems, an inertial measurement unit (IMU) 622, a radar 623, a laser rangefinder 624, and a camera 625.

[0110] Control system 630 controls the operation of vehicle 600 and its components. Control system 630 may include various components, including a steering system 631, an accelerator pedal 632, a brake unit 633, a computer vision system 634, a path control system 635, and an obstacle avoidance system 636, which may also be referred to as an obstacle avoidance system.

[0111] Vehicle 600 interacts with external sensors, other vehicles, other computer systems, or users via peripheral devices 640. Peripheral devices 640 may include a wireless communication system 641, an onboard computer 642, a microphone 643, and / or a speaker 644.

[0112] Power source 650 may provide power to various components of vehicle 600 .

[0113] Some or all functions of vehicle 600 are controlled by computer system 660. Computer system 660 may include at least one processor 661 that executes instructions 6621 stored in a non-transitory computer-readable medium such as memory 662. Computer system 660 may also be a plurality of computing devices that control individual components or subsystems of vehicle 600 in a distributed manner.

[0114] The processor 661 may be any conventional processor, such as a commercially available central processing unit (CPU). Alternatively, the processor may be a dedicated device such as an application-specific integrated circuit (ASIC) or other hardware-based processor.

[0115] In some embodiments, memory 662 may include instructions 6621 (e.g., program logic) that are executable by processor 661 to perform various functions of vehicle 600. Memory 662 may also include additional instructions, including instructions for sending data to, receiving data from, interacting with, and / or controlling one or more of travel system 610, sensor system 620, control system 630, and peripherals 640.

[0116] In addition to instructions 6621, memory 662 may also store data such as road maps, route information, the vehicle's location, direction, speed, and other vehicle data, and other information. This information may be used by vehicle 600 and computer system 660 during operation of vehicle 600 in autonomous, semi-autonomous, and / or manual modes.

[0117] Exemplarily, computer vision system 634 processes visual signals to determine the presence of a pedestrian ahead of the vehicle. Computer vision system 634 encrypts the visual data indicated by the visual signal (e.g., a pedestrian ahead) using a CRC checksum and transmits the encrypted visual data to processor 661. Processor 661 decrypts the received data using the CRC to obtain visual data, and based on this visual data, determines whether the vehicle should brake. Processor 661 encrypts the braking data using the CRC checksum and transmits the encrypted braking data to braking unit 633. Braking unit 633 decrypts the received data using the CRC checksum to obtain braking data, and applies the brakes to avoid the pedestrian.

[0118] The user interface 670 is used to provide information to or receive information from a user of the vehicle 600 .

[0119] Computer system 660 may control functions of vehicle 600 based on input received from various subsystems (eg, travel system 610 , sensor system 620 , and control system 630 ) and from user interface 670 .

[0120] In some embodiments, vehicle 600 may also include a vehicle controller (not shown in FIG6 ), which can also be described as a powertrain controller or intelligent driving computing platform. It is the core control component of the entire vehicle. It collects input information from various systems and components, makes decisions based on this input, and controls the operation of various components in vehicle 600 to drive vehicle 600.

[0121] Specifically, as the command and management center for vehicle 600, the vehicle controller's primary functions include: driving torque control, optimized braking energy control, vehicle energy management, controller area network (CAN) maintenance and management, fault diagnosis and troubleshooting, and vehicle status monitoring. It controls vehicle operation. Therefore, the quality of the vehicle controller directly determines the stability and safety of the vehicle.

[0122] Alternatively, one or more of the above components may be installed or associated separately from the vehicle 600. For example, the memory 662 may be partially or completely separate from the vehicle 600. The above components may be communicatively coupled together in a wired and / or wireless manner.

[0123] Optionally, the above components are only an example. In actual applications, the components in the above modules may be added or deleted according to actual needs. Figure 6 should not be understood as a limitation on the embodiments of the present application.

[0124] The vehicle 600 may be a new energy vehicle, an electric vehicle, a car, a truck, a motorcycle, a bus, a boat, an airplane, a helicopter, a lawn mower, an amusement vehicle, an amusement park vehicle, construction equipment, a tram, a golf cart, or a train, etc., and is not particularly limited in this embodiment of the present application. The vehicle may be powered by gasoline, diesel, electricity, solar energy, hydrogen energy, or the like.

[0125] In other embodiments of the present application, the vehicle may further include hardware structures and / or software modules to implement the aforementioned functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular one of the aforementioned functions is implemented in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.

[0126] The method provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0127] To optimize data verification, multiple CRC algorithms are supported, adaptively providing the optimal verification method based on system information to improve calculation speed. This application proposes a data verification method, which can be executed by a vehicle or other devices outside the vehicle, such as mobile phones, computers, and other electronic devices. It can also be a processor on the vehicle or other devices outside the vehicle, such as processor 51 or processor 661 mentioned above.

[0128] The present embodiment of the present application is described using an in-vehicle communication scenario as an example. Referring to FIG7 , FIG7 shows a flow chart of a data verification method provided by the present embodiment of the present application. The data verification method includes the following steps S701-S703:

[0129] S701: The vehicle controller obtains operating environment information, verification information, and data to be verified.

[0130] In the embodiment of the present application, the vehicle controller can also be an intelligent driving computing platform, which is the core control component of the vehicle. For example, the vehicle controller verifies data in communication, storage, and other scenarios in the vehicle to ensure data security in the vehicle.

[0131] In the embodiment of the present application, the vehicle controller may also be a controller of a component or system in the vehicle, for example, the controller of the computer vision system 634 in FIG6 .

[0132] In an embodiment of the present application, the operating environment information includes the vector instruction set and / or hardware CRC information supported by the current operating environment.

[0133] In the embodiments of the present application, the operating environment information is the basic information that enables the normal operation of the application on the operating system and hardware devices. The operating environment information includes the vector instruction set supported by the current operating environment, hardware CRC information, operating system, processor architecture, system configuration information, hardware device information, network environment information, etc. The operating environment information can also be understood as CPU-related information.

[0134] In some examples, the vector instruction set supported by the current operating environment includes a single instruction multiple data (SIMD) vector acceleration instruction set supported by the current operating environment, for example, the Advanced SIMD (NEON) instruction set or the Scalable Vector Extension (SVE) instruction set under the ARM architecture, or the Streaming SIMD Extensions (SSE) instruction set or the Advanced Vector Extensions (AVX) instruction set under the Intel architecture.

[0135] It can be understood that in this application, the vehicle controller obtains the vector instruction set executable in the vehicle, so that when it is subsequently determined that the verification method is to complete the CRC calculation based on vectorized calculation, the vectorized CRC calculation can be completed according to the vector instruction set.

[0136] In some examples, the hardware CRC information includes hardware CRC interface information supported by the current operating environment, such as a hardware CRC32 interface or a hardware CRC32C interface.

[0137] It can be understood that in this application, the vehicle controller obtains the hardware CRC information that can be used in the vehicle, so that when the verification method is subsequently determined to be based on the hardware CRC to complete the CRC calculation, the data verification can be completed according to the hardware CRC indicated by the hardware CRC information.

[0138] In one possible implementation, the vehicle controller obtains operating environment information from various subsystems of the vehicle.

[0139] In some examples, after the vehicle is started, the vehicle controller dynamically obtains operating environment information according to instructions.

[0140] For example, if the operating system is Linux, the vehicle controller can obtain operating environment information using the system's built-in "getauxval AT_HWCAP" command. Alternatively, the vehicle controller can view operating environment information using the "cat / proc / cpuinfo" command. If the operating system is other operating systems, the vehicle controller can also query operating environment information using the "sysctl" command.

[0141] Figure 8 shows the operating environment information dynamically acquired by the Linux system based on instructions. It can be determined that the vector instruction sets supported by this Linux system include the "pmull" vector instruction set for performing integer vector multiplication operations and the "sve" vector instruction set for processing multiple data simultaneously in a single instruction. The hardware CRC interface supported by this Linux system is CRC32.

[0142] It is understandable that the system actively acquires information and dynamically reads the operating environment information, which makes the system more portable and scalable. In addition, accurate information about the current system can be obtained, so that the optimal verification method can be determined based on the operating environment information, speeding up data verification.

[0143] In another possible implementation manner, the vehicle controller determines predefined operating environment information.

[0144] In some examples, each module using the CRC check function pre-defines operating environment information so that the vehicle controller obtains the pre-defined operating environment information corresponding to the module using the CRC check function.

[0145] Understandably, pre-defined operating environment information avoids the time loss of dynamic reading and allows for customizable, flexible control and allocation of computing resources within the vehicle. However, operating environment information is inherent to the system and requires prior knowledge of the system's specific hardware information and active input into the vehicle, making this operation more cumbersome and limiting the system's portability.

[0146] It is understandable that the vehicle controller obtains the operating environment information so that it can subsequently determine whether hardware CRC can be used, whether vectorized calculation can be used, or whether table lookup calculation can be used based on the operating environment information, thereby determining the target verification method.

[0147] In the embodiment of the present application, the check information includes the CRC algorithm parameters to be used. The CRC algorithm parameters include six parameters: polynomial length, polynomial definition, initial value, whether the input is inverted, whether the output is inverted, and the result XOR value.

[0148] In one possible implementation, the vehicle controller determines the check information in response to a CRC algorithm selected by the user.

[0149] In some examples, the vehicle controller determines the CRC algorithm and check information to be used for data verification in response to user operation.

[0150] It can be understood that the operating environment information is inherent to the current system, and the system implements the corresponding CRC algorithm based on the current operating environment information. It can be understood that the CRC algorithm that the system can currently implement can be determined based on the operating environment information. The verification information is the CRC algorithm that the user wants to use when performing data verification. Based on the verification information, it is determined whether the CRC algorithm provided by the operating environment information can be used. For example, it is determined whether the CRC algorithm corresponding to the verification information is the CRC algorithm supported by the hardware CRC information in the operating environment information. If so, it indicates that the hardware CRC can be used, otherwise, the hardware CRC cannot be used. It is determined whether the CRC algorithm corresponding to the verification information can be implemented according to the vector instruction set in the current operating environment.

[0151] S702. The vehicle controller matches the target verification method according to the operating environment information and the verification information; the target verification method is one of the first verification method, the second verification method and the third verification method; the first verification method completes the cyclic redundancy check CRC calculation based on vectorized calculation, the second verification method completes the CRC calculation based on hardware CRC, and the third verification method completes the CRC calculation based on table lookup.

[0152] In an embodiment of the present application, the vehicle controller matches the target verification method based on the operating environment information and the verification information, including: the vehicle controller determines whether the operating environment information includes hardware CRC information; if the vehicle controller determines that the operating environment information includes hardware CRC information, and the hardware CRC information corresponds to the CRC algorithm parameters to be used, then the target verification method is determined to be the second verification method.

[0153] In some examples, the vehicle controller first determines whether the second verification method can be used. Specifically, the vehicle controller first determines whether the operating environment information includes hardware CRC information. If the operating environment information includes hardware CRC information, the vehicle controller determines whether the hardware CRC can be used based on the CRC algorithm parameters to be used. If the CRC algorithm parameters to be used correspond to a certain hardware CRC information in the operating environment information, it means that the CRC algorithm supported by the certain hardware CRC information of the current system is the CRC algorithm desired by the user, and the hardware CRC is directly used to complete the data verification.

[0154] It should be understood that the situations where the second verification method is not used include: the operating environment information does not include hardware CRC information. This means that the current system does not include a hardware CRC interface and does not provide a hardware CRC calculation function, so the second verification method cannot be used. Alternatively, the operating environment includes hardware CRC information, but the hardware CRC information is different from the CRC algorithm parameters selected by the user to be used. This means that the current system provides a hardware CRC interface, but the CRC algorithm that can be implemented by the provided hardware CRC interface is not the CRC algorithm that the user expects to use. Therefore, the hardware CRC interface provided by the system cannot be used, and the second verification method cannot be used.

[0155] It is understandable that compared to vectorized calculation and table lookup calculation, hardware CRC calculation speed is the fastest. Therefore, when it is determined that hardware CRC can be used to complete the CRC calculation, the second verification method is directly determined as the target verification method.

[0156] In an embodiment of the present application, based on the above-mentioned example of the vehicle controller determining the hardware CRC information, if the vehicle controller determines that the operating environment information does not include the hardware CRC information; or, the vehicle controller determines that the operating environment information includes hardware CRC information, but the hardware CRC information and the CRC algorithm parameters to be used do not correspond, the vehicle controller matches the target verification method according to the operating environment information and the verification information, and the method also includes: the vehicle controller determines whether the operating environment information includes a vector instruction set; if the vehicle controller determines that the operating environment information includes a vector instruction set, and the data length of the data to be verified meets the preset threshold value, then the target verification method is determined to be the first verification method.

[0157] It is understandable that the first verification method can also be described as software vector CRC calculation. The first verification method does not rely on hardware CRC instructions, fully utilizes the parallel computing capabilities of the system platform (software platform) chip (such as the CPU), and implements vectorized CRC calculation based on the vector instruction set.

[0158] In an embodiment of the present application, based on the above-mentioned examples of the vehicle controller determining whether the second verification method and the first verification method can be used, if the vehicle controller determines that the operating environment information does not include the hardware CRC information; or, the vehicle controller determines that the operating environment information includes hardware CRC information, but the hardware CRC information and the CRC algorithm parameters to be used do not correspond; on this basis, the operating environment information does not yet include a vector instruction set; or, the operating environment information includes a vector instruction set, but the data length of the data to be verified does not meet the preset threshold value, the vehicle controller matches the target verification method according to the operating environment information and the verification information, and the method also includes: determining that the target verification method is the third verification method.

[0159] In the embodiment of the present application, the preset threshold value is the minimum data length of data that can be verified by the preset first verification method.

[0160] It can be understood that, with the preset threshold value as the boundary, if the data length of the data to be verified is not less than the preset threshold value, the first verification method can be used; if the data length of the data to be verified is less than the preset threshold value, the first verification method is not used and the third verification method is used.

[0161] In some examples, after the vehicle controller determines not to use the second verification method, it then determines whether the first verification method can be used. Specifically, the vehicle controller determines whether the operating environment includes a vector instruction set. If the operating environment information includes a vector instruction set, it determines whether the data length of the data to be verified is less than a preset threshold. If the data length of the data to be verified is not less than the preset threshold, it indicates that the data to be verified can be verified through vectorized calculation, and the first verification method is used. If the data length of the data to be verified is less than the preset threshold, it indicates that the data to be verified can be verified through table lookup calculation, and the third verification method is used.

[0162] It should be understood that after determining not to use the second verification method, an appropriate verification method is selected based on the length of the data to be verified. When the data to be verified is long, vectorized CRC calculation is faster than table lookup calculation. When the data to be verified is short, table lookup calculation is more effective than vectorized calculation.

[0163] In an embodiment of the present application, the priority of each vector instruction set is pre-set. If the vehicle controller determines that the target verification method is the first verification method, the vector instruction set with the highest priority among the vector instruction sets supported by the current operating environment is selected for vectorized calculation.

[0164] It is understandable that the vector instruction set includes a variety of vector operation instruction sets, and the priority of each vector operation instruction set is determined according to the operation speed, maturity and adaptability of each vector operation instruction set to the vectorized computing principle.

[0165] Exemplarily, the priority order of each vector operation instruction set is as follows: Intel's instruction set that executes the carry-less multiplication algorithm (also described as INTEL-CLMUL) = ARM architecture's extended instruction set (ARM-SVE2) > Intel's instruction set that executes parallel carry-less multiplication with quadwords instructions with prefetch (also described as INTEL-PCLMULQDQ) = ARM-NEON > ARM-SVE > other SIMD instruction sets.

[0166] In this application, the optimal and most efficient verification method supported by the current scenario is determined based on the operating environment information, verification information and the length of the data to be verified, so as to improve the data verification efficiency.

[0167] In an embodiment of the present application, the specific implementation of the vehicle controller matching the target verification method based on the operating environment information and verification information also includes: the vehicle controller determines the matching target verification method based on the operating environment information, verification information and preset priority; the preset priority is a pre-set selection order of different verification methods.

[0168] In some examples, the preset priority can be the selection order of different verification methods determined by the system based on various types of information. The preset priority can also be the selection order of different verification methods determined based on user preferences.

[0169] Exemplarily, the user-set preset priority is first verification method > second verification method > third verification method. After obtaining operating environment information, verification information, and the data to be verified, the vehicle controller determines whether the first verification method can be used based on the preset priority, environmental information, and verification information. If so, the target verification method is determined to be the first verification method; if not, the second verification method is determined to be the second verification method. If so, the target verification method is determined to be the second verification method; otherwise, the target verification method is determined to be the third verification method.

[0170] In this application, the target verification method is determined based on the operating environment information, verification information, and preset priorities. By presetting the priorities of various verification methods, the speed of determining the target verification method can be accelerated. Furthermore, the target verification method that best meets the user's needs can be selected based on user preferences to meet various user needs and enhance the user experience.

[0171] In an embodiment of the present application, after determining the target verification method, if it is determined that the target verification method is the third verification method, a corresponding table can be pre-calculated according to the verification information for use in subsequent verification.

[0172] It is understood that the table used for the lookup calculation can be pre-calculated and stored in the system during the development phase or system initialization phase. During the actual verification process, the stored table in the system can be used for verification to speed up processing. For example, during the development phase, the calculation results corresponding to various predetermined lengths can be calculated for a commonly used CRC algorithm and stored in the system. Alternatively, when the system is powered on and started, the calculation results corresponding to various predetermined lengths can be calculated for a commonly used CRC algorithm and stored in the system. Pre-calculation does not occupy runtime, and the pre-calculated results are stored according to a preset fixed storage path for subsequent use, updating, and maintenance.

[0173] It is understandable that for a special CRC algorithm, a corresponding table can be pre-calculated based on the verification information input by the user for subsequent verification.

[0174] In an embodiment of the present application, after determining the target verification method, if it is determined that the target verification method is the first verification method, a characteristic value can be pre-calculated based on the verification information for use in subsequent verification.

[0175] In this application, the eigenvalue is a fixed value used in the subsequent vectorized calculation process. The eigenvalue is determined based on the polynomial in the check information.

[0176] Exemplarily, the eigenvalues ​​are calculated based on whether the input data in the verification information is inverted. The calculation formulas for each eigenvalue are shown in Table 1 below. (Table 1 only shows part of the information).

[0177] Table 1

[0178] As shown in Table 1, K3, K4, K5, K6 and U are eigenvalues. P(x) is a polynomial with x as the variable, and the exponent of x in the formula is the right shift length of the data segment. That is, the right shift length of the data segment corresponding to K6 is 64, the right shift length of the data segment corresponding to K5 is 96, the right shift length of the data segment corresponding to K4 is 128, and the right shift length of the data segment corresponding to K3 is 128+64. mod is a modular operation, << is a left shift, ' is a bitwise reversal, floor is a rounding, and / is a division operation. The formula corresponding to K3 in the input data reversal is a modular operation, which means x 128+64 The remainder after dividing by the polynomial P(x). The formula corresponding to K3' in the case where the input data is not inverted means x 128+32 The result of the modulo operation with P(x) is shifted left by 32 bits, the data after the left shift is bit-reversed, and the bit-reversed data is shifted left by one bit again to get the final data. The meaning of U in the input data reversal is 64 Round the result of division by the polynomial P(x) to an integer.

[0179] It is understandable that the eigenvalues ​​used in vectorized calculations can be pre-calculated and stored in the system during the development phase or system initialization phase. During the actual verification process, the eigenvalues ​​stored in the system can be used for verification to speed up processing. For example, during the development phase, the corresponding eigenvalues ​​for the commonly used CRC algorithm are calculated and stored in the system. Alternatively, when the system is powered on and started, the corresponding eigenvalues ​​for the commonly used CRC algorithm are calculated and stored in the system. Pre-calculation does not take up runtime, and the pre-calculated results are stored according to a preset fixed storage path for subsequent use, updating, and maintenance.

[0180] It is understandable that for a special CRC algorithm, the corresponding characteristic value can be pre-calculated based on the verification information input by the user for subsequent verification.

[0181] It is understood that the pre-calculated results completed during the development or system initialization phase will occupy storage space if not used for a long time. The vehicle controller can clean up pre-calculated results based on aging mechanisms, and based on usage frequency and activity, clean up infrequently used or low-activity pre-calculated results to save space resources.

[0182] S703: The vehicle controller verifies the data to be verified according to the target verification method.

[0183] In an embodiment of the present application, if the target verification method is the first verification method, the vehicle controller verifies the verification data according to the target verification method, including: the vehicle controller generates a target vector instruction set based on the vector instruction set supported by the current operating environment; the target vector instruction set is a vector instruction set that can complete the CRC calculation; the vehicle controller verifies the verification data according to the target vector instruction and the verification information.

[0184] It is understandable that the mathematical principle of the vectorized calculation (first verification method) in this application is the same as the data principle of the hardware CRC (second verification method), but the processing method is different. Its mathematical principle is that one carry-less multiplication operation and one XOR operation are equivalent to replacing multiple modulo-2 division operations of the same length. The processing method of the first verification method is to perform vectorized calculation by combining vector instruction sets, and the processing method of the second verification method is to complete the CRC calculation based on the hardware CRC instruction, and the hardware CRC instruction can be integrated into the hardware device.

[0185] The mathematical principle of the first verification method is explained in detail below. As shown in Figure 9, the complete data to be verified is M(x). The vectorized calculation effect can be regarded as selecting two adjacent fixed-length data from the head of the data to be verified, here taking 64-bit length H(x) and L(x) as an example. After performing carry-free multiplication on each fixed-length data with its corresponding eigenvalue (i.e., K1 and K2), the resulting carry-free multiplication result is right-shifted by a fixed length (i.e., T+64 and T, where T is the length of the remaining data G(x)). The carry-free multiplication result after right shift is then XORed with the remaining data in the data to be verified (i.e., G(x)). At this point, the CRC calculation has been completed for the data segments H(x) and L(x) at the head of the data to be calculated. The above steps are then repeated on the XOR result until all the data to be verified are calculated. The above steps gradually reduce the length of the data to be verified until the number of remaining data blocks is reduced to twice the length of the CRC result. These data blocks are then processed through a fast barrett reduction to obtain the final CRC result.

[0186] Exemplarily, the calculation process corresponding to FIG9 is as follows:

[0187] It is understandable that the above calculation process can be referred to in the prior art and will not be described in detail here.

[0188] It is understandable that the first verification method uses carry-less multiplication and XOR operations instead of modulo-2 division. Both carry-less multiplication and XOR operations conform to the commutative and associative laws and have no order-of-operation dependency. This approach solves the order-of-operation dependency issue in principle, better utilizing the CPU's parallel computing capabilities and accelerating the CRC calculation process based on the vector instruction set, improving computational efficiency and speed.

[0189] In an embodiment of the present application, the vehicle controller generates a target vector instruction set based on the vector instruction set supported by the current operating environment, including: the vehicle controller combines the vector instruction set supported by the current operating environment to obtain a target vector instruction set, and the target vector instruction set includes a carry-less multiplication operation instruction and an exclusive-OR operation instruction.

[0190] It is understandable that in actual applications, the SIMD instruction sets and register sizes supported by the CPUs of different system platforms may be different, resulting in the vector instruction sets supported by the system platforms containing different vector operation instruction sets. In the first verification method, vectorized calculations require the use of carry-less multiplication and XOR operations. XOR operations are basic vector operations, and all system platforms include XOR operations. Carry-less multiplication operations are advanced vector operation instructions, and some system platforms do not provide instruction sets for carry-less multiplication operations. However, by combining basic instructions such as vector shift, vector multiplication, and vector load, an instruction set for carry-less multiplication operations can be obtained to implement carry-less multiplication operations.

[0191] In an embodiment of the present application, the vehicle controller needs to combine the vector instruction sets supported by the current operating environment to generate a target vector instruction set including carry multiplication operation instructions and XOR operation instructions.

[0192] It is understood that the target vector instruction set is an instruction set that can directly perform vectorized calculations to implement data verification. Vectorized CRC calculation cannot be implemented based solely on the basic vector instruction set supported by the current operating environment. Therefore, it is necessary to convert and combine the basic vector instruction set supported by the current operating environment into a target vector instruction set that can perform CRC calculations.

[0193] In some embodiments of the present application, the vector instruction set supported by the current operating environment does not include a carry-less multiplication operation instruction, and the vehicle controller combines the vector instruction set supported by the current operating environment to obtain a target vector instruction set in the following manner: the vehicle controller combines the vector instruction set supported by the current operating environment to obtain a carry-less multiplication operation instruction; the vehicle controller generates a target vector instruction set based on the carry-less multiplication operation instruction and an exclusive-OR operation instruction in the vector instruction set supported by the current operating environment.

[0194] In some cases, if the vector instruction set supported by the current operating environment does not provide a carry-less multiplication instruction, the vehicle controller can implement the carry-less multiplication by repackaging the vector instruction set. For example, for the ARM-SVE instruction set, basic instructions in the vector instruction set can be processed through vector shift, vector multiplication, and vector load, and then combined and packaged to obtain the carry-less multiplication instruction.

[0195] For example, if the vector instruction set is ARM-NEON, then the vmull instruction for performing signed or unsigned integer multiplication and the vextq instruction for performing vector data expansion, shift, and concatenation operations in the instruction set are combined into a carry-less multiplication instruction, and the veor instruction for performing vector XOR operations in the instruction set is determined as an XOR instruction. If the vector instruction set is ARM-SVE, then the svmul instruction for performing vector multiplication, the sveor instruction for performing vector XOR operations, and the svlsr instruction for performing vector logical right shift operations in the instruction set are combined into a carry-less multiplication instruction, and sveor is determined as an XOR instruction. If the vector instruction set is ARM-SVE2, then the svpmull instruction for performing unsigned integer vector multiplication in the instruction set is determined as a carry-less multiplication instruction, and sveor is determined as an XOR instruction. If the vector instruction set is INTEL-CLMUL, a carry-less multiplication instruction is determined based on pclmulqdq for performing a polynomial multiplication operation in the instruction set, and an exclusive OR instruction is determined based on pxor for a bitwise exclusive OR operation in the instruction set.

[0196] It can be understood that by secondary encapsulating the vector instruction set, the advanced vector operation instructions required for CRC calculation, that is, the carry-less multiplication operation instructions, are obtained to facilitate subsequent vectorized CRC calculation, thereby improving computing efficiency and performance, and also improving the reusability and portability of the code.

[0197] In other embodiments of the present application, the vector instruction set supported by the current operating environment includes a carry-less multiplication operation instruction, but the data length that can be processed by the vector register indicated by the carry-less multiplication operation instruction is lower than the polynomial length in the verification information; the vehicle controller verifies the verification data according to the target vector instruction and the verification information in the following manner: the vehicle controller performs segmented processing according to the target vector instruction and the verification information, and verifies the verification data.

[0198] In some examples, the carry-less multiplication operation instructions provided by the vector instruction set supported by the current operating environment have register processing length limitations, and the vehicle controller uses segmented operations to complete secondary packaging.

[0199] It is understandable that the length of the eigenvalues ​​involved in the carry-less multiplication operation in Table 1 above is consistent with the length of the polynomial. However, some vector instruction sets, such as the ARM-NEON instruction set, provide carry-less multiplication instructions based on a fixed-length 64-bit vector register and can only process carry-less multiplication operations of 64 bits at a time. When the polynomial length in the CRC algorithm exceeds the data length that can be processed by the vector register, multiple vector registers are introduced. The eigenvalues ​​are divided into multiple segments based on the data length that can be processed by the vector register indicated by the carry-less multiplication instruction, with the length of each segment not exceeding the length of the vector register indicated by the carry-less multiplication instruction. Then, a vector load instruction is used to load each segment of the eigenvalues ​​into a different vector register. The data to be verified is also divided into multiple segments, each segment having the same length as the eigenvalue. Each segment of the data to be verified is multiplied by the corresponding eigenvalue using the carry-less multiplication instruction. The carry-less multiplication results of each segment are combined (segment-by-segment shifting and XOR operation) to obtain the carry-less multiplication result of the data to be verified.

[0200] It can be understood that, through the segmented processing in the above manner, a fixed-length vector register can process longer CRC polynomials.

[0201] It can be understood that based on the above method, a calculation framework corresponding to the vectorized calculation is constructed. As long as the vector instruction set is supported by the current operating environment, the corresponding target vector instruction can be obtained according to the calculation framework to perform vectorized CRC calculation of any CRC algorithm. The calculation framework corresponding to the above processing method can be applied to different vector instruction sets and different CRC algorithms. During the calculation process, the user only needs to provide parameters such as the initial value of the CRC algorithm, whether the output is inverted, and the XOR value of the result. The vehicle controller pre-calculates the eigenvalue based on the polynomial in the verification information, and then brings the parameters provided by the user into the calculation framework to obtain the calculation result of the CRC algorithm selected by the user.

[0202] In this application, when performing vectorized operations, the vector instruction set is based on the operation framework, which can meet the requirements of different CRC algorithms and achieve efficient calculations in the current operating environment. Moreover, the operation framework is highly versatile and can be applied to any platform or device that supports the basic vector instruction set, making it highly applicable.

[0203] In an embodiment of the present application, the verification information includes a polynomial length, and the first verification method includes a preset polynomial length. The vehicle controller may further normalize the polynomial length in the verification information based on the preset polynomial length, so that the processed polynomial length is the same as the preset polynomial length.

[0204] It's understandable that CRC algorithms vary widely, and the lengths of CRC polynomials vary. To improve the versatility and consistency of the calculation framework, polynomials of different lengths are normalized so that the normalized polynomial lengths are the same as the preset polynomial length. For example, this normalization is performed by padding with zeros.

[0205] It should be understood that the normalized polynomials have the same length, and different CRC algorithms can be calculated using the same calculation framework, which improves the versatility of the calculation framework.

[0206] It is understandable that there are differences between the CRC algorithm with inverted input data and the CRC algorithm with non-inverted input data in terms of vector shift direction, vector loading interval, fast modulo operation, etc. Therefore, it is necessary to design a calculation framework according to the specific processing of the input data of each CRC algorithm to meet the needs of different CRC algorithms.

[0207] In an embodiment of the present application, the verification information also includes whether the input data is inverted, and the first verification method also includes a first preset processing framework and a second preset processing framework. The first preset processing framework is a preset CRC calculation framework when the input data is inverted; the second preset processing framework is a preset CRC calculation framework when the input data is not inverted. In an embodiment of the present application, the vehicle controller verifies the verification data according to the target vector instruction and the verification information in the following manner: if the verification information includes input data inversion, the vehicle controller verifies the verification data according to the target vector instruction and the first preset processing framework; if the verification information includes input data non-inversion, the vehicle controller verifies the verification data according to the target vector instruction and the second preset processing framework.

[0208] It should be understood that corresponding processing frameworks are set for differentiated operation modes to better adapt to different CRC algorithm requirements, improve computing efficiency, and ensure the versatility and consistency of the operation framework.

[0209] It should be understood that the above example is a specific implementation process of the first verification method, which completes the CRC calculation based on the vectorization of the operation framework. The operation framework is applicable to different CRC algorithms and different vector instruction sets, and the CRC operation speed is significantly increased.

[0210] In an embodiment of the present application, if the target verification method is the second verification method, the vehicle controller verifies the data to be verified according to the target verification method, including: the vehicle controller verifies the data to be verified based on the hardware CRC indicated by the hardware CRC information.

[0211] In some examples, determining that the target verification mode is the second verification mode indicates that the current system provides a CRC algorithm hardware calculation interface selected by the user, and the interface can be directly called to perform CRC calculation.

[0212] It can be understood that the input parameters of the hardware CRC interface are usually basic data types (such as integer types). If the input parameters are long, it is necessary to split the longer data to be checked into multiple parts according to the parameter type definition of the hardware CRC interface, and call the hardware interface in sequence for calculation to obtain the final CRC calculation result.

[0213] In this application, if the target verification method is the second verification method, high-speed CRC calculation can be performed based on the hardware CRC, making full use of the computing power of the hardware and improving computing efficiency and performance.

[0214] In an embodiment of the present application, if the target verification method is the third verification method, the vehicle controller verifies the verification data according to the target verification method, including: the vehicle controller generates a lookup table according to the preset bits and verification information, and verifies the verification data according to the lookup table.

[0215] In some examples, the target verification mode is determined to be the third verification mode, which means that the current system neither uses hardware CRC nor performs vectorized calculation, and the data verification can be completed by table lookup method.

[0216] In this application, the table lookup method is efficient and flexible, and is suitable for the calculation requirements of different CRC polynomial lengths.

[0217] In this application, through the above method, multiple CRC algorithms are supported. According to the current operating environment and the CRC algorithm selected by the user, the optimal and most efficient CRC verification method supported by the system in the current scenario is adaptively selected, and efficient calculation is performed based on this CRC verification method. The data verification method provided by this application expands the application scenarios, supports different operating environments and different CRC algorithms, and adaptively provides the optimal verification method based on system information, thereby improving the calculation speed and optimizing data verification.

[0218] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0219] FIG10 is a schematic diagram of another data verification system according to an embodiment of the present invention. The data verification system 1000 includes an acquisition module 1001 , a matching module 1002 , and a verification module 1003 .

[0220] The acquisition module is used to obtain operating environment information, verification information and data to be verified.

[0221] A matching module is used to match a target verification mode according to the operating environment information and the verification information; the target verification mode is one of a first verification mode, a second verification mode, and a third verification mode; the first verification mode completes cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification mode completes CRC calculation based on hardware CRC, and the third verification mode completes CRC calculation based on table lookup.

[0222] The verification module is used to verify the data to be verified according to the target verification method.

[0223] It should be understood that the above description of the data verification system 1000 is merely an example, and the embodiments of the present application do not specifically limit the specific form and implementation of the data verification system.

[0224] An embodiment of the present application also provides a chip system, as shown in Figure 11, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. As an example, when the chip system 1100 includes one processor and one interface circuit, the one processor may be the processor 1101 shown in the solid box in Figure 11 (or the processor 1101 shown in the dotted box), and the one interface circuit may be the interface circuit 1102 shown in the solid box in Figure 11 (or the interface circuit 1102 shown in the dotted box). When the chip system 1100 includes two processors and two interface circuits, the two processors include the processor 1101 shown in the solid box in Figure 11 and the processor 1101 shown in the dotted box, and the two interface circuits include the interface circuit 1102 shown in the solid box in Figure 11 and the interface circuit 1102 shown in the dotted box. This is not limited.

[0225] The processor 1101 and the interface circuit 1102 can be interconnected via a line. For example, the interface circuit 1102 can be used to receive signals. For another example, the interface circuit 1102 can be used to send signals to other devices (such as the processor 1101). For example, the interface circuit 1102 can read instructions stored in a memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the firewall device can execute the various steps in the above-mentioned embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiments of the present application.

[0226] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system on a chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chip.

[0227] It should be understood that each step in the above method embodiment can be completed by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0228] An embodiment of the present application further provides a computer-readable storage medium storing one or more computer programs, wherein the one or more computer programs include instructions that, when executed by a computer, enable the computer to execute the corresponding process of the data verification method in the above embodiment.

[0229] In some embodiments, the disclosed methods may be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of manufacture.

[0230] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the data verification method in the above-mentioned embodiment.

[0231] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0232] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data verification method, characterized in that: The method comprises: Obtain operating environment information, verification information, and data to be verified; Matching a target verification mode according to the operating environment information and the verification information; the target verification mode is one of a first verification mode, a second verification mode, and a third verification mode; the first verification mode performs cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification mode performs CRC calculation based on hardware CRC, and the third verification mode performs CRC calculation based on table lookup; The data to be verified is verified according to the target verification method.

2. The method according to claim 1, characterized in that The operating environment information includes the vector instruction set and / or hardware CRC information supported by the current operating environment; the verification information includes the CRC algorithm parameters to be used.

3. The method according to claim 2, characterized in that The target verification mode is a first verification mode, and verifying the data to be verified according to the target verification mode includes: Generate a target vector instruction set according to the vector instruction set supported by the current operating environment; the target vector instruction set is a vector instruction set capable of completing CRC calculation; The data to be verified is verified according to the target vector instruction and the verification information.

4. The method according to claim 3, characterized in that Generating a target vector instruction set according to the vector instruction set supported by the current operating environment includes: The vector instruction sets supported by the current operating environment are combined to obtain the target vector instruction set, where the target vector instruction set includes a carry-less multiplication instruction and an exclusive-OR instruction.

5. The method according to claim 4, characterized in that The vector instruction set supported by the current operating environment does not include a carry-less multiplication instruction; and combining the vector instruction set supported by the current operating environment to obtain the target vector instruction set includes: Combining and operating the vector instruction set supported by the current operating environment to obtain the carry-less multiplication instruction; The target vector instruction set is generated according to the carry-less multiplication operation instruction and an exclusive-OR operation instruction in a vector instruction set supported by the current operating environment.

6. The method according to claim 4, characterized in that The vector instruction set supported by the current operating environment includes a carry-less multiplication instruction, but the data length that can be processed by the vector register indicated by the carry-less multiplication instruction is shorter than the polynomial length in the check information; The verifying the data to be verified according to the target vector instruction and the verification information includes: Segmented processing is performed according to the target vector instruction and the verification information, and the data to be verified is verified.

7. The method according to any one of claims 3 to 6, characterized in that The verification information includes a polynomial length; the first verification method includes a preset polynomial length; and the method further includes: The polynomial length in the verification information is normalized according to the preset polynomial length, and the processed polynomial length is the same as the preset polynomial length.

8. The method according to any one of claims 3 to 7, characterized in that The verification information also includes whether the input data is inverted, and the first verification method also includes a first preset processing framework and a second preset processing framework; the first preset processing framework is a preset CRC calculation framework when the input data is inverted; the second preset processing framework is a preset CRC calculation framework when the input data is not inverted; The verifying the data to be verified according to the target vector instruction and the verification information includes: If the verification information includes input data inversion, verifying the data to be verified according to the target vector instruction and the first preset processing framework; If the verification information includes that the input data is not inverted, the data to be verified is verified according to the target vector instruction and the second preset processing framework.

9. The method according to claim 2, characterized in that The target verification mode is a second verification mode, and verifying the data to be verified according to the target verification mode includes: The data to be verified is verified based on the hardware CRC indicated by the hardware CRC information.

10. The method according to claim 2, characterized in that The target verification mode is a third verification mode, and verifying the data to be verified according to the target verification mode includes: A lookup table is generated according to the preset bits and the verification information, and the data to be verified is verified according to the lookup table.

11. The method according to any one of claims 2 to 10, characterized in that The matching of a target verification mode according to the operating environment information and the verification information includes: Determining whether the operating environment information includes the hardware CRC information; If it is determined that the operating environment information includes the hardware CRC information, and the hardware CRC information corresponds to the CRC algorithm parameters to be used, then the target verification method is determined to be the second verification method.

12. The method according to claim 11, characterized in that The operating environment information does not include the hardware CRC information; or, if the operating environment information includes the hardware CRC information, but the hardware CRC information does not correspond to the CRC algorithm parameters to be used; matching the target verification mode according to the operating environment information and the verification information includes: determining whether the operating environment information includes the vector instruction set; If it is determined that the operating environment information includes the vector instruction set, and the data length of the data to be verified meets the preset threshold value, then the target verification mode is determined to be the first verification mode.

13. The method according to claim 12, characterized in that The operating environment information does not include the vector instruction set; or the operating environment information includes the vector instruction set, but the data length of the data to be verified does not meet a preset threshold value; matching the target verification mode according to the operating environment information and the verification information includes: The target verification mode is determined to be the third verification mode.

14. The method according to any one of claims 2 to 13, characterized in that The matching of a target verification mode according to the operating environment information and the verification information includes: A matching target verification method is determined according to the operating environment information, the verification information and a preset priority; the preset priority is a pre-set order of selection of different verification methods.

15. A data verification system, characterized in that: include: The acquisition module is used to obtain the operating environment information, verification information and data to be verified; A matching module, configured to match a target verification mode according to the operating environment information and the verification information; The target verification mode is one of a first verification mode, a second verification mode, and a third verification mode; the first verification mode performs cyclic redundancy check (CRC) calculation based on vectorized calculation, the second verification mode performs CRC calculation based on hardware CRC, and the third verification mode performs CRC calculation based on table lookup; The verification module is used to verify the data to be verified according to the target verification method.

16. A data verification device, characterized in that: include: A processor and a memory, wherein the memory is coupled to the processor, and the memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the data verification device executes the method according to any one of claims 1 to 14.

17. A vehicle, characterized in that: The vehicle includes the data verification system according to claim 15 or the data verification device according to claim 16.

18. A chip system, characterized in that: The method comprises at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions, and the at least one processor is used to perform the method according to any one of claims 1 to 14.

19. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises a computer program, and when the computer program is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Data verification method, device and system

    CN120492216A

  • Dynamic communication data verification system and method

    CN113961391A

  • Communicating with Error Checking to a Device Capable of Operating According to an Address Prefix Serial Bus Protocol

    US20070271490A1

Cited By

  • Cyclic redundancy check method, device and equipment based on priori knowledge

    CN121560631A

  • Password similarity judgment method and device, electronic equipment and storage medium

    CN121765712A

  • Password similarity determination method and device, electronic equipment and storage medium

    CN121765712B