Vehicle configuration word writing method and device

By generating error check verification codes for the configuration item parameters of the vehicle controller and dynamically determining the allocation rules, the problem of insufficient security of configuration word data in the prior art is solved, and the effect of significantly improving the security of configuration word is achieved.

CN119046996BActive Publication Date: 2025-03-14CHENGDU CELIS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411531253.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-14
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In the prior art, the vehicle controller cannot effectively ensure the data security of the written configuration word by only passing the authentication measures of the 27 service, resulting in the attacking party tampering with the configuration item parameters in the configuration word after the key is leaked, seriously threatening the vehicle's security.

Method used

By generating error check check codes for the configuration item parameters to be written to the vehicle controller, and dynamically determining the error check check code allocation rules, the error check check code is assigned to each error check check code field in the configuration word data structure, ensuring the security of the configuration word during transmission and storage.

Benefits of technology

By sorting out the wrong verification codes and dynamically determining the allocation rules, the difficulty of cracking error verification codes is significantly increased, and the security of configuration words in the transmission and storage process is improved, preventing attackers from tampering with configuration words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046996B_ABST
    Figure CN119046996B_ABST
Patent Text Reader

Abstract

The present application relates to a method and device for writing vehicle configuration words, the method comprising: generating an error checking code for configuration item parameters to be written into a vehicle controller; determining an error checking code allocation rule used for writing the configuration word this time; according to the error checking code allocation rule, the error checking code is allocated to each error checking code field in a preset configuration word data structure, and the configuration item parameters are written into the corresponding configuration item field in the configuration word data structure to obtain a target configuration word to be written; the target configuration word is sent to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes. This can significantly improve the security of the configuration word during transmission and storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle data security, and in particular to a method and device for writing vehicle configuration words. Background Art

[0002] Currently, configuration words are often written into a vehicle controller through a diagnostic instrument or an electric inspection device, and when writing configuration words into a vehicle controller, the configuration words can be changed as long as the authentication of the 27 service of the vehicle controller is passed.

[0003] However, 27 services usually use the CMAC (Cipher-based Message Authentication Code) key algorithm to generate keys. Once the key is leaked, the attacker can arbitrarily tamper with the configuration item parameters in the configuration word during the configuration word writing process, which will pose a serious threat to vehicle safety. Summary of the invention

[0004] The present application provides a method and device for writing vehicle configuration words to solve the technical problem in the prior art that the vehicle controller cannot effectively ensure the data security of the written configuration words only through the authentication measures of 27 services.

[0005] In a first aspect, the present application provides a method for writing a vehicle configuration word, the method comprising:

[0006] Generate error checking code for configuration item parameters to be written into the vehicle controller;

[0007] Determine the error checking code allocation rule used for writing the configuration word this time;

[0008] According to the error checking code allocation rule, the error checking code is allocated to each error checking code field in a preset configuration word data structure, and the configuration item parameter is written into the corresponding configuration item field in the configuration word data structure to obtain a target configuration word to be written;

[0009] The target configuration word is sent to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes.

[0010] In a possible implementation manner, determining the error checking code allocation rule used for writing the configuration word this time includes:

[0011] Determining a historical number of times that configuration words have been successfully written to the vehicle controller to date;

[0012] According to the historical writing times, an error checking code allocation rule used for writing the configuration word this time is determined.

[0013] In a possible implementation manner, determining the error checking code allocation rule used for writing the configuration word this time according to the historical number of writes includes:

[0014] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0015] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0016] After the traversal is completed, the error checking code allocation rule used for writing the configuration word this time is determined according to the current error checking code field sequence.

[0017] In a possible implementation manner, allocating the error checking code to each error checking code field in a preset configuration word data structure according to the error checking code allocation rule includes:

[0018] According to the error checking code field sequence indicated by the error checking code allocation rule, starting from the first bit in the error checking code, each bit in the error checking code is allocated to the error checking code field in sequence.

[0019] In a possible implementation, after the traversal is completed, determining the error checking code allocation rule used for writing the configuration word this time according to the current error checking code field sequence includes:

[0020] obtaining identification data of the vehicle controller;

[0021] The current error checking code field sequence is adjusted according to the identification data, and the adjusted error checking code field sequence is determined as the error checking code allocation rule used for writing the configuration word this time.

[0022] In a possible implementation, adjusting the current error checking code field sequence according to the identification data, and determining the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time, includes:

[0023] According to a preset second conversion rule, convert the identification data into second binary data;

[0024] Traversing each bit in the second binary data in order, and when the value of the jth bit currently traversed is the first value, moving the error checking code field ranked at the jth bit in the basic error checking code field sequence to the first position of the current basic error checking code field sequence;

[0025] After the traversal is completed, the current basic error checking code field sequence is determined as the error checking code allocation rule used for writing the configuration word this time.

[0026] In a possible implementation, writing the configuration item parameter into a corresponding configuration item field in the configuration word data structure includes:

[0027] According to the changed configuration item parameters among the multiple configuration item parameters to be written, determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written;

[0028] The target configuration item parameters are processed according to the set processing rules, and the processed target configuration item parameters and other configuration item parameters are respectively written into the corresponding configuration item fields in the configuration word data structure; wherein the other configuration item parameters refer to the configuration item parameters other than the target configuration item parameters among the multiple configuration item parameters to be written.

[0029] In a second aspect, the present application provides a method for writing a vehicle configuration word, the method comprising:

[0030] Receive the target configuration word to be written;

[0031] Determine an error checking code allocation rule used by the target configuration word;

[0032] Generate a first error checking code according to the configuration item parameters in the target configuration word, and parse a second error checking code from the target configuration word according to the error checking code allocation rule;

[0033] When it is determined that the first error checking code is consistent with the second error checking code, a write operation is performed on the target configuration word.

[0034] In a possible implementation manner, determining an error checking code allocation rule used by the target configuration word includes:

[0035] Determine the historical number of writes that have been successfully written to the configuration word up to now;

[0036] According to the historical write times, an error checking code allocation rule used by the target configuration word is determined.

[0037] In a possible implementation manner, determining the error checking code allocation rule used by the target configuration word according to the historical number of writes includes:

[0038] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0039] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0040] After the traversal is completed, the error checking code allocation rule used by the target configuration word is determined according to the current error checking code field sequence.

[0041] In a possible implementation manner, parsing the second error checking code from the target configuration word according to the error checking code allocation rule includes:

[0042] Parsing each error checking code field from the target configuration word;

[0043] The respective error checking code fields are concatenated according to the error checking code field sequence indicated by the error checking code allocation rule to obtain a second error checking code.

[0044] In a possible implementation manner, before determining the error checking code allocation rule used by the target configuration word, the method further includes:

[0045] determining whether the target configuration word has been written;

[0046] In the case where it is determined that the target configuration word has been written, determining the changed configuration item parameters to be written this time from the target configuration word;

[0047] Determining the configuration item to be verified from the target configuration word according to the changed configuration item parameter, and determining whether the configuration item parameter of the configuration item to be verified has been processed according to the set processing rule;

[0048] When it is determined that the configuration item parameters of the configuration item to be checked have been processed according to the set processing rules, the error checking code allocation rule used to determine the target configuration word is executed; when it is determined that the configuration item parameters of the configuration item to be checked have not been processed according to the set processing rules, the write operation on the target configuration word is refused.

[0049] In a third aspect, the present application provides a device for writing a vehicle configuration word, the device comprising:

