Search

CN-121979554-A - Data refreshing method, device, electronic equipment and storage medium

CN121979554ACN 121979554 ACN121979554 ACN 121979554ACN-121979554-A

Abstract

The application provides a data refreshing method, a device, electronic equipment and a storage medium, wherein the method is applied to the technical field of data refreshing, and comprises the steps of obtaining target firmware to be refreshed and storing the target firmware in a cache area; the method comprises the steps of storing target firmware in a target area, storing backup firmware in the target area, reading data which is different from the backup firmware from a cache area to serve as data to be refreshed, and refreshing the data to be refreshed into the target area. The method can shorten the time required by firmware refreshing.

Inventors

  • Zhou siru

Assignees

  • 长城汽车股份有限公司

Dates

Publication Date
20260505
Application Date
20260120

Claims (10)

  1. 1. A method for refreshing data of an electronic control unit, wherein a storage unit of the electronic control unit includes a cache area and a target area, the method comprising: The method comprises the steps of obtaining target firmware to be refreshed and storing the target firmware in the cache area, wherein the version of the target firmware is higher than that of backup firmware, and the backup firmware is stored in the target area; reading data different from the backup firmware from the cache area as data to be refreshed; And brushing the data to be brushed into the target area.
  2. 2. The method of claim 1, wherein the reading data from the cache region that is different from the backup firmware as data to be flushed comprises: Calculating a first check value according to the target firmware stored in the cache area, and calculating a second check value according to the backup firmware stored in the target area; and reading data different from the backup firmware from the cache area as data to be refreshed according to the first check value and the second check value.
  3. 3. The method of claim 2, wherein the target firmware is stored in the cache area in units of pages; The calculating a first check value according to the target firmware stored in the cache area, and calculating a second check value according to the backup firmware stored in the target area includes: Traversing the data of each page in the cache area in sequence; Calculating a first check value of data of the current page and a second check value of target data in the target area for the traversed current page, wherein the target data is data corresponding to the address of the current page in the target area; The reading, from the cache area, data different from the backup firmware as data to be refreshed according to the first check value and the second check value, including: And for the traversed current page, if the first check value is different from the second check value, taking the data of the current page as the data to be refreshed.
  4. 4. The method of claim 3, wherein the target data is stored in a target sub-region of the target region, and wherein if the first check value is determined to be different from the second check value, the method further comprises: Clearing the target data from the target subregion; The writing the data to be written into the target area includes: And for the traversed current page, after the target data is cleared, the data of the current page is used as data to be refreshed and written into the target subarea.
  5. 5. The method of claim 1, wherein the obtaining the target firmware to be flushed and storing the target firmware in the cache area comprises: receiving the target firmware sent by a diagnostic instrument; and checking the target firmware, and storing the target firmware in the cache area under the condition that the target firmware passes the check.
  6. 6. The method of claim 5, wherein the target firmware comprises a plurality of sub-firmware that the diagnostic apparatus divides based on a target data length that is a maximum length of data that the electronic control unit can receive at a single time.
  7. 7. The method of claim 6, wherein verifying the target firmware and storing the target firmware in the cache region if the target firmware verification passes comprises: Traversing each sub-firmware in turn; And calculating a third check value corresponding to the currently traversed sub-firmware, judging whether the third check value is equal to a preset check value corresponding to the sub-firmware, and storing the sub-firmware in the cache area if the third check value is equal to the preset check value, wherein the preset check value is pre-calculated by the diagnostic instrument and is sent to the electronic control unit.
  8. 8. A data flushing device of an electronic control unit, wherein a storage unit of the electronic control unit includes a cache area and a target area, the device comprising: the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring target firmware to be refreshed and storing the target firmware in the cache area, the version of the target firmware is higher than that of backup firmware, and the backup firmware is stored in the target area; The reading module is used for reading data which is different from the backup firmware from the cache area and is used as data to be refreshed; and the brushing module is used for brushing the data to be brushed into the target area.
  9. 9. An electronic device, the electronic device comprising: A memory for storing executable program code; A processor for calling and running the executable program code from the memory, causing the electronic device to perform the method of any one of claims 1 to 7.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed, implements the method according to any of claims 1 to 7.

Description

Data refreshing method, device, electronic equipment and storage medium Technical Field The present application relates to the field of data writing technology, and more particularly, to a data writing method, apparatus, electronic device, and storage medium in the field of data writing technology. Background Currently, as a core control component of a vehicle, an ECU (Electronic Control Unit ) is responsible for executing various complex control tasks, and in order to ensure continuous improvement of vehicle performance and functional iteration, regular update and upgrade of software in the ECU control unit are necessarily required. The software upgrade of The ECU is mainly implemented through OTA (Over-The-Air) or local mode, i.e. The new version of firmware is flushed to a memory unit in The ECU. In the prior art, most ECU use MCU (Microcontroller Unit ) as a core processor, and a Flash memory (Flash memory, abbreviated as Flash memory, i.e. the above-mentioned storage unit) is integrated therein for storing firmware. As vehicle functions increase, the firmware size of a single ECU is also increasing, and the speed of firmware flashing is slow, which directly results in an increase in the time required for the steps of firmware downloading, verification, flashing, and restarting during an upgrade. Therefore, how to shorten the time required for firmware writing becomes a current urgent problem to be solved. Disclosure of Invention The application provides a data refreshing method, a device, electronic equipment and a storage medium. In a first aspect, a data refreshing method is provided, and the method is applied to an electronic control unit, wherein a storage unit of the electronic control unit comprises a cache area and a target area, the method comprises the steps of obtaining target firmware to be refreshed and storing the target firmware in the cache area, wherein the version of the target firmware is higher than that of backup firmware, the backup firmware is stored in the target area, reading data different from the backup firmware from the cache area as data to be refreshed, and refreshing the data to be refreshed into the target area. According to the technical scheme, the cache area and the target area are arranged in the electronic control unit, the target firmware with a higher version is stored in the cache area, and then the data to be refreshed, which is different from the backup firmware, is read from the cache area for refreshing, instead of refreshing the whole target firmware, so that the data amount for refreshing can be reduced, and the time required for refreshing the firmware is shortened. With reference to the first aspect, in some possible implementations, reading data different from the backup firmware from the cache area as the data to be refreshed includes calculating a first check value according to the target firmware stored in the cache area and calculating a second check value according to the backup firmware stored in the target area, and reading data different from the backup firmware from the cache area as the data to be refreshed according to the first check value and the second check value. According to the technical scheme, the first check value and the second check value are calculated according to the target firmware and the backup firmware stored in the cache area respectively, and the data to be refreshed is determined based on the two check values, so that the accuracy of the refreshing process of the electronic control unit can be ensured, and the refreshing success rate is improved. With reference to the first aspect and the implementation manner, in some possible implementation manners, the target firmware is stored in the cache area in a page unit, according to the target firmware stored in the cache area, a first check value is calculated, and according to the backup firmware stored in the target area, a second check value is calculated, wherein the method comprises the steps of traversing data of each page in the cache area in sequence, calculating a first check value of the data of the current page for the traversed current page, and calculating a second check value of the target data in the target area, wherein the target data is the data corresponding to the address of the current page in the target area, and reading the data different from the backup firmware from the cache area as the data to be brushed according to the first check value and the second check value, and comprises the step of regarding the data of the current page as the data to be brushed if the traversed current page is determined that the first check value is different from the second check value. According to the technical scheme, in the process of traversing the data of each page in the cache area, for the traversed current page, a first check value of the data of the current page is calculated, a second check value of the data corresponding to the address of the current page in