CN114265613A - Method and system for differentially upgrading firmware of all electric control units of whole vehicle - Google Patents

Method and system for differentially upgrading firmware of all electric control units of whole vehicle Download PDF

Info

Publication number
CN114265613A
CN114265613A CN202111569286.1A CN202111569286A CN114265613A CN 114265613 A CN114265613 A CN 114265613A CN 202111569286 A CN202111569286 A CN 202111569286A CN 114265613 A CN114265613 A CN 114265613A
Authority
CN
China
Prior art keywords
control unit
firmware
electronic control
target
differential
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111569286.1A
Other languages
Chinese (zh)
Other versions
CN114265613B (en
Inventor
韩黎光
刘建伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Redstone Sunshine Beijing Technology Co ltd
Original Assignee
Redstone Sunshine Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Redstone Sunshine Beijing Technology Co ltd filed Critical Redstone Sunshine Beijing Technology Co ltd
Priority to CN202111569286.1A priority Critical patent/CN114265613B/en
Publication of CN114265613A publication Critical patent/CN114265613A/en
Application granted granted Critical
Publication of CN114265613B publication Critical patent/CN114265613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a system for differentially upgrading firmware of all electric control units of a whole vehicle, wherein the method comprises the following steps: the method comprises the steps of storing a backup file of electronic control unit source firmware in a main control unit of a target vehicle, receiving electronic control unit differential firmware from a network terminal, restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware, and writing the electronic control unit target firmware to each electronic control unit of the target vehicle to achieve firmware upgrading work of the electronic control unit. The ECU firmware differential upgrading can be indirectly realized by obtaining the target upgrading firmware of the electronic control unit by means of the condition that the RAM resource of the main control unit is sufficient, the condition that the whole package of the ECU needs to be downloaded in the upgrading package downloading process is avoided, only the differential package between the source version and the target version needs to be downloaded, the downloading demand and the upgrading package volume are reduced, the downloading time is shortened, the network data flow cost is saved, and the user experience is improved.

Description

Method and system for differentially upgrading firmware of all electric control units of whole vehicle
Technical Field
The invention relates to the technical field of firmware upgrading of new energy automobiles, in particular to a method and a system for differentially upgrading all electronic control unit firmware of a whole automobile.
Background
With the development and utilization of new energy, instruments or vehicles supplied by the new energy are developed in various fields, so that the environment is protected, and the loss of traditional energy is greatly reduced. Besides the main control, the whole vehicle system also has a plurality of Electronic Control Units (ECUs), the ECUs are generally manufactured by adopting MCU chips with low cost and low performance, and the RAMs of the ECUs are generally very small. The scheme of differential upgrading is not suitable for being adopted due to the fact that the small RAM and the low CPU main frequency are not suitable for the scheme of differential upgrading, because the differential reduction algorithm depends on a certain RAM size, and most MCU cannot meet the requirement, the scheme of whole package upgrading is generally adopted, the size of an upgrading package is increased due to the mode of whole package upgrading, and further the downloading time of the upgrading package is too long and the network data flow cost is increased.
Disclosure of Invention
Aiming at the problems shown above, the invention provides a method and a system for differentially upgrading the firmware of all electric control units of a whole vehicle, which are used for solving the problems that the size of an upgrade package is increased due to the whole package upgrading mode mentioned in the background technology, and further the downloading time of the upgrade package is too long and the network data flow cost is increased.
A differential upgrading method for firmware of all electric control units of a whole vehicle comprises the following steps:
storing a backup file of source firmware of an electronic control unit in a main control unit of a target vehicle;
receiving an electronic control unit differential firmware from a network terminal;
restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware;
and flashing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to realize the firmware upgrading work of the electronic control unit.
Preferably, the storing the backup file of the electronic control unit source firmware in the main control unit of the target vehicle includes:
detecting a first memory of a backup space in a storage space of the main control unit;
determining a second memory of a backup file of the source firmware of the electronic control unit;
comparing the first memory with the second memory, and determining whether the backup space is sufficient according to a comparison result;
and when the backup space is determined to be sufficient, storing the backup file of the source firmware of the electronic control unit into the main control unit, deleting the useless backup file in the backup space when the backup space is determined to be insufficient, and storing the backup file of the source firmware of the electronic control unit into the main control unit after deleting.
Preferably, after the backup file of the electronic control unit source firmware is stored in the main control unit of the target vehicle, and before the electronic control unit differential firmware is received from the network terminal, the method further includes:
creating a preset number of index nodes;
acquiring address information of each data block in the backup file, a path in the backup file and a starting offset value;
constructing an index factor according to the path of each data block in the backup file and the starting offset value;
and mapping each index node with the address information and the index factor of each data block to generate an index file of the backup file.
Preferably, the receiving the electronic control unit differential firmware from the network terminal includes:
acquiring a memory mapping file of the current firmware of the electronic control unit, and constructing firmware parameter entries according to the memory mapping file;
connecting the network terminal, logging in a firmware library of the network terminal and starting a matching function of the firmware library;
obtaining a plurality of first differential firmware matched with the firmware parameter entries by using the matching function, and selecting a second differential firmware from the plurality of first differential firmware according to the model of the electronic control unit;
and downloading the mapping file of the second differential firmware from the firmware library.
Preferably, the reducing the electronic control unit source firmware and the electronic control unit differential firmware to obtain the electronic control unit target firmware includes:
determining a copying instruction and an adding instruction corresponding to the differential firmware of the electronic control unit;
based on the source firmware of the electronic control unit, extracting firmware parameters related to the copying instruction and the adding instruction by using a preset differential reduction algorithm;
fusing the extracted firmware parameters to generate the target firmware of the electronic control unit.
Preferably, the flushing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to realize the firmware upgrade work on the target firmware comprises:
calling a firmware upgrading program of each electronic control unit and detecting whether the electronic control unit is in a normal operation state or not;
if yes, the target firmware of the electronic control unit is flushed into a firmware upgrading program of each electronic control unit to update the firmware;
detecting the firmware updating progress of each electronic control unit in real time, and generating a firmware updating log of each electronic control unit after the updating is finished;
and storing the firmware updating log and the updating date of each electronic control unit into a preset database of the main control unit of the target vehicle in an associated mode.
Preferably, before the electronic control unit source firmware and the electronic control unit differential firmware are restored to obtain the electronic control unit target firmware, the method further includes:
acquiring the use condition of the RAM of the main control unit in a preset period, and determining the use peak value and the use valley value of each time period according to the use condition;
constructing an RAM work distribution curve of the main control unit according to the use peak value and the use valley value of each time period;
reading each use peak value coordinate and each use valley value coordinate in the RAM work distribution curve, and intelligently determining a target number of firmware recovery time periods according to the reading result;
performing reduction test in each reduction time period by using a preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
evaluating the matching rate of each restoration time period according to the offset condition of the character string which is tested and updated by the preset updating firmware in each restoration time period;
and selecting a target reduction time period with the maximum matching rate as a working time period for the main control unit to reduce the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit.
Preferably, before the electronic control unit target firmware is flushed to each electronic control unit of the target vehicle to realize upgrading of the firmware thereof, the method further includes:
constructing a target number of kernel threads in an operating program of the main control unit according to the target number of the electronic control units;
setting a target stack characteristic set for a target kernel thread corresponding to each electronic control unit according to the operating parameters of the electronic control unit;
fusing each stack feature set and the corresponding kernel thread thereof to obtain a flash thread of each electronic control unit;
determining a calling sequence of each flash thread in a running program of a main control unit;
establishing a shared resource pool of a main control unit according to a plurality of calling sequences, and storing target firmware corresponding to each electronic control unit into the shared resource pool;
acquiring configuration parameters of each electronic control unit and determining the performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from big to small to obtain a sequencing result;
determining a first access sequence of the main control unit shared data pool according to the sequencing result;
determining the target mutual exclusion probability of two adjacent electronic control units in the first access sequence according to the calling sequence of each flash thread;
comparing the target mutual exclusion probability with a preset mutual exclusion probability, and marking the target electronic control units with the target mutual exclusion probability smaller than the preset mutual exclusion probability;
adaptively modifying the first access sequence according to the distribution condition of the marked target electronic control units in the first access sequence to obtain a second access sequence;
determining a target firmware flashing sequence of the main control unit to the electronic control unit according to the second access sequence;
generating a flash instruction of each electronic control unit according to the condition state parameter of each electronic control unit and the target firmware type of the electronic control unit;
corresponding the flash command of each electronic control unit to the flash sequence;
and activating the flash function of the main control unit to enable the main control unit to carry out flash preparation work on target firmware in the shared resource pool according to the flash sequence and the flash instruction of each electronic control unit.
A system for differentially upgrading firmware of all electric control units of a whole vehicle comprises:
the storage module is used for storing a backup file of the source firmware of the electronic control unit in a main control unit of the target vehicle;
the receiving module is used for receiving the electronic control unit differential firmware from the network terminal;
the restoring module is used for restoring the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit;
and the flashing module is used for flashing the target firmware of the electronic control unit to each electronic control unit of the target vehicle so as to realize the firmware upgrading work.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a flowchart of the differential upgrading method for firmware of all electric control units of a whole vehicle according to the present invention;
FIG. 2 is another work flow chart of the method for differentially upgrading the firmware of all the electric control units of the entire vehicle according to the present invention;
FIG. 3 is another work flow chart of the method for differentially upgrading the firmware of all the electric control units of the entire vehicle according to the present invention;
FIG. 4 is a screenshot of an embodiment of a method for differentially upgrading firmware of all electronic control units of a vehicle according to the present invention;
fig. 5 is a schematic structural diagram of a system for differentially upgrading firmware of all electronic control units of a whole vehicle according to the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
With the development and utilization of new energy, instruments or vehicles supplied by the new energy are developed in various fields, so that the environment is protected, and the loss of traditional energy is greatly reduced. Besides the main control, the whole vehicle system also has a plurality of Electronic Control Units (ECUs), the ECUs are generally manufactured by adopting MCU chips with low cost and low performance, and the RAMs of the ECUs are generally very small. The scheme of differential upgrading is not suitable for being adopted due to the fact that the small RAM and the low CPU main frequency are not suitable for the scheme of differential upgrading, because the differential reduction algorithm depends on a certain RAM size, and most MCU cannot meet the requirement, the scheme of whole package upgrading is generally adopted, the size of an upgrading package is increased due to the mode of whole package upgrading, and further the downloading time of the upgrading package is too long and the network data flow cost is increased. In order to solve the above problems, the present implementation discloses a method for differentially upgrading firmware of all electronic control units of a whole vehicle.
A method for differentially upgrading firmware of all electric control units of a whole vehicle is shown in figure 1 and comprises the following steps:
step S101, storing a backup file of source firmware of an electronic control unit in a main control unit of a target vehicle;
step S102, receiving an electronic control unit differential firmware from a network terminal;
step S103, restoring the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit;
and step S104, the target firmware of the electronic control unit is flushed to each electronic control unit of the target vehicle to realize the firmware upgrading work of the target vehicle.
The working principle of the technical scheme is as follows: the method comprises the steps of storing a backup file of electronic control unit source firmware in a main control unit of a target vehicle, receiving electronic control unit differential firmware from a network terminal, restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware, and writing the electronic control unit target firmware to each electronic control unit of the target vehicle to achieve firmware upgrading work of the electronic control unit.
The beneficial effects of the above technical scheme are: the ECU firmware differential upgrading can be indirectly realized by obtaining the target upgrading firmware of the electronic control unit by means of the condition that the RAM resource of the main control unit is sufficient, the condition that the whole package firmware of the ECU needs to be downloaded in the upgrading package downloading process is avoided, only the differential package between the source version and the target version needs to be downloaded, the downloading demand and the upgrading package volume are reduced, the downloading time is shortened, the network data flow cost is saved, the user experience is improved, and the problems that the upgrading package volume is increased due to the whole package upgrading mode in the prior art, the downloading time of the upgrading package is too long, and the network data flow cost is increased are solved.
In this embodiment, before flushing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to implement the firmware upgrade work on the target firmware, the method further includes:
starting each electronic control unit and simultaneously activating an initial operation mode of a main control unit, and detecting a state variable value of the main control unit;
determining the system fault rate of the main control unit in the initial operation mode when each electronic control unit is carried according to the state variable value of the main control unit:
Figure BDA0003423030530000081
wherein k isiThe system failure rate of the main control unit in an initial operation mode when the ith electronic control unit is carried is represented, alpha is the preset system failure probability of the main control unit, beta is the restoration rate corresponding to the preset system failure probability of the main control unit, and u is the restoration rate corresponding to the preset system failure probability of the main control unitiExpressed as the control input of the main control unit when the ith electronic control unit is carried, d is expressed as the system external interference of the main control unit, p is the state transition rate of the main control unit, xiExpressed as the variable value of the state of the main control unit when the ith electronic control unit is mounted, the operation gain coefficient of theta main control unit when the ith electronic control unit is mounted, f1() Expressed as a predetermined non-linear function, eiThe detection error is expressed as the state variable value detection error of the main control unit when the ith electronic control unit is mounted;
determining a current electronic control unit corresponding to a system fault rate greater than or equal to a first preset threshold;
decomposing the current target firmware corresponding to the current control unit into a plurality of data blocks with the same size;
inputting a single data block into an initial operation mode of the main control unit, and detecting a first probability of misoperation, a second probability of operation rejection and a third probability of function failure of an operation system of the main control unit;
calculating a system stability index of the main control unit when a single data block is operated according to the first probability and the second probability:
Figure BDA0003423030530000082
wherein M is a system stability index, Q, of the master control unit when running a single data block1Expressed as a first probability, Q2Expressed as a second probability, Q3Expressed as a third probability;
and determining whether the stability index is smaller than or equal to a second preset threshold, if so, not needing to perform subsequent operation, and otherwise, decomposing the current target firmware corresponding to the current control unit into a plurality of smaller data blocks again for retesting until the test is passed.
The beneficial effects of the above technical scheme are: whether the main control unit can smoothly control each electronic control unit to complete upgrading work or not can be effectively determined by calculating the system fault rate of the main control unit in the initial operation mode when the main control unit carries each electronic control unit, the stability is further improved, the occurrence of fault conditions caused by overlarge load of the main control unit is also avoided, the practicability is improved, furthermore, the size of a single maximum operation data block of the main control unit can be accurately evaluated by calculating the system stability index of the main control unit when the main control unit operates a single data block, and then the current target firmware corresponding to the current electronic control unit is decomposed into the data block with the target size, so that the main control unit can more stably and efficiently control each electronic control unit to realize upgrading work.
In one embodiment, the storing a backup file of the electronic control unit source firmware in the master control unit of the target vehicle includes:
detecting a first memory of a backup space in a storage space of the main control unit;
determining a second memory of a backup file of the source firmware of the electronic control unit;
comparing the first memory with the second memory, and determining whether the backup space is sufficient according to a comparison result;
and when the backup space is determined to be sufficient, storing the backup file of the source firmware of the electronic control unit into the main control unit, deleting the useless backup file in the backup space when the backup space is determined to be insufficient, and storing the backup file of the source firmware of the electronic control unit into the main control unit after deleting.
The beneficial effects of the above technical scheme are: the backup space in the storage space of the main control unit is detected, so that the backup file of the source firmware of the electronic control unit can be completely and effectively stored, a foundation is laid for the subsequent differential upgrading work of the firmware of the electronic control unit, the working efficiency is improved, furthermore, the problem that the main control unit is overloaded due to the accumulation of useless data in the backup space and the working efficiency is low can be solved by deleting the useless backup file to clean the memory of the backup space, meanwhile, the backup space is effectively cleaned, and the practicability is improved.
In one embodiment, as shown in fig. 2, after storing the backup file of the electronic control unit source firmware in the master control unit of the target vehicle, before receiving the electronic control unit differential firmware from the network terminal, the method further includes:
step S201, creating a preset number of index nodes;
step S202, acquiring address information of each data block in the backup file, a path in the backup file and a starting offset value;
step S203, constructing an index factor according to the path of each data block in the backup file and the initial offset value;
and step S204, mapping each index node with the address information and the index factor of each data block to generate an index file of the backup file.
The beneficial effects of the above technical scheme are: the backup files can be searched out from the main control unit quickly in the follow-up process by constructing the index files of the backup files, and the working efficiency is further improved.
In one embodiment, as shown in fig. 3, the receiving the electronic control unit differential firmware from the network terminal includes:
step S301, acquiring a memory mapping file of the current firmware of the electronic control unit, and constructing a firmware parameter entry according to the memory mapping file;
step S302, connecting the network terminal, logging in a firmware library of the network terminal and starting a matching function of the firmware library;
step S303, obtaining a plurality of first differential firmware matched with the firmware parameter entries by using the matching function, and selecting a second differential firmware from the plurality of first differential firmware according to the model of the electronic control unit;
step S304, downloading the mapping file of the second differential firmware from the firmware library.
The beneficial effects of the above technical scheme are: the adaptive firmware of the electronic control unit can be accurately and quickly determined by matching the firmware parameter items to obtain the corresponding differential parts, so that screening samples are reduced, screening efficiency is improved, further, the most appropriate differential firmware is further screened according to the model of the electronic control unit, the optimal adaptability can be ensured, and the running stability of the system in the vehicle is improved.
In one embodiment, the restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain the electronic control unit target firmware includes:
determining a copying instruction and an adding instruction corresponding to the differential firmware of the electronic control unit;
based on the source firmware of the electronic control unit, extracting firmware parameters related to the copying instruction and the adding instruction by using a preset differential reduction algorithm;
fusing the extracted firmware parameters to generate the target firmware of the electronic control unit.
The beneficial effects of the above technical scheme are: the target firmware relevant to the differential firmware is extracted by using the preset differential reduction algorithm, so that the whole package of the ECU does not need to be downloaded, only the differential package between the source version and the target version needs to be downloaded, the flow loss is further saved, and the downloading speed is improved.
In one embodiment, the flushing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to realize the firmware upgrading work on the target firmware comprises:
calling a firmware upgrading program of each electronic control unit and detecting whether the electronic control unit is in a normal operation state or not;
if yes, the target firmware of the electronic control unit is flushed into a firmware upgrading program of each electronic control unit to update the firmware;
detecting the firmware updating progress of each electronic control unit in real time, and generating a firmware updating log of each electronic control unit after the updating is finished;
and storing the firmware updating log and the updating date of each electronic control unit into a preset database of the main control unit of the target vehicle in an associated mode.
The beneficial effects of the above technical scheme are: the firmware updating progress of the electronic control unit is detected in real time, so that the smooth proceeding of firmware updating work can be effectively guaranteed, the stability is further improved, furthermore, the updating logs can be subsequently called by an owner at any time through the self-adaptive generation of the firmware updating logs of the electronic control unit so as to determine the firmware updating condition of each electronic control unit, and the experience of the owner is improved.
In one embodiment, before the electronic control unit source firmware and the electronic control unit differential firmware are restored to obtain the electronic control unit target firmware, the method further includes:
acquiring the use condition of the RAM of the main control unit in a preset period, and determining the use peak value and the use valley value of each time period according to the use condition;
constructing an RAM work distribution curve of the main control unit according to the use peak value and the use valley value of each time period;
reading each use peak value coordinate and each use valley value coordinate in the RAM work distribution curve, and intelligently determining a target number of firmware recovery time periods according to the reading result;
performing reduction test in each reduction time period by using a preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
evaluating the matching rate of each restoration time period according to the offset condition of the character string which is tested and updated by the preset updating firmware in each restoration time period;
and selecting a target reduction time period with the maximum matching rate as a working time period for the main control unit to reduce the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit.
The beneficial effects of the above technical scheme are: by determining the optimal working time period of the main control unit, the stable operation of the electronic control unit target firmware reduction can be ensured without influencing other operations of the main control unit, and the stability is further improved.
In one embodiment, before flushing the electronic control unit target firmware to each electronic control unit of the target vehicle to achieve upgrading of the firmware thereof, the method further comprises:
constructing a target number of kernel threads in an operating program of the main control unit according to the target number of the electronic control units;
setting a target stack characteristic set for a target kernel thread corresponding to each electronic control unit according to the operating parameters of the electronic control unit;
fusing each stack feature set and the corresponding kernel thread thereof to obtain a flash thread of each electronic control unit;
determining a calling sequence of each flash thread in a running program of a main control unit;
establishing a shared resource pool of a main control unit according to a plurality of calling sequences, and storing target firmware corresponding to each electronic control unit into the shared resource pool;
acquiring configuration parameters of each electronic control unit and determining the performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from big to small to obtain a sequencing result;
determining a first access sequence of the main control unit shared data pool according to the sequencing result;
determining the target mutual exclusion probability of two adjacent electronic control units in the first access sequence according to the calling sequence of each flash thread;
comparing the target mutual exclusion probability with a preset mutual exclusion probability, and marking the target electronic control units with the target mutual exclusion probability smaller than the preset mutual exclusion probability;
adaptively modifying the first access sequence according to the distribution condition of the marked target electronic control units in the first access sequence to obtain a second access sequence;
determining a target firmware flashing sequence of the main control unit to the electronic control unit according to the second access sequence;
generating a flash instruction of each electronic control unit according to the condition state parameter of each electronic control unit and the target firmware type of the electronic control unit;
corresponding the flash command of each electronic control unit to the flash sequence;
and activating the flash function of the main control unit to enable the main control unit to carry out flash preparation work on target firmware in the shared resource pool according to the flash sequence and the flash instruction of each electronic control unit.
The beneficial effects of the above technical scheme are: the upgrading sequence of all the electronic control units can be accurately determined according to the performance index of each electronic control unit and the mutual exclusivity of two adjacent electronic control units, the flashing efficiency is improved, the stability is guaranteed, further, the flashing work of the main control unit on the firmware of each electronic control unit can be more stably realized by generating the flashing instruction of each electronic control unit, and the stability is further improved.
In one embodiment, as shown in fig. 4, includes:
1) a differential reduction module and ECU source firmware are preset in the main control unit;
2) the main control unit downloads and receives ECU differential firmware by using a networking module;
3) the main control unit uses a differential reduction module to reduce the ECU source firmware and the ECU differential firmware to obtain ECU target firmware;
4) the main control unit uses CAN bus communication to write ECU target firmware to the ECU;
5) the master control unit copies the ECU target firmware to the ECU source firmware.
In this embodiment, the advantage of differential upgrade over whole package upgrade is that the differential package is much smaller than the whole package, which can greatly reduce the download traffic. Although the RAM of the ECU is relatively small, the vehicle-mounted main control unit generally runs a relatively advanced system, such as linux and android systems, and the RAM resource is relatively sufficient, so that a differential reduction algorithm can be run. Firstly, the backup of the ECU firmware source version is stored in the main control unit, and then the source version is subjected to differential reduction by combining a differential packet by adopting a differential reduction module to obtain a target version. This target version is the entire package of firmware to be flashed to the ECU. Therefore, differential upgrading of the ECU firmware can be indirectly realized, the condition that the whole package of the ECU firmware needs to be downloaded in the upgrading package downloading process is avoided, and only the differential package between the source version and the target version needs to be downloaded.
This embodiment also discloses a system for differentially upgrading firmware of all electronic control units of a whole vehicle, as shown in fig. 5, the system includes:
a storage module 501, configured to store a backup file of a source firmware of an electronic control unit in a main control unit of a target vehicle;
a receiving module 502, configured to receive the electronic control unit differential firmware from the network terminal;
the restoring module 503 is configured to restore the electronic control unit source firmware and the electronic control unit differential firmware to obtain an electronic control unit target firmware;
and the flashing module 504 is configured to flash the target firmware of the electronic control unit to each electronic control unit of the target vehicle to upgrade the firmware of the target vehicle.
The working principle and the advantageous effects of the above technical solution have been explained in the method claims, and are not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A method for differentially upgrading firmware of all electric control units of a whole vehicle is characterized by comprising the following steps:
storing a backup file of source firmware of an electronic control unit in a main control unit of a target vehicle;
receiving an electronic control unit differential firmware from a network terminal;
restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware;
and flashing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to realize the firmware upgrading work of the electronic control unit.
2. The method for differentially upgrading the firmware of all the electric control units of the whole vehicle according to claim 1, wherein the step of storing the backup file of the source firmware of the electric control unit in the main control unit of the target vehicle comprises the following steps:
detecting a first memory of a backup space in a storage space of the main control unit;
determining a second memory of a backup file of the source firmware of the electronic control unit;
comparing the first memory with the second memory, and determining whether the backup space is sufficient according to a comparison result;
and when the backup space is determined to be sufficient, storing the backup file of the source firmware of the electronic control unit into the main control unit, deleting the useless backup file in the backup space when the backup space is determined to be insufficient, and storing the backup file of the source firmware of the electronic control unit into the main control unit after deleting.
3. The method for differentially upgrading the firmware of all the electric control units of the whole vehicle according to claim 1, wherein after the backup file of the source firmware of the electronic control unit is stored in the main control unit of the target vehicle, and before the differential firmware of the electronic control unit is received from the network terminal, the method further comprises the following steps:
creating a preset number of index nodes;
acquiring address information of each data block in the backup file, a path in the backup file and a starting offset value;
constructing an index factor according to the path of each data block in the backup file and the starting offset value;
and mapping each index node with the address information and the index factor of each data block to generate an index file of the backup file.
4. The method for differentially upgrading the firmware of all the electric control units of the whole vehicle according to claim 1, wherein the step of receiving the differential firmware of the electric control units from the network terminal comprises the following steps:
acquiring a memory mapping file of the current firmware of the electronic control unit, and constructing firmware parameter entries according to the memory mapping file;
connecting the network terminal, logging in a firmware library of the network terminal and starting a matching function of the firmware library;
obtaining a plurality of first differential firmware matched with the firmware parameter entries by using the matching function, and selecting a second differential firmware from the plurality of first differential firmware according to the model of the electronic control unit;
and downloading the mapping file of the second differential firmware from the firmware library.
5. The method for differentially upgrading the firmware of all the electric control units of the whole vehicle according to claim 1, wherein the step of restoring the source firmware of the electronic control unit and the differential firmware of the electronic control unit to obtain the target firmware of the electronic control unit comprises the following steps:
determining a copying instruction and an adding instruction corresponding to the differential firmware of the electronic control unit;
based on the source firmware of the electronic control unit, extracting firmware parameters related to the copying instruction and the adding instruction by using a preset differential reduction algorithm;
fusing the extracted firmware parameters to generate the target firmware of the electronic control unit.
6. The method for differentially upgrading the firmware of all electric control units of the whole vehicle according to claim 1, wherein the step of writing the target firmware of the electronic control unit to each electronic control unit of the target vehicle to realize the firmware upgrading work comprises the following steps:
calling a firmware upgrading program of each electronic control unit and detecting whether the electronic control unit is in a normal operation state or not;
if yes, the target firmware of the electronic control unit is flushed into a firmware upgrading program of each electronic control unit to update the firmware;
detecting the firmware updating progress of each electronic control unit in real time, and generating a firmware updating log of each electronic control unit after the updating is finished;
and storing the firmware updating log and the updating date of each electronic control unit into a preset database of the main control unit of the target vehicle in an associated mode.
7. The method for differentially upgrading the firmware of all the electric control units of the whole vehicle according to claim 1, wherein before the electronic control unit source firmware and the electronic control unit differential firmware are reduced to obtain the electronic control unit target firmware, the method further comprises the following steps:
acquiring the use condition of the RAM of the main control unit in a preset period, and determining the use peak value and the use valley value of each time period according to the use condition;
constructing an RAM work distribution curve of the main control unit according to the use peak value and the use valley value of each time period;
reading each use peak value coordinate and each use valley value coordinate in the RAM work distribution curve, and intelligently determining a target number of firmware recovery time periods according to the reading result;
performing reduction test in each reduction time period by using a preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
evaluating the matching rate of each restoration time period according to the offset condition of the character string which is tested and updated by the preset updating firmware in each restoration time period;
and selecting a target reduction time period with the maximum matching rate as a working time period for the main control unit to reduce the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit.
8. The method for differentially upgrading the firmware of all electric control units of the whole vehicle according to claim 1, wherein before the electronic control unit target firmware is flushed to each electronic control unit of the target vehicle to realize upgrading of the firmware of the electronic control unit target firmware, the method further comprises the following steps:
constructing a target number of kernel threads in an operating program of the main control unit according to the target number of the electronic control units;
setting a target stack characteristic set for a target kernel thread corresponding to each electronic control unit according to the operating parameters of the electronic control unit;
fusing each stack feature set and the corresponding kernel thread thereof to obtain a flash thread of each electronic control unit;
determining a calling sequence of each flash thread in a running program of a main control unit;
establishing a shared resource pool of a main control unit according to a plurality of calling sequences, and storing target firmware corresponding to each electronic control unit into the shared resource pool;
acquiring configuration parameters of each electronic control unit and determining the performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from big to small to obtain a sequencing result;
determining a first access sequence of the main control unit shared data pool according to the sequencing result;
determining the target mutual exclusion probability of two adjacent electronic control units in the first access sequence according to the calling sequence of each flash thread;
comparing the target mutual exclusion probability with a preset mutual exclusion probability, and marking the target electronic control units with the target mutual exclusion probability smaller than the preset mutual exclusion probability;
adaptively modifying the first access sequence according to the distribution condition of the marked target electronic control units in the first access sequence to obtain a second access sequence;
determining a target firmware flashing sequence of the main control unit to the electronic control unit according to the second access sequence;
generating a flash instruction of each electronic control unit according to the condition state parameter of each electronic control unit and the target firmware type of the electronic control unit;
corresponding the flash command of each electronic control unit to the flash sequence;
and activating the flash function of the main control unit to enable the main control unit to carry out flash preparation work on target firmware in the shared resource pool according to the flash sequence and the flash instruction of each electronic control unit.
9. The utility model provides a whole car all electric control unit firmware difference upgrade system which characterized in that, this system includes:
the storage module is used for storing a backup file of the source firmware of the electronic control unit in a main control unit of the target vehicle;
the receiving module is used for receiving the electronic control unit differential firmware from the network terminal;
the restoring module is used for restoring the source firmware and the differential firmware of the electronic control unit to obtain target firmware of the electronic control unit;
and the flashing module is used for flashing the target firmware of the electronic control unit to each electronic control unit of the target vehicle so as to realize the firmware upgrading work.
CN202111569286.1A 2021-12-21 2021-12-21 Method and system for differentially upgrading firmware of all electric control units of whole vehicle Active CN114265613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111569286.1A CN114265613B (en) 2021-12-21 2021-12-21 Method and system for differentially upgrading firmware of all electric control units of whole vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111569286.1A CN114265613B (en) 2021-12-21 2021-12-21 Method and system for differentially upgrading firmware of all electric control units of whole vehicle