[0050] A check code generation module is used to generate an error checking check code for the configuration item parameters to be written into the vehicle controller;

[0051] A rule determination module, used to determine the error checking code allocation rule used for writing the configuration word this time;

[0052] A check code allocation module, used to allocate the error checking code to each error checking code field in a preset configuration word data structure according to the error checking code allocation rule;

[0053] A configuration word building module, used for writing the configuration item parameters into the corresponding configuration item fields in the configuration word data structure to obtain a target configuration word to be written;

[0054] The configuration word writing module is used to send the target configuration word to the vehicle controller so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes.

[0055] In a possible implementation, the rule determination module includes:

[0056] A historical number determination unit, used to determine the historical number of times the configuration word has been successfully written into the vehicle controller up to the present;

[0057] The rule determination unit is used to determine the error checking code allocation rule used for writing the configuration word this time according to the historical writing times.

[0058] In a possible implementation manner, the rule determination unit is specifically configured to:

[0059] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0060] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0061] After the traversal is completed, the error checking code allocation rule used for writing the configuration word this time is determined according to the current error checking code field sequence.

[0062] In a possible implementation, the verification code allocation module is specifically used to:

[0063] According to the error checking code field sequence indicated by the error checking code allocation rule, starting from the first bit in the error checking code, each bit in the error checking code is allocated to the error checking code field in sequence.

[0064] In a possible implementation manner, the rule determination unit includes:

[0065] The adjustment subunit is used to obtain the identification data of the vehicle controller; adjust the current error checking code field sequence according to the identification data, and determine the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time.

[0066] In a possible implementation manner, the adjustment subunit is specifically used to:

[0067] According to a preset second conversion rule, convert the identification data into second binary data;

[0068] Traverse each bit in the second binary data in sequence, and when the value of the j-th bit currently traversed is the first value, move the error checking code field ranked at the j-th bit in the basic error checking code field sequence to the first position of the current basic error checking code field sequence; after the traversal is completed, determine the current basic error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time.

[0069] In a possible implementation manner, the configuration word building module is specifically used to:

[0070] According to the changed configuration item parameters among the multiple configuration item parameters to be written, determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written;

[0071] The target configuration item parameters are processed according to the set processing rules, and the processed target configuration item parameters and other configuration item parameters are respectively written into the corresponding configuration item fields in the configuration word data structure; wherein the other configuration item parameters refer to the configuration item parameters other than the target configuration item parameters among the multiple configuration item parameters to be written.

[0072] In a fourth aspect, the present application provides a device for writing a vehicle configuration word, the device comprising:

[0073] A receiving module, used for receiving a target configuration word to be written;

[0074] A rule determination module, used to determine an error checking code allocation rule used by the target configuration word;

[0075] A check code generation module, used to generate a first error checking check code according to the configuration item parameters in the target configuration word;

[0076] A check code parsing module, used for parsing a second error checking code from the target configuration word according to the error checking check code allocation rule;

[0077] A verification module, used to determine whether the first error checking verification code and the second error checking verification code are consistent;

[0078] The configuration word writing module is used to perform a write operation on the target configuration word when it is determined that the first error checking code and the second error checking code are consistent.

[0079] In a possible implementation, the rule determination module includes:

[0080] A historical number determination unit, used to determine the historical number of times the configuration word has been successfully written up to the present;

[0081] A rule determination unit is used to determine an error checking code allocation rule used by the target configuration word according to the historical write times.

[0082] In a possible implementation manner, the rule determination unit is specifically configured to:

[0083] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0084] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0085] After the traversal is completed, the error checking code allocation rule used by the target configuration word is determined according to the current error checking code field sequence.

[0086] In a possible implementation, the verification code parsing module includes:

[0087] A parsing unit, used for parsing each error checking code field from the target configuration word;

[0088] The sequential splicing unit is used to splice the various error checking code fields according to the error checking code field sequence indicated by the error checking code allocation rule to obtain a second error checking code.

[0089] In a possible implementation, the device further includes:

[0090] a change determination module, configured to determine whether the target configuration word has been written before determining the error checking code allocation rule used by the target configuration word; and if it is determined that the target configuration word has been written, determine the change configuration item parameter written this time from the target configuration word;

[0091] A change check module is used to determine the configuration item to be checked from the target configuration word according to the changed configuration item parameter, and determine whether the configuration item parameter of the configuration item to be checked has been processed according to the set processing rule; if it is determined that the configuration item parameter of the configuration item to be checked has been processed according to the set processing rule, execute the error checking code allocation rule used for determining the target configuration word; if it is determined that the configuration item parameter of the configuration item to be checked has not been processed according to the set processing rule, refuse to perform a write operation on the target configuration word.

[0092] In a fifth aspect, the present application provides a device comprising: a processor and a memory, wherein the processor is used to execute a vehicle configuration word writing program stored in the memory to implement the vehicle configuration word writing method described in any one of the first aspects.

[0093] In a sixth aspect, the present application provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the vehicle configuration word writing method described in any one of the first aspects.

[0094] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by generating an error checking code for the configuration item parameters to be written into the vehicle controller, determines the error checking code allocation rule used for writing the configuration word this time, and allocates the error checking code to each error checking code field in the preset configuration word data structure according to the error checking code allocation rule, and writes the configuration item parameters into the corresponding configuration item field in the configuration word data structure to obtain the target configuration word to be written. In this scheme, since the error checking codes are scattered and arranged in random order in the configuration word, even if the attacker knows the calculation method of the error checking code and the distribution of the error checking code fields in the configuration word, it is impossible to find the correct error checking code sorting and assignment by simply guessing or trial and error, thereby increasing the difficulty of cracking the error checking code. Since the error checking code allocation rule used for writing the configuration word is dynamically determined, the error checking code allocation rule used for constructing the configuration word each time is not exactly the same, so that even if an attacker can intercept and analyze a successful error checking code allocation process, this information cannot be directly applied to the next attack, because the error checking code allocation rule for the next time will change. In summary, the technical solution of the embodiment of the present application can increase the difficulty of cracking the error checking code in the configuration word, thereby significantly improving the security of the configuration word during transmission and storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0096] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0097] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0098] Figure 1 A flow chart of an embodiment of a method for writing a vehicle configuration word provided in an embodiment of the present application;

[0099] Figure 2 A flowchart of another method for writing vehicle configuration characters provided in an embodiment of the present application;

[0100] Figure 3An example of the process of changing the error checking code field sequence in the process of determining the error checking code allocation rule;

[0101] Figure 4 A flow chart of another embodiment of a method for writing vehicle configuration characters provided in an embodiment of the present application;

[0102] Figure 5 A block diagram of an embodiment of a vehicle configuration word writing device provided in an embodiment of the present application;

[0103] Figure 6 A block diagram of another embodiment of a device for writing vehicle configuration characters provided in an embodiment of the present application;

[0104] Figure 7 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0105] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0106] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0107] In order to solve the technical problem in the prior art that the vehicle controller cannot effectively ensure the data security of the written configuration words only through the authentication measures of 27 services, the present application provides a configuration word writing method and device for a vehicle controller, which can significantly improve the security of the configuration words during transmission and storage.

[0108] Figure 1 The flowchart of the embodiment of the method for writing a vehicle configuration word provided in the embodiment of the present application is as follows. In one embodiment, Figure 1 The execution subject of the process shown is an external device, such as a diagnostic instrument or an electric inspection device. The external device uses the vehicle configuration word writing method provided in the embodiment of the present application to write the configuration word to the vehicle controller to meet the actual functional configuration requirements of the vehicle. Figure 1 As shown, the process includes the following steps:

[0109] Step 101: Generate an error checking code for the configuration item parameters to be written into the vehicle controller.

[0110] The configuration items of the vehicle controller (including but not limited to the vehicle controller, body controller, etc.) are used to distinguish the functions and parameter settings of a certain aspect of the vehicle, which vary depending on the vehicle model, manufacturer and functional requirements. Generally, the configuration items of the vehicle controller include multiple, covering multiple aspects of functions and parameter settings to achieve precise control and optimization of various vehicle functions. For example, the configuration items of the vehicle controller include power configuration configuration items, seat configuration items, rearview mirror configuration items, motor model configuration items, etc.

[0111] Error checking code is a technology used to detect and correct errors that may occur during data transmission or storage. In the prior art, this type of check code ensures the integrity and correctness of the data by attaching redundant information to the end of the data. Common error checking codes currently include but are not limited to: parity check code, cyclic redundancy check code, Hamming code, etc. Taking the cyclic redundancy check code as an example, its principle is that the sender regards the data as a binary number for division operation, and uses a predefined divisor (polynomial) to generate a fixed-length check code attached to the data for transmission. After receiving the data, the receiving end uses the same generating polynomial for division operation, and compares the remainder obtained with the check code attached by the sending end. If they are consistent, the data is considered to be correct; otherwise, the data is considered to be wrong. The cyclic redundancy check code can detect multiple error types, including single-bit errors, double-bit errors, and byte errors. In the technical solution of the embodiment of the present application, the configuration item parameters to be written into the vehicle controller are the data sent by the sending end described above.

[0112] In one embodiment, a cyclic redundancy check code technology is used to generate an error checking code for the configuration item parameters to be written into the vehicle controller. Optionally, multiple configuration item parameters to be written into the vehicle controller can be spliced ​​in order to obtain a generating polynomial, and the generating polynomial is used to perform a division operation on the configuration item parameters to be written into the vehicle controller to obtain an error checking code for the configuration item parameters to be written into the vehicle controller. Optionally, the user can also customize the above generating polynomial according to experience. This embodiment of the application does not limit this.

[0113] Step 102: Determine the error checking code allocation rule used for writing the configuration word this time.

[0114] Step 103: according to the error checking code allocation rule, the error checking code is allocated to each error checking code field in the preset configuration word data structure, and the configuration item parameter is written into the corresponding configuration item field in the configuration word data structure to obtain the target configuration word to be written.

[0115] For ease of understanding, step 102 and step 103 are described in a unified manner as follows:

[0116] In the technical solution of the embodiment of the present application, the error checking code is not attached as a whole to the end of the data (i.e., the configuration item parameters to be written into the vehicle controller) as in the prior art, but the error checking code is divided into multiple sub-fields according to certain rules, and the multiple sub-fields are dispersedly arranged in the configuration word finally sent. This can increase the difficulty of cracking the error checking code, thereby improving the security of the configuration word during transmission or storage.

[0117] In one embodiment, see Table 1 below, which is a schematic diagram of a configuration word data structure provided in an embodiment of the present application:

[0118] Table 1

[0119]

[0120] As shown in Table 1, the configuration word data structure includes multiple configuration item fields and multiple error checking code fields. Among them, the configuration item field is used to write the configuration item parameters, and the error checking code field is used to write the error checking code determined in step 101. Generally speaking, the total space occupied by the configuration word is 32 bytes. In order to ensure that the error checking is accurate enough, 28 bytes are allocated to the configuration item field and 4 bytes are allocated to the error checking code field. For example, in the example of Table 1, configuration item field 1, configuration item field 2, and configuration item field 3 are respectively distributed in the 0th byte and the 1st byte of the configuration word data structure, and the lengths are 4 bits, 1 bit, and 2 bits, respectively, and the remaining fields are the positions of the error checking code fields.

[0121] It should be noted that multiple error checking code fields are dispersedly arranged in the configuration word data structure, and the lengths of multiple error checking code fields are not consistent. For example, in the example of Table 1, the length of error checking code field 1 is 3 bits, and the length of error checking code field 2 is 2 bits. The total length of each error checking code field is usually consistent with the length of the error checking code determined in step 101, for example, 32 bits, so that the error checking code can be assigned to each error checking code field. It can be seen that in the configuration word constructed by the technical solution of the embodiment of the present application, all error checking code fields are spliced ​​in a certain order to form a complete error checking code. Therefore, even if the attacker knows the calculation method of the error checking code and the distribution of the error checking code fields in the configuration word, it is impossible to simply find the correct error checking code sorting and assignment by guessing or trial and error, thereby increasing the difficulty of cracking the error checking code.

[0122] On this basis, the above error checking code allocation rule can be used to indicate the arrangement order of each error checking code field, or it can be said that the error checking code allocation rule indicates an error checking code field sequence. For example, the error checking code field sequence indicated by the error checking code allocation rule is error checking code field 5, error checking code field 3, error checking code field 7, error checking code field 6, error checking code field 2, error checking code field 1, error checking code field 8, and error checking code field 4.

[0123] The specific implementation of allocating the error checking code to each error checking code field in the preset configuration word data structure according to the error checking code allocation rule includes: according to the error checking code field sequence indicated by the error checking code allocation rule, starting from the first bit in the error checking code, each bit in the error checking code is allocated to the error checking code field in sequence.

[0124] For example, assuming that the length of the error checking code field 5 is 4 bits and the length of the error checking code field 3 is 5 bits, then, starting from the first bit in the error checking code, the first to fourth bits are allocated to the error checking code field 5, and the fifth to ninth bits are allocated to the error checking code field 3, and the subsequent bits are allocated to the error checking code field 7, error checking code field 6, error checking code field 2, error checking code field 1, error checking code field 8, and error checking code field 4 in the same way, and they will not be repeated here one by one.

[0125] It can be seen from the above example that the error checking code determined in step 101 is scattered and arranged in a random order in the configuration word, so that even if the attacker knows the calculation method of the error checking code and the distribution of the error checking code field in the configuration word, it is impossible to simply find the correct error checking code sorting and assignment by guessing or trial and error, thereby increasing the difficulty of cracking the error checking code.

[0126] Further, it can be seen from the description of step 102 and step 103 that in the technical solution of the embodiment of the present application, when writing the configuration word to the vehicle controller each time, a fixed error checking code allocation rule is not adopted, but a method of dynamically determining the error checking code allocation rule used for writing the configuration word this time is adopted. This method can make the error checking code allocation rule used for each construction of the configuration word not completely the same. On the one hand, this processing method makes it impossible for the attacker to simply find the correct error checking code sorting and assignment by guessing or trial and error even if he knows the calculation method of the error checking code and the distribution of the error checking code field in the configuration word. On the other hand, even if the attacker can intercept and analyze a successful error checking code allocation process, this information cannot be directly applied to the next attack, because the next error checking code allocation rule will change. Combining these two aspects, the technical solution of the embodiment of the present application can increase the difficulty of cracking the error checking code in the configuration word, thereby significantly improving the security of the configuration word during transmission and storage.

[0127] As for how to determine the error check code allocation rule used for writing the configuration word this time, the following will be described Figure 2 The illustrated embodiments are merely illustrative and will not be described in detail herein.

[0128] Step 104: Send the target configuration word to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes.

[0129] It can be seen from the description of step 102 and step 103 that in the technical solution of the embodiment of the present application, the configuration word sent by the external device (for the convenience of description, referred to as the target configuration word) includes configuration item parameters and an error checking code. This allows the vehicle controller to verify whether the configuration item parameters are correct and legal through the error checking code therein after receiving the target configuration word during the execution of step 104.

[0130] As for how the vehicle controller verifies the legitimacy of the received target configuration word, the following will be described in detail. Figure 4 The illustrated embodiments are provided for illustrative purposes only and will not be described in detail herein.

[0131] The technical solution provided by the embodiment of the present application generates an error checking code for the configuration item parameters to be written into the vehicle controller, determines the error checking code allocation rule used for writing the configuration word this time, allocates the error checking code to each error checking code field in the preset configuration word data structure according to the error checking code allocation rule, and writes the configuration item parameters into the corresponding configuration item field in the configuration word data structure to obtain the target configuration word to be written. In this solution, since the error checking code is scattered and arranged in a random order in the configuration word, even if the attacker knows the calculation method of the error checking code and the distribution of the error checking code field in the configuration word, it is impossible to simply find the correct error checking code sorting and assignment by guessing or trial and error, thereby increasing the difficulty of cracking the error checking code. Due to the method of dynamically determining the error checking code allocation rule used for writing the configuration word this time, the error checking code allocation rule used for each configuration word construction is not exactly the same, so that even if the attacker can intercept and analyze a successful error checking code allocation process, this information cannot be directly applied to the next attack, because the next error checking code allocation rule will change. In summary, the application of the technical solution of the embodiment of the present application can increase the difficulty of cracking the error checking code in the configuration word, thereby significantly improving the security of the configuration word during transmission and storage.

[0132] In addition, since the technical solution of the embodiment of the present application can significantly improve the security of the configuration word during transmission and storage, the technical solution of the embodiment of the present application can be applied to the remote configuration word writing scenario. Through the remote configuration word writing function, the configuration word can be changed remotely after the vehicle is launched on the market without arranging personnel to go to the after-sales site to solve it, thereby avoiding the time consumption and personnel energy consumption caused by changing the configuration word.

[0133] Figure 2 A flowchart of another method for writing vehicle configuration characters provided in an embodiment of the present application. Figure 2 The process shown in Figure 1 Based on the process shown in FIG. 1 , an exemplary description is given of how to determine the error checking code allocation rule used for writing the configuration word this time. Figure 2 As shown, the following steps are included:

[0134] Step 201: Determine the historical number of times that the configuration word has been successfully written into the vehicle controller up to now.

[0135] In one embodiment, the above-mentioned historical write count refers to the number of times the configuration word has been successfully written to the vehicle controller up to the present. That is to say, the configuration word writing process with a write failure result is no longer counted. It should be noted that the writing mentioned here includes two situations: the first writing and the change writing. Among them, the change writing refers to changing the configuration item in the configuration word after the configuration word is written for the first time.

[0136] In one embodiment, the external device may maintain a counter or recorder for tracking the number of successful writes of the configuration word to the vehicle controller (ie, the historical write count).

[0137] Step 202: Determine the error checking code allocation rule used for writing the configuration word this time according to the historical writing times.

[0138] It can be understood that each time a configuration word is successfully written to the vehicle controller, the historical number of times the configuration word has been successfully written to the vehicle controller up to the current time will change, and then based on the historical number of writes, the error checking code allocation rule used for this write of the configuration word can be determined dynamically.

[0139] In one embodiment, the specific implementation of determining the error checking code allocation rule used for writing the configuration word this time according to the historical writing times includes: according to the preset first conversion rule, converting the historical writing times into the first binary data, traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the error checking code field ranked at the i-th bit in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence. After the traversal is completed, the error checking code allocation rule used for writing the configuration word this time is determined according to the current error checking code field sequence.

[0140] Among them, the above-mentioned first conversion rule is: first convert the historical write count to the interval [0, n), where n is the total number of sorting methods of multiple error checking code fields, that is, there are theoretically n sorting methods for multiple error checking code fields. Optionally, when the historical write count does not belong to the interval [0, n), the historical write count is converted to the interval [0, n). In addition, as an optional implementation method, the counting interval of the above-mentioned counter or recorder can also be set to [0, n), so that as the number of successful configuration words written to the vehicle controller changes, the value of the counter or recorder circulates within [0, n). In this implementation method, the historical write count described in step 202 refers to the count value of the counter or recorder.

[0141] The next step is to convert the sum of the historical write times in the interval [0, n) and the set value into binary data, and then take the first m bits of the binary data, and determine the first m bits of the binary data as the first binary data mentioned above. Among them, m is the number of error checking code fields in the configuration word data structure. The above set value is usually an integer greater than 8, for example, 13. The reason for this setting is that the binary data converted from the sum of the historical write times and an integer greater than 8 can ensure that it has more than 4 bits, so that it can cover the possible ordering of the error checking code fields in actual applications, and make the ordering rules relatively complex, thereby further increasing the difficulty of cracking the error checking code.

[0142] The first value is, for example, 1, and the values ​​of i are 1, 2, ..., m in sequence.

[0143] The basic error checking code field sequence refers to the initial error checking code field sequence, which is fixed. The dynamic change of the error checking code field sequence takes the basic error checking code field sequence as the initial state.

[0144] For example, assuming that the first binary data is 1100, and assuming that the basic error checking code field sequence is: error checking code field 5, error checking code field 3, error checking code field 7, error checking code field 6, error checking code field 2, error checking code field 1, error checking code field 8, error checking code field 4. According to the above description, each bit in the first binary data is traversed in order (such as from low to high). When the first bit is traversed, the value of the first bit is 0, not the first value, and the next bit is traversed. When the second bit is traversed, the value of the second bit is 0, not the first value, and the next bit is traversed. When traversing to the third bit, the value of the third bit is 1, that is, the first value. At this time, i is 3, and the error checking code field 7 ranked at the third position in the above basic error checking code field sequence is moved to the first position of the current error checking code field sequence (at this time, it is the basic error checking code field sequence), and the latest current error checking code field sequence is obtained: error checking code field 7, error checking code field 5, error checking code field 3, error checking code field 6, error checking code field 2, error checking code field 1, error checking code field 8, error checking code field 4, and then continue to traverse the next bit. When the 4th bit is traversed, the value of the 4th bit is 1, that is, the first value. At this time, i is 4, and the error checking code field 6 ranked at the 4th bit in the above basic error checking code field sequence is moved to the first position of the current error checking code field sequence, and the latest current error checking code field sequence is obtained: error checking code field 6, error checking code field 7, error checking code field 5, error checking code field 3, error checking code field 2, error checking code field 1, error checking code field 8, error checking code field 4. At this point, the traversal is completed, and the error checking code allocation rule used for the current writing configuration word is obtained: error checking code field 6, error checking code field 7, error checking code field 5, error checking code field 3, error checking code field 2, error checking code field 1, error checking code field 8, error checking code field 4.

[0145] For ease of understanding, Figure 3 The following illustrates the changing process of the error checking code field sequence in the above example.

[0146] Figure 2 In the embodiment shown, by determining the historical number of times that the configuration word has been successfully written to the vehicle controller up to the present time, and determining the error checking code allocation rule used for writing the configuration word this time based on the historical number of times, it is possible to dynamically update the error checking code allocation rule used for writing the configuration word as the number of times the configuration word is successfully written to the vehicle controller accumulates.

[0147] In one embodiment, in order to further ensure the security of the configuration word and prevent the data security of other types of vehicle controllers from being threatened after the error checking code allocation rule of one type of vehicle controller is cracked, different error checking code field sequences can be set for different types of vehicle controllers. In this regard, as an optional implementation method, after the above traversal is completed, the specific implementation of determining the error checking code allocation rule used for writing the configuration word this time according to the current error checking code field sequence includes: obtaining the identification data of the vehicle controller, adjusting the current error checking code field sequence according to the identification data, and determining the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time.

[0148] It is understandable that the identification data of different types of vehicle controllers are usually different. Therefore, adjusting the current error checking code field sequence according to the identification data of the vehicle controller can determine different error checking code field sequences for different types of vehicle controllers.

[0149] Further, as an optional implementation, the current error checking code field sequence is adjusted according to the identification data, and the specific implementation of determining the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time includes: according to the preset second conversion rule, converting the identification data into second binary data; traversing each bit in the second binary data in sequence, and when the value of the jth bit currently traversed is the first value, moving the error checking code field ranked at the jth position in the basic error checking code field sequence to the first position of the current error checking code field sequence. After the traversal is completed, the current basic error checking code field sequence is determined as the basic error checking code field sequence used for writing the configuration word this time.

[0150] Optionally, the identification data of the vehicle controller is a diagnostic ID of the vehicle controller, such as 0x711, 0x721.

[0151] The second conversion rule is: first take the last two digits of the vehicle controller identification data, and then convert the last two digits into binary numbers to obtain the second binary data mentioned above.

[0152] The values ​​of j are 1, 2, ..., 8 in sequence. The upper limit of the value of j is 8 because the number of bits of the second binary data is 8.

[0153] For example, assuming that the diagnostic ID of the vehicle controller is 0x732, the last two digits 32 are converted into the second binary data 100000, and assuming that the current error check code field sequence is: error check code field 6, error check code field 7, error check code field 5, error check code field 3, error check code field 2, error check code field 1, error check code field 8, error check code field 4, and assuming that the basic error check code field sequence is: error check code field 5, error check code field 3, error check code field 7, error check code field 6, error check code field 2, error check code field 1, error check code field 8, error check code field 4. According to the above description, each bit in the second binary data is traversed in sequence (such as from low to high), when traversing to the first bit, the value of the first bit is 0, not the first value, and the next bit is traversed. When traversing to the second bit, the value of the second bit is 0, not the first value, and the next bit is traversed. And so on until the 6th bit is traversed. When the 6th bit is traversed, the value of the 6th bit is 1, that is, the first value. At this time, j is 6, and the error checking code field 1 ranked at the 6th bit in the above basic error checking code field sequence is moved to the first position of the current error checking code field sequence, and a new error checking code field sequence is obtained: error checking code field 1, error checking code field 6, error checking code field 7, error checking code field 5, error checking code field 3, error checking code field 2, error checking code field 8, error checking code field 4. At this point, the traversal is completed, and the error checking code sequence used for writing the configuration word this time is obtained: error checking code field 1, error checking code field 6, error checking code field 7, error checking code field 5, error checking code field 3, error checking code field 2, error checking code field 8, error checking code field 4.

[0154] In the technical solution of the above embodiment, by setting different error checking code field sequences for different types of vehicle controllers, it can effectively prevent the data security of other types of vehicle controllers from being threatened after the error checking code allocation rules of one type of vehicle controller are cracked, thereby further ensuring the security of the configuration words.

[0155] In practical applications, for a configuration word, in addition to the first writing, it is also possible to change the configuration word, that is, to change one or several configuration item parameters. In order to further ensure the security of the configuration word when changing and writing the configuration word, the technical solution of the present application also provides the following embodiments:

[0156] In one embodiment, when the configuration word is modified and written, in addition to changing the configuration item parameters that need to be changed, a certain other configuration item parameter in the configuration word is also specially processed. After receiving the configuration word, the vehicle controller does not modify and write the specially processed configuration item parameter, but uses the specially processed configuration item parameter as a security mechanism for the change strategy to verify whether the changed configuration item parameter is a legal change.

[0157] In this regard, in one embodiment, the specific implementation of writing the configuration item parameters into the corresponding configuration item fields in the configuration word data structure includes: determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written according to the configuration item parameters that have changed among the multiple configuration item parameters to be written, processing the target configuration item parameters according to the set processing rules, and writing the processed target configuration item parameters and other configuration item parameters into the corresponding configuration item fields in the configuration word data structure respectively; wherein the other configuration item parameters refer to the configuration item parameters other than the target configuration item parameters among the multiple configuration item parameters to be written.

[0158] In the above implementation, which configuration item parameter is specially processed is determined according to the changed configuration item parameter (i.e., the changed configuration item parameter). Therefore, after receiving the configuration word, the vehicle controller can determine the configuration item parameter that originally needs to be specially processed by the changed configuration item parameter, and then determine whether the changed configuration item parameter is a legal change by whether the configuration item parameter has actually been specially processed.

[0159] As an optional implementation method, according to the configuration item parameters that have changed among the multiple configuration item parameters to be written, the specific implementation of determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written includes: dividing the number of changed bits in the changed configuration item parameter by the total number of configuration items to obtain a remainder s, and determining the sth configuration item parameter as the configuration item parameter to be processed.

[0160] As an optional implementation, the processing rule is set as follows: invert each bit of the configuration item parameter. For example, if the value of a bit in the configuration item parameter is originally 1, it is inverted to 0; for another example, if the value of a bit in the configuration item parameter is originally 0, it is inverted to 1.

[0161] For example, the number of seats in the seat layout configuration item is changed from six seats to five seats, and it is assumed that the configuration item occupies 4 bits, of which the configuration item parameter corresponding to six seats is 0010, and the configuration item parameter corresponding to five seats is 0001. It can be seen that the number of seats is changed from six seats to five seats, and the number of bits changed is 0, that is, two bits in the configuration item parameter need to be changed. Assume that the configuration word data structure includes 5 configuration items in total, in order from front to back: seat layout configuration item, ambient light configuration item, exterior light configuration item, liveness detection configuration item, and power configuration configuration item. According to the above description, the remainder obtained by dividing the number of bits changed by the total number of configuration items is 2, so the second configuration item: ambient light configuration item is determined as the target configuration item to be processed. Assuming that the original value of the ambient light configuration item is 001, then after processing it according to the set processing rules, the value is changed to 110.

[0162] The technical solution of the above embodiment, when changing and writing the configuration word, in addition to changing the configuration item parameters that need to be changed, also performs special processing on other configuration item parameters in the configuration word. After receiving the configuration word, the vehicle controller can use the specially processed configuration item parameters as a security mechanism for the change strategy to verify whether the changed configuration item parameters are legal changes. This can further ensure the security of the configuration word when changing and writing the configuration word.

[0163] The above is a detailed explanation of the configuration word writing method of the vehicle controller provided by the embodiment of the present application from the perspective of the external device. The following is a detailed explanation of the configuration word writing method of the vehicle controller provided by the embodiment of the present application from the perspective of the vehicle controller.

[0164] Figure 4 The flowchart of another embodiment of a method for writing a vehicle configuration word provided in the embodiment of the present application, in one embodiment, Figure 4 The execution subject of the process shown is the vehicle controller. Figure 4 As shown, the process includes the following steps:

[0165] Step 401: Receive a target configuration word to be written.

[0166] Here, the vehicle controller receives the target configuration word sent by the external device. Figure 1 The process shown generates the target configuration word.

[0167] Taking the external device as a diagnostic instrument as an example, the diagnostic instrument sends a 27 service request seed instruction to the gateway. After receiving the instruction, the gateway forwards the instruction to the corresponding vehicle controller according to the diagnostic ID. After receiving it, the vehicle controller returns the seed to the gateway. After receiving the feedback, the gateway feeds back the seed to the diagnostic instrument. After that, the diagnostic instrument calculates the KEY value corresponding to the seed based on the preset key and key algorithm, and forwards the KEY value to the corresponding vehicle controller through the gateway. The vehicle controller verifies whether the KEY value is correct and feeds back the verification result to the diagnostic instrument through the gateway. If the verification is successful, the diagnostic instrument sends the target configuration word to the vehicle controller through the 22 service. At this point, the vehicle controller receives the target configuration word to be written.

[0168] It is understandable that during the transmission of the target configuration word, an attacker may tamper with the configuration item parameters therein, so the target configuration word received by the vehicle controller is not completely consistent with the target configuration word sent by the external device. Therefore, after receiving the target configuration word to be written, the vehicle controller continues to perform subsequent steps to verify the legitimacy of the target configuration word.

[0169] Step 402: Determine the error checking code allocation rule used by the target configuration word.

[0170] The error checking code allocation rule determined here is the above Figure 1 The error checking code allocation rule is determined in step 102 in the illustrated process.

[0171] In one embodiment, the specific implementation of the vehicle controller determining the error checking code allocation rule used by the target configuration word includes: determining the historical number of writes that have been successfully written to the configuration word up to the current time, and determining the error checking code allocation rule used by the target configuration word based on the historical number of writes.

[0172] The vehicle controller may maintain a counter or recorder to track the number of times the configuration word is successfully written to the vehicle controller (i.e., the number of historical writes). Figure 2 The process is the same as shown in the figure. The write here also includes the first write and the change write. It can be seen that the number of historical writes here is the same as the above Figure 2 The historical write times involved in the process shown are synchronous.

[0173] Further, as an optional implementation method, the specific implementation of determining the error checking code allocation rule used by the target configuration word according to the historical write count includes: converting the historical write count into the first binary data according to the preset first conversion rule; traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the error checking code field ranked at the i-th position in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence; after the traversal is completed, the error checking code allocation rule used by the target configuration word is determined according to the current error checking code field sequence. It can be known from the description of the embodiment of the external device side above that the current error checking code field sequence can be directly determined as the error checking code allocation rule used by the target configuration word, or the current error checking code field sequence can be adjusted according to the identification data of the vehicle controller, and the adjusted error checking code field sequence is determined as the error checking code allocation rule used by the target configuration word. As for the specific adjustment method, please refer to the relevant description in the above embodiment, which will not be repeated here.

[0174] It can be seen from the above description that the vehicle controller determines the error checking code allocation rule in the same way as the external device constructs the target configuration word, and the historical write times are also synchronized. Therefore, the error checking code allocation rule determined by the vehicle controller in step 402 is the error checking code allocation rule used by the correct target configuration word.

[0175] Step 403: Generate a first error checking code according to the configuration item parameters in the target configuration word, and parse a second error checking code from the target configuration word according to the error checking code allocation rule.

[0176] Here, the vehicle controller acts as a data receiving end. After receiving the target configuration word, it parses the configuration item parameters from the target configuration word and uses the same generating polynomial as in the above step 101 to perform a division operation to obtain an error checking code corresponding to the configuration item parameters actually received (for convenience of description, referred to as the first error checking code).

[0177] Here, the specific implementation of parsing the second error checking code from the target configuration word according to the error checking code allocation rule includes: parsing each error checking code field from the target configuration word, splicing each error checking code field according to the error checking code field sequence indicated by the error checking code allocation rule, and obtaining the second error checking code.

[0178] For example, assume that the error checking code field sequence indicated by the error checking code allocation rule is error checking code field 3, error checking code field 2, and error checking code field 1. And assume that the length of error checking code field 3 is 4 bits, the length of error checking code field 2 is 5 bits, and the length of error checking code field 1 is 3 bits. Then, when the external device constructs the target configuration word, starting from the first bit in the error checking code, the first to fourth bits are allocated to the error checking code field 3, the fifth to ninth bits are allocated to the error checking code field 2, and the ninth to eleventh bits are allocated to the error checking code 1.

[0179] In step 403, after the vehicle controller parses the error checking code field 1, error checking code field 2 and error checking code field 3 from the received target configuration word, the three fields are spliced ​​in the order of error checking code field 3, error checking code field 2, and error checking code field 1 to obtain a second error checking code.

[0180] It can be understood that, when the error checking code has not been tampered with, the second error checking code obtained by the vehicle controller in the above manner is a complete and correct error checking code.

[0181] Step 404: When it is determined that the first error checking code and the second error checking code are consistent, a write operation is performed on the target configuration word.

[0182] The consistency of the first error checking code and the second error checking code means that the configuration item parameters and the error checking code in the target configuration word have not been tampered with. Therefore, when it is determined that the first error checking code and the second error checking code are consistent, the target configuration word can be deemed legal, and then a write operation can be performed on the target configuration word.

[0183] In addition, the first error checking code and the second error checking code are inconsistent in the following cases:

[0184] Case 1: During the transmission of the target configuration word, the attacker tampered with the configuration item parameters, resulting in the first error check code not being the correct error check code.

[0185] Case 2: During the transmission of the target configuration word, the attacker not only tampered with the configuration item parameters, but also tampered with the error check code, intending to crack the error check code to make the vehicle controller recognize the originally illegal target configuration word as a legal target configuration word. However, since the error check code in the target configuration word is very difficult to crack, the attacker failed to correctly crack the error check code.

[0186] It can be seen that by increasing the difficulty of cracking the error checking code in the configuration word, the security of the configuration word during transmission or storage can be significantly improved.

[0187] The technical solution provided by the embodiment of the present application is that after receiving the target configuration word to be written, the vehicle controller determines the error checking code allocation rule used by the target configuration word, generates a first error checking code according to the configuration item parameters in the target configuration word, and parses the second error checking code from the target configuration word according to the error checking code allocation rule, and performs a write operation on the target configuration word when it is determined that the first error checking code and the second error checking code are consistent. Since the error checking code of the configuration item parameters to be written is scattered and arranged in a random order in the target configuration word, even if the attacker knows the calculation method of the error checking code and the distribution of the error checking code field in the configuration word, it is impossible to simply find the correct error checking code sorting and assignment by guessing or trial and error, thereby increasing the difficulty of cracking the error checking code. Due to the method of dynamically determining the error checking code allocation rule used for writing the configuration word this time, the error checking code allocation rule used for each configuration word construction is not exactly the same, so that even if the attacker can intercept and analyze a successful error checking code allocation process, this information cannot be directly applied to the next attack, because the next error checking code allocation rule will change. In summary, the application of the technical solution of the embodiment of the present application can increase the difficulty of cracking the error checking code in the configuration word, thereby significantly improving the security of the configuration word during transmission and storage.

[0188] It can be seen from the above description on the external device side that when the configuration word is changed and written, after receiving the configuration word, the vehicle controller can verify whether the changed configuration item parameter is a legal change through a certain configuration item parameter therein.

[0189] In this regard, in one embodiment, before determining the error checking code allocation rule used by the target configuration word, the vehicle controller first determines whether the target configuration word has been written. If it is determined that the target configuration word has been written, the changed configuration item parameters written this time are determined from the target configuration word, and the configuration item to be checked is determined from the target configuration word according to the changed configuration item parameters, and it is determined whether the configuration item parameters of the configuration item to be checked have been processed according to the set processing rules. If it is determined that the configuration item parameters of the configuration item to be checked have been processed according to the set processing rules, subsequent operations are performed to determine whether the target configuration word is legal. If it is determined that the configuration item parameters of the configuration item to be checked have not been processed according to the set processing rules, the write operation on the target configuration word is refused. This processing method can further enhance the security of the configuration word.

[0190] The vehicle controller may determine whether the target configuration word has been written by the DID of the currently received target configuration word.

[0191] The configuration items to be checked correspond to the target configuration item parameters to be processed described in the above embodiment. Accordingly, the specific implementation of determining the configuration items to be checked from the target configuration word according to the changed configuration item parameters is also consistent with the specific implementation of determining the target configuration item parameters in the above embodiment, which will not be repeated here.

[0192] Figure 5 This is a block diagram of an embodiment of a vehicle configuration word writing device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0193] A check code generation module 51 is used to generate an error checking check code for the configuration item parameters to be written into the vehicle controller;

[0194] A rule determination module 52, used to determine the error checking code allocation rule used for writing the configuration word this time;

[0195] A check code allocation module 53, configured to allocate the error checking code to each error checking code field in a preset configuration word data structure according to the error checking code allocation rule;

[0196] A configuration word building module 54 is used to write the configuration item parameters into the corresponding configuration item fields in the configuration word data structure to obtain a target configuration word to be written;

[0197] The configuration word writing module 55 is used to send the target configuration word to the vehicle controller so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes.

[0198] In a possible implementation, the rule determination module 52 includes:

[0199] A historical number determination unit, used to determine the historical number of times the configuration word has been successfully written into the vehicle controller up to the present;

[0200] The rule determination unit is used to determine the error checking code allocation rule used for writing the configuration word this time according to the historical writing times.

[0201] In a possible implementation manner, the rule determination unit is specifically configured to:

[0202] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0203] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0204] After the traversal is completed, the error checking code allocation rule used for writing the configuration word this time is determined according to the current error checking code field sequence.

[0205] In a possible implementation manner, the verification code allocation module 53 is specifically configured to:

[0206] According to the error checking code field sequence indicated by the error checking code allocation rule, starting from the first bit in the error checking code, each bit in the error checking code is allocated to the error checking code field in sequence.

[0207] In a possible implementation manner, the rule determination unit includes:

[0208] The adjustment subunit is used to obtain the identification data of the vehicle controller; adjust the current error checking code field sequence according to the identification data, and determine the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time.

[0209] In a possible implementation manner, the adjustment subunit is specifically used to:

[0210] According to a preset second conversion rule, convert the identification data into second binary data;

[0211] Traversing each bit in the second binary data in order, and when the value of the jth bit currently traversed is the first value, moving the error checking code field ranked at the jth bit in the basic error checking code field sequence to the first position of the current basic error checking code field sequence;

[0212] After the traversal is completed, the current basic error checking code field sequence is determined as the error checking code field sequence used for writing the configuration word this time.

[0213] In a possible implementation manner, the configuration word building module 54 is specifically used to:

[0214] According to the changed configuration item parameters among the multiple configuration item parameters to be written, determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written;

[0215] The target configuration item parameters are processed according to the set processing rules, and the processed target configuration item parameters and other configuration item parameters are respectively written into the corresponding configuration item fields in the configuration word data structure; wherein the other configuration item parameters refer to the configuration item parameters other than the target configuration item parameters among the multiple configuration item parameters to be written.

[0216] Figure 6 This is a block diagram of another embodiment of a vehicle configuration word writing device provided in an embodiment of the present application. Figure 6 As shown, the device comprises:

[0217] A receiving module 61, used for receiving a target configuration word to be written;

[0218] A rule determination module 62, used to determine the error checking code allocation rule used by the target configuration word;

[0219] A check code generation module 63, configured to generate a first error checking check code according to the configuration item parameters in the target configuration word;

[0220] A check code parsing module 64, configured to parse a second error checking code from the target configuration word according to the error checking code allocation rule;

[0221] A verification module 65, used to determine whether the first error checking verification code and the second error checking verification code are consistent;

[0222] The configuration word writing module 66 is used to perform a write operation on the target configuration word when it is determined that the first error checking code and the second error checking code are consistent.

[0223] In a possible implementation, the rule determination module 62 includes:

[0224] A historical number determination unit, used to determine the historical number of times the configuration word has been successfully written up to the present;

[0225] A rule determination unit is used to determine an error checking code allocation rule used by the target configuration word according to the historical write times.

[0226] In a possible implementation manner, the rule determination unit is specifically configured to:

[0227] According to a preset first conversion rule, converting the historical writing times into first binary data;

[0228] Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence;

[0229] After the traversal is completed, the error checking code allocation rule used by the target configuration word is determined according to the current error checking code field sequence.

[0230] In a possible implementation, the verification code parsing module 64 includes:

[0231] A parsing unit, used for parsing each error checking code field from the target configuration word;

[0232] The sequential splicing unit is used to splice the various error checking code fields according to the error checking code field sequence indicated by the error checking code allocation rule to obtain a second error checking code.

[0233] In a possible implementation, the device further includes:

[0234] a change determination module, configured to determine whether the target configuration word has been written before determining the error checking code allocation rule used by the target configuration word; and if it is determined that the target configuration word has been written, determine the change configuration item parameter written this time from the target configuration word;

[0235] A change check module is used to determine the configuration item to be checked from the target configuration word according to the changed configuration item parameter, and determine whether the configuration item parameter of the configuration item to be checked has been processed according to the set processing rule; if it is determined that the configuration item parameter of the configuration item to be checked has been processed according to the set processing rule, execute the error checking code allocation rule used for determining the target configuration word; if it is determined that the configuration item parameter of the configuration item to be checked has not been processed according to the set processing rule, refuse to perform a write operation on the target configuration word.

[0236] like Figure 7 As shown, an embodiment of the present application provides a device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0237] Memory 113, used for storing computer programs;

[0238] In one embodiment of the present application, the processor 111 is used to execute the program stored in the memory 113 to implement the configuration word writing method of the vehicle controller provided by any of the above method embodiments, including:

[0239] Generate error checking code for configuration item parameters to be written into the vehicle controller;

[0240] Determine the error checking code allocation rule used for writing the configuration word this time;

[0241] According to the error checking code allocation rule, the error checking code is allocated to each error checking code field in a preset configuration word data structure, and the configuration item parameter is written into the corresponding configuration item field in the configuration word data structure to obtain a target configuration word to be written;

[0242] The target configuration word is sent to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes.

[0243] or,

[0244] Receive the target configuration word to be written;

[0245] Determine an error checking code allocation rule used by the target configuration word;

