Data transmission method, check code generation system and storage medium

By performing binary and decimal operations on the transmitted data using a dual feature value generation mechanism, a non-zero check code is generated, which solves the problem of all-zero false positives in the CRC algorithm during data transmission, ensuring the reliability and security of data transmission.

CN121308912APending Publication Date: 2026-01-09HUIZHOU DESAY SV AUTOMOTIVE
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511405490.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

In existing technologies, the Cyclic Redundancy Check (CRC) algorithm cannot identify cases where both the transmitted data and the checksum are zero during data transmission, causing abnormal data to be misjudged as normal data, leading to functional failures or control malfunctions.

Method used

A dual feature value generation mechanism is adopted to perform binary-level XOR operation and decimal-level arithmetic operation on the transmitted data to generate a non-zero check code, ensuring that the check code will not be zero even if all the transmitted data is zero.

Benefits of technology

Effectively identify abnormal data transmission, prevent abnormal data from being used and causing functional failures or control malfunctions, and improve the reliability and security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121308912A_ABST
    Figure CN121308912A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method, a check code generation system and a storage medium, and the data transmission method applied to a data receiving end comprises the steps: receiving and analyzing a data frame, and analyzing transmission data and a first check code; calculating a second check code according to the transmission data; when the first check code and the second check code are the same, using the transmission data; wherein the step of generating the second check code comprises the following substeps: converting transmission data into binary check code generation data, splicing the binary check code generation data, and dividing the obtained spliced data according to a preset length to obtain a plurality of pieces of first block data; performing a first type of operation on each first block of data; and converting each first block data into decimal second block data, performing a second type of operation on each second block data, generating a second check code based on an operation result, and outputting the second check code. According to the data transmission method applied to the data receiving end, the problem that the abnormal all-zero data frame received by the receiving end passes verification can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a data transmission method, a check code generation system, and a storage medium. Background Technology

[0002] With the rapid development of automotive electronics technology, especially the continuous evolution of intelligent driving systems and future autonomous driving technologies, data communication between onboard electronic control units (ECUs) is becoming increasingly frequent and complex. In key application scenarios such as powertrain, chassis control, advanced driver assistance systems (ADAS), and onboard networks (e.g., CAN, CAN FD, Ethernet), the integrity and reliability of data transmission are directly related to the functional safety of the entire vehicle and can even affect the lives of passengers. Therefore, in the design of various communication protocols, verification mechanisms are commonly used to detect whether errors occur during data transmission. Currently, Cyclic Redundancy Check (CRC) algorithms are often used. CRC generates a fixed-length checksum (e.g., CRC8, CRC16, CRC32) through polynomial division, appends it to the transmitted data, and the receiving end recalculates and compares the checksum to determine whether the data is erroneous. However, during data transmission, if data is overwritten due to an anomaly or accidentally cleared to zero due to a logical error, resulting in both the transmitted data and the checksum being zero, the receiving end uses the received abnormal data to calculate a CRC check. If the calculated checksum is zero, it will be considered abnormal data. Since the checksum matches, it will be considered normal data, leading to the use of abnormal data and causing unpredictable functional failures or control malfunctions. Summary of the Invention

[0003] To address the aforementioned technical problems, this application provides a data transmission method, a checksum generation system, and a storage medium.

[0004] A data transmission method, applied at a data receiving end, the method comprising: Receive and parse data frames to extract transmitted data and a first checksum; calculate a second checksum based on the transmitted data. When the first check code and the second check code are the same, the receiving end uses the transmitted data; The step of generating a second checksum based on the transmitted data includes: The transmitted data is converted into binary checksums to generate data; The generated data of the verification code is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; Perform a first type of operation on each of the first data blocks, and obtain a first feature value based on the result of the first type of operation; Each of the first block data is converted into the second block data in decimal form. A second type of operation is performed on each second block data, and the second feature value is obtained based on the result of the second type of operation. A second check code is generated and output based on the first feature value and the second feature value. The second check code is a non-zero check code.

[0005] This scheme employs a mechanism to force the generation of a non-zero checksum, ensuring that even if the transmitted data is entirely zero, the generated checksum will not be zero, fundamentally eliminating the possibility of false positives when using the CRC algorithm with all zeros. It extracts dual features by performing binary-level Type I operations (such as XOR, shift, bitwise NOT, etc.) and decimal-level Type II operations (such as arithmetic operations, modulo addition, sum of squares, prime weight accumulation, etc.) on the segmented data, and then fuses these features to generate the final checksum. Even if the transmitted data is entirely zero, the checksum remains non-zero. If the receiving end receives an abnormal all-zero data frame, i.e., the received transmitted data and the first checksum are both all zeros, its locally calculated second checksum (non-zero) will not be equal to the received abnormal first checksum (all zeros), thus triggering a checksum failure. This effectively identifies data anomalies and prevents the use of abnormal data from causing unpredictable functional failures or control malfunctions.

[0006] Further, performing the first type of operation on each of the first data blocks includes: The first type of operation includes at least the XOR operation; Perform an XOR operation on all bits in each of the first data blocks to obtain multiple values ​​for the first data blocks.

[0007] In this scheme, the XOR operation is applied directly to the binary bits. All bits in each block can be calculated synchronously and independently without sequential processing. This bit-level parallelism significantly reduces timing complexity and improves computational efficiency.

[0008] Furthermore, obtaining the first feature value based on the first type of operation result includes: sequentially concatenating multiple first block data operation values ​​to obtain the first feature value.

[0009] In this scheme, sequential concatenation preserves the physical and logical order of the original blocks, allowing the first feature value to form a block error location matrix. When verification fails, the specific location of the abnormal block can be deduced through the feature value.

[0010] Furthermore, the second type of operation performed on each second block of data includes: The second type of operation includes at least four arithmetic operations; The second block of data is configured with position index values ​​in sequence, and the position index values ​​correspond to the sorting of the second block of data, which are 1, 2, 3...N; The second block data with a position index value of 1 is added to the corresponding position index value, and the remaining second block data is multiplied by the corresponding position index value to obtain multiple second block data operation values.

[0011] In this scheme, by binding an incremental position index (1,2,...,N) to the second block of data and performing differential operations, the first block is added (value +1) to avoid the risk of returning to zero, and subsequent blocks are multiplied (value × index) to amplify the weight of the higher-order blocks. This strategy makes the same value produce different operation results in different positions, completely breaking the uniform distribution characteristics of the data.

[0012] Further, obtaining the second feature value based on the result of the second type of operation includes: Add the values ​​of multiple second-block data together and convert the result into binary feature data; The second feature value is extracted from the feature data according to the preset extraction rules.

[0013] In this scheme, by performing a summation operation on the index-weighted block values, the summation result can always be at least 1 and never zero. According to the preset extraction rules, such as extracting several bits of data from the low bits, the second feature value can be guaranteed to be non-zero.

[0014] Furthermore, generating the second check code based on the first feature value and the second feature value includes concatenating the first feature value and the second feature value to obtain the second check code.

[0015] In this scheme, the direct concatenation operation fully preserves the independent structure of the first and second feature values. The non-zero nature of the second feature value ensures that even when the transmitted data is all zeros, the calculated second checksum will still be non-zero. Upon receiving an abnormal first checksum (all zeros), the checksum comparison triggers a verification failure, thus effectively identifying data anomalies and preventing the use of abnormal data from causing unpredictable functional failures or control malfunctions.

[0016] Furthermore, the step of dividing the spliced ​​data into multiple first data blocks according to a preset length includes: When the spliced ​​data is divided into segments of a preset length, and the last segment is not long enough, zeros are added to the last segment to reach the preset length.

[0017] In this scheme, all blocks are forced to reach a preset length, avoiding special processing for the last non-standard block and allowing all blocks to reuse the same computational unit. Simultaneously, a uniform block length enables precise location of faulty blocks. When verification fails, the abnormal characteristic value directly corresponds to a unique block index, eliminating the need for additional parsing of irregular block boundaries.

[0018] Based on the same concept, a data transmission method is also provided, applied at the data sending end, the method comprising: Generate the transmission data to be transmitted; generate a first checksum based on the transmission data; encapsulate the transmission data and the first checksum into a data frame, and send the data frame; The step of calculating the first checksum based on the transmitted data includes: The transmitted data is converted into binary checksums to generate data; The generated data of the verification code is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; Perform a first type of operation on each of the first data blocks, and obtain a first feature value based on the result of the first type of operation; Each of the first block data is converted into the second block data in decimal form. A second type of operation is performed on each second block data, and the second feature value is obtained based on the result of the second type of operation. A first checksum is generated based on the first feature value and the second feature value.

[0019] Based on the same concept, a checksum generation system is also provided, including: The acquisition module is used to acquire transmitted data; The data processing module is used to convert the transmitted data into binary checksum generation data; concatenate the checksum generation data to obtain concatenated data; and divide the concatenated data into multiple first block data according to a preset length. The data processing module is used to perform a first type of operation on each first block of data, and obtain a first feature value based on the result of the first type of operation; convert each first block of data into a second block of data in decimal form, perform a second type of operation on each second block of data, and obtain a second feature value based on the result of the second type of operation; A check code generation module is used to generate a check code based on the first feature value and the second feature value. The verification code output module is used to output the verification code.

[0020] Based on the same concept, a computer-readable storage medium is also provided, characterized in that the computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the above-described data transmission method.

[0021] Compared with the prior art, the beneficial effects of this application are as follows: This scheme employs a mechanism to force the generation of a non-zero checksum, ensuring that even if the transmitted data is entirely zero, the generated checksum will not be zero, fundamentally eliminating the possibility of false positives when using the CRC algorithm with all zeros. It extracts dual features by performing binary-level Type I operations (such as XOR, shift, bitwise NOT, etc.) and decimal-level Type II operations (such as arithmetic operations, modulo addition, sum of squares, prime weight accumulation, etc.) on the segmented data, and then fuses these features to generate the final checksum. Even if the transmitted data is entirely zero, the checksum remains non-zero. If the receiving end receives an abnormal all-zero data frame, i.e., the received transmitted data and the first checksum are both all zeros, its locally calculated second checksum (non-zero) will not be equal to the received abnormal first checksum (all zeros), thus triggering a checksum failure. This effectively identifies data anomalies and prevents the use of abnormal data from causing unpredictable functional failures or control malfunctions. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the data transmission method applied to the data receiving end as described in this application.

[0023] Figure 2 This is a schematic diagram of the process for generating a second check code based on transmitted data as described in this application.

[0024] Figure 3 This is a flowchart illustrating the data transmission method applied to the data sending end as described in this application.

[0025] Figure 4 This is a schematic diagram of the check code generation system described in this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0027] End-to-end (E2E) communication protection mechanisms are mechanisms that dynamically identify communication failures caused by hardware and software faults during system operation to ensure secure data communication between ECUs and between different cores and SWCs within an ECU. They aim to meet functional safety requirements and prevent communication failures. Their functional safety relies on data integrity; data exchange between the sending and receiving ends can impact system functional safety. E2E communication protection mechanisms can ensure the integrity and security of data transmission through CRC (Cyclic Redundancy Check) verification. However, during data transmission, if data is overwritten due to an anomaly or accidentally cleared to zero due to a logical error, resulting in both the transmitted data and the checksum being zero, the receiving end will use the received abnormal data to perform a CRC check. If the calculated checksum is zero, it will be considered abnormal data. Because the checksum matches, it will be considered normal data, leading to unpredictable functional failures or control malfunctions. E2E communication protection mechanisms can be applied in automotive electronics, industrial automation, and medical equipment. Taking the automotive electronics field as an example, it can be applied to the protection of communication between automotive electronic control units (ECUs), such as sensor data transmission (e.g., radar, camera data) in autonomous driving systems, and command interaction between the powertrain (engine control, battery management) and chassis systems (braking, steering). The following uses communication between automotive electronic control units (ECUs) as an example to illustrate the specific implementation method of this application. Example 1:

[0028] like Figure 1 As shown, a data transmission method, applied at a data receiving end, includes: S10: Receive and parse the data frame, and parse out the transmitted data and the first checksum; S20, Calculate the second check code based on the transmitted data; S30: When the first checksum and the second checksum are the same, the receiving end uses the transmitted data.

[0029] like Figure 2 As shown, step S20, generating a second checksum based on the transmitted data, includes: S21, convert the transmitted data into binary checksums to generate data; S22, concatenate the verification code generation data to obtain concatenated data, and divide the concatenated data according to a preset length to obtain multiple first block data; S23, perform the first type of operation on each first block of data, and obtain the first feature value based on the result of the first type of operation; S24, convert each first block of data into decimal second block of data, perform a second type of operation on each second block of data, and obtain the second feature value based on the result of the second type of operation; S25, Generate and output a second check code based on the first feature value and the second feature value. The second check code is a non-zero check code.

[0030] To illustrate this method more clearly, for example, five binary data (01010101, 10101010, 01111000, 00000001, 00110101) will be used as the transmitted data to explain this method.

[0031] In step S21, since the transmitted data is binary data, no data conversion is required; that is, the checksum generation data is 01010101, 10101010, 01111000, 00000001, 00110101. In other possible embodiments, the transmitted data may be of other types, such as hexadecimal data (0x55, 0xAA, 0x78, 0x01, 0x35). In this case, the hexadecimal data first needs to be converted into binary checksum generation data, which is 01010101, 10101010, 01111000, 00000001, 00110101.

[0032] In step S22, the check code generated data in step S21 is concatenated to obtain concatenated data, which is 0101010110101010011110000000000100110101. The concatenated data is divided according to a preset length, which is set according to actual needs. In this embodiment, the preset length is 8 bits, so the concatenated data can be divided into 5 first blocks of data, namely: 01010101, 10101010, 01111000, 00000001, 00110101.

[0033] It should be noted that when dividing the concatenated data according to a preset length, if the last block is insufficient in length, it is padded with zeros to reach the preset length. For example, if the preset length is 6 bits, the concatenated data can be divided into 7 first blocks. The first 6 first blocks are: 010101, 011010, 101001, 111000, 000000, 010011. The 7th first block is 0101. Since the 7th first block is less than 6 bits, it is padded with zeros, resulting in 010100. Forcing all blocks to reach the preset length avoids special processing for the last irregular block, allowing all blocks to reuse the same computational unit. Simultaneously, a uniform block length allows for precise location of faulty blocks. When verification fails, the abnormal characteristic value directly corresponds to a unique block index, eliminating the need for additional parsing of irregular block boundaries.

[0034] In step S23, a first type of operation is performed on each first block of data, including: The first type of operation includes at least the XOR operation; Perform an XOR operation on all bits in each first block of data to obtain multiple first block data operation values; concatenate the multiple first block data operation values ​​in sequence to obtain the first feature value.

[0035] For example, an XOR operation is performed on all bits of the five first blocks of data (01010101, 10101010, 01111000, 00000001, 00110101) in step S22 above, as follows: Perform an XOR operation on the first block of data 1 (01010101): 0 XOR 1 XOR 0 XOR 1 XOR 0 XOR 1 XOR 0 XOR 1 = 0; Perform an XOR operation on the first block of data 2 (10101010): 1 XOR 0 XOR 1 XOR 0 XOR 1 XOR 0 XOR 1 XOR 0 = 0; The first block of data 3 (01111000) is XORed: 0 XOR 1 XOR 1 XOR 1 XOR 1 XOR 0 XOR 0 XOR 0 = 0; Perform an XOR operation on the first block of data 4 (00000001): 0 XOR 0 XOR 0 XOR 0 XOR 0 XOR 0 XOR 0 XOR 0 XOR 1 = 1; The first block of data 5 (00110101) is XORed: 0 XOR 0 XOR 1 XOR 1 XOR 0 XOR 1 XOR 0 XOR 1 = 0; The first feature value is obtained by concatenating the calculated values ​​of all the first block data in order: 00010.