Publications (2)

Publication Number Publication Date
CN114265613A true CN114265613A (en) 2022-04-01
CN114265613B CN114265613B (en) 2022-06-28

Family

ID=80828444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111569286.1A Active CN114265613B (en) 2021-12-21 2021-12-21 Method and system for differentially upgrading firmware of all electric control units of whole vehicle

Country Status (1)

Country Link
CN (1) CN114265613B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116166298A (en) * 2023-03-16 2023-05-26 北京百度网讯科技有限公司 Firmware upgrading method, device, equipment and storage medium
CN116974616A (en) * 2023-07-14 2023-10-31 红石阳光(北京)科技股份有限公司 Method for upgrading all electronic control units of whole vehicle through USB flash disk

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060064687A1 (en) * 2004-09-23 2006-03-23 Jan Dostert Thread-level resource usage measurement
KR20100064472A (en) * 2008-12-05 2010-06-15 (주)티아이소프트 Upgrade system of electronic control unit for vehicle
US20110179406A1 (en) * 2009-08-24 2011-07-21 Hitachi Solutions, Ltd. Firmware update system and information apparatus, and program
CN104615594A (en) * 2013-11-01 2015-05-13 阿里巴巴集团控股有限公司 Data updating method and device
CN106250168A (en) * 2015-06-15 2016-12-21 李尔公司 Telematics control units including difference update bag
US20160371076A1 (en) * 2015-06-16 2016-12-22 Lear Corporation METHOD FOR UPDATING VEHICLE ECUs USING DIFFERENTIAL UPDATE PACKAGES
CN111385191A (en) * 2018-12-28 2020-07-07 联合汽车电子有限公司 Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium
US20200218531A1 (en) * 2019-01-07 2020-07-09 Nokia Solutions And Networks Oy OVER-THE-AIR (OTA) UPDATES OF ELECTRONIC CONTROL UNITS (ECUs) IN VEHICLES
CN112328294A (en) * 2020-11-12 2021-02-05 杭州创想智联科技有限公司 OTA (over the air) upgrading method and system for vehicle ECU (electronic control Unit)
CN112543915A (en) * 2018-08-10 2021-03-23 株式会社电装 Electronic control system for vehicle, host device for vehicle, transmission control method for data storage surface information, and transmission control program for data storage surface information

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060064687A1 (en) * 2004-09-23 2006-03-23 Jan Dostert Thread-level resource usage measurement
KR20100064472A (en) * 2008-12-05 2010-06-15 (주)티아이소프트 Upgrade system of electronic control unit for vehicle
US20110179406A1 (en) * 2009-08-24 2011-07-21 Hitachi Solutions, Ltd. Firmware update system and information apparatus, and program
CN104615594A (en) * 2013-11-01 2015-05-13 阿里巴巴集团控股有限公司 Data updating method and device
CN106250168A (en) * 2015-06-15 2016-12-21 李尔公司 Telematics control units including difference update bag
US20160371076A1 (en) * 2015-06-16 2016-12-22 Lear Corporation METHOD FOR UPDATING VEHICLE ECUs USING DIFFERENTIAL UPDATE PACKAGES
CN112543915A (en) * 2018-08-10 2021-03-23 株式会社电装 Electronic control system for vehicle, host device for vehicle, transmission control method for data storage surface information, and transmission control program for data storage surface information
CN111385191A (en) * 2018-12-28 2020-07-07 联合汽车电子有限公司 Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium
US20200218531A1 (en) * 2019-01-07 2020-07-09 Nokia Solutions And Networks Oy OVER-THE-AIR (OTA) UPDATES OF ELECTRONIC CONTROL UNITS (ECUs) IN VEHICLES
CN112328294A (en) * 2020-11-12 2021-02-05 杭州创想智联科技有限公司 OTA (over the air) upgrading method and system for vehicle ECU (electronic control Unit)

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
YOUNG SEO LEE: "Automotive ECU Software Reprogramming Method Based on Ethernet Backbone Network to Save Time", 《IMCOM`16:PROCEEDINGS OF THE 10TH INTERNATIONAL CONFERENCE ON UBIQUITOUS INFORMATION MANAGEMENT AND COMMUNICATION》 *
YUTAKA ONUMA: "Compression Method for ECU Software Updates", 《TENTH INTERNATIONAL CONFERENCE ON MOBILE COMPUTING AND UBIQUITOUS NETWORK (ICMU)》 *
李立安等: "OTA实现方案及汽车端设计分析", 《汽车实用技术》 *
王栋梁等: "智能网联汽车整车OTA功能设计研究", 《汽车技术》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116166298A (en) * 2023-03-16 2023-05-26 北京百度网讯科技有限公司 Firmware upgrading method, device, equipment and storage medium
CN116166298B (en) * 2023-03-16 2024-03-01 北京百度网讯科技有限公司 Firmware upgrading method, device, equipment and storage medium
CN116974616A (en) * 2023-07-14 2023-10-31 红石阳光(北京)科技股份有限公司 Method for upgrading all electronic control units of whole vehicle through USB flash disk
CN116974616B (en) * 2023-07-14 2024-03-15 红石阳光(北京)科技股份有限公司 Method for upgrading all electronic control units of whole vehicle through USB flash disk

Also Published As

Publication number Publication date
CN114265613B (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN114265613B (en) Method and system for differentially upgrading firmware of all electric control units of whole vehicle
CN103299276B (en) The software upgrading process of embedded equipment
US20050036390A1 (en) Non-volatile memory and non-volatile memory data rewriting method
CN108646982B (en) Automatic data restoration method and device based on UBIFS
CN105930236A (en) Application program version returning method based on BMS Bootloaderupgrade
CN109508148B (en) Metadata reconstruction method and device and computer readable storage medium
CN115437581B (en) Data processing method, device and equipment and readable storage medium
CN114584539B (en) Cloud upgrading method and system for industrial field device
CN111596945B (en) Differential upgrading method for dynamic multi-partition firmware of embedded system
CN112306408A (en) Storage block processing method, device, equipment and storage medium
CN107992268B (en) Bad block marking method and related device
CN115662489A (en) Hard disk test method and device, electronic equipment and storage medium
CN114816266A (en) Metadata repairing method, system, storage medium and equipment
CN108664255B (en) Software upgrading method and device
CN113535563A (en) Test case duplication removing method and device, computer equipment and storage medium
CN109445693A (en) A kind of data compression method and device
CN109597639B (en) Software upgrading method, device, equipment and medium
CN103714059A (en) Data updating method and device
CN113703670B (en) Wear balance control method, device, equipment and readable storage medium
CN113419672B (en) Storage capacity management method, system and storage medium
JP2003036209A (en) Nonvolatile memory and data rewriting method thereof
CN113821193B (en) Information generation method, device and storage medium
CN112948173A (en) Data recovery method, device, equipment and medium
CN114003174A (en) Erasure code storage method and system and electronic equipment
CN110364211B (en) Method, device and equipment for reducing erasing interference time of nonvolatile memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant