CN116431186A - Upgrading method, device and medium of vehicle-mounted ECU - Google Patents

Upgrading method, device and medium of vehicle-mounted ECU Download PDF

Info

Publication number
CN116431186A
CN116431186A CN202310433282.3A CN202310433282A CN116431186A CN 116431186 A CN116431186 A CN 116431186A CN 202310433282 A CN202310433282 A CN 202310433282A CN 116431186 A CN116431186 A CN 116431186A
Authority
CN
China
Prior art keywords
upgrading
boot
level
target
upgrade
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.)
Pending
Application number
CN202310433282.3A
Other languages
Chinese (zh)
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.)
Invt Electric Vehicle Drive Technology Shenzhen Co ltd
Original Assignee
Invt Electric Vehicle Drive Technology Shenzhen 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 Invt Electric Vehicle Drive Technology Shenzhen Co ltd filed Critical Invt Electric Vehicle Drive Technology Shenzhen Co ltd
Priority to CN202310433282.3A priority Critical patent/CN116431186A/en
Publication of CN116431186A publication Critical patent/CN116431186A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/572Secure firmware programming, e.g. of basic input output system [BIOS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The invention discloses a vehicle-mounted ECU upgrading method, device and medium, which are suitable for the technical field of vehicles. Acquiring bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of a multi-level BOOT, and the multi-level BOOT is divided in advance based on an OTA function; determining a target upgrading level of the multi-level BOOT according to the bus number information; determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area; and carrying out corresponding upgrading operation according to the brushing flow. Through dividing multistage BOOT in the storage area based on OTA function requirement, except that accomplish OTA function requirement through multistage BOOT, can also utilize multistage BOOT to accomplish self BOOT upgrading, avoid current through additional simulator, demolish the problem that the machine hardware brushes and writes the big with high costs of brush that the BOOT caused, can realize through software that the brush is write to upgrade, improve upgrade efficiency.

Description

Upgrading method, device and medium of vehicle-mounted ECU
Technical Field
The invention relates to the technical field of vehicles, in particular to a vehicle-mounted ECU upgrading method, device and medium.
Background
With the rapid development of the electric and intelligent directions of automobiles, electronic control units (Electronic Control Unit, ECU) are more and more, so that on-line upgrade (OTA) and unified diagnostic service (Unified Diagnostic Services, UDS) functions are popularized, and the ECU becomes a necessary option to realize a Bootloader (BOOT) function of software self-upgrade.
Usually, an ECU is provided with a BOOT and an application program (App), and the BOOT is used as a bootstrap program to implement the function of completing App upgrade by the CAN bus. Because of the popularity of OTA, the BOOT upgrading APP software needs to be upgraded according to the requirements set forth by original commission production (Original Entrusted Manufacture, OEM), however, the OTA function requirements set forth by each OEM manufacturer are different, the OTA requirements are continuously updated, the ECU carrying a BOOT cannot conveniently and rapidly complete the upgrading of the BOOT per se, in this case, an emulator tool is usually added, and then the machine is dismantled to brush the BOOT through hardware, so that the brushing upgrading cost is high.
Therefore, how to upgrade the BOOT software according to the OTA requirement to improve the upgrade efficiency is needed to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a device and a medium for upgrading a vehicle-mounted ECU, which can finish the self BOOT upgrade by using a multi-stage BOOT besides finishing OTA function requirements, avoid the problem of high brushing cost caused by removing a machine hardware brushing BOOT through an additional simulator, realize brushing upgrade through software and improve upgrade efficiency.
In order to solve the technical problems, the invention provides an upgrading method of a vehicle-mounted ECU, which comprises the following steps:
acquiring bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of multi-level BOOTs, and the multi-level BOOTs are divided in advance based on OTA functions;
determining a target upgrading level of the multi-level BOOT according to the bus number information;
determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area;
and performing corresponding upgrading operation according to the brushing flow.
Preferably, before the acquiring the bus number information in the vehicle-mounted storage area, the method further includes:
acquiring upgrade request information sent by an upper computer;
judging whether the current state corresponding to the upgrading request information meets the upgrading requirement or not;
if yes, starting a pre-upgrading mode, and entering the step of acquiring bus number information in the vehicle-mounted storage area.
Preferably, the bus number information includes a plurality of bus numbers, and the bus numbers corresponding to the multi-stage BOOT are different.
Preferably, the target upgrading level of the multi-level BOOT comprises a level BOOT, and the level BOOT comprises a set of bus number information;
the determining the brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area comprises the following steps:
when the target upgrading level is the primary BOOT, acquiring identification information corresponding to the primary BOOT according to the relation between the target upgrading level and the identification information written into the storage area, wherein the identification information comprises an erasing address and a length corresponding to each brushing flow of the primary BOOT;
determining the brushing flow of the primary BOOT according to the identification information, wherein the brushing flow of the primary BOOT comprises APP upgrading and upgrading from the primary BOOT to the secondary BOOT, and the corresponding erasing addresses and lengths of the brushing flows are different.
Preferably, the target upgrading level of the multi-level BOOT comprises a secondary BOOT, and the secondary BOOT comprises two sets of bus number information;
the determining the brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area comprises the following steps:
when the target upgrading level is the secondary BOOT, acquiring the identification information corresponding to the secondary BOOT according to the relation between the target upgrading level and the identification information of the storage area, wherein the identification information comprises an identifier, an erasing address and a length corresponding to each brushing flow of the secondary BOOT;
determining a brushing flow of the secondary BOOT according to the identification information, wherein the brushing flow of the secondary BOOT comprises self BOOT upgrading, primary BOOT upgrading and APP upgrading, and the self BOOT upgrading is the same as the brushing flow of the primary BOOT upgrading;
correspondingly, the determining the brushing flow of the secondary BOOT according to the identification information comprises the following steps:
determining corresponding bus number information according to the identifier;
determining a corresponding upgrading object according to the bus number information, wherein a mapping relation is established in advance between the upgrading object and the brushing flow of the secondary BOOT;
and determining the brushing flow of the secondary BOOT according to the upgrading object, the erasing address and the length.
Preferably, before the determining the brushing flow under the target upgrade level according to the relation between the target upgrade level and the identification information written into the storage area, the method further includes:
determining a corresponding security authentication mode of the upgrading level according to the bus number information, wherein the security authentication mode of the primary BOOT is determined based on a self-made security algorithm of a provider, and the security authentication mode of the secondary BOOT is determined based on each security algorithm customized by a whole vehicle factory enterprise;
acquiring the secure access of the OTA function to send a random seed, so that the upper computer can encrypt a key by utilizing a security algorithm corresponding to the security authentication mode according to the random seed;
receiving key information sent by the upper computer;
comparing the key with the key information;
and if the target upgrade level is the same, unlocking to acquire the upgrade authority, and entering a step of determining a brushing flow under the target upgrade level according to the relation between the target upgrade level and the identification information written into the storage area.
Preferably, the method further comprises:
and when the upgrading of the secondary BOOT is abnormal, upgrading by using the primary BOOT.
Preferably, after the corresponding upgrade operation is performed according to the brushing flow, the method further includes:
downloading the data packet corresponding to the upgrading operation to the storage area;
checking the data packet;
if the verification is successful, the upgrading is determined to be successful.
Preferably, before the corresponding upgrade operation is performed according to the brushing flow, the method further includes:
powering up the upgrade operation;
and after the power-on time sequence is finished, entering into the step of performing corresponding upgrading operation according to the brushing flow to perform upgrading operation.
In order to solve the technical problem, the invention also provides an upgrading device of the vehicle-mounted ECU, which comprises the following components:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring bus number information in a vehicle-mounted storage area, the bus number information is used for distinguishing level information of multi-level BOOTs, and the multi-level BOOTs are divided in advance based on OTA functions;
the first determining module is used for determining the target upgrading level of the multi-level BOOT according to the bus number information;
the second determining module is used for determining a brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area;
and the upgrade operation module is used for carrying out corresponding upgrade operation according to the brushing flow.
In order to solve the technical problem, the invention also provides an upgrading device of the vehicle-mounted ECU, which comprises the following components:
a memory for storing a computer program;
and the processor is used for realizing the steps of the upgrading method of the vehicle-mounted ECU when executing the computer program.
In order to solve the above technical problem, the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for upgrading an on-vehicle ECU as described above.
The invention provides an upgrading method of a vehicle-mounted ECU, which comprises the steps of obtaining bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of a multi-level BOOT, and the multi-level BOOT is divided in advance based on an OTA function; determining a target upgrading level of the multi-level BOOT according to the bus number information; determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area; and carrying out corresponding upgrading operation according to the brushing flow. According to the method, the storage area is divided into the plurality of stages of BOOTs based on OTA function requirements, the OTA function requirements are finished through the plurality of stages of BOOTs, the BOOT upgrading of the storage area can be finished through the plurality of stages of BOOTs, the problem that the existing machine hardware is removed through an additional simulator to cause high brushing cost is solved, the brushing upgrading can be achieved through software, and the upgrading efficiency is improved.
In addition, the invention also provides an upgrading device and medium of the vehicle-mounted ECU, and the upgrading device and medium have the same beneficial effects as the upgrading method of the vehicle-mounted ECU.
Drawings
For a clearer description of embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
Fig. 1 is a flowchart of an upgrade method of a vehicle-mounted ECU provided in an embodiment of the present invention;
FIG. 2 is a power-on timing chart according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for upgrading an on-board ECU according to an embodiment of the present invention;
fig. 4 is an upgrade schematic diagram of a vehicle-mounted ECU according to another embodiment of the present invention;
fig. 5 is a block diagram of an upgrade apparatus for a vehicle-mounted ECU according to an embodiment of the present invention;
fig. 6 is a block diagram of another upgrading device for a vehicle-mounted ECU according to the embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
The invention has the core of providing a vehicle-mounted ECU upgrading method, device and medium, and the multi-stage BOOT can be used for completing the self BOOT upgrading besides the OTA function requirement, so that the problem of high brushing cost caused by removing the machine hardware brushing BOOT through an additional simulator is avoided, the brushing upgrading can be realized through software, and the upgrading efficiency is improved.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
It should be noted that, when the existing OTA is performed, the APP content is updated to the non-running area, so as to prevent the vehicle from being unable to run during the OTA, and only meet the requirement of the OTA, if the OTA side proposes a new downloading requirement, the BOOT update still needs to be performed by a hardware brushing manner, so as to face the new updating requirement; in addition, the main control processor unit and the slave processor unit are connected with an additional external storage area through USB to construct a hierarchical BOOT, a BOOT partition is established, the multi-level BOOT can be set, but the hardware cost is increased, the debugging mode is inconvenient, and the enterprise cost reduction strategy is not facilitated. And the multi-stage BOOT is used as backup storage, for example, the one-stage BOOT stores the content of a BOOT guide area, so that the program can not normally run after single BOOT damage is prevented, and the method is only a prevention means proposed by the BOOT damage, and the logic content stored in the BOOT is kept consistent so as to carry out program jump. The invention provides an upgrading method of a vehicle-mounted ECU to solve the technical problems.
Fig. 1 is a flowchart of an upgrade method of a vehicle-mounted ECU according to an embodiment of the present invention, as shown in fig. 1, where the method includes:
s11: acquiring bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of a multi-level BOOT, and the multi-level BOOT is divided in advance based on an OTA function;
s12: determining a target upgrading level of the multi-level BOOT according to the bus number information;
s13: determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area;
s14: and carrying out corresponding upgrading operation according to the brushing flow.
Specifically, bus number information in a vehicle-mounted storage area is obtained, it CAN be understood that the vehicle-mounted storage area CAN be a Flash (chip storage unit) area or other storage areas, the bus number information CAN be controller area network (Controller Area Network, CAN) number information or other bus number information, the bus number information CAN be CAN ID or other flag information, and the bus number information is level information for distinguishing multi-level BOOT, that is, the current BOOT upgrading CAN be determined by the bus number information.
As one embodiment, the bus number information includes a plurality of bus numbers, and the bus numbers corresponding to the plurality of levels of BOOT are different.
The bus number is specific to different combination modes, for the combination modes of the multi-stage BOOT, the BOOT of each stage cannot be reused, for example, the CAN ID is 1, 2 and 3, for the multi-stage BOOT, the CAN ID comprises a primary BOOT and a secondary BOOT, the CAN ID is 1 and 2 in the primary BOOT, and the secondary BOOT comprises 3. The multi-level BOOT adopts a UDS unified diagnosis protocol, and is upgraded by using different CAN bus number combinations, wherein the preset CAN bus number information combinations are distinguished, APP software writes different identifiers into a specific space of a storage area according to a programming mode jump request of the UDS protocol issued by the different CAN bus number information, so that the OTA upgrading requirement of the current BOOT is judged, and the corresponding upgrading flow is conveniently entered.
Dividing a storage area of the DSP based on an OTA function in advance, dividing a storage area of the DSP into a multi-stage BOOT area and an APP area, for example, dividing the storage area into a two-stage BOOT area (a first-stage BOOT (Pre-BOOT, PBL) and a second-stage BOOT (Sec-BOOT, SBL)), taking the first-stage BOOT as a power-on specified bootstrap program, and executing jump-over second-stage BOOT, app and upgrading software operation; the second-level Boot is used as a specific program of an OTA function of a whole vehicle factory enterprise, an OTA request instruction is responded, an App upgrading action is executed, and an App program jump function is completed; app is used as a logic function program customized by a whole vehicle factory enterprise, and is used as download data in an OTA function, and is written to a designated position through primary/secondary Boot brushing.
It should be noted that, before the bus number information is acquired in step S11, the pre-compiling request for upgrading the bus number information needs to be further determined, and as an embodiment, before the bus number information in the vehicle-mounted storage area is acquired, the method further includes:
acquiring upgrade request information sent by an upper computer;
judging whether the current state corresponding to the upgrade request information meets the upgrade requirement or not;
if yes, starting a pre-upgrading mode, and entering a step of acquiring bus number information in a vehicle-mounted storage area.
Specifically, when the APP receives an upgrade request sent by the upper computer, checking the pre-compiling request through the 0x31 service of the UDS protocol, judging whether the current state meets the upgrade requirement, if so, replying a positive response, thereby being used as a judging condition for entering a programming mode for a request sent by a subsequent upper computer, and if not, not allowing entering the programming mode and prohibiting OTA upgrade.
Determining a target upgrading level of a multi-level BOOT according to bus number information, specifically taking the two levels of BOOT as examples, sending a request of 0x10 service by an upper computer to enter a programming mode, writing an identifier in a specific area of a storage area according to different bus number information sent by the upper computer, if the identifier is an OTA upgrading request, writing an identifier of a secondary BOOT, and reading the identifier by the secondary BOOT; if the upgrading request is a common upgrading request, writing an identifier of a primary Boot, reading the identifier by the primary Boot, and enabling the primary/secondary Boot to enter a corresponding upgrading flow according to the corresponding identifier.
And determining the corresponding brushing flow according to the relationship between the current corresponding upgrading level and the identification information written into the storage area. It should be noted that the brushing flow of the BOOT at one level is divided into multiple types, and the corresponding brushing flow needs to be determined according to the identification information for brushing. And after determining the brushing flow, upgrading operation is carried out. If an abnormality occurs in the upgrading process by using the current upgrading operation, upgrading is performed according to the previous grade BOOT with the current grade as a reference. As one embodiment, the method comprises a first-level BOOT and a second-level BOOT, and when the second-level BOOT is updated abnormally, the first-level BOOT is used for updating.
The hierarchical Boot is adopted in the embodiment, the secondary Boot can be upgraded through the primary Boot in the product debugging stage and the batch stage so as to meet the OTA requirement of continuous updating, meanwhile, when the secondary Boot is abnormal, the primary Boot can still be used for upgrading an App program, downtime is avoided, and the secondary Boot is updated again later.
The invention provides an upgrading method of a vehicle-mounted ECU, which comprises the steps of obtaining bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of a multi-level BOOT, and the multi-level BOOT is divided in advance based on an OTA function; determining a target upgrading level of the multi-level BOOT according to the bus number information; determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area; and carrying out corresponding upgrading operation according to the brushing flow. According to the method, the storage area is divided into the plurality of stages of BOOTs based on OTA function requirements, the OTA function requirements are finished through the plurality of stages of BOOTs, the BOOT upgrading of the storage area can be finished through the plurality of stages of BOOTs, the problem that the existing machine hardware is removed through an additional simulator to cause high brushing cost is solved, the brushing upgrading can be achieved through software, and the upgrading efficiency is improved.
On the basis of the embodiment, how many levels of the multi-level BOOT are set up according to OTA functions, and as an embodiment, the target upgrading level of the multi-level BOOT comprises a level BOOT which comprises a set of bus number information;
determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area, wherein the refreshing flow comprises the following steps:
when the target upgrading level is a primary BOOT, acquiring identification information corresponding to the primary BOOT according to the relation between the target upgrading level and the identification information written into the storage area, wherein the identification information comprises erasure addresses and lengths corresponding to each brushing flow of the primary BOOT;
and determining the brushing flow of the primary BOOT according to the identification information, wherein the brushing flow of the primary BOOT comprises APP upgrading and upgrading from the primary BOOT to the secondary BOOT, and the corresponding erasing addresses and lengths of the brushing flows are different.
Specifically, the primary BOOT comprises a set of bus number information, and two sets of brushing flows respectively realize secondary BOOT upgrading and APP upgrading. The general brushing flow is to preprogram the request by using 0x31, 0x10 enters a programming mode, 0x27 is a security algorithm range, 0x31 is Flash address erasure and length, and 0x34, 0x36 and 0x37 are used for data transmission.
And determining a corresponding brushing flow according to the erasing address and the length corresponding to the brushing flow of the identification information. According to the primary Boot identifier written by the App, executing an upgrading process without executing secondary Boot/App jump; and according to the erasing address and the length sent by the upper computer through the 0x31 service of the UDS protocol, the corresponding Flash area erasing is carried out in one-to-one correspondence with the erasing address and the length preset by the Boot, so that the program is prevented from flying due to erroneous erasing.
As another embodiment, the target upgrade level of the multi-level BOOT includes a secondary BOOT that contains two sets of bus number information;
determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area, wherein the refreshing flow comprises the following steps:
when the target upgrading level is the secondary BOOT, acquiring the identification information corresponding to the secondary BOOT according to the relation between the target upgrading level and the identification information of the storage area, wherein the identification information comprises an identifier, and an erasing address and a length corresponding to each brushing flow of the secondary BOOT;
determining a second-level BOOT refreshing flow according to the identification information, wherein the second-level BOOT refreshing flow comprises self BOOT upgrading, primary BOOT upgrading and APP upgrading, and the self BOOT upgrading is the same as the primary BOOT refreshing flow;
correspondingly, determining the brushing flow of the secondary BOOT according to the identification information comprises the following steps:
determining corresponding bus number information according to the identifier;
determining a corresponding upgrading object according to the bus number information, wherein a mapping relation is established in advance between the upgrading object and a brushing flow of the secondary BOOT;
and determining the brushing flow of the secondary BOOT according to the upgrading object, the erasing address and the length.
Specifically, the secondary BOOT comprises two sets of bus number information, one set is used for upgrading the APP and the primary BOOT, and the other set is used for upgrading the secondary BOOT. Because of the two sets of bus numbering information, the upgrade objects (upgrade APP and primary BOOT and upgrade itself) need to be determined first, and the two sets of brushing flows respectively realize upgrade primary BOOT and upgrade APP. It should be noted that the upgrade itself needs to be reduced to the primary BOOT, and then be upgraded from the primary BOOT to the secondary BOOT. The first-level BOOT writing process is the same as the first-level BOOT writing process, but the erasing address and length in the first-level BOOT writing process and the corresponding identifier information are different, and are not described in detail herein.
On the basis of the above embodiment, as an embodiment, before determining the brushing flow at the target upgrade level according to the relationship between the target upgrade level and the identification information written to the storage area, the method further includes:
determining a corresponding upgrade-level security authentication mode according to the bus number information, wherein the primary BOOT security authentication mode is determined based on a self-made security algorithm of a provider, and the secondary BOOT security authentication mode is determined based on each security algorithm customized by a whole vehicle factory enterprise;
acquiring the secure access of the OTA function to send the random seed, so that the upper computer can encrypt the key according to the random seed by utilizing a secure algorithm corresponding to the secure authentication mode;
receiving key information sent by an upper computer;
comparing the key with the key information;
if the target upgrade level is the same, unlocking to acquire the upgrade right, and entering a step of determining a brushing flow under the target upgrade level according to the relation between the target upgrade level and the identification information written into the storage area.
Specifically, the primary Boot and the secondary Boot have two sets of different security authentication modes, the primary Boot is self-made by a provider to carry out a security algorithm, and the secondary Boot program and the App program can be upgraded by the same security algorithm; the second-level Boot customizes different security algorithms according to different whole vehicle factories and enterprises, so that an App program is upgraded, and an upgrade protocol of the whole vehicle factories is realized. The secure access of the OTA function is obtained, the ECU sends a random seed, the upper computer calculates a key according to the random seed by utilizing a agreed secure algorithm, the ECU compares the key sent by the upper computer, and if the comparison is successful, the secure unlocking can be performed to obtain the software upgrading authority. Correspondingly, the security algorithm is not limited herein, and may be set according to actual situations, suppliers and enterprises in the whole vehicle factory.
On the basis of the above embodiment, as an embodiment, after performing the corresponding upgrade operation according to the brushing flow, the method further includes:
downloading the data packet corresponding to the upgrading operation to a storage area;
checking the data packet;
if the verification is successful, the upgrading is determined to be successful.
Specifically, according to the data transmission protocol of the UDS, the complete data packet corresponding to the upgrade operation is downloaded to the storage area, and after the downloading is completed, the data integrity verification is carried out, the upgrade can be considered to be successful after verification, and the corresponding verification process can carry out data verification according to the written identifier or other verification algorithms, so that the data package is used as a judgment condition for program jump. The verification method may be one method or a plurality of methods, and is not limited.
Before the corresponding upgrading operation is performed according to the brushing flow, the method further comprises the following steps:
powering up the upgrade operation;
after the power-on time sequence is completed, the step of corresponding upgrading operation according to the brushing flow is entered to carry out upgrading operation.
Specifically, the power-on sequence and the upgrading process are independent, but the APP function is executed by completing the power-on sequence first so as to upgrade. The power-on time sequence is an action which is executed in the power-on process of the chip every time, and the upgrading process is an action which is executed when the upper computer sends an instruction. Taking two-stage BOOT as an example, powering-on time sequence is taken as entering a first-stage BOOT, and then judging whether an App program exists or not, so that jump App is met; judging whether a secondary Boot exists or not, and if yes, jumping the secondary Boot; none of them satisfies the run first class Boot.
The primary Boot presets addresses of two Flash storage areas, so that the content of the secondary Boot and the content of the App are erased/downloaded, and the primary Boot is distinguished according to the difference of the address starting position and the data length in the 0x31 service and the 0x34 service of the UDS protocol sent by the upper computer, so that the software upgrading of the secondary Boot and the App is completed. The second-level Boot program writes identifiers at the beginning and the end of the address, and the identifiers serve as judging conditions for the first-level Boot to jump to the second-level Boot, so that the OTA upgrading function requirement of the whole vehicle factory enterprise is partially completed, the second-level Boot program serves as a main execution unit of the OTA, interacts with an upper computer, and performs software upgrading according to an OTA protocol; meanwhile, two Flash storage area addresses are preset, primary Boot and App software are erased/downloaded, primary Boot setting authority is upgraded, specified Data Identifier (DID) content is written through 0x2E service of a UDS protocol, specific Identifier is written in the Flash addresses, primary Boot upgrading operation is allowed, and the risk that an ECU changes bricks due to the fact that a person brushing the primary Boot is avoided.
On the basis of keeping main functional logic, the App adds two sets of upgrading CAN IDs, meets the OTA upgrading of the secondary Boot and the self-made protocol upgrading of the primary Boot, executes corresponding upgrading processes when receiving upgrading-requesting instructions issued by different CAN IDs, and writes different identifiers in different Flash areas to enter the primary Boot upgrading process or the secondary Boot upgrading process.
The specific multi-stage BOOT and the updating operation of the flashing flow provided by the embodiment have redundant design on the software updating method, so that the software updating method can not only update the software through the OTA of the whole vehicle factory enterprise, but also update the software by using the own protocol of the supplier enterprise, thereby effectively improving the software updating efficiency, and having an alternative scheme under the condition that the single updating mode cannot be updated under the complex working condition. The secondary Boot is used for completing OTA function development of the whole vehicle factory enterprise, is beneficial to updating the secondary Boot conveniently and rapidly in the debugging process, so that the OTA function of the whole vehicle factory is continuously met, and the research and development efficiency is improved. The two sets of CAN ID upgrading protocols are used by the secondary Boot to realize the upgrading of the primary Boot function, and the situation that the machine is required to be disassembled for hardware brushing when the primary Boot is upgraded is avoided.
Fig. 2 is a power-on timing chart provided by an embodiment of the present invention, as shown in fig. 2, including:
s21: judging whether the secondary BOOT identifier meets the secondary BOOT upgrading requirement, if so, entering a step S22, and if not, entering a step S23;
s22: jumping to an upgrade secondary BOOT, judging whether the APP identifier meets the requirement, if so, entering a step S24, and if not, returning to the step S23;
s23: upgrading by using a primary BOOT;
s24: jumping to an APP layer;
s25: judging whether the OTA upgrading requirement meets the preset requirement, if so, entering a step S26, and if not, returning to the step S23;
s26: entering an upgrade mode, judging whether the APP identifier meets the requirement, if so, entering a step S27, and if not, returning to the step S23;
s27: and finishing the function logic at the APP interface.
Fig. 3 is a flowchart of another method for upgrading an ECU in a vehicle according to an embodiment of the present invention, as shown in fig. 3, including:
s31: acquiring an OTA upgrading request;
s32: the APP responds to the request according to the corresponding ID, writes in a specified identifier according to the requirement, and resets the chip;
s33: if the primary BOOT does not respond, the reading identifier enters the secondary BOOT;
s34: the second-level BOOT reads the identifier, enters a programming mode and prohibits the jump APP;
s35: and the second BOOT completes OTA software upgrading, resets after finishing upgrading, and jumps to the APP.
Fig. 4 is an upgrade schematic diagram of a vehicle-mounted ECU according to another embodiment of the present invention, where, as shown in fig. 4, a multi-stage BOOT includes a primary BOOT and a secondary BOOT, the primary BOOT can upgrade the secondary BOOT, the secondary BOOT can upgrade the primary BOOT, and when an APP interface needs to be upgraded, the primary BOOT and the secondary BOOT can both complete the upgrade of the APP interface, but write identifiers of the primary BOOT and the secondary BOOT are required, so that the upgrade operation can be skipped to a corresponding upgrade level.
For the description of the method, the schematic diagram and the power-on sequence of the vehicle-mounted ECU provided by the invention, refer to the above method embodiments, and the invention is not repeated herein, and has the same beneficial effects as the method for upgrading the vehicle-mounted ECU.
The invention further discloses an upgrading device of the vehicle-mounted ECU corresponding to the method, and fig. 5 is a structural diagram of the upgrading device of the vehicle-mounted ECU provided by the embodiment of the invention. As shown in fig. 5, the upgrading device of the vehicle-mounted ECU includes:
the acquiring module 11 is configured to acquire CAN bus number information in a vehicle-mounted Flash area, where the CAN bus number information is used to distinguish level information of a multi-level BOOT, and the multi-level BOOT is divided in advance based on an OTA function;
a first determining module 12, configured to determine an upgrade level of the multi-level BOOT according to the CAN bus number information;
the second determining module 13 is configured to determine a brushing flow of the BOOT at the current level according to the corresponding relationship between the upgrade level and the identification information written in the Flash area;
the upgrade operation module 14 is configured to perform a corresponding upgrade operation according to the brushing flow.
Since the embodiments of the device portion correspond to the above embodiments, the embodiments of the device portion are described with reference to the embodiments of the method portion, and are not described herein.
For the description of the upgrading device of the vehicle-mounted ECU provided by the invention, please refer to the above method embodiment, the invention is not described herein, and the upgrading device has the same beneficial effects as the upgrading method of the vehicle-mounted ECU.
Fig. 6 is a block diagram of another upgrading apparatus for a vehicle-mounted ECU according to an embodiment of the present invention, as shown in fig. 6, including:
a memory 21 for storing a computer program;
and a processor 22 for implementing the steps of the upgrade method of the vehicle-mounted ECU when executing the computer program.
Processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like, among others. The processor 22 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 22 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 22 may be integrated with an image processor (Graphics Processing Unit, GPU) for use in responsible for rendering and rendering of content required for display by the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 21 may include one or more computer-readable storage media, which may be non-transitory. Memory 21 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used for storing a computer program 211, which, after being loaded and executed by the processor 22, can implement the relevant steps of the method for upgrading an in-vehicle ECU disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 21 may further include an operating system 212, data 213, and the like, and the storage manner may be transient storage or permanent storage. The operating system 212 may include Windows, unix, linux, among other things. The data 213 may include, but is not limited to, data related to an upgrade method of the vehicle-mounted ECU, and the like.
In some embodiments, the upgrading device of the vehicle-mounted ECU may further include a display screen 23, an input-output interface 24, a communication interface 25, a power supply 26 and a communication bus 27.
It will be appreciated by those skilled in the art that the configuration shown in fig. 6 does not constitute a limitation of the upgrading device of the vehicle-mounted ECU, and may include more or less components than those shown.
The processor 22 implements the upgrade method of the in-vehicle ECU provided in any of the above embodiments by calling instructions stored in the memory 21.
For the description of the upgrading device of the vehicle-mounted ECU provided by the invention, please refer to the above method embodiment, the invention is not described herein, and the upgrading device has the same beneficial effects as the upgrading method of the vehicle-mounted ECU.
Further, the present invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by the processor 22 implements the steps of the method for upgrading an onboard ECU as described above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
For the introduction of a computer readable storage medium provided by the present invention, please refer to the above method embodiment, the present invention is not described herein, and the method has the same advantages as the above method for upgrading the vehicle-mounted ECU.
The method for upgrading the vehicle-mounted ECU, the device for upgrading the vehicle-mounted ECU and the medium provided by the invention are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (12)

1. An upgrade method of an on-vehicle ECU, comprising:
acquiring bus number information in a vehicle-mounted storage area, wherein the bus number information is used for distinguishing level information of multi-level BOOTs, and the multi-level BOOTs are divided in advance based on OTA functions;
determining a target upgrading level of the multi-level BOOT according to the bus number information;
determining a refreshing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area;
and performing corresponding upgrading operation according to the brushing flow.
2. The method for upgrading an ECU according to claim 1, further comprising, before said acquiring bus number information in the storage area of the vehicle:
acquiring upgrade request information sent by an upper computer;
judging whether the current state corresponding to the upgrading request information meets the upgrading requirement or not;
if yes, starting a pre-upgrading mode, and entering the step of acquiring bus number information in the vehicle-mounted storage area.
3. The method for upgrading an in-vehicle ECU according to claim 2, wherein said bus number information includes a plurality of bus numbers, and said bus numbers corresponding to said plurality of levels of BOOT are different.
4. The method for upgrading an on-board ECU according to claim 3, wherein the target upgrading level of the multi-level BOOT includes a level BOOT, the level BOOT including a set of bus number information;
the determining the brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area comprises the following steps:
when the target upgrading level is the primary BOOT, acquiring identification information corresponding to the primary BOOT according to the relation between the target upgrading level and the identification information written into the storage area, wherein the identification information comprises an erasing address and a length corresponding to each brushing flow of the primary BOOT;
determining the brushing flow of the primary BOOT according to the identification information, wherein the brushing flow of the primary BOOT comprises APP upgrading and upgrading from the primary BOOT to the secondary BOOT, and the corresponding erasing addresses and lengths of the brushing flows are different.
5. The method for upgrading an on-board ECU according to claim 3, wherein the target upgrading level of the multi-level BOOT includes a secondary BOOT containing two sets of bus number information;
the determining the brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area comprises the following steps:
when the target upgrading level is the secondary BOOT, acquiring the identification information corresponding to the secondary BOOT according to the relation between the target upgrading level and the identification information of the storage area, wherein the identification information comprises an identifier, an erasing address and a length corresponding to each brushing flow of the secondary BOOT;
determining a brushing flow of the secondary BOOT according to the identification information, wherein the brushing flow of the secondary BOOT comprises self BOOT upgrading, primary BOOT upgrading and APP upgrading, and the self BOOT upgrading is the same as the brushing flow of the primary BOOT upgrading;
correspondingly, the determining the brushing flow of the secondary BOOT according to the identification information comprises the following steps:
determining corresponding bus number information according to the identifier;
determining a corresponding upgrading object according to the bus number information, wherein a mapping relation is established in advance between the upgrading object and the brushing flow of the secondary BOOT;
and determining the brushing flow of the secondary BOOT according to the upgrading object, the erasing address and the length.
6. The upgrade method according to claim 4 or 5, further comprising, before said determining a flushing flow at said target upgrade level according to a relation between said target upgrade level and identification information written to said storage area:
determining a corresponding security authentication mode of the upgrading level according to the bus number information, wherein the security authentication mode of the primary BOOT is determined based on a self-made security algorithm of a provider, and the security authentication mode of the secondary BOOT is determined based on each security algorithm customized by a whole vehicle factory enterprise;
acquiring the secure access of the OTA function to send a random seed, so that the upper computer can encrypt a key by utilizing a security algorithm corresponding to the security authentication mode according to the random seed;
receiving key information sent by the upper computer;
comparing the key with the key information;
and if the target upgrade level is the same, unlocking to acquire the upgrade authority, and entering a step of determining a brushing flow under the target upgrade level according to the relation between the target upgrade level and the identification information written into the storage area.
7. The method for upgrading an in-vehicle ECU according to claim 6, further comprising:
and when the upgrading of the secondary BOOT is abnormal, upgrading by using the primary BOOT.
8. The method for upgrading an in-vehicle ECU according to claim 1, further comprising, after said performing the corresponding upgrading operation according to the brushing flow:
downloading the data packet corresponding to the upgrading operation to the storage area;
checking the data packet;
if the verification is successful, the upgrading is determined to be successful.
9. The method for upgrading an in-vehicle ECU according to claim 1, further comprising, before said performing the corresponding upgrading operation according to the brushing flow:
powering up the upgrade operation;
and after the power-on time sequence is finished, entering into the step of performing corresponding upgrading operation according to the brushing flow to perform upgrading operation.
10. An upgrade apparatus of an in-vehicle ECU, characterized by comprising:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring bus number information in a vehicle-mounted storage area, the bus number information is used for distinguishing level information of multi-level BOOTs, and the multi-level BOOTs are divided in advance based on OTA functions;
the first determining module is used for determining the target upgrading level of the multi-level BOOT according to the bus number information;
the second determining module is used for determining a brushing flow under the target upgrading level according to the relation between the target upgrading level and the identification information written into the storage area;
and the upgrade operation module is used for carrying out corresponding upgrade operation according to the brushing flow.
11. An upgrade apparatus of an in-vehicle ECU, characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for upgrading an in-vehicle ECU according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method for upgrading an in-vehicle ECU according to any one of claims 1 to 9.
CN202310433282.3A 2023-04-17 2023-04-17 Upgrading method, device and medium of vehicle-mounted ECU Pending CN116431186A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310433282.3A CN116431186A (en) 2023-04-17 2023-04-17 Upgrading method, device and medium of vehicle-mounted ECU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310433282.3A CN116431186A (en) 2023-04-17 2023-04-17 Upgrading method, device and medium of vehicle-mounted ECU

Publications (1)

Publication Number Publication Date
CN116431186A true CN116431186A (en) 2023-07-14

Family

ID=87088865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310433282.3A Pending CN116431186A (en) 2023-04-17 2023-04-17 Upgrading method, device and medium of vehicle-mounted ECU

Country Status (1)

Country Link
CN (1) CN116431186A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775083A (en) * 2023-08-21 2023-09-19 小米汽车科技有限公司 Brushing method and device of vehicle-mounted controller and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775083A (en) * 2023-08-21 2023-09-19 小米汽车科技有限公司 Brushing method and device of vehicle-mounted controller and electronic equipment
CN116775083B (en) * 2023-08-21 2023-11-21 小米汽车科技有限公司 Brushing method and device of vehicle-mounted controller and electronic equipment

Similar Documents

Publication Publication Date Title
CN108279916B (en) Electronic control unit program updating method and device
CN106095480A (en) A kind of method and device of optical module firmware upgrading
US20060248172A1 (en) Method for updating software of an electronic control device by flash programming via a serial interface and corresponding automatic state machine
CN110371022B (en) Battery matching method and device and vehicle-mounted equipment
CN108271150B (en) Method and system for supporting simultaneous flashing or data clearing of multiple mobile phones
CN116431186A (en) Upgrading method, device and medium of vehicle-mounted ECU
JP2006221274A (en) Electronic control device for vehicle and rewriting method of control program
CN115543395A (en) Vehicle-mounted ECU upgrading method and device, electronic equipment and storage medium
US20240069906A1 (en) Server, software update system, distribution method, and non-transitory storage medium
CN112579105B (en) Flash method of whole vehicle initialization controller and related equipment
CN113360175A (en) Application updating method of vehicle controller and vehicle controller
US20220391194A1 (en) Ota master, system, method, non-transitory storage medium, and vehicle
US20220283799A1 (en) Center, update management method, and non-transitory storage medium
CN115129025A (en) Finished automobile off-line distribution method, finished automobile off-line distribution system, readable storage medium and equipment
CN114780114A (en) Firmware upgrading method, system, vehicle and storage medium
CN114281374A (en) Remote flash method and system for vehicle electronic control unit and storage medium
CN113935011A (en) Method for executing a secure boot sequence of a control device
CN112783527B (en) Upgrading method and equipment for vehicle controller program
CN112596677B (en) Data storage method and device of electronic control unit and storage medium
US20230032451A1 (en) Center, method, and non-transitory storage medium
CN112000358B (en) Upgrading method of charging pile and intelligent charging pile
CN111414176B (en) Program burning method, device, electronic equipment and storage medium
CN112599172A (en) Data writing method and device of electronic control unit and storage medium
CN111475179B (en) Online software refreshing method and device, electronic control unit and upper computer
US20220222054A1 (en) Center, update management method, and non-transitory storage medium

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