[0036] The XOR operation operates directly on binary bits, allowing all bits within each block to be calculated synchronously and independently without sequential processing. This bit-level parallelism significantly reduces timing complexity and improves computational efficiency. Sequential concatenation preserves the physical and logical order of the original blocks, enabling the first eigenvalue to form a block error location matrix. When verification fails, the specific location of the abnormal block can be deduced from the eigenvalue. It should be noted that the first type of operation is not limited to XOR; other operations such as AND, OR, shift, bitwise NOT, and their combinations can be used in other possible embodiments, without specific limitations.

[0037] In step 24, each first block of data is converted into decimal second block data. Therefore, the five first block data (01010101, 10101010, 01111000, 00000001, 00110101) in step S22 are converted into decimal second block data as follows: 85, 170, 120, 1, 53.

[0038] Furthermore, a second type of operation is performed on each second block of data, including: The second type of operation includes at least four arithmetic operations; Configure position index values ​​for the second block of data in sequence. The position index values ​​correspond to the sorting of the second block of data and are 1, 2, 3...N. The second block of data with a position index value of 1 is added to the corresponding position index value, and the remaining second block of data is multiplied by the corresponding position index value to obtain multiple calculated values ​​of the second block of data; Add the values ​​of multiple second-block data together and convert the result into binary feature data; The second feature value is extracted from the feature data according to the preset extraction rules.

[0039] For example, the five second data blocks (85, 170, 120, 1, 53) are configured with position index values ​​of 1, 2, 3, 4, and 5 respectively, and then the corresponding arithmetic operations are performed as follows: The second block of data 1 (85) is added: 85 + 1 = 86; Multiply the second block of data 2 (170): 170 × 2 = 340; Multiply the second block of data 3 (120): 120 × 3 = 360; The second block of data 4(1) is calculated using the multiplication method: 1×4=4; The second block of data 5 (53) is calculated using the multiplication method: 53 × 5 = 265; The sum of all the data values ​​in the second block is 1056, which is converted to binary data as 010000011111.

[0040] It should be noted that the preset extraction rule is to extract N data points starting from the least significant digit. In this embodiment, the least significant three digits are extracted, i.e., the second feature value is 111.

[0041] By binding incremental position indices (1, 2, ..., N) to the second block of data and performing differential operations, the first block is added (value + 1) to avoid the risk of zeroing out, and subsequent blocks are multiplied (value × index) to amplify the weight of higher-order blocks. This strategy causes the same value to produce different calculation results at different positions, completely breaking the uniform distribution of data. By performing a summation operation on the index-weighted block values, the summation result is always at least 1 and never zero. According to preset extraction rules, such as extracting several bits of data from the lower order, the second feature value is guaranteed to be non-zero.

[0042] It should be noted that the second type of operation is not limited to the four arithmetic operations. In other possible embodiments, exponentiation, modular arithmetic, logarithmic arithmetic, sum of squares, and accumulation of prime weights may be adopted, and no specific restrictions are made here.

[0043] In step S25, a second check code is generated based on the first feature value and the second feature value, including concatenating the first feature value and the second feature value to obtain the second check code.

[0044] For example, the first feature value (00010) calculated in step S23 and the second feature value (111) calculated in step S24 are concatenated to obtain the second check code 00010111.

[0045] The direct concatenation operation fully preserves the independent structure of the first and second feature values. The non-zero nature of the second feature value ensures that even when the transmitted data is all zeros, the calculated second checksum will still be non-zero. Upon receiving an abnormal first checksum (all zeros), the checksum comparison triggers a verification failure, thus effectively identifying data anomalies and preventing the use of abnormal data from causing unpredictable functional failures or control malfunctions.

