CN114265613B - 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 PDFInfo
- Publication number
- CN114265613B CN114265613B CN202111569286.1A CN202111569286A CN114265613B CN 114265613 B CN114265613 B CN 114265613B CN 202111569286 A CN202111569286 A CN 202111569286A CN 114265613 B CN114265613 B CN 114265613B
- 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.)
- Active
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a differential upgrading method and a differential upgrading system for all electric control unit firmware 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 target firmware. The ECU firmware differential upgrading can be indirectly realized by obtaining the target upgrading firmware of the electronic control unit through 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
Technical Field
The invention relates to the technical field of firmware upgrading of new energy automobiles, in particular to a differential upgrading method and system for firmware of all electric control units of an entire 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, the loss of traditional energy is greatly reduced, and outstanding new energy automobiles can be used. 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 upgrade is not suitable for the undersized RAM and the low CPU dominant frequency, because the differential reduction algorithm depends on a certain RAM size, and most MCUs cannot meet the requirement, the whole-package upgrade scheme is generally adopted, and the whole-package upgrade mode causes the volume of an upgrade package to be increased, so that the download time of the upgrade 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 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 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 copy instruction and an addition instruction corresponding to the electronic control unit differential firmware;
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 running state or not;
if yes, the electronic control unit target firmware is written into the firmware upgrading program of each electronic control unit to be updated;
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 firmware updating progress is displayed as updating completion;
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 the preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
evaluating the matching rate of each recovery time period according to the offset condition of the character string tested and updated by the preset updating firmware in each recovery time period;
and selecting the target reduction time period with the maximum matching rate as the working time period of the main control unit for reducing the electronic control unit source firmware and the electronic control unit differential firmware to obtain the electronic control unit target firmware.
Preferably, before the electronic control unit target firmware is flushed to each electronic control unit of the target vehicle to implement 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 a performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from large 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 unit of which the target mutual exclusion probability is 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;
The flash command of each electronic control unit corresponds 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 a shared resource pool according to the flash sequence and the flash instruction of each electronic control unit.
A system for differentially upgrading all electric control unit firmware 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 upgrade method for firmware of all electric control units of a vehicle according to the present invention;
FIG. 2 is another flowchart of the differential upgrade method for firmware of all electric control units of a vehicle according to the present invention;
FIG. 3 is another flowchart of the differential upgrade method for firmware of all electric control units of a 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 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. The following description refers to the accompanying drawings in which the same 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 electronic control unit differential firmware from a network terminal;
step S103, restoring the electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware;
and step S104, the firmware of the target electronic control unit is flushed to each electronic control unit of the target vehicle to realize the firmware upgrading work of the target electronic control unit.
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:
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, e iThe 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:
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 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 electronic control unit source firmware;
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 main control unit of the target vehicle, before receiving the electronic control unit differential firmware from the network terminal, the method further comprises:
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 file can be searched out in the main control unit quickly in the follow-up process by constructing the index file of the backup file, 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;
and 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 firmware 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 firmware of the target electronic control unit to each electronic control unit of the target vehicle to implement the firmware upgrade work on the target electronic control unit includes:
calling a firmware upgrading program of each electronic control unit and detecting whether the electronic control unit is in a normal running state or not;
if yes, the electronic control unit target firmware is written into the firmware upgrading program of each electronic control unit to be updated;
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 firmware updating progress is displayed as updating completion;
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 manner.
The beneficial effects of the above technical scheme are: the firmware updating progress of the electronic control units is detected in real time, so that the smooth proceeding of firmware updating can be effectively guaranteed, the stability is further improved, furthermore, the updating logs of the electronic control units are generated in a self-adaptive mode, so that an owner can call the updating logs at any time subsequently 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 the preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
evaluating the matching rate of each recovery time period according to the offset condition of the character string tested and updated by the preset updating firmware in each recovery time period;
and selecting the target reduction time period with the maximum matching rate as the working time period of the main control unit for reducing the electronic control unit source firmware and the electronic control unit differential firmware to obtain the electronic control unit target firmware.
The beneficial effects of the above technical scheme are: the stable operation of the electronic control unit target firmware restoration operation can be ensured without influencing other operations of the main control unit by determining the optimal operation time period 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 the 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 a performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from large 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 restores the ECU source firmware and the ECU differential firmware by using a differential restoration module to obtain ECU target firmware;
4) the main control unit uses CAN bus communication to write the ECU target firmware to the ECU;
5) the main 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 packages are 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 a linux system and an android system, 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 flushed 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 the source firmware of the electronic control unit in the main control unit of the target vehicle;
a receiving module 502 for receiving 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 a flashing module 504, configured to flash the firmware of the target electronic control unit to each electronic control unit of the target vehicle to implement firmware upgrade work on the target electronic control unit.
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 that have been 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 (8)
1. A differential upgrading method for all electric control unit firmware 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 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;
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;
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 the 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 data 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 data pool;
acquiring configuration parameters of each electronic control unit and determining a performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from large 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 unit of which the target mutual exclusion probability is 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;
the flash command of each electronic control unit corresponds 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 a shared data pool according to the flash sequence and the flash instruction of each electronic control unit.
2. The differential upgrading method for the firmware of all the electric control units of the whole vehicle as claimed in 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 electronic control unit source firmware;
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 differential upgrading method for the firmware of all the electric control units of the whole vehicle as claimed in 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:
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 initial 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 copy instruction and an addition instruction corresponding to the electronic control unit differential firmware;
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 firmware updating progress is displayed as updating completion;
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 manner.
7. The differential upgrading method for the firmware of all the electric control units of the whole vehicle as claimed in claim 1, wherein 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 comprises:
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 the preset updated firmware, and detecting the offset condition of the firmware character string in the test process;
Evaluating the matching rate of each recovery time period according to the offset condition of the character string tested and updated by the preset updating firmware in each recovery time period;
and selecting the target reduction time period with the maximum matching rate as the working time period of the main control unit for reducing the electronic control unit source firmware and the electronic control unit differential firmware to obtain the electronic control unit target firmware.
8. A system for differentially upgrading firmware of all electric control units of a whole vehicle is characterized by comprising:
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 electronic control unit source firmware and the electronic control unit differential firmware to obtain electronic control unit target firmware;
the flash module is used for flashing the firmware of the target electronic control unit to each electronic control unit of the target vehicle so as to realize the firmware upgrading work of the target electronic control unit;
before flushing the electronic control unit target firmware to each electronic control unit of the target vehicle to realize the firmware upgrade of the electronic control unit target firmware, the system is further used for:
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 the 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 data 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 data pool;
acquiring configuration parameters of each electronic control unit and determining a performance index of each electronic control unit according to the configuration parameters;
sequencing the performance indexes of each electronic control unit from large 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;
the flash command of each electronic control unit corresponds 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 a shared data pool according to the flash sequence and the flash instruction of each electronic control unit.
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 CN114265613A (en) | 2022-04-01 |
CN114265613B true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116166298B (en) * | 2023-03-16 | 2024-03-01 | 北京百度网讯科技有限公司 | Firmware upgrading method, device, equipment and storage medium |
CN116974616B (en) * | 2023-07-14 | 2024-03-15 | 红石阳光(北京)科技股份有限公司 | Method for upgrading all electronic control units of whole vehicle through USB flash disk |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100064472A (en) * | 2008-12-05 | 2010-06-15 | (주)티아이소프트 | Upgrade system of electronic control unit for vehicle |
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 |
CN111385191A (en) * | 2018-12-28 | 2020-07-07 | 联合汽车电子有限公司 | Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium |
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 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7624395B2 (en) * | 2004-09-23 | 2009-11-24 | Sap Ag | Thread-level resource usage measurement |
JP5346253B2 (en) * | 2009-08-24 | 2013-11-20 | 株式会社日立ソリューションズ | Firmware update system, information device, and program |
US9836300B2 (en) * | 2015-06-16 | 2017-12-05 | Lear Corporation | Method for updating vehicle ECUs using differential update packages |
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 |
-
2021
- 2021-12-21 CN CN202111569286.1A patent/CN114265613B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20100064472A (en) * | 2008-12-05 | 2010-06-15 | (주)티아이소프트 | Upgrade system of electronic control unit for vehicle |
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 |
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 |
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)
Title |
---|
Automotive ECU Software Reprogramming Method Based on Ethernet Backbone Network to Save Time;Young Seo Lee;《IMCOM`16:Proceedings of the 10th International Conference on Ubiquitous Information Management and Communication》;20160106;全文 * |
Compression Method for ECU Software Updates;Yutaka Onuma;《Tenth International Conference on Mobile Computing and Ubiquitous Network (ICMU)》;20171231;全文 * |
OTA实现方案及汽车端设计分析;李立安等;《汽车实用技术》;20200730(第14期);全文 * |
智能网联汽车整车OTA功能设计研究;王栋梁等;《汽车技术》;20181017(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114265613A (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114265613B (en) | Method and system for differentially upgrading firmware of all electric control units of whole vehicle | |
US7240178B2 (en) | Non-volatile memory and non-volatile memory data rewriting method | |
CN109508148B (en) | Metadata reconstruction method and device and computer readable storage medium | |
CN110442473B (en) | Nonvolatile data storage method and device, electronic equipment and medium | |
CN112947856B (en) | Memory data management method and device, computer equipment and storage medium | |
CN103268201A (en) | Data storing method, storing device and reading method | |
CN114584539B (en) | Cloud upgrading method and system for industrial field device | |
CN111198705A (en) | Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment | |
CN111596945B (en) | Differential upgrading method for dynamic multi-partition firmware of embedded system | |
CN107992268B (en) | Bad block marking method and related device | |
CN113703670A (en) | Wear leveling control method, device, equipment and readable storage medium | |
CN112306408A (en) | Storage block processing method, device, equipment and storage medium | |
CN109753384B (en) | Cloud host snapshot backup method and device, computer equipment and storage medium | |
CN112685275B (en) | Algorithm policy search method and device, electronic equipment and storage medium | |
CN109992492A (en) | Log recording method, device, equipment and the readable storage medium storing program for executing of functional module | |
CN113535563A (en) | Test case duplication removing method and device, computer equipment and storage medium | |
CN109597639B (en) | Software upgrading method, device, equipment and medium | |
CN103714059A (en) | Data updating method and device | |
CN110119285A (en) | A kind of low side scm software upgrade method and relevant apparatus | |
CN116009923A (en) | Control method, device and storage medium for firmware differential upgrade | |
JP2003036209A (en) | Nonvolatile memory and data rewriting method thereof | |
CN109325005A (en) | A kind of data processing method and electronic equipment | |
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 |
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 |