Matching verification method and device for ECU flash data, equipment and medium
By verifying the verification of the ECU flashing data and the prof file, the problems of flashing failure and flashing death are solved, and the success rate and security of the ECU flashing are improved.
Patent Information
- Application Number
- CN202411151402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-03-04
AI Technical Summary
When using the flashing software to flash the ECU, due to different manual proficiency, the selected data file does not match the controller's flashing process prof file, resulting in the ECU flashing failure or even the flashing death.
A matching verification method for ECU flashing data is provided. By obtaining the ECU data file to be flashed and the prof file preselected by the user, analyzing and calculating the checksum between the two, verifying their consistency, and performing ECU data flashing under consistency.
Through checksum consistency verification, ensure that the data before ECU flashing is fully matched with the prof file, improve the success rate of ECU flashing, and reduce the risk of ECU flashing death.
Smart Images

Figure CN119556667A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle control technology, and in particular to a method, device, equipment and medium for verifying the matching of ECU flash data. Background Art
[0002] The electronic control unit (ECU) is one of the core components of electronically controlled engines. With the widespread use of various electronic control technologies for engines, the importance of ECU is becoming increasingly prominent. Since ECU stores different control program codes and various types of data, and the characteristic data of the components it controls are different, the data of ECU often needs to be flashed during the development and production of electronically controlled engines.
[0003] When using flashing software to flash the ECU, due to different manual proficiency, the selected data file does not match the controller flashing process prof file, which will cause the ECU flashing to fail or even crash. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and medium for verifying the matching of ECU flashing data, so as to at least solve the technical problem in the related art that when flashing the ECU using flashing software, the selected data file does not match the controller flashing process prof file, resulting in ECU flashing failure or even flashing death.
[0005] According to one aspect of an embodiment of the present application, a method for verifying the matching of ECU flash data is provided, comprising:
[0006] Get the ECU data file to be flashed and the prof file pre-selected by the user;
[0007] Parsing the checksum of the target prof file pre-stored in the ECU data file to be flashed;
[0008] Calculating the checksum of the pre-selected prof file, and verifying whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file;
[0009] When the checksums are consistent, the ECU data is flashed based on the prof file preselected by the user.
[0010] In one implementation, before obtaining the ECU data file to be flashed, the method further includes:
[0011] According to the flashing process corresponding to the ECU data to be flashed, obtain the matching target prof file;
[0012] Calculate the checksum of the target prof file;
[0013] The checksum of the target prof file is written into the ECU data file to be flashed.
[0014] In one implementation, calculating the checksum of the prof file includes:
[0015] Use the preset hash algorithm to calculate the hash value of the prof file;
[0016] A checksum of the prof file is determined based on the hash value.
[0017] In one embodiment, it further includes:
[0018] If the checksum is inconsistent, the flashing process will not be started;
[0019] Returns the prompt message for reselecting a matching prof file.
[0020] In one embodiment, when the checksum is inconsistent, the method further includes:
[0021] Call the pre-generated prof file verification table;
[0022] Based on the checksum of the target prof file corresponding to the ECU data to be flashed as an index, searching for a matching prof file from the prof file checklist;
[0023] Return the matching prof file to the user.
[0024] In one embodiment, before calling the pre-generated prof file verification table, the method further includes:
[0025] Calculate the checksum of each prof file in the prof file database;
[0026] The prof file checksum is generated based on the checksum of each prof file, and the checksum contains a mapping relationship between the prof files and their corresponding checksums.
[0027] According to another aspect of an embodiment of the present application, a device for verifying the compatibility of ECU flash data is provided, comprising:
[0028] The acquisition module is used to obtain the ECU data file to be flashed and the prof file pre-selected by the user;
[0029] A parsing module, used for parsing the checksum of the target prof file pre-stored in the ECU data file to be flashed;
[0030] A verification module, used to calculate the checksum of the pre-selected prof file, and verify whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file;
[0031] The flashing module is used to flash the ECU data based on the prof file pre-selected by the user when the checksum is consistent.
[0032] In one embodiment, it further includes:
[0033] The calculation module is used to calculate the hash value of the prof file by using a preset hash algorithm; and determine the checksum of the prof file based on the hash value.
[0034] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the matching verification method of the ECU flash data through the computer program.
[0035] According to another aspect of the embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned ECU flash data matching verification method when running.
[0036] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0037] The method for verifying the matching of ECU flashing data and prof file provided in the embodiment of the present application can perform matching verification on the ECU flashing data selected by the user and the flashing process prof file before flashing. The consistency check is performed through the checksum. On the basis of manual processing, it is increased to ensure that the data before flashing completely matches the prof file, thereby improving the success rate of ECU flashing and reducing the risk of ECU flash failure.
[0038] In this method, the flashing software pre-matches the data and process without interacting with the ECU, and only enters the standard flashing process after the judgment is passed. The flashing condition judgment is pre-placed, which not only has no requirements on the ECU status, but also has rich host computer resources, which facilitates the subsequent expansion of various flashing conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 It is a flowchart of an optional ECU flash data matching verification method according to an embodiment of the present application;
[0041] Figure 2is an application flow chart of another matching verification method according to an embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of a device for verifying the compatibility of ECU flash data according to an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of a device for verifying the compatibility of ECU flash data according to an embodiment of the present application;
[0044] Figure 5 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the solution of the present application, 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 only 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 creative work should fall within the scope of protection of the present application.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] At the same time, it should be understood that for the sake of ease of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The technologies, methods and devices known to ordinary technicians in the relevant fields may not be discussed in detail, but in appropriate cases, the technologies, methods and devices should be regarded as part of the specification.
[0048] The following is combined with Figure 1-2 The matching verification method of the ECU flash data of the embodiment of the present application is introduced in detail. It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario.
[0049] like Figure 1 As shown, the method mainly includes the following steps:
[0050] S101 obtains the ECU data file to be flashed and the prof file pre-selected by the user.
[0051] After confirming that the ECU meets the flashing conditions, the user starts flashing the ECU. First, the user opens the flashing software, selects the ECU data to be flashed, and selects the prof file.
[0052] Among them, the prof file is a set of descriptive files used by the Flash programming tool for embedded control units to configure different ECU flashing processes. It is mainly used for calibration data download and contains the flashing process and configuration information.
[0053] In addition, in one embodiment, before obtaining the ECU data file to be flashed, it also includes: obtaining a matching target prof file according to the flashing process corresponding to the ECU data to be flashed; calculating the checksum of the target prof file; and writing the checksum of the target prof file into the ECU data file to be flashed.
[0054] During the data integration and release phase, this application verifies the flashed data, calculates the checksum of the target prof file based on the matching target prof file, and writes the checksum into the data file.
[0055] Therefore, in the solution of the present application, the checksum of the matching prof file is integrated into the flash data selected by the user.
[0056] S102 analyzes the checksum of the target prof file pre-stored in the ECU data file to be flashed.
[0057] It can be understood that after obtaining the ECU data file to be flashed, the checksum of the pre-written matching target prof file is parsed, and then a consistency check is performed based on the checksum.
[0058] S103 calculates the checksum of the pre-selected prof file, and verifies whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file.
[0059] Further, a checksum of the prof file preselected by the user is calculated. Calculating the checksum of the prof file is an important step to ensure the integrity and consistency of the file. In one embodiment, calculating the checksum of the prof file includes: calculating a hash value of the prof file using a preset hash algorithm; and determining the checksum of the prof file based on the hash value.
[0060] Specifically, choose a hash algorithm: First, you need to choose a suitable hash algorithm to generate the checksum. Commonly used hash algorithms include MD5, SHA-1, SHA-256, etc. SHA-256 provides higher security, but the calculation speed may be slightly slower than MD5.
[0061] Next, read the file contents: open the prof file and read all its contents into memory. If the file is large, consider using streaming to read the file contents in chunks.
[0062] Further, the hash value is calculated: for each data block read, it is processed using the selected hash algorithm. The processing results are accumulated or linked together to form the final hash value. Different hash algorithms have different accumulation methods.
[0063] A checksum is further generated. After all data blocks are processed, the final hash value obtained is the checksum of the prof file.
[0064] Output checksum, output the calculated checksum, usually displayed in the form of a hexadecimal string.
[0065] After calculating the checksum of the user's pre-selected file, verify whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file.
[0066] Calculate the checksum of the pre-selected prof file and the checksum of the target prof file. It is necessary to ensure that the same hash algorithm is used to check the pre-selected prof file and the target prof file. This step ensures the fairness and accuracy of the verification process. Compare the calculated checksum of the pre-selected prof file with the checksum of the target prof file. If the two checksum values are the same, then it can be considered that the pre-selected prof file matches the target prof file and can be safely used for ECU flashing. If the two checksum values are different, then the pre-selected prof file does not match the target prof file. The reason should be further checked to avoid using the wrong file for flashing.
[0067] S104 performs ECU data flashing based on the prof file pre-selected by the user when the checksum is consistent.
[0068] If the two checksum values are the same, then it can be considered that the pre-selected prof file matches the target prof file and can be safely used for ECU flashing. Enter the standard flashing process.
[0069] In one implementation, the method further includes: if the checksum is inconsistent, not entering the flash process; and returning a prompt message for reselecting a matching prof file.
[0070] In one embodiment, when the checksum is inconsistent, it also includes: calling a pre-generated prof file check table; searching for a matching prof file from the prof file check table based on the checksum of the target prof file corresponding to the ECU data to be flashed as an index; and returning the matching prof file to the user.
[0071] It can be understood that before calling the pre-generated prof file check table, it also includes: calculating the checksum of each prof file in the prof file database; generating a prof file check table based on the checksum of each prof file, and the check table contains a mapping relationship between the prof file and its corresponding checksum.
[0072] Specifically, prepare the prof file checklist: Make sure there is a pre-generated checklist that contains the checksum of each prof file and the corresponding file information.
[0073] Furthermore, a checksum of the target prof file is obtained: a checksum of the target prof file is obtained from the ECU data to be flashed.
[0074] Further, the checksum table is called: according to the obtained checksum of the target prof file, a search is performed in the pre-generated checksum table.
[0075] Furthermore, matching the prof file: if an entry matching the checksum of the target prof file is found in the check table, then the prof file corresponding to this entry is the matching file.
[0076] Return the matching prof file: Return the matching prof file to the user for the next flash operation.
[0077] See the application process in flashing software for details. Figure 2 , the user selects data and prof in the flashing software for flashing, and then calls the matching verification module. This module first parses the data file, obtains the prof file checksum in the data, and then obtains the corresponding file checksum based on the prof file selected by the user. The two are compared for consistency. If they match, the standard flashing process is entered. If they do not match, the flashing process will not be entered, and the user will be prompted to reselect matching data and prof files.
[0078] This application uses the system to verify the matching of data files and the flashing process before entering the standard flashing process, which effectively improves the robustness and security of ECU flashing and reduces the risk of ECU flashing dead.
[0079] According to another aspect of the embodiment of the present application, there is also provided an ECU flash data matching verification device for implementing the above-mentioned ECU flash data matching verification method. Figure 3 As shown, the device comprises:
[0080] The acquisition module 301 is used to acquire the ECU data file to be flashed and the prof file pre-selected by the user;
[0081] The parsing module 302 is used to parse the checksum of the target prof file pre-stored in the ECU data file to be flashed;
[0082] A verification module 303 is used to calculate the checksum of the pre-selected prof file and verify whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file;
[0083] The flashing module 304 is used to flash the ECU data based on the prof file pre-selected by the user when the checksum is consistent.
[0084] In one embodiment, it further includes:
[0085] The calculation module is used to calculate the hash value of the prof file using a preset hash algorithm; and determine the checksum of the prof file based on the hash value.
[0086] In one embodiment, the device of the present application is Figure 4 As shown, it is divided into three modules: a prof file verification module, which is used to verify the prof file and generate a file checksum; a data generation module, which verifies the flashed data in the data integration and release stage, calls the prof file verification module to generate a file checksum according to the matching prof file, and writes the checksum into the data; a matching verification module, which is used to compare the prof file checksum recorded in the data with the checksum calculated by the prof selected by the user, and determine the matching of the flashed data with the prof file.
[0087] It should be noted that the ECU flash data matching verification device provided in the above embodiment only uses the division of the above functional modules as an example when executing the ECU flash data matching verification method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the ECU flash data matching verification device provided in the above embodiment and the ECU flash data matching verification method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0088] According to another aspect of an embodiment of the present application, an electronic device corresponding to the matching verification method for ECU flashing data provided in the above embodiment is also provided to execute the above-mentioned matching verification method for ECU flashing data.
[0089] Please refer to Figure 5 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 5 As shown, the electronic device includes: a processor 500, a memory 501, a bus 502 and a communication interface 503, and the processor 500, the communication interface 503 and the memory 501 are connected via the bus 502; the memory 501 stores a computer program that can be run on the processor 500, and when the processor 500 runs the computer program, it executes the matching verification method of the ECU flash data provided in any of the aforementioned embodiments of the present application.
[0090] The memory 501 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 503 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0091] The bus 502 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 501 is used to store programs, and the processor 500 executes the program after receiving the execution instruction. The matching verification method of the ECU flash data disclosed in any implementation of the embodiment of the present application may be applied to the processor 500, or implemented by the processor 500.
[0092] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 500. The above processor 500 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and completes the steps of the above method in combination with its hardware.
[0093] The electronic device provided in the embodiment of the present application and the method for verifying the matching of ECU flash data provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented therein.
[0094] According to another aspect of the embodiments of the present application, a computer-readable storage medium corresponding to the ECU flash data matching verification method provided in the aforementioned embodiments is also provided, on which a computer program (i.e., a program product) is stored. When the computer program is run by the processor, it will execute the ECU flash data matching verification method provided in any of the aforementioned embodiments.
[0095] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0096] The computer-readable storage medium provided in the above-mentioned embodiment of the present application and the matching verification method of ECU flash data provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0097] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. A method for verifying the matching of ECU flash data, characterized in that: include: Get the ECU data file to be flashed and the prof file pre-selected by the user; Parsing the checksum of the target prof file pre-stored in the ECU data file to be flashed; Calculating the checksum of the pre-selected prof file, and verifying whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file; When the checksums are consistent, the ECU data is flashed based on the prof file preselected by the user.
2. The method according to claim 1, characterized in that Before obtaining the ECU data file to be flashed, it also includes: According to the flashing process corresponding to the ECU data to be flashed, obtain the matching target prof file; Calculate the checksum of the target prof file; The checksum of the target prof file is written into the ECU data file to be flashed.
3. The method according to claim 1 or 2, characterized in that: Calculate the checksum of the prof file, including: Use the preset hash algorithm to calculate the hash value of the prof file; A checksum of the prof file is determined based on the hash value.
4. The method according to claim 1, characterized in that Also includes: If the checksum is inconsistent, the flashing process will not be started; Returns the prompt message for reselecting a matching prof file.
5. The method according to claim 1, characterized in that In the case where the checksums are inconsistent, it also includes: Call the pre-generated prof file verification table; Based on the checksum of the target prof file corresponding to the ECU data to be flashed as an index, searching for a matching prof file from the prof file checklist; Return the matching prof file to the user.
6. The method according to claim 5, characterized in that Before calling the pre-generated prof file verification table, it also includes: Calculate the checksum of each prof file in the prof file database; The prof file checksum is generated based on the checksum of each prof file, and the checksum contains a mapping relationship between the prof files and their corresponding checksums.
7. A device for verifying the matching of ECU flash data, characterized in that: include: The acquisition module is used to obtain the ECU data file to be flashed and the prof file pre-selected by the user; A parsing module, used for parsing the checksum of the target prof file pre-stored in the ECU data file to be flashed; A verification module, used to calculate the checksum of the pre-selected prof file, and verify whether the checksum of the target prof file is consistent with the checksum of the pre-selected prof file; The flashing module is used to flash the ECU data based on the prof file pre-selected by the user when the checksum is consistent.
8. The device according to claim 7, characterized in that Also includes: A calculation module, used to calculate the hash value of the prof file using a preset hash algorithm; A checksum of the prof file is determined based on the hash value.
9. An electronic device, characterized in that: The invention comprises a processor and a memory storing program instructions, wherein the processor is configured to execute the matching verification method of ECU flashing data as claimed in any one of claims 1 to 6 when executing the program instructions.
10. A computer-readable medium, characterized in that Computer-readable instructions are stored thereon, and the computer-readable instructions are executed by a processor to implement a matching verification method for ECU flashing data as described in any one of claims 1 to 6.