[go: up one dir, main page]

CN118916056A - Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment - Google Patents

Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment Download PDF

Info

Publication number
CN118916056A
CN118916056A CN202411071840.7A CN202411071840A CN118916056A CN 118916056 A CN118916056 A CN 118916056A CN 202411071840 A CN202411071840 A CN 202411071840A CN 118916056 A CN118916056 A CN 118916056A
Authority
CN
China
Prior art keywords
target
partition
software data
vehicle
software
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
CN202411071840.7A
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.)
FAW Jiefang Automotive Co Ltd
Original Assignee
FAW Jiefang Automotive 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 FAW Jiefang Automotive Co Ltd filed Critical FAW Jiefang Automotive Co Ltd
Priority to CN202411071840.7A priority Critical patent/CN118916056A/en
Publication of CN118916056A publication Critical patent/CN118916056A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

本申请涉及一种车载控制器、车载控制器软件升级方法、装置、计算机设备、计算机可读存储介质。该方法包括:获取待刷写的目标软件数据;确定至少两个外部存储分区中的一个外部存储分区为目标分区。将目标软件数据写入目标分区;在目标分区内写入的目标软件数据校验通过的情况下,采用目标分区内的目标软件数据升级车载控制器。由于设计了独立的外部存储分区,先将目标软件数据刷写到外部存储分区里面而并非直接刷写到车载控制器,从而刷写的时候不影响车辆正常使用,另一方面,只有当目标分区内的目标软件数据校验通过后,才会用目标分区内的目标软件数据对车载控制器进行升级,保证了目标软件数据的正确性,提高了升级的成功率。

The present application relates to a vehicle-mounted controller, a vehicle-mounted controller software upgrade method, device, computer equipment, and computer-readable storage medium. The method includes: obtaining target software data to be flashed; determining one of at least two external storage partitions as a target partition. Writing the target software data into the target partition; when the target software data written in the target partition passes the verification, using the target software data in the target partition to upgrade the vehicle-mounted controller. Since an independent external storage partition is designed, the target software data is first flashed into the external storage partition instead of being directly flashed into the vehicle-mounted controller, so that the normal use of the vehicle is not affected during the flashing. On the other hand, only when the target software data in the target partition passes the verification, the target software data in the target partition will be used to upgrade the vehicle-mounted controller, which ensures the correctness of the target software data and improves the success rate of the upgrade.

Description

Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment
Technical Field
The present application relates to the field of vehicle technologies, and in particular, to a vehicle-mounted controller, a method and an apparatus for upgrading software of the vehicle-mounted controller, a computer device, and a computer readable storage medium.
Background
With the development of vehicle technology, in order to accelerate the iteration speed of vehicle type products, a number of automobile manufacturers currently implement staged implementation of automobile functions through over-the-air technology (OTA), and more common methods are as follows: only basic driving functions are provided when the vehicle is on the market, and software with intelligent driving functions is pushed to the user vehicle through OTA after a few months, so that the functions of the vehicle are remotely updated through the software.
In the prior art, after an upgrade software package is downloaded, the upgrade software package is directly adopted to brush and write the vehicle-mounted controller.
However, according to the size of the upgrade software package, the process of directly adopting the upgrade software package to brush the vehicle-mounted controller generally needs several minutes to tens of minutes, and in the process, the user cannot use related functions or vehicles, and the whole process takes a long time, so that the use experience of the user is affected.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a vehicle-mounted controller, a vehicle-mounted controller software upgrading method, a device, a computer device, and a computer readable storage medium that can save the time of OTA upgrade and improve the success rate of upgrade.
In a first aspect, the present application provides a method for upgrading software of a vehicle-mounted controller, where the vehicle-mounted controller includes at least two external storage partitions, and the method includes:
Acquiring target software data to be refreshed;
determining one external storage partition of the at least two external storage partitions as a target partition, wherein data is not stored in the target partition, or the version of software data stored in the target partition is different from the version of current software data of the vehicle-mounted controller;
Writing the target software data into the target partition;
And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition.
In one embodiment, when the target software data written in the target partition passes the verification, upgrading the vehicle-mounted controller by using the target software data in the target partition includes:
determining whether the current state of the vehicle-mounted controller meets a preset condition;
Writing the target software data in the target partition into an internal storage partition of the vehicle-mounted controller under the condition that the current state of the vehicle-mounted controller meets the preset condition so as to upgrade the vehicle-mounted controller;
verifying target software data in the internal storage partition;
And under the condition that the verification of the target software data in the internal storage partition is passed, determining that the target software data is successfully written.
In one embodiment, after determining that the target software data is successfully written, the method for upgrading the vehicle-mounted controller software further includes:
marking the target partition as a new backup partition;
the determining that one of the at least two external storage partitions is the target partition includes: and taking an external storage partition except the backup partition as a new target partition.
In one embodiment, after determining that the target software data is successfully written, the method for upgrading the vehicle-mounted controller software further includes:
Acquiring version information of current software data in the internal storage partition;
And if the version information of the current software data in the internal storage partition is consistent with the version information of the target software data, determining that the vehicle-mounted controller is successfully upgraded.
In one embodiment, after the step of verifying the target software data in the internal storage partition, the method for upgrading the software of the vehicle-mounted controller further includes:
And under the condition that the verification of the target software data in the internal storage partition fails, writing the backup software data in the current backup partition into the internal storage partition of the vehicle-mounted controller, wherein the backup software data is the same as the software data before the vehicle-mounted controller does not write the target software data.
In one embodiment, after the step of writing the backup software data in the current backup partition into the internal storage partition of the in-vehicle controller, the in-vehicle controller software upgrade method further includes:
Acquiring version information of current software data in the internal storage partition;
And if the version information of the current software data in the internal storage partition is consistent with the version information of the backup software data, determining that the rollback of the vehicle-mounted controller is successful.
In a second aspect, the present application also provides an in-vehicle controller, including: a software upgrade control module, at least two external memory partitions, an internal memory partition, and a register, wherein,
The register is used for storing the flag bit of the backup partition, wherein the backup software data stored in the backup partition is the same as the software data before the vehicle-mounted controller is not upgraded;
The software upgrading control module is used for acquiring target software data to be refreshed; determining one external storage partition except the backup partition in the at least two external storage partitions as a target partition according to the flag bit of the backup partition stored in the register, and writing the target software data into the target partition; and under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition, wherein the target partition does not store data, or the version of the software data stored in the target partition is different from the version of the current software data of the vehicle-mounted controller.
In a third aspect, the present application also provides a software upgrading apparatus for a vehicle-mounted controller, where the vehicle-mounted controller includes at least two external storage partitions, and the apparatus includes:
The software acquisition module is used for acquiring target software data to be written;
The partition determining module is used for determining one external storage partition of the at least two external storage partitions as a target partition, wherein data are not stored in the target partition, or the version of software data stored in the target partition is different from the version of current software data of the vehicle-mounted controller;
The software writing module is used for writing the target software data into the target partition;
And the upgrade execution module is used for upgrading the vehicle-mounted controller by adopting the target software data in the target partition under the condition that the target software data written in the target partition passes verification.
In a fourth aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
Acquiring target software data to be refreshed;
determining one external storage partition of the at least two external storage partitions as a target partition, wherein data is not stored in the target partition, or the version of software data stored in the target partition is different from the version of current software data of the vehicle-mounted controller;
Writing the target software data into the target partition;
And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition.
In a fifth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Acquiring target software data to be refreshed;
determining one external storage partition of the at least two external storage partitions as a target partition, wherein data is not stored in the target partition, or the version of software data stored in the target partition is different from the version of current software data of the vehicle-mounted controller;
Writing the target software data into the target partition;
And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition.
The vehicle-mounted controller, the vehicle-mounted controller software upgrading method, the device, the computer equipment and the computer readable storage medium. The target software data to be refreshed is firstly obtained, and the target software data can be directly received from the cloud. And then determining one external storage partition in the at least two external storage partitions as a target partition, wherein the target partition needs to store no data, or even if the target partition stores software data, the version of the stored software data needs to be different from the version of the current software data of the vehicle-mounted controller, so that the backup data of the vehicle-mounted controller cannot be covered when the target partition is subjected to software refreshing, and the data can be conveniently rolled back when the subsequent upgrading fails. The target software data is then written to the target partition. And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition. Because the independent external storage partition is designed, the target software data is firstly written into the external storage partition instead of being directly written into the vehicle-mounted controller, so that normal use of the vehicle is not affected when the target software data in the target partition is written, and on the other hand, the vehicle-mounted controller is updated by the target software data in the target partition only after the target software data in the target partition passes verification, thereby ensuring the correctness of the target software data and improving the success rate of the updating.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments or the conventional techniques of the present application, the drawings required for the descriptions of the embodiments or the conventional techniques will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flow chart of a method of upgrading software of an on-board controller in one embodiment;
FIG. 2 is a block diagram of an in-vehicle controller in one embodiment;
FIG. 3 is a second flowchart of a method for upgrading software of an in-vehicle controller according to an embodiment;
FIG. 4 is a third flowchart of a method for upgrading software of an in-vehicle controller according to one embodiment;
FIG. 5 is a flow chart of a method for upgrading software of an in-vehicle controller in one embodiment;
FIG. 6 is a fifth flowchart of a method for upgrading software of an in-vehicle controller in one embodiment;
FIG. 7 is a flowchart of a method for upgrading software of an in-vehicle controller according to one embodiment;
FIG. 8 is a schematic diagram of a software upgrade apparatus for a vehicle-mounted controller according to an embodiment;
fig. 9 is an internal structural diagram of a computer device in one embodiment.
Reference numerals illustrate:
10-software upgrade control module, 20-external memory partition, 30-internal memory partition, 40-register,
Detailed Description
In order that the application may be readily understood, a more complete description of the application will be rendered by reference to the appended drawings. Embodiments of the application are illustrated in the accompanying drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It will be understood that when an element is referred to as being "connected" to another element, it can be directly connected to the other element or be connected to the other element through intervening elements. Further, "connection" in the following embodiments should be understood as "electrical connection", "communication connection", and the like if there is transmission of electrical signals or data between objects to be connected.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," and/or the like, specify the presence of stated features, integers, steps, operations, elements, components, or groups thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof.
In one embodiment, as shown in fig. 1, there is provided a software upgrade method for an in-vehicle controller, where the in-vehicle controller includes at least two external memory partitions, the method including: steps S100-130.
Step S100, obtaining target software data to be refreshed.
The vehicle may receive the target software data of the OTA through the vehicle-mounted communication device, may acquire information related to the OTA task from the cloud end, and download the target software data packet file from the cloud end, thereby acquiring the target software data to be refreshed, and then may send the target software data packet to the vehicle-mounted controller to be upgraded through the vehicle-mounted communication link (such as CAN or ethernet) for software refreshing.
The cloud, that is, the OTA cloud platform, may be formed by one or more servers. The OTA cloud platform is responsible for storing and releasing upgrade software packages of various vehicle-mounted controllers. The in-vehicle communication device refers to a device that can communicate with the cloud on the vehicle, and may be, for example, a remote communication Box (TELEMATICS BOX, T-Box) or a Gateway (i.e., gateway), etc. The communication network between the vehicle-mounted communication device and the cloud 110 may be a 4G network or a 5G network. The in-vehicle controller refers to a control unit of related electronic equipment in the vehicle, and can be various electronic control units (electronic control unit, ECU), remote information control units (transmission control unit, TCU), vehicle body control units (body control management, BCM) and the like. The in-vehicle communication link used between the in-vehicle controller and the in-vehicle communication device may be a controller area network (controller area network, CAN) bus, ethernet, or the like.
The structural block diagram of the vehicle-mounted controller provided by the application may be as shown in fig. 2, and the vehicle-mounted controller may include: a software upgrade control module 10, at least two external memory partitions 20, an internal memory partition 30, and registers 40. The software upgrade control module 10 may be used to control the flow of OTA upgrade, including communication with the OTA cloud, downloading of upgrade packages, decryption and verification, inspection of upgrade policies, management of upgrade processes, and the like. The external memory partition 20 (flash) serves as a memory for storing software data. The internal storage partition 30 (flash) may be a memory of the vehicle-mounted controller, which is a memory space operated when the vehicle-mounted controller works, and the external storage partition 20 may be refreshed by a controller Boot, and at least includes two external storage partitions 20, where one external storage partition 20 is used to store software data refreshed last time, that is, as a backup partition, and the other external storage partition 20 is used to store software data refreshed this time. The register 40 may be emulated by the NVM (non-volatile memory) to record the flag bit of the last external storage partition 20 that was flushed in order to determine which external storage partition 20 is the backup partition.
In step S110, it is determined that one of the at least two external storage partitions is the target partition.
The target partition does not store data, or the version of the software data stored in the target partition is different from the version of the current software data of the vehicle-mounted controller. Therefore, the target partition does not store data, or even if the target partition stores software data, but the version of the stored software data needs to be different from the version of the current software data of the vehicle-mounted controller, so that backup data of the vehicle-mounted controller cannot be covered when the target partition is subjected to software refreshing, that is, the target partition can be any partition except the backup partition.
When the vehicle-mounted controller is offline for first refreshing, the data stored in the target partition is empty, namely the data is not stored.
In step S120, the target software data is written into the target partition.
And the target software data is written into the storage space of the target partition.
And step S130, under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition.
The target software data written in the target partition can be verified, and then the verification result can be circularly read through the diagnosis instruction. When it is determined that software upgrading is required to be performed on the vehicle-mounted controller, the vehicle-mounted communication device sends an upgrading request to the cloud end and sends information such as a data length value, a check value and the like of an upgrading software package in upgrading task information to the vehicle-mounted controller. In the process of upgrading the software, the vehicle-mounted controller determines whether the data of the upgrading software package in the target partition is written according to the data length value in the upgrading task information, and verifies the data integrity of the target software data in the target storage partition according to the verification value information in the upgrading task information. The first check value in the upgrade task information may be a cyclic redundancy check (cyclic redundancycheck, CRC) value, and the vehicle-mounted controller may calculate a check value of the target software data packet according to the written data in the target partition through a CRC algorithm, record the calculated check value as a second check value, and determine whether the second check value is consistent with the first check value, so as to check the data integrity of the target software data packet in the target partition. If the second check value is consistent with the first check value, the data of the target software data packet in the target partition is not tampered in the transmission process, namely the written data is credible, and the check is passed. If the second check value is inconsistent with the first check value, the data of the target software data packet in the target partition is tampered in the transmission process, namely the written data is unreliable, the verification is failed, the written data of the target software data packet needs to be deleted, and the acquisition and the refreshing of the target software data packet are carried out again.
For example, in the case that verification of the target software data written in the target partition fails, the flush procedure is exited, and the vehicle-mounted controller is marked as a non-flush piece.
In this embodiment, the target software data to be refreshed may be obtained first, or the target software data may be directly received from the cloud. And then determining one external storage partition in the at least two external storage partitions as a target partition, wherein the target partition needs to store no data, or even if the target partition stores software data, the version of the stored software data needs to be different from the version of the current software data of the vehicle-mounted controller, so that backup data of the vehicle-mounted controller cannot be covered when the target partition is subjected to software refreshing, and the data can be conveniently rolled back when the subsequent upgrading fails. The target software data is then written to the target partition. And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition. Because the independent external storage partition is designed, the target software data is firstly written into the external storage partition instead of being directly written into the vehicle-mounted controller, so that normal use of the vehicle is not affected when the target software data in the target partition is written, and on the other hand, the vehicle-mounted controller is updated by the target software data in the target partition only after the target software data in the target partition passes verification, thereby ensuring the correctness of the target software data and improving the success rate of the updating.
In one embodiment, as shown in fig. 3, step S130 upgrades the in-vehicle controller with the target software data in the target partition if the target software data written in the target partition is verified. Comprising the following steps: steps S300-330.
Step S300, determining whether the current state of the vehicle-mounted controller satisfies a preset condition.
The preset condition may be to determine whether the current state of the vehicle-mounted controller meets an upgrade policy, for example, whether the vehicle needs to be upgraded according to basic information such as a name and a version number of upgrade software and basic information such as a name and a version number of currently running software in the vehicle-mounted controller, and when determining that the vehicle needs to be upgraded, perform man-machine interaction with a user (driver), and finally select whether to be upgraded by the user, and select upgrade time by the user, where the preset condition is that the user selects upgrade and reaches user selection time. After the vehicle-mounted controller finishes upgrading, human-computer interaction is performed with the user, and the preset conditions can be specifically set according to actual situations or scenes without limitation.
And step S310, when the current state of the vehicle-mounted controller meets the preset condition, writing the target software data in the target partition into the internal storage partition of the vehicle-mounted controller so as to upgrade the vehicle-mounted controller.
The method comprises the steps of writing target software data in a target partition into an internal storage partition of the vehicle-mounted controller, wherein the internal storage partition is a memory of the vehicle-mounted controller and is a memory space operated when the vehicle-mounted controller works, so that the target software data is written into the internal storage partition of the vehicle-mounted controller, namely, the vehicle-mounted controller is updated.
Step S320, verifying the target software data in the internal storage partition.
The checking can be in a cyclic redundancy check mode, and the checking result of the internal storage partition is circularly read to judge whether the target software data in the internal storage partition passes the checking.
Step S330, determining that the target software data is successfully written when the target software data in the internal storage partition passes the verification.
In this embodiment, when the vehicle-mounted controller meets the preset condition, the target software data in the target partition is written into the internal storage partition of the vehicle-mounted controller, so that the vehicle-mounted controller is updated, and the internal storage partition is directly written from the target partition, so that the brushing speed is faster than the writing speed when the internal storage partition is written from the cloud.
In one embodiment, as shown in FIG. 4, at step S330, it is determined that the target software data flush was successful. Then, the vehicle-mounted controller software upgrading method further comprises the following steps: in step S340, the target partition is marked as a new backup partition.
The flag bit of the backup partition stored in the register may be modified to be the flag bit of the target partition. For example, the external storage partition includes a region a and a region B, the last backup partition is a region a, so the flag bit of the backup partition stored in the register is a region a, but after the target software data is successfully written, the current target partition is a region B, so the latest target software data is stored in a region B, so the flag bit of the backup partition stored in the register is modified into a region B.
Step S110, determining one external storage partition of the at least two external storage partitions as a target partition, includes: an external storage partition other than the backup partition is taken as a new target partition.
In this embodiment, after the target software data is successfully written, the target software data is stored in the internal memory partition of the in-vehicle controller. And the target partition also stores target software data, so that the target partition is used as a current backup partition to store the target software data which is the same as the current version of the vehicle-mounted controller, and the backup of the data is realized.
In one embodiment, as shown in FIG. 5, at step S330, it is determined that the target software data flush was successful. Then, the vehicle-mounted controller software upgrading method further comprises the following steps: steps S350-370.
In step S350, version information of current software data in the internal storage partition is acquired.
The version information of the current software data may be a version number of the current software data.
Step S360, if the version information of the current software data in the internal storage partition is consistent with the version information of the target software data, the vehicle-mounted controller is determined to be successfully upgraded.
For example, if the version number of the current software data in the internal storage partition is V6.1 and the version number of the target software data is V6.1.2, it is determined that the version information of the current software data in the internal storage partition is inconsistent with the version information of the target software data, and the version number of the software data in the internal storage partition is wrong and is not the version that needs to be upgraded. If the version number of the current software data in the internal storage partition is V6.1 and the version number of the target software data is V6.1, judging that the version information of the current software data in the internal storage partition is consistent with the version information of the target software data, and representing that the software upgrading of the vehicle-mounted controller is successful.
In step S370, if the version information of the current software data in the internal storage partition is inconsistent with the version information of the target software data, it is determined that the upgrade of the vehicle-mounted controller fails.
If the vehicle-mounted controller is located on the production line, and if it is determined that the version information of the current software data in the internal storage partition is inconsistent with the version information of the target software data, the software refreshing of the vehicle-mounted controller fails, and the software refreshing is required to be refreshed or the cause of the failure is analyzed.
In this embodiment, whether the software of the vehicle-mounted controller is successfully upgraded may be determined according to the version number of the current software data in the internal memory partition of the vehicle-mounted controller.
In one embodiment, as shown in FIG. 6, at step S320, target software data in the internal storage partition is verified. Then, the vehicle-mounted controller software upgrading method further comprises the following steps:
And step S380, under the condition that the verification of the target software data in the internal storage partition fails, the backup software data in the current backup partition is written into the internal storage partition of the vehicle-mounted controller.
The backup software data are the same as the software data before the vehicle-mounted controller writes the target software data.
In this embodiment, when the verification of the target software data in the internal storage partition fails, data rollback is required, that is, the backup software data in the current backup partition is written into the internal storage partition of the vehicle-mounted controller, and the version of the software data in the internal storage partition of the vehicle-mounted controller is restored to the software version before the target software data is not written. Therefore, the software version is returned to the version state before the upgrading, and the related functions of the vehicle-mounted controller can be ensured to be normally used.
In one embodiment, as shown in fig. 7, in step S380, after that, the on-board controller software upgrade method further includes:
Step S400, the version information of the current software data in the internal storage partition is acquired.
In step S410, if the version information of the current software data in the internal storage partition is consistent with the version information of the backup software data, it is determined that the rollback of the vehicle-mounted controller is successful.
Step S420, if the version information of the current software data in the internal storage partition is inconsistent with the version information of the backup software data, determining that the rollback of the vehicle-mounted controller fails.
In this embodiment, whether the software of the vehicle-mounted controller rolls back successfully may be determined according to whether the version number of the current software data in the internal storage partition of the vehicle-mounted controller is consistent with the version of the backup software data.
It should be understood that, although the steps in the flowcharts of fig. 1, 3-7 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps of FIGS. 1, 3-7 may include steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the steps or stages in other steps.
In one embodiment, please continue to refer to fig. 2, the present application provides an in-vehicle controller, which includes: a software upgrade control module 10, at least two external memory partitions 20, an internal memory partition 30, a register 40, wherein,
The register 40 is used to store the flag bit of the backup partition.
The backup software data stored in the backup partition are the same as the software data before the vehicle-mounted controller is not upgraded. The backup partition is one of at least two external storage partitions 20.
The software upgrade control module 10 is used for acquiring target software data to be written. And determining one external storage partition 20 except the backup partition in the at least two external storage partitions 20 as a target partition according to the flag bit of the backup partition stored in the register 40, and writing target software data into the target partition. And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition.
The target partition does not store data, or the version of the software data stored in the target partition is different from the version of the current software data of the vehicle-mounted controller. Therefore, the target partition does not store data, or even if the target partition stores software data, but the version of the stored software data needs to be different from the version of the current software data of the vehicle-mounted controller, so that backup data of the vehicle-mounted controller cannot be covered when the target partition is subjected to software refreshing, that is, the target partition can be any partition except the backup partition.
In this embodiment, by setting the software upgrade control module, the target software data to be refreshed may be obtained, or the target software data may be directly received from the cloud. And then determining one external storage partition in at least two external storage partitions as a target partition according to the flag bit of the backup partition stored in the register, wherein the target partition needs to store no data or stores software data even though the version of the stored software data is different from the version of the current software data of the vehicle-mounted controller, so that the backup data of the vehicle-mounted controller cannot be covered when the target partition is subjected to software refreshing, and the data can be conveniently rolled back when the subsequent upgrading fails. The target software data is then written to the target partition. And under the condition that the verification of the target software data written in the target partition passes, upgrading the vehicle-mounted controller by adopting the target software data in the target partition. Because the independent external storage partition is designed, the target software data is firstly written into the external storage partition instead of being directly written into the vehicle-mounted controller, so that normal use of the vehicle is not affected when the target software data in the target partition is written, and on the other hand, the vehicle-mounted controller is updated by the target software data in the target partition only after the target software data in the target partition passes verification, thereby ensuring the correctness of the target software data and improving the success rate of the updating.
In one embodiment, as shown in fig. 8, there is provided an in-vehicle controller software upgrade apparatus, the in-vehicle controller including at least two external memory partitions, the apparatus including: a software acquisition module 801, a partition determination module 802, a software writing module 803, an upgrade execution module 804, wherein:
A software obtaining module 801, configured to obtain target software data to be written.
The partition determining module 802 is configured to determine one external storage partition of the at least two external storage partitions as a target partition, where no data is stored in the target partition, or a version of software data stored in the target partition is different from a version of current software data of the vehicle-mounted controller.
A software writing module 803 for writing the target software data to the target partition.
And the upgrade execution module 804 is configured to upgrade the vehicle-mounted controller by using the target software data in the target partition if the target software data written in the target partition passes the verification.
In one embodiment, the upgrade execution module 804 includes: the device comprises a condition judging unit, a refreshing unit, a checking unit and a refreshing judging unit, wherein:
And the condition judging unit is used for determining whether the current state of the vehicle-mounted controller meets the preset condition.
And the refreshing unit is used for writing the target software data in the target partition into the internal storage partition of the vehicle-mounted controller under the condition that the current state of the vehicle-mounted controller meets the preset condition so as to upgrade the vehicle-mounted controller.
And the verification unit is used for verifying the target software data in the internal storage partition.
And the refreshing judgment unit is used for determining that the refreshing of the target software data is successful under the condition that the verification of the target software data in the internal storage partition is passed.
The specific limitation of the on-board controller software upgrading device can be referred to the limitation of the on-board controller software upgrading method hereinabove, and will not be repeated here. The modules in the vehicle-mounted controller software upgrading device can be realized in whole or in part through software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method for upgrading software of a vehicle-mounted controller.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
In the description of the present specification, reference to the terms "some embodiments," "other embodiments," "desired embodiments," and the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1.一种车载控制器软件升级方法,其特征在于,所述车载控制器至少包括两个外部存储分区,所述方法包括:1. A method for upgrading the software of an on-board controller, characterized in that the on-board controller includes at least two external storage partitions, and the method comprises: 获取待刷写的目标软件数据;Obtain the target software data to be flashed; 确定所述至少两个外部存储分区中的一个外部存储分区为目标分区,其中,所述目标分区内未存储数据,或者所述目标分区内存储的软件数据的版本与所述车载控制器的当前软件数据的版本不同;Determine one of the at least two external storage partitions as a target partition, wherein no data is stored in the target partition, or a version of software data stored in the target partition is different from a version of current software data of the vehicle-mounted controller; 将所述目标软件数据写入所述目标分区;Writing the target software data into the target partition; 在所述目标分区内写入的所述目标软件数据校验通过的情况下,采用所述目标分区内的所述目标软件数据升级所述车载控制器。In the case where the target software data written in the target partition passes verification, the target software data in the target partition is used to upgrade the vehicle controller. 2.根据权利要求1所述的车载控制器软件升级方法,其特征在于,所述在所述目标分区内写入的所述目标软件数据校验通过的情况下,采用所述目标分区内的所述目标软件数据升级所述车载控制器,包括:2. The vehicle controller software upgrade method according to claim 1, characterized in that, when the target software data written in the target partition passes the verification, the vehicle controller is upgraded using the target software data in the target partition, comprising: 确定所述车载控制器的当前状态是否满足预设条件;Determining whether the current state of the vehicle controller meets a preset condition; 在所述车载控制器的当前状态满足预设条件的情况下,将所述目标分区内的所述目标软件数据写入所述车载控制器的内部存储分区中,以对所述车载控制器进行升级;When the current state of the vehicle-mounted controller meets a preset condition, writing the target software data in the target partition into an internal storage partition of the vehicle-mounted controller to upgrade the vehicle-mounted controller; 对所述内部存储分区中的目标软件数据进行校验;Verifying the target software data in the internal storage partition; 在所述内部存储分区中的目标软件数据校验通过的情况下,确定所述目标软件数据刷写成功。When the target software data in the internal storage partition passes the verification, it is determined that the target software data is successfully flashed. 3.根据权利要求2所述的车载控制器软件升级方法,其特征在于,在确定所述目标软件数据刷写成功之后,所述方法还包括:3. The vehicle controller software upgrade method according to claim 2, characterized in that after determining that the target software data is successfully flashed, the method further comprises: 将所述目标分区标记为新的备份分区;Marking the target partition as a new backup partition; 所述确定所述至少两个外部存储分区中的一个外部存储分区为目标分区,包括:将除所述备份分区之外的一个外部存储分区作为新的目标分区。The determining one of the at least two external storage partitions as the target partition includes: taking an external storage partition other than the backup partition as a new target partition. 4.根据权利要求3所述的车载控制器软件升级方法,其特征在于,在确定所述目标软件数据刷写成功之后,所述方法还包括:4. The vehicle controller software upgrade method according to claim 3, characterized in that after determining that the target software data is successfully flashed, the method further comprises: 获取所述内部存储分区中的当前软件数据的版本信息;Obtaining version information of current software data in the internal storage partition; 若所述内部存储分区中的当前软件数据的版本信息与所述目标软件数据的版本信息一致,则确定所述车载控制器升级成功。If the version information of the current software data in the internal storage partition is consistent with the version information of the target software data, it is determined that the vehicle controller is upgraded successfully. 5.根据权利要求2所述的车载控制器软件升级方法,其特征在于,在所述对所述内部存储分区中的目标软件数据进行校验的步骤之后,所述方法还包括:5. The vehicle controller software upgrade method according to claim 2, characterized in that after the step of verifying the target software data in the internal storage partition, the method further comprises: 在所述内部存储分区中的目标软件数据校验失败的情况下,将当前的备份分区内的备份软件数据写入所述车载控制器的内部存储分区中,其中,所述备份软件数据与所述车载控制器未写入所述目标软件数据之前的软件数据相同。In the event that verification of the target software data in the internal storage partition fails, the backup software data in the current backup partition is written into the internal storage partition of the vehicle controller, wherein the backup software data is identical to the software data of the vehicle controller before the target software data is written. 6.根据权利要求5所述的车载控制器软件升级方法,其特征在于,在将当前的备份分区内的备份软件数据写入所述车载控制器的内部存储分区中的步骤之后,所述方法还包括:6. The vehicle controller software upgrade method according to claim 5, characterized in that after the step of writing the backup software data in the current backup partition into the internal storage partition of the vehicle controller, the method further comprises: 获取所述内部存储分区中的当前软件数据的版本信息;Obtaining version information of current software data in the internal storage partition; 若所述内部存储分区中的当前软件数据的版本信息与所述备份软件数据的版本信息一致,则确定所述车载控制器回滚成功。If the version information of the current software data in the internal storage partition is consistent with the version information of the backup software data, it is determined that the rollback of the vehicle controller is successful. 7.一种车载控制器,其特征在于,所述车载控制器包括:软件升级控制模块、至少两个外部存储分区、内部存储分区、寄存器,其中,7. A vehicle-mounted controller, characterized in that the vehicle-mounted controller comprises: a software upgrade control module, at least two external storage partitions, an internal storage partition, and a register, wherein: 所述寄存器用于存储备份分区的标志位,其中,所述备份分区内存储的备份软件数据与所述车载控制器未进行升级前的软件数据相同;The register is used to store a flag bit of a backup partition, wherein the backup software data stored in the backup partition is the same as the software data of the vehicle controller before the upgrade; 所述软件升级控制模块用于获取待刷写的目标软件数据;根据所述寄存器存储的备份分区的标志位,确定所述至少两个外部存储分区中除所述备份分区之外的一个外部存储分区为目标分区,将所述目标软件数据写入所述目标分区;在所述目标分区内写入的所述目标软件数据校验通过的情况下,采用所述目标分区内的所述目标软件数据升级所述车载控制器,其中,所述目标分区内未存储数据,或者所述目标分区内存储的软件数据的版本与所述车载控制器的当前软件数据的版本不同。The software upgrade control module is used to obtain the target software data to be flashed; according to the flag bit of the backup partition stored in the register, determine that one of the at least two external storage partitions other than the backup partition is the target partition, and write the target software data into the target partition; if the target software data written in the target partition is verified, use the target software data in the target partition to upgrade the vehicle-mounted controller, wherein no data is stored in the target partition, or the version of the software data stored in the target partition is different from the version of the current software data of the vehicle-mounted controller. 8.一种车载控制器软件升级装置,其特征在于,所述车载控制器至少包括两个外部存储分区,所述装置包括:8. A vehicle controller software upgrade device, characterized in that the vehicle controller includes at least two external storage partitions, and the device includes: 软件获取模块,用于获取待刷写的目标软件数据;A software acquisition module is used to acquire target software data to be flashed; 分区确定模块,用于确定所述至少两个外部存储分区中的一个外部存储分区为目标分区,其中,所述目标分区内未存储数据,或者所述目标分区内存储的软件数据的版本与所述车载控制器的当前软件数据的版本不同;a partition determination module, configured to determine one of the at least two external storage partitions as a target partition, wherein no data is stored in the target partition, or a version of software data stored in the target partition is different from a version of current software data of the vehicle-mounted controller; 软件写入模块,用于将所述目标软件数据写入所述目标分区;A software writing module, used for writing the target software data into the target partition; 升级执行模块,用于在所述目标分区内写入的所述目标软件数据校验通过的情况下,采用所述目标分区内的所述目标软件数据升级所述车载控制器。The upgrade execution module is used to upgrade the vehicle-mounted controller using the target software data in the target partition if the target software data written in the target partition passes verification. 9.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6中任一项所述的方法的步骤。9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
CN202411071840.7A 2024-08-06 2024-08-06 Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment Pending CN118916056A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411071840.7A CN118916056A (en) 2024-08-06 2024-08-06 Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411071840.7A CN118916056A (en) 2024-08-06 2024-08-06 Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment

Publications (1)

Publication Number Publication Date
CN118916056A true CN118916056A (en) 2024-11-08

Family

ID=93300985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411071840.7A Pending CN118916056A (en) 2024-08-06 2024-08-06 Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment

Country Status (1)

Country Link
CN (1) CN118916056A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119271245A (en) * 2024-12-06 2025-01-07 浙江吉利控股集团有限公司 OTA update rollback method, device, storage medium and program product
CN120179272A (en) * 2025-05-22 2025-06-20 思翼科技(深圳)有限公司 Firmware upgrade backup method, system and storage medium based on external Flash

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119271245A (en) * 2024-12-06 2025-01-07 浙江吉利控股集团有限公司 OTA update rollback method, device, storage medium and program product
CN120179272A (en) * 2025-05-22 2025-06-20 思翼科技(深圳)有限公司 Firmware upgrade backup method, system and storage medium based on external Flash

Similar Documents

Publication Publication Date Title
CN118916056A (en) Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment
CN114895947A (en) Software upgrading method, device, equipment and storage medium of vehicle-mounted controller
CN110244958B (en) Method and device for updating calibration data of a vehicle
CN110659038B (en) Vehicle-mounted millimeter wave radar upgrading method and device, computer equipment and storage medium
CN114915554A (en) Remote upgrading method and device, computer equipment and storage medium
US12461732B2 (en) Ota master, system, method, non-transitory storage medium, and vehicle
US12190100B2 (en) OTA software update based on ECU non-volatile memory type
CN113672258A (en) System upgrade method, device, computer equipment and storage medium of vehicle
CN116400944A (en) Flashing method, device, electronic device, vehicle and storage medium for vehicle system
CN116866172A (en) Diagnostic flashing system, method, device and medium in automobile OTA upgrading process
CN118400266A (en) Vehicle remote upgrade method, device, equipment, medium and program product
US20220244946A1 (en) Ota master, update control method, non-transitory storage medium, and vehicle
KR102275142B1 (en) Update system and method of controller for vehicle
CN117407020A (en) OTA upgrade refreshing method and device, electronic equipment and storage medium
US12307230B2 (en) Over-the-air (OTA) master, center, system, method, non-transitory storage medium, and vehicle
CN110704076A (en) Data processing method and device, vehicle-mounted controller and computer-readable storage medium
CN113176891B (en) Bootloader-based ECU (electronic control Unit) program programming method with backup function
JP2007287022A (en) Information storage method for electronic control unit
WO2025161499A1 (en) Ecu firmware upgrade method, apparatus, and system, vehicle, and storage medium
CN113434163B (en) Online calibration method, system, device and medium suitable for electronic control unit
CN112379909A (en) Method, device and equipment for refreshing combination instrument program and storage medium
CN115543388A (en) A kind of OTA flashing method of CAN-ECU
CN113254031A (en) Domain controller OTA self-checking system and method and computer storage medium
US12481495B2 (en) Firmware update method of a flash bootloader in a micro controller unit for a vehicle
CN112578772A (en) Data processing method of electronic control unit and related device

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