Vehicle-mounted controller, vehicle-mounted controller software upgrading method, device and equipment
By designing multiple external storage partitions in the on-board controller, writing and verifying the software data first, then upgrading, the problem of long upgrade time and low success rate of on-board controller software is solved, and more efficient and reliable upgrades are achieved process.
Patent Information
- Application Number
- CN202411071840.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, the on-board controller software upgrade process is long, which affects the user experience, and the upgrade success rate is not high.
Design a software upgrade method for on-board controllers, using at least two external storage partitions, first write the target software data to the target partition, and then pass the verification in the partition, then upgrade the on-board controller to ensure the correctness of the data and success rate.
Through partition design, the upgrade time is shortened, the upgrade success rate is improved, and a rollback mechanism is provided when the upgrade fails to ensure the stability of the vehicle's functions.
Smart Images

Figure CN118916056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle-mounted controller, a vehicle-mounted controller software upgrade method, a device, a computer device, and a computer-readable storage medium. Background Art
[0002] With the development of vehicle technology, in order to speed up the iteration of vehicle models, many automobile manufacturers currently use over-the-air technology (OTA) to realize the phased implementation of automobile functions. The more common practice is: only provide basic driving functions when the vehicle is launched on the market, and then push software with intelligent driving functions to users' vehicles through OTA a few months later, so as to remotely upgrade the vehicle functions through this software.
[0003] In the prior art, after the upgrade software package is downloaded, the vehicle controller is directly flashed using the upgrade software package.
[0004] However, depending on the size of the upgrade software package, the process of directly using the upgrade software package to flash the vehicle controller generally takes several minutes to tens of minutes, and during this process the user cannot use related functions or the vehicle. The entire process takes a long time, affecting the user experience. Summary of the invention
[0005] Based on this, it is necessary to provide a vehicle-mounted controller, a vehicle-mounted controller software upgrade method, an apparatus, a computer device, and a computer-readable storage medium that can save OTA upgrade time and improve the upgrade success rate in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a method for upgrading software of an on-board controller, wherein the on-board controller includes at least two external storage partitions, and the method includes:
[0007] Obtain the target software data to be flashed;
[0008] 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;
[0009] Writing the target software data into the target partition;
[0010] 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.
[0011] In one embodiment, when the target software data written in the target partition passes verification, upgrading the vehicle controller using the target software data in the target partition includes:
[0012] Determining whether the current state of the vehicle controller meets a preset condition;
[0013] 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;
[0014] Verifying the target software data in the internal storage partition;
[0015] When the target software data in the internal storage partition passes the verification, it is determined that the target software data is successfully flashed.
[0016] In one embodiment, after determining that the target software data is successfully flashed, the vehicle controller software upgrade method further includes:
[0017] Marking the target partition as a new backup partition;
[0018] 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.
[0019] In one embodiment, after determining that the target software data is successfully flashed, the vehicle controller software upgrade method further includes:
[0020] Obtaining version information of current software data in the internal storage partition;
[0021] 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.
[0022] In one of the embodiments, after the step of verifying the target software data in the internal storage partition, the vehicle controller software upgrade method further includes:
[0023] 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.
[0024] In one embodiment, after the step of writing the backup software data in the current backup partition into the internal storage partition of the vehicle controller, the vehicle controller software upgrade method further includes:
[0025] Obtaining version information of current software data in the internal storage partition;
[0026] 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.
[0027] In a second aspect, the present application further provides a vehicle-mounted controller, the vehicle-mounted controller comprising: a software upgrade control module, at least two external storage partitions, an internal storage partition, and a register, wherein:
[0028] 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;
[0029] 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.
[0030] In a third aspect, the present application further provides a vehicle controller software upgrade device, wherein the vehicle controller includes at least two external storage partitions, and the device includes:
[0031] A software acquisition module is used to acquire target software data to be flashed;
[0032] 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;
[0033] A software writing module, used for writing the target software data into the target partition;
[0034] 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.
[0035] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Obtain the target software data to be flashed;
[0037] 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;
[0038] Writing the target software data into the target partition;
[0039] 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.
[0040] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Obtain the target software data to be flashed;
[0042] 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;
[0043] Writing the target software data into the target partition;
[0044] 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.
[0045] The above-mentioned vehicle-mounted controller, vehicle-mounted controller software upgrade method, device, computer equipment, and computer-readable storage medium. First, the target software data to be flashed is obtained, and the target software data can be directly received from the cloud. Then, one of the at least two external storage partitions is determined as the target partition, and the target partition needs to have no data stored, or even if the software data is stored in the target partition, 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 as to ensure that when the software is flashed to the target partition, the backup data of the vehicle-mounted controller will not be overwritten, so that the data can be rolled back when the subsequent upgrade fails. Then the target software data is written to the target partition. When the target software data written in the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle-mounted controller. Due to the design of an independent external storage partition, the target software data is first flashed into the external storage partition instead of directly flashed into the vehicle-mounted controller, so that the normal use of the vehicle is not affected when 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0047] FIG1 is a flow chart of a method for upgrading vehicle controller software in one embodiment;
[0048] FIG2 is a block diagram of a vehicle-mounted controller in one embodiment;
[0049] FIG3 is a second flowchart of a method for upgrading the software of a vehicle controller in one embodiment;
[0050] FIG4 is a third flow chart of a method for upgrading the software of a vehicle controller in one embodiment;
[0051] FIG5 is a fourth flow chart of a method for upgrading the software of a vehicle controller in one embodiment;
[0052] FIG6 is a fifth flowchart of a method for upgrading the software of a vehicle controller in one embodiment;
[0053] FIG7 is a sixth flowchart of a method for upgrading the software of a vehicle controller in one embodiment;
[0054] FIG8 is a schematic diagram of the structure of a vehicle controller software upgrade device in one embodiment;
[0055] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment.
[0056] Description of reference numerals:
[0057] 10-software upgrade control module, 20-external storage partition, 30-internal storage partition, 40-register, DETAILED DESCRIPTION
[0058] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0060] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element, or connected to the other element through an intermediate element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is transmission of electrical signals or data between the connected objects.
[0061] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.
[0062] In one embodiment, as shown in FIG. 1 , a method for upgrading software of an on-board controller is provided. The on-board controller includes at least two external storage partitions. The method includes steps S100 - 130 .
[0063] Step S100, obtaining target software data to be flashed.
[0064] Among them, the vehicle can receive the target software data of OTA through the on-board communication equipment, and can obtain OTA task-related information from the cloud, and download the target software data packet file from the cloud to obtain the target software data to be flashed, and then the target software data packet can be sent to the on-board controller to be upgraded through the in-vehicle communication link (such as CAN or Ethernet) for software flashing.
[0065] Among them, the cloud, that is, the OTA cloud platform, can be composed of one or more servers. The OTA cloud platform is responsible for the storage and release of upgrade software packages for various vehicle-mounted controllers. The vehicle-mounted communication device refers to a device on the vehicle that can communicate with the cloud. For example, it can be a telematics box (T-Box) or a gateway (i.e., Gateway). The communication network between the vehicle-mounted communication device and the cloud 110 can be a 4G network or a 5G network. The vehicle-mounted controller refers to the control unit of the relevant electronic equipment in the vehicle, which can be various electronic control units (ECU), telematic control units (TCU) or body control units (BCM). The in-vehicle communication link used between the vehicle-mounted controller and the vehicle-mounted communication device can be a controller area network (CAN) bus or Ethernet, etc.
[0066] Among them, the structural block diagram of the vehicle controller provided by the present application can be shown in Figure 2, and the vehicle controller can include: a software upgrade control module 10, at least two external storage partitions 20, an internal storage partition 30, and a register 40. The software upgrade control module 10 can be used to control the process of OTA upgrade, including communication with the OTA cloud, downloading, decrypting and verifying the upgrade package, checking the upgrade strategy, and managing the upgrade process. The external storage partition 20 (flash) is used as a memory to store software data. The internal storage partition 30 (flash) can be the memory of the vehicle controller, which is the memory space running when the vehicle controller is working. The external storage partition 20 can be flashed through the controller Boot, including at least two external storage partitions 20, one of which is used to store the software data flashed last time, that is, as a backup partition, and the other external storage partition 20 is used to store the software data flashed this time. The register 40 can be simulated by NVM (non-volatile memory), which is used to record the flag of the external storage partition 20 that was flashed last time, so as to determine which external storage partition 20 is the backup partition.
[0067] Step S110: determining one of at least two external storage partitions as a target partition.
[0068] There is no data 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 controller. Therefore, there is no data stored in the target partition, or even if the software data is stored in the target partition, the version of the stored software data needs to be different from the version of the current software data of the vehicle controller, so as to ensure that the backup data of the vehicle controller will not be overwritten when the software is flashed to the target partition, that is, the target partition can be any partition except the backup partition.
[0069] Among them, when the vehicle controller is offline and flashed for the first time, the data stored in the target partition is empty, that is, no data is stored.
[0070] Step S120, writing the target software data into the target partition.
[0071] Among them, the target software data can be flashed into the storage space of the target partition.
[0072] Step S130 , when the target software data written in the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle controller.
[0073] Among them, the target software data written in the target partition can be verified, and then the verification result can be read cyclically through the diagnostic instruction. It can be that when it is determined that the vehicle controller needs to be upgraded, the vehicle communication device sends the upgrade request to the cloud, and sends the data length value and verification value of the upgrade software package in the upgrade task information to the vehicle controller. In the process of software upgrade, the vehicle controller determines whether the data of the upgrade software package in the target partition is written according to the data length value in the upgrade 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 upgrade task information. The first verification value in the upgrade task information can be a cyclic redundancy check (CRC) value. The vehicle controller can calculate the verification value of the target software data packet according to the data written in the target partition through the CRC algorithm, record it as the second verification value, and determine whether the second verification value is consistent with the first verification value, and verify the data integrity of the target software data packet in the target partition. If the second verification value is consistent with the first verification value, it means that the data of the target software data packet in the target partition has not been tampered with during the transmission process, that is, the written data is credible, and the verification is passed. If the second check value is inconsistent with the first check value, it means that the data of the target software data package in the target partition has been tampered with during the transmission process, that is, the written data is unreliable, and the verification fails. It is necessary to delete the data of the written target software data package and re-acquire and flash the target software data package.
[0074] For example, when verification of the target software data written in the target partition fails, the flashing process is exited and the vehicle controller is marked as a component that cannot be flashed.
[0075] In this embodiment, the target software data to be flashed is first obtained, and the target software data can be directly received from the cloud. Then, one of the at least two external storage partitions is determined as the target partition, and the target partition needs to have no data stored, or even if the software data is stored in the target partition, the version of the stored software data needs to be different from the version of the current software data of the vehicle controller, so as to ensure that when the software is flashed to the target partition, the backup data of the vehicle controller will not be overwritten, so that the data can be rolled back when the subsequent upgrade fails. Then the target software data is written to the target partition. When the target software data written in the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle controller. Since an independent external storage partition is designed, the target software data is first flashed into the external storage partition instead of directly flashed into the vehicle controller, so that the normal use of the vehicle is not affected when 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 controller, which ensures the correctness of the target software data and improves the success rate of the upgrade.
[0076] In one embodiment, as shown in FIG3 , step S130 , when the target software data written in the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle controller, including steps S300 - 330 .
[0077] Step S300, determining whether the current state of the vehicle controller meets a preset condition.
[0078] Among them, the preset condition can be to determine whether the current state of the vehicle controller meets the upgrade strategy. For example, it can first determine whether the vehicle needs to be upgraded based on the basic information such as the name and version number of the upgrade software and the name and version number of the currently running software in the vehicle controller. When it is determined that the vehicle needs to be upgraded, human-computer interaction is performed with the user (driver), and the user ultimately chooses whether to upgrade and the time to upgrade, etc. The preset condition is that the user chooses to upgrade and the user-selected time has arrived. After the vehicle controller completes the upgrade, human-computer interaction is performed with the user. The preset conditions can be set according to the actual situation or scenario, and there is no restriction here.
[0079] Step S310, when the current state of the vehicle-mounted controller meets the preset conditions, the target software data in the target partition is written into the internal storage partition of the vehicle-mounted controller to upgrade the vehicle-mounted controller.
[0080] Among them, the target software data in the target partition is written into the internal storage partition of the vehicle controller, and the internal storage partition is the memory of the vehicle controller, which is the memory space running when the vehicle controller is working. Therefore, writing the target software data into the internal storage partition of the vehicle controller means upgrading the vehicle controller.
[0081] Step S320, verifying the target software data in the internal storage partition.
[0082] The verification may be performed in the form of a cyclic redundancy check, in which the verification result of the internal storage partition is read cyclically to determine whether the target software data in the internal storage partition passes the verification.
[0083] Step S330 , when the target software data in the internal storage partition passes verification, it is determined that the target software data is successfully flashed.
[0084] In this embodiment, when the vehicle-mounted controller meets the preset conditions, the target software data in the target partition is written into the internal storage partition of the vehicle-mounted controller to upgrade the vehicle-mounted controller. Since the internal storage partition is written directly from the target partition, the flashing speed is faster than writing from the cloud to the internal storage partition.
[0085] In one embodiment, as shown in FIG4 , at step S330 , it is determined that the target software data is successfully flashed. Afterwards, the vehicle controller software upgrade method further includes: step S340 , marking the target partition as a new backup partition.
[0086] Among them, the flag bit of the backup partition stored in the register can be modified to the flag bit of the target partition. For example, the external storage partition includes area A and area B, and the previous backup partition is area A, so the flag bit of the backup partition stored in the register is area A, but after the target software data is successfully flashed, the current target partition is area B, so the latest target software data is stored in area B, so the flag bit of the backup partition stored in the register is modified to area B.
[0087] Step S110, determining one of the at least two external storage partitions as a target partition, includes: taking an external storage partition other than the backup partition as a new target partition.
[0088] In this embodiment, after the target software data is successfully flashed, the internal storage partition of the vehicle controller contains the target software data. The target partition also stores the target software data. Therefore, the target partition is used as the current backup partition to store the target software data of the same version as the current version of the vehicle controller, thereby realizing data backup.
[0089] In one embodiment, as shown in FIG5 , at step S330 , it is determined that the target software data is successfully flashed. Afterwards, the vehicle controller software upgrade method further includes: steps S350 - 370 .
[0090] Step S350, obtaining version information of current software data in the internal storage partition.
[0091] The version information of the current software data may be the version number of the current software data.
[0092] 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, it is determined that the vehicle controller is upgraded successfully.
[0093] 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 it 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, it is determined 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, indicating that the software upgrade of the vehicle controller is successful.
[0094] 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 controller has failed.
[0095] Among them, if the vehicle controller is on the production line, when 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 flashing of the vehicle controller fails and needs to be re-flashed or re-flashed after analyzing the cause of the failure.
[0096] In this embodiment, whether the software of the vehicle controller is successfully upgraded can be determined according to the version number of the current software data in the internal storage partition of the vehicle controller.
[0097] In one embodiment, as shown in FIG6 , in step S320 , the target software data in the internal storage partition is verified. Thereafter, the vehicle controller software upgrade method further includes:
[0098] Step S380: When the target software data in the internal storage partition fails to be verified, the backup software data in the current backup partition is written into the internal storage partition of the vehicle controller.
[0099] The backup software data is the same as the software data before the target software data is written into the vehicle controller.
[0100] In this embodiment, when the target software data in the internal storage partition fails to be verified, 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 controller, and the version of the software data in the internal storage partition of the vehicle controller is restored to the software version before the target software data is written. In this way, the software version is rolled back to the version state before the upgrade, ensuring that the relevant functions of the vehicle controller can be used normally.
[0101] In one embodiment, as shown in FIG. 7 , after step S380, the vehicle controller software upgrade method further includes:
[0102] Step S400, obtaining version information of current software data in the internal storage partition.
[0103] 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 controller is successful.
[0104] 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, it is determined that the rollback of the vehicle controller has failed.
[0105] In this embodiment, whether the software of the vehicle controller is successfully rolled back can be determined based on whether the version number of the current software data in the internal storage partition of the vehicle controller is consistent with the version of the backup software data.
[0106] It should be understood that, although the various steps in the flowcharts of Figures 1, 3-7 are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in Figures 1, 3-7 may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0107] In one embodiment, please continue to refer to FIG. 2 , the present application provides a vehicle-mounted controller, the vehicle-mounted controller includes: a software upgrade control module 10, at least two external storage partitions 20, an internal storage partition 30, and a register 40, wherein:
[0108] Register 40 is used to store the flag bit of the backup partition.
[0109] The backup software data stored in the backup partition is the same as the software data of the vehicle controller before the upgrade. The backup partition is one of the at least two external storage partitions 20 .
[0110] The software upgrade control module 10 is used to obtain the target software data to be flashed. According to the flag bit of the backup partition stored in the register 40, one of the at least two external storage partitions 20 other than the backup partition is determined as the target partition, and the target software data is written into the target partition. If the target software data written into the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle controller.
[0111] There is no data 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 controller. Therefore, there is no data stored in the target partition, or even if the software data is stored in the target partition, the version of the stored software data needs to be different from the version of the current software data of the vehicle controller, so as to ensure that the backup data of the vehicle controller will not be overwritten when the software is flashed to the target partition, that is, the target partition can be any partition except the backup partition.
[0112] In this embodiment, by setting a software upgrade control module, the target software data to be flashed can be obtained, and the target software data can be directly received from the cloud. Then, according to the flag bit of the backup partition stored in the register, one of the at least two external storage partitions is determined as the target partition. The target partition needs to have no data stored, or even if the software data is stored in the target partition, the version of the stored software data needs to be different from the version of the current software data of the vehicle controller, so as to ensure that when the software is flashed to the target partition, the backup data of the vehicle controller will not be overwritten, so that the data can be rolled back when the subsequent upgrade fails. Then the target software data is written to the target partition. In the case where the target software data written in the target partition passes the verification, the target software data in the target partition is used to upgrade the vehicle controller. Since an independent external storage partition is designed, the target software data is first flashed into the external storage partition instead of directly flashed into the vehicle controller, so that the normal use of the vehicle is not affected when 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 controller, which ensures the correctness of the target software data and improves the success rate of the upgrade.
[0113] In one embodiment, as shown in FIG8 , a vehicle controller software upgrade device is provided, the vehicle controller includes at least two external storage partitions, the device includes: a software acquisition module 801, a partition determination module 802, a software writing module 803, and an upgrade execution module 804, wherein:
[0114] The software acquisition module 801 is used to acquire the target software data to be flashed.
[0115] The partition determination module 802 is used to determine one of at least two external storage partitions as a target partition, 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 controller.
[0116] The software writing module 803 is used to write the target software data into the target partition.
[0117] The upgrade execution module 804 is used to upgrade the vehicle controller using the target software data in the target partition when the target software data written in the target partition passes the verification.
[0118] In one embodiment, the upgrade execution module 804 includes: a condition judgment unit, a flashing unit, a verification unit, and a flashing judgment unit, wherein:
[0119] The condition judgment unit is used to determine whether the current state of the vehicle controller meets the preset conditions.
[0120] The flash writing unit is used to write the target software data in the target partition into the internal storage partition of the vehicle controller when the current state of the vehicle controller meets the preset conditions, so as to upgrade the vehicle controller.
[0121] The verification unit is used to verify the target software data in the internal storage partition.
[0122] The flashing judgment unit is used to determine whether the target software data is successfully flashed when the target software data in the internal storage partition passes the verification.
[0123] For the specific limitations of the vehicle-mounted controller software upgrade device, please refer to the limitations of the vehicle-mounted controller software upgrade method above, which will not be repeated here. The various modules in the above-mentioned vehicle-mounted controller software upgrade device can be fully or partially implemented by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0124] In one embodiment, a computer device is provided, and the internal structure diagram of the computer device can be shown in Figure 9. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for upgrading the software of a vehicle controller is implemented.
[0125] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0126] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0128] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0129] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0130] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for upgrading vehicle controller software, It is characterized in that The vehicle controller includes at least two external storage partitions, and the method includes: 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. The vehicle controller software upgrade method according to claim 1, It is characterized in that When the target software data written in the target partition passes verification, upgrading the vehicle controller using the target software data in the target partition includes: 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. The vehicle controller software upgrade method according to claim 2, It is characterized in that After determining that the target software data is successfully flashed, the method further includes: 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. The vehicle controller software upgrade method according to claim 3, It is characterized in that After determining that the target software data is successfully flashed, the method further includes: 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. The vehicle controller software upgrade method according to claim 2, It is characterized in that After the step of verifying the target software data in the internal storage partition, the method further includes: 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. The vehicle controller software upgrade method according to claim 5, It is 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 includes: 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. A vehicle controller, It is characterized in that The vehicle controller includes: 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. A vehicle controller software upgrade device, It is characterized in that The vehicle-mounted 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. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that 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.
Citation Information
Cited By
OTA update rollback method and device, storage medium and program product
CN119271245A
Firmware upgrade backup method and system based on external Flash and storage medium
CN120179272A