[0046] It should be noted that the number of bits in the second checksum is equal to the sum of the number of bits in the first and second feature values. Depending on the actual verification performance requirements, 8-bit, 16-bit, and 32-bit checksums can be designed by adjusting the number of blocks in the first data segment and the number of low-order bits (N) taken from the feature data values, similar to CRC8, CRC16, and CRC32. Of course, the number of bits in the checksum can also be customized according to actual needs, such as 12 bits or 24 bits.

[0047] This embodiment employs a mechanism to force the generation of a non-zero checksum, ensuring that even if the transmitted data is entirely zero, the generated checksum will not be zero, fundamentally eliminating the possibility of false positives when using the CRC algorithm with all zeros. It extracts dual features by performing binary-level first-type operations (such as AND, OR, shift, bitwise NOT, and their combinations) and decimal-level second-type operations (such as arithmetic operations, modulo addition, sum of squares, and prime-weighted summation) on the segmented data, and then fuses these features to generate the final checksum. Even if the transmitted data is entirely zero, the checksum remains non-zero. If the receiving end receives an abnormal all-zero data frame, i.e., the received transmitted data and the first checksum are both all zeros, its locally calculated second checksum (non-zero) will not be equal to the received abnormal first checksum (all zeros), thus triggering a checksum failure. This effectively identifies data anomalies and prevents the use of abnormal data from causing unpredictable functional failures or control malfunctions. Example 2:

[0048] like Figure 3 As shown, this application also provides a data transmission method applied at a data sending end, the method comprising: Generate the data to be transmitted; Generate the first checksum based on the transmitted data; The transmitted data and the first checksum are encapsulated into a data frame, and the data frame is sent. The calculation of the first checksum based on the transmitted data includes: Convert the transmitted data into binary checksums to generate data; The verification code generation data is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; Perform the first type of operation on each first block of data, and obtain the first feature value based on the result of the first type of operation; Each first block of data is converted into a second block of data in decimal form. A second type of operation is performed on each second block of data. The second feature value is obtained based on the result of the second type of operation. The first check code is generated based on the first feature value and the second feature value.

[0049] It should be noted that the specific steps for calculating the first check code based on the transmitted data in this embodiment are the same as the steps for calculating the second check code in Embodiment 1, and will not be repeated here.

[0050] Furthermore, the data transmitter of this embodiment and the data receiver of Embodiment 1 can constitute a data transmission system, for example, for data transmission between two ECUs. The transmitter and receiver use the same checksum generation method. The transmitter encapsulates the transmitted data and the first checksum into a data frame and sends it to the receiver. The receiver receives and parses the data frame, extracting the transmitted data and the first checksum; it calculates the second checksum based on the transmitted data; when the first checksum and the second checksum are the same, the receiver uses the transmitted data. Example 3:

[0051] like Figure 4 As shown, this application also provides a check code generation system, including: an acquisition module 100, a data processing module 200, a data operation module 300, a check code generation module 400, and a check code output module 500.

[0052] Acquisition module 100 is used to acquire transmitted data; The data processing module 200 is used to convert the transmitted data into binary checksum generation data; concatenate the checksum generation data to obtain concatenated data; and divide the concatenated data into multiple first blocks of data according to a preset length. The data processing module 300 is used to perform a first type of operation on each first block of data and obtain a first feature value based on the result of the first type of operation; convert each first block of data into decimal second block of data, perform a second type of operation on each second block of data, and obtain a second feature value based on the result of the second type of operation; The check code generation module 400 is used to generate a check code based on the first feature value and the second feature value; The verification code output module 500 is used to output the verification code. Example 4:

[0053] This application also provides a computer-readable storage medium in which the methods described in the embodiments of this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer instruction code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes storage components capable of storing or receiving software or computer instruction code. When the computer instruction code is accessed and executed by the computer, processor, or hardware, the methods shown in the embodiments above, i.e., the data transmission method, are implemented.

[0054] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of this application. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of this application. All such changes and modifications are intended to be included within the scope of this application as claimed in the appended claims.

[0055] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0056] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.