[0246] Generate a first error checking code according to the configuration item parameters in the target configuration word, and parse a second error checking code from the target configuration word according to the error checking code allocation rule;

[0247] When it is determined that the first error checking code is consistent with the second error checking code, a write operation is performed on the target configuration word.

[0248] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for writing configuration words of a vehicle controller provided in any of the aforementioned method embodiments are implemented.

[0249] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0250] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0251] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0252] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for writing a vehicle configuration word, characterized in that: The method comprises: Generate error checking code for configuration item parameters to be written into the vehicle controller; Determine the error checking code allocation rule used for writing the configuration word this time; According to the error checking code allocation rule, the error checking code is allocated to each error checking code field in a preset configuration word data structure, and the configuration item parameter is written into the corresponding configuration item field in the configuration word data structure to obtain a target configuration word to be written; Sending the target configuration word to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes; The step of determining the error checking code allocation rule used for writing the configuration word this time includes: Determining a historical number of times that configuration words have been successfully written to the vehicle controller to date; According to the historical writing times, an error checking code allocation rule used for writing the configuration word this time is determined.

2. The method according to claim 1, characterized in that The step of determining the error checking code allocation rule used for writing the configuration word this time according to the historical writing times includes: According to a preset first conversion rule, converting the historical writing times into first binary data; Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence; After the traversal is completed, the error checking code allocation rule used for writing the configuration word this time is determined according to the current error checking code field sequence.

3. The method according to claim 1, characterized in that The step of allocating the error checking code to each error checking code field in a preset configuration word data structure according to the error checking code allocation rule includes: According to the error checking code field sequence indicated by the error checking code allocation rule, starting from the first bit in the error checking code, each bit in the error checking code is allocated to the error checking code field in sequence.

4. The method according to claim 2, characterized in that: The step of determining the error checking code allocation rule used for writing the configuration word this time according to the current error checking code field sequence includes: obtaining identification data of the vehicle controller; The current error checking code field sequence is adjusted according to the identification data, and the adjusted error checking code field sequence is determined as the error checking code allocation rule used for writing the configuration word this time.

5. The method according to claim 4, characterized in that The step of adjusting the current error checking code field sequence according to the identification data and determining the adjusted error checking code field sequence as the error checking code allocation rule used for writing the configuration word this time includes: According to a preset second conversion rule, convert the identification data into second binary data; Traversing each bit in the second binary data in order, and when the value of the jth bit currently traversed is the first value, moving the error checking code field ranked at the jth bit in the basic error checking code field sequence to the first position of the current basic error checking code field sequence; After the traversal is completed, the current basic error checking code field sequence is determined as the error checking code allocation rule used for writing the configuration word this time.

6. The method according to claim 1, characterized in that The step of writing the configuration item parameter into a corresponding configuration item field in the configuration word data structure includes: According to the changed configuration item parameters among the multiple configuration item parameters to be written, determining the target configuration item parameters to be processed from the multiple configuration item parameters to be written; The target configuration item parameters are processed according to the set processing rules, and the processed target configuration item parameters and other configuration item parameters are respectively written into the corresponding configuration item fields in the configuration word data structure; wherein the other configuration item parameters refer to the configuration item parameters other than the target configuration item parameters among the multiple configuration item parameters to be written.

7. A method for writing vehicle configuration words, characterized in that: The method comprises: Receive the target configuration word to be written; Determine an error checking code allocation rule used by the target configuration word; Generate a first error checking code according to the configuration item parameters in the target configuration word, and parse a second error checking code from the target configuration word according to the error checking code allocation rule; When it is determined that the first error checking code and the second error checking code are consistent, performing a write operation on the target configuration word; The step of determining an error checking code allocation rule used by the target configuration word includes: Determine the historical number of writes that have been successfully written to the configuration word up to now; According to the historical write times, an error checking code allocation rule used by the target configuration word is determined.

8. The method according to claim 7, characterized in that The step of determining the error checking code allocation rule used by the target configuration word according to the historical write times includes: According to a preset first conversion rule, converting the historical writing times into first binary data; Traversing each bit in the first binary data in order, and when the value of the i-th bit currently traversed is the first value, moving the i-th error checking code field in the preset basic error checking code field sequence to the first position of the current error checking code field sequence; wherein, in the initial case, the basic error checking code field sequence is determined as the current error checking code field sequence; After the traversal is completed, the error checking code allocation rule used by the target configuration word is determined according to the current error checking code field sequence.

9. The method according to claim 7, characterized in that: The step of parsing the second error checking code from the target configuration word according to the error checking code allocation rule comprises: Parsing each error checking code field from the target configuration word; The respective error checking code fields are concatenated according to the error checking code field sequence indicated by the error checking code allocation rule to obtain a second error checking code.

10. The method according to claim 7, characterized in that Before determining the error checking code allocation rule used by the target configuration word, the method further includes: determining whether the target configuration word has been written; In the case where it is determined that the target configuration word has been written, determining the changed configuration item parameters to be written this time from the target configuration word; Determining the configuration item to be verified from the target configuration word according to the changed configuration item parameter, and determining whether the configuration item parameter of the configuration item to be verified has been processed according to the set processing rule; When it is determined that the configuration item parameters of the configuration item to be checked have been processed according to the set processing rules, the error checking code allocation rule used to determine the target configuration word is executed; when it is determined that the configuration item parameters of the configuration item to be checked have not been processed according to the set processing rules, the write operation on the target configuration word is refused.

11. A device for writing vehicle configuration characters, characterized in that: The device comprises: A check code generation module is used to generate an error checking check code for the configuration item parameters to be written into the vehicle controller; A rule determination module, used to determine the error checking code allocation rule used for writing the configuration word this time; A check code allocation module, used to allocate the error checking code to each error checking code field in a preset configuration word data structure according to the error checking code allocation rule; A configuration word building module, used for writing the configuration item parameters into the corresponding configuration item fields in the configuration word data structure to obtain a target configuration word to be written; A configuration word writing module, used for sending the target configuration word to the vehicle controller, so that the vehicle controller verifies the received target configuration word according to each error checking code field in the received target configuration word, and performs a write operation on the received target configuration word if the verification passes; The step of determining the error checking code allocation rule used for writing the configuration word this time includes: Determining a historical number of times that configuration words have been successfully written to the vehicle controller to date; According to the historical writing times, an error checking code allocation rule used for writing the configuration word this time is determined.

12. A device for writing vehicle configuration characters, characterized in that: The device comprises: A receiving module, used for receiving a target configuration word to be written; A rule determination module, used to determine an error checking code allocation rule used by the target configuration word; A check code generation module, used to generate a first error checking check code according to the configuration item parameters in the target configuration word; A check code parsing module, used for parsing a second error checking code from the target configuration word according to the error checking check code allocation rule; A verification module, used to determine whether the first error checking verification code and the second error checking verification code are consistent; a configuration word writing module, configured to perform a write operation on the target configuration word when it is determined that the first error checking code and the second error checking code are consistent; The step of determining an error checking code allocation rule used by the target configuration word includes: Determine the historical number of writes that have been successfully written to the configuration word up to now; According to the historical write times, an error checking code allocation rule used by the target configuration word is determined.

Citation Information

Patent Citations

  • Vehicle controller configuration word writing method, device and equipment and storage medium

    CN117251180A

  • Vehicle configuration word flashing method and device, vehicle control unit and vehicle

    CN118170398A