[0057] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules according to the embodiments of this application. This application can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0058] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0059] Although the description of this application has been made in conjunction with the specific embodiments described above, it will be apparent to those skilled in the art that many substitutions, modifications, and variations can be made based on the foregoing. Therefore, all such substitutions, modifications, and variations are included within the spirit and scope of the appended claims.

Claims

1. A data transmission method, applied at a data receiving end, characterized in that, The method includes: Receive and parse data frames to extract the transmitted data and the first checksum; Calculate the second checksum based on the transmitted data; When the first check code and the second check code are the same, the receiving end uses the transmitted data; The step of generating a second checksum based on the transmitted data includes: The transmitted data is converted into binary checksums to generate data; The generated data of the verification code is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; Perform a first type of operation on each of the first data blocks, and obtain a first feature value based on the result of the first type of operation; Each of the first block data is converted into the second block data in decimal form. A second type of operation is performed on each second block data, and the second feature value is obtained based on the result of the second type of operation. A second check code is generated and output based on the first feature value and the second feature value. The second check code is a non-zero check code.

2. The data transmission method according to claim 1, characterized in that, The first type of operation performed on each of the first data blocks includes: The first type of operation includes at least the XOR operation; Perform an XOR operation on all bits in each of the first data blocks to obtain multiple values ​​for the first data blocks.

3. The data transmission method according to claim 2, characterized in that, The step of obtaining the first feature value based on the first type of operation result includes: sequentially concatenating multiple first block data operation values ​​to obtain the first feature value.

4. The data transmission method according to claim 1, characterized in that, The second type of operation performed on each second block of data includes: The second type of operation includes at least four arithmetic operations; The second block of data is configured with position index values ​​in sequence, and the position index values ​​correspond to the sorting of the second block of data, which are 1, 2, 3...N; The second block data with a position index value of 1 is added to the corresponding position index value, and the remaining second block data is multiplied by the corresponding position index value to obtain multiple second block data operation values.

5. The data transmission method according to claim 4, characterized in that, The step of obtaining the second feature value based on the result of the second type of operation includes: Add the values ​​of multiple second-block data together and convert the result into binary feature data; The second feature value is extracted from the feature data according to the preset extraction rules.

6. The data transmission method according to claim 1, characterized in that, The step of generating a second check code based on the first feature value and the second feature value includes: concatenating the first feature value and the second feature value to obtain the second check code.

7. The data transmission method according to claim 1, characterized in that, The process of dividing the spliced ​​data into multiple first data blocks according to a preset length includes: When the spliced ​​data is divided into segments of a preset length, and the last segment is not long enough, zeros are added to the last segment to reach the preset length.

8. A data transmission method, applied at a data sending end, characterized in that, The method includes: Generate the data to be transmitted; A first verification code is generated based on the transmitted data; The transmitted data and the first checksum are encapsulated into a data frame, and the data frame is sent. The step of calculating the first checksum based on the transmitted data includes: The transmitted data is converted into binary checksums to generate data; The generated data of the verification code is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; Perform a first type of operation on each of the first data blocks, and obtain a first feature value based on the result of the first type of operation; Each of the first block data is converted into the second block data in decimal form. A second type of operation is performed on each second block data, and the second feature value is obtained based on the result of the second type of operation. A first checksum is generated based on the first feature value and the second feature value.

9. A check code generation system, characterized in that, include: The acquisition module is used to acquire transmitted data; A data processing module is used to convert the transmitted data into binary checksum generation data; The generated data of the verification code is concatenated to obtain concatenated data, and the concatenated data is divided according to a preset length to obtain multiple first block data; The data processing module is used to perform a first type of operation on each of the first data blocks and obtain a first feature value based on the result of the first type of operation. Each of the first block data is converted into the second block data in decimal form. A second type of operation is performed on each second block data, and the second feature value is obtained based on the result of the second type of operation. A check code generation module is used to generate a check code based on the first feature value and the second feature value. The verification code output module is used to output the verification code.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Data frame generation and verification method, data communication system and storage medium

    CN121603163A