WO2023241458A1 - 车载控制器的软件升级方法、装置、设备和存储介质 - Google Patents
车载控制器的软件升级方法、装置、设备和存储介质 Download PDFInfo
- Publication number
- WO2023241458A1 WO2023241458A1 PCT/CN2023/099216 CN2023099216W WO2023241458A1 WO 2023241458 A1 WO2023241458 A1 WO 2023241458A1 CN 2023099216 W CN2023099216 W CN 2023099216W WO 2023241458 A1 WO2023241458 A1 WO 2023241458A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- storage partition
- data
- target
- upgrade
- vehicle
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000005192 partition Methods 0.000 claims abstract description 347
- 230000004044 response Effects 0.000 claims abstract description 38
- 238000004891 communication Methods 0.000 claims description 53
- 230000015654 memory Effects 0.000 claims description 27
- 238000012795 verification Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 230000008859 change Effects 0.000 claims description 8
- 230000004913 activation Effects 0.000 claims description 5
- 230000002779 inactivation Effects 0.000 claims description 2
- 238000013524 data verification Methods 0.000 claims 1
- 238000005516 engineering process Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 12
- 230000005540 biological transmission Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013496 data integrity verification Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005096 rolling process Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- Embodiments of the present application relate to the field of vehicle technology, for example, to a software upgrade method, device, equipment, storage medium and system for a vehicle controller.
- a processing module configured to write the data of the target data packet into a target storage partition.
- the target storage partition refers to a storage partition that is currently in an inactive state.
- the target storage partition is the first storage partition or The second storage partition; determine whether the data of the upgrade software package in the target storage partition has been written; in response to determining that the data of the upgrade software package in the target storage partition has been written, verify the The data integrity of the upgrade software package in the target storage partition; in response to the data integrity verification of the upgrade software package in the target storage partition passing, changing the status of the target storage partition to an activated state;
- a control module configured to control the operation of the vehicle controller based on the data of the upgrade software package in the target storage partition.
- embodiments of the present application provide a computer-readable storage medium on which a computer program is stored.
- the program is executed by a processor, the software of the vehicle-mounted controller as described in the first aspect is implemented. Upgrade method.
- embodiments of the present application provide a software upgrade system for a vehicle-mounted controller, including: a cloud, a vehicle-mounted communication device, and at least one vehicle-mounted controller according to claim 8; the cloud and the vehicle-mounted communication device pass Wireless network connection, the vehicle-mounted communication device is connected to at least one vehicle-mounted controller through an in-vehicle communication link.
- Figure 1 is a schematic structural diagram of a software upgrade system for a vehicle controller provided in Embodiment 1 of the present application;
- Figure 2 is a schematic flow chart of a software upgrade method for a vehicle controller provided in Embodiment 2 of the present application;
- Figure 3 is a schematic flow chart of a software upgrade method for a vehicle-mounted controller provided in Embodiment 3 of the present application;
- FIG. 5 is a schematic structural diagram of a vehicle-mounted controller provided in Embodiment 5 of the present application.
- the current relevant OTA upgrade scheme is: when the vehicle communication device receives the OTA upgrade task, it will obtain task-related information from the cloud, download the upgrade software package file from the cloud to its memory, and perform integrity verification on the upgrade software package. After verification, the upgrade software package is sent to the target vehicle controller to be upgraded through the in-vehicle communication link (such as Controller Area Network (CAN) or Ethernet) for software flashing.
- the upgrade software package of the previous version of each controller will be stored in the memory of the vehicle communication device.
- the vehicle communication device will continue to flash the previous version of the software to the target vehicle controller, thereby returning the software to the version state before the upgrade to ensure that relevant functions or vehicles are available.
- the embodiment of this application provides a software upgrade solution for a vehicle controller.
- AB partition i.e. dual partition
- the data of the package is downloaded and written to the inactive partition of the controller to be upgraded (that is, the target vehicle controller).
- the data of the upgrade software package is downloaded and written in the form of a data stream, so that the vehicle communication device does not need to reserve a large storage space to save the entire upgrade software of each vehicle controller.
- the AB partition technology is used to alternately use the inactive partitions in the AB partition to flash the upgrade software package data, so that no additional version rollback operation is required when the flash fails, thereby solving the problem of related technologies.
- the problem of related functions or vehicle unavailability caused by software version rollback reduces the risk of functional failure of the vehicle controller to be upgraded, which is beneficial to improving the user experience.
- Figure 1 is a schematic structural diagram of a software upgrade system for a vehicle-mounted controller provided in Embodiment 1 of the present application.
- the software upgrade system 100 for a vehicle-mounted controller includes:
- the vehicle-mounted communication device 120 refers to a device on the vehicle that can communicate with the cloud 110.
- it can be a telematics box (Telematics BOX, T-BOX) or a gateway (Gateway).
- the communication network between the vehicle communication device 120 and the cloud 110 may be a 4G network or a 5G network, etc.
- the vehicle controller 130 refers to the control unit of related electronic equipment in the vehicle, which can be various electronic control units (Electronic Control Unit, ECU), remote information control unit (Transmission Control Unit, TCU) or body control unit (Body Control Management). , BCM) etc.
- ECU Electronic Control Unit
- TCU Transmission Control Unit
- BCM Body Control Management
- the in-vehicle communication link used between the vehicle controller 130 and the vehicle communication device 120 may be a control area network bus or Ethernet, or the like.
- vehicle-mounted communication device 120 and at least one vehicle-mounted controller 130 in FIG. 1 are both located on the vehicle side.
- each vehicle-mounted controller 130 is provided with a first storage partition and a second storage partition, wherein one storage partition is an activated storage partition and the other storage partition is an inactive storage partition.
- the active storage partition refers to the storage partition that is currently in the active state, that is, the storage partition that is currently in the working state.
- the inactive storage partition refers to the storage partition that is currently in the inactive state, that is, the storage partition that is currently in the non-working state. .
- the second storage partition is an inactive storage partition; if the first storage partition is an inactive storage partition, the second storage partition is an activated storage partition.
- the cloud 110 is responsible for pushing new OTA upgrade tasks.
- the vehicle-mounted communication device 120 sends a software upgrade request to the cloud 110.
- the cloud 110 starts to send the data of the upgrade software package in the form of a data stream based on receiving the software upgrade request, that is, the data of the upgrade software is sent in batches in the form of multiple data packets to the vehicle-mounted communication device 120 located at the vehicle end.
- the software upgrade process of one of the vehicle-mounted controllers 130 As an example, assume that the currently transmitted data packet is called a target data packet. For example, in this embodiment, after the vehicle-mounted communication device 120 receives the target data packet, it will The data packet is forwarded to the vehicle-mounted controller 130 that needs software upgrade. In order to facilitate the distinction, the vehicle-mounted controller that needs software upgrade is called the target vehicle-mounted controller. After receiving the target data packet, the target vehicle-mounted controller will follow the preset software The upgrade process processes the target data packet.
- the target vehicle controller determines the storage partition that is currently in an inactive state. To facilitate differentiation, the storage partition that is currently in an inactive state is called the target storage partition. , and writes the data in the target packet to the target storage partition. After writing the data of the target data package, determine whether the data of the upgrade software package in the target storage partition has been written, that is, determine whether the target data package is the last data package of the upgrade software package. If so, Then verify the data integrity of the upgrade software package in the target storage partition, that is, determine whether the data of the upgrade software package in the target storage partition is the data sent by the cloud 110, that is, determine whether the data of the upgrade software package has been tampered with during the transmission process.
- the verification passes, it means that the software upgrade is successful, and the status of the first storage partition and the second storage partition is switched, so that the original inactive storage partition is converted into an activated storage partition, and the original activated storage partition is converted into an inactive storage partition. .
- the verification fails, it means that the software upgrade has failed, and the status of the first storage partition and the second storage partition is kept unchanged, thereby ensuring that the activated storage partition is always the partition that stores the latest version of the software data that has been successfully flashed. Since this embodiment will switch the storage partition every time the software upgrade is successful, the target vehicle controller will use the data in the storage partition to run the software. When the software upgrade fails, the storage partition will not be switched, so that the target vehicle controller will not switch the storage partition. The on-board controller still uses the data in the original storage partition to run the software, which avoids the impact of failed software upgrades on users and improves the user experience.
- the target storage partition is the first storage partition
- the first storage partition when the software upgrade is successful, the first storage partition is converted into an activated storage partition, and the second storage partition is converted into an inactive storage partition.
- the software upgrade fails, the first storage partition remains as an inactive storage partition and the second storage partition remains as an active storage partition.
- state switching between the first storage partition and the second storage partition is achieved by changing the status identifiers of the first storage partition and the second storage partition.
- the identification of the active state and the inactive state can be predefined. For example, the number “1" is used to represent the active state, and the number "0" is used to represent the inactive state. If the target storage partition is the One storage partition, it can be determined that the current status identifier of the first storage partition is "0", and the current status identifier of the second storage partition is "1". When performing state switching, just change the current state identifier of the first storage partition to "1" and change the current state identifier of the second storage partition to "0".
- the status identifier of only one of the storage partitions can be read to determine The target storage partition (which is an inactive storage partition).
- the target storage partition (which is an inactive storage partition).
- the vehicle communication device 120 sends the upgrade request to the cloud 110 and at the same time, adds the data length value and calibration value of the upgrade software package in the upgrade task information.
- the verification value and other information are sent to the target vehicle controller.
- the target vehicle controller determines whether the data of the upgrade software package in the target storage partition has been written according to the data length value in the upgrade task information, and verifies the target storage based on the check value information in the upgrade task information. Data integrity of upgrade packages in partitions.
- the inactive storage partition and set the target vehicle controller to always run with the data in the active partition.
- the vehicle communication equipment since the vehicle communication equipment only needs to reserve space large enough to store a single data packet, it does not need to reserve a large storage space to save the entire upgrade software package of each vehicle controller, which solves the problem of related technologies.
- the problem of large storage space overhead in vehicle communication equipment saves the hardware cost of vehicle communication equipment, thereby reducing the cost of a single vehicle.
- the target vehicle controller is determined to run.
- FIG. 2 is a schematic flowchart of a software upgrade method for a vehicle-mounted controller provided in Embodiment 2 of the present application.
- the method of this embodiment can be executed by a software upgrade device for a vehicle-mounted controller provided by the embodiment of the present application.
- the device can be implemented by software and/or hardware, and can be integrated into each vehicle controller as shown in Figure 1.
- the software upgrade method of the vehicle controller in this embodiment includes:
- the cloud when the software upgrade is started, the cloud sends the data package of the upgrade software package to the target vehicle controller in the form of a data stream through the vehicle communication device.
- the target controller receives the upgrade sent by the cloud through the vehicle communication device.
- the data package of the software package when the software upgrade is started, the cloud sends the data package of the upgrade software package to the target vehicle controller in the form of a data stream through the vehicle communication device.
- the target data packet is the data packet currently received by the target vehicle controller, and the target data packet includes part of the data of the upgrade software package.
- the target data package may be an upgrade software package, may be the first data package of the upgrade software package, may be the last data package of the upgrade software package, or may be a data package between the first data package and the last data package.
- the target vehicle-mounted controller determines the storage partition that is currently in the inactive state.
- the storage partition that is currently in the inactive state is called the target storage partition, and the target The data in the packet is written to the target storage partition.
- the target storage partition may be the first storage partition or the second storage partition.
- the target data packet is The data of the target data packet is written into the first storage partition; in response to determining that the first storage partition is not the target storage partition, the data of the target data packet is written into the second storage partition.
- the data in the target data package is stored in the target storage partition through S202, in this step, it is necessary to determine whether the data of the upgrade software package in the target storage partition has been written, that is, whether the target data package is the last one of the upgrade software package. data package.
- S204 is executed.
- the data of the upgrade software package in the target storage partition not being completely written the data of the upgrade software package continues to be received and written.
- the target vehicle controller calculates the second length value of the data written in the target storage partition, and determines whether the second length value is consistent with the first length value in the received upgrade task information. Whether the length values are consistent determines whether the data of the upgrade software package has been written. For example, if the second length value is equal to the first length value, it means that the data of the upgrade software package in the target storage partition has been written; if the second length value is less than the first length value, it means that the data of the upgrade software package in the target storage partition has been written. Data writing has not been completed.
- the target vehicle controller calculates the second check value of the upgrade software package based on the data written in the target storage partition, and determines whether the second check value is consistent with the first check value. , to verify the data integrity of the upgrade software package in the target storage partition. For example, if the second check value is consistent with the first check value, it means that the data of the upgrade software package in the target storage partition has not been transferred during the transmission process. has been tampered with, that is, the written data is credible, and the verification passes; if the second verification value is inconsistent with the first verification value, it means that the data of the upgrade software package in the target storage partition has been tampered with during the transmission process. , that is, the written data is not trustworthy, and the verification fails.
- the first check value and the second check value are CRC values calculated using the same CRC algorithm.
- the state of the first storage partition and the second storage partition is switched, that is, the target storage partition (that is, the original The inactive storage partition) becomes the active storage partition, and the non-target storage partition (that is, the original active storage partition) becomes the inactive storage partition.
- the target storage partition is the first storage partition
- the first storage partition is converted into an activated storage partition
- the second storage partition is converted into an inactive storage partition.
- state switching between the first storage partition and the second storage partition is achieved by changing the status identifiers of the first storage partition and the second storage partition.
- the identification of the active state and the inactive state can be predefined. For example, the number “1" is used to represent the active state, and the number "0" is used to represent the inactive state. If the target storage partition is the One storage partition, it can be determined that the current status identifier of the first storage partition is "0", and the current status identifier of the second storage partition is "1". When performing state switching, just change the current state identifier of the first storage partition to "1" and change the current state identifier of the second storage partition to "0".
- the target vehicle-mounted controller is controlled to run based on the data operation of the upgrade software package in the target storage partition, so that the target vehicle-mounted controller can switch to the upgraded Software provides services to users.
- the target vehicle controller will continue to be controlled based on the data of the upgrade software package in the non-target storage partition. run.
- the first storage partition and the second storage partition are not switched, and the first storage partition and the second storage partition are kept in their original state, that is, the target storage partition is kept in an inactive state and the non-target storage partition is kept. is activated.
- the method in this embodiment also includes:
- the upgrade task information is sent from the cloud to the vehicle-mounted communication device, and is sent by the vehicle-mounted communication device to the target vehicle controller.
- the upgrade task information includes information such as the upgrade software package data length value (i.e., the first length value) and the check value (i.e., the first check value), so as to subsequently determine whether the data of the upgrade software package has been written and Used when verifying the data integrity of the upgrade software package.
- the data of the target data package is written into the target storage partition that is currently in an inactive state.
- the target storage partition For the first storage partition or the second storage partition, determine whether the data of the upgrade software package in the target storage partition has been written, and in response to determining that the data of the upgrade software package in the target storage partition has been written, verify the upgrade software in the target storage partition.
- the data integrity of the package in response to the data integrity check of the upgrade software package in the target storage partition passing, changes the status of the target storage partition to the active state, and controls the vehicle controller based on the data of the upgrade software package in the target storage partition Run, so that the data of the upgrade software package can be flashed to the inactive partition of the target vehicle controller while downloading, which not only reduces the storage overhead of the vehicle communication equipment, saves the hardware cost of the vehicle communication equipment, and reduces the cost of a single vehicle, but also It solves the problem of unavailability of related functions
- FIG. 3 is a schematic flowchart of a software upgrade method for a vehicle-mounted controller provided in Embodiment 3 of the present application.
- the method in this embodiment can be jointly executed by a vehicle-mounted communication device and a vehicle-mounted controller.
- the software upgrade method of the vehicle controller in this embodiment mainly includes the following steps:
- the vehicle-mounted communication equipment periodically detects whether there are new OTA upgrade tasks in the cloud. When a new OTA upgrade task is detected, the vehicle-mounted communication equipment obtains the upgrade task information from the cloud;
- the target vehicle controller will restart when the upgrade is successful, and after the restart is completed, switch to the newly activated partition to run, ending this upgrade task.
- FIG 4 is a schematic structural diagram of a software upgrade device for a vehicle-mounted controller provided in Embodiment 4 of the present application.
- the device can be implemented by software and/or hardware, and can be integrated into each vehicle-mounted controller shown in Figure 1 middle.
- the software upgrade device 400 of the vehicle controller in this embodiment includes:
- the communication module 410 is configured to receive a target data packet of the upgrade software package, where the target data packet includes part of the data of the upgrade software package;
- the control module 430 is configured to control the operation of the vehicle controller based on the data of the upgrade software package in the target storage partition.
- the communication module 410 is configured to, before receiving the target data packet of the upgrade software package,
- Receive upgrade task information which includes the first length value of the upgrade software package
- FIG 5 is a schematic structural diagram of a vehicle-mounted controller provided in Embodiment 5 of the present application.
- the vehicle-mounted controller 130 includes a memory 131, a processor 132, and a program stored in the memory and capable of running on the processor.
- Computer program, the number of processors 132 in the vehicle-mounted controller 130 can be one or more, one processor 132 is taken as an example in Figure 5; the processor 132 and the memory 131 in the vehicle-mounted controller 130 can be connected through a bus or other means.
- Figure 5 takes connection via bus as an example.
- Embodiment 6 of the present application also provides a computer-readable storage medium on which a computer program is stored.
- the computer program when executed by a computer processor, is used to perform a software upgrade method for a vehicle-mounted controller.
- the method includes:
- the target storage partition refers to the storage partition that is currently inactive, and the target storage partition is the first storage partition or the second storage partition;
- the present application can be implemented with the help of software and necessary general hardware. Of course, it can also be implemented with hardware, but in many cases the former is a better implementation. .
- the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to related technologies.
- the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, Read-Only Memory (ROM), Random Access Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including multiple instructions to make a computer device (which can be a personal computer , server, or grid device, etc.) to execute the methods described in various embodiments of this application.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本申请实施例提供一种车载控制器的软件升级方法、装置、设备、存储介质及系统,通过接收升级软件包的目标数据包,将目标数据包的数据写入到当前为非激活状态的目标存储分区中,确定目标存储分区中升级软件包的数据是否写入完毕,响应于写入完毕,则校验目标存储分区中升级软件包的数据完整性,响应于校验通过,则将目标存储分区的状态变更为激活状态,并基于目标存储分区中升级软件包的数据,控制车载控制器运行。
Description
本申请要求在2022年06月14日提交中国专利局、申请号为202210669229.9的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
本申请实施例涉及车辆技术领域,例如涉及一种车载控制器的软件升级方法、装置、设备、存储介质及系统。
为了加快车型产品迭代速度,目前众多汽车厂商通过空中下载技术(Over-the-Air Technology,OTA)来实现汽车功能的分阶段体现,较为常见的做法是:在车辆上市时只提供基础驾驶功能,在几个月以后通过OTA为用户车辆推送具备智能驾驶功能的软件,从而通过该软件对车辆的功能进行远程升级。
但是,远程升级存在升级失败的风险,为保证在升级失败时相关功能或车辆依然可用,相关技术中,在云端下发升级软件包时,通过增加备份区对上一版本的升级软件包进行存储,一旦升级失败,则基于备份区通过回滚操作将软件恢复到升级前的版本状态。
然而,相关技术实质上是采用上一版本的升级软件包对车内相应的控制器重新进行刷写,而根据升级软件包大小,该过程一般需要几分钟到几十分钟不等,而在该过程中用户依然无法使用相关功能或车辆,即版本回退成功后用户才可以使用相关功能或车辆,从而浪费用户时间,影响用户的使用体验。
发明内容
本申请实施例提供一种车载控制器的软件升级方法、装置、设备、存储介质及系统,以降低目标车载控制器功能失效的风险。
第一方面,本申请实施例提供一种车载控制器的软件升级方法,应用于车载控制器,所述车载控制器的存储器中设置有第一存储分区和第二存储分区,所述方法包括:
接收升级软件包的目标数据包,所述目标数据包中包括所述升级软件包的一部分数据;
将所述目标数据包的数据写入到目标存储分区中,所述目标存储分区是指
当前为非激活状态的存储分区,所述目标存储分区为所述第一存储分区或所述第二存储分区;
确定所述目标存储分区中所述升级软件包的数据是否写入完毕;
响应于确定所述目标存储分区中所述升级软件包的数据写入完毕,校验所述目标存储分区中所述升级软件包的数据完整性;
响应于所述目标存储分区中所述升级软件包的数据完整性校验通过,将所述目标存储分区的状态变更为激活状态;
基于所述目标存储分区中升级软件包的数据,控制所述车载控制器运行。
第二方面,本申请实施例提供一种车载控制器的软件升级装置,集成于车载控制器,所述车载控制器的存储器中设置有第一存储分区和第二存储分区,所述装置包括:
通信模块,设置为接收升级软件包的目标数据包,所述目标数据包中包括所述升级软件包的一部分数据;
处理模块,设置为将所述目标数据包的数据写入到目标存储分区中,所述目标存储分区是指当前为非激活状态的存储分区,所述目标存储分区为所述第一存储分区或所述第二存储分区;确定所述目标存储分区中所述升级软件包的数据是否写入完毕;响应于确定所述目标存储分区中所述升级软件包的数据写入完毕,校验所述目标存储分区中所述升级软件包的数据完整性;响应于所述目标存储分区中所述升级软件包的数据完整校验通过,将所述目标存储分区的状态变更为激活状态;
控制模块,设置为基于所述目标存储分区中升级软件包的数据,控制所述车载控制器运行。
第三方面,本申请实施例提供一种车载控制器,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述存储器中包括第一存储分区和第二存储分区,所述处理器执行所述程序时实现如上述第一方面所述的车载控制器的软件升级方法。
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面所述的车载控制器的软件
升级方法。
第五方面,本申请实施例提供一种车载控制器的软件升级系统,包括:云端、车载通信设备和至少一个如权利要求8所述的车载控制器;所述云端与所述车载通信设备通过无线网络连接,所述车载通信设备与至少一个车载控制器通过车内通信链路连接。
下面将对实施例描述中所需要使用的附图作简单地介绍,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例一提供的一种车载控制器的软件升级系统的结构示意图;
图2为本申请实施例二提供的一种车载控制器的软件升级方法的流程示意图;
图3为本申请实施例三提供的一种车载控制器的软件升级方法的流程示意图;
图4为本申请实施例四提供的一种车载控制器的软件升级装置的结构示意图;
图5为本申请实施例五提供的一种车载控制器的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“目标”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备也可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
目前相关的OTA升级方案为:当车载通信设备接收到OTA升级任务时,会从云端获取任务相关信息,并从云端将升级软件包文件下载到其存储器中,在对升级软件包进行完整性校验后,通过车内通信链路(如控制器局域网络(Controller Area Network,CAN)或以太网)将升级软件包下发给待升级的目标车载控制器进行软件刷写。为了防止目标车载控制器升级失败,导致相关功能或车辆不可用,在车载通信设备的存储器中会存储各控制器上一版本的升级软件包。当此次OTA升级失败时,车载通信设备会继续向目标车载控制器刷写上一版本的软件,从而将软件回退到此次升级前的版本状态,保证相关功能或车辆可用。
然而,相关技术的方案中存在以下问题:(1)车载通信设备需要预留大量的存储空间来保存各控制器的新升级软件包和上一版本的升级软件包;(2)当升级失败时,需要一段时间(根据升级软件包大小而定,一般几分钟或几十分钟不等)重新刷写,进行版本回退后用户才可以使用车辆,用户体验不好。
本申请的主要思路:基于相关技术中存在的技术问题,本申请实施例提供一种车载控制器的软件升级方案,基于流式数据传输技术和AB分区(即双分区)技术,实现将升级软件包的数据边下载边刷写到待升级控制器(即目标车载控制器)的非激活分区中。一方面,本申请实施例中,以数据流的形式对升级软件包的数据进行边下载边刷写,使得车载通信设备不需要预留较大的存储空间来保存各车载控制器的整个升级软件包,从而解决了相关技术中车载通信设备的存储空间开销大的问题,节约了车载通信设备硬件成本,从而降低单车成本。另一方面,本申请实施例中,通过AB分区技术交替采用AB分区中的非激活分区进行升级软件包数据的刷写,实现刷写失败时不需额外版本回退操作,从而解决了相关技术中软件版本回退造成的相关功能或车辆不可用的问题,降低待升级目标车载控制器功能失效风险,有利于提升用户的使用体验。
实施例一
示例性地,图1为本申请实施例一提供的一种车载控制器的软件升级系统的结构示意图,如图1所示,车载控制器的软件升级系统100中包括:
云端110、车载通信设备120及至少一个车载控制器130。车载通信设备120与云端110及各车载控制器130分别连接,车载通信设备120通过无线网络与云端110进行通信和数据交互,车载通信设备120与各车载控制器130通过车内通信链路进行通信和数据交互。
其中,云端110,即OTA云平台,该OTA云平台可以由一个或多个服务器
构成。OTA云平台负责各种车载控制器的升级软件包的存储和发布。
车载通信设备120,是指车上可以与云端110进行通信的设备,示例性地,可以为远程通信盒(Telematics BOX,T-BOX)或网关(Gateway)等。车载通信设备120与云端110之间的通信网络可以为4G网络或5G网络等。
车载控制器130,是指车内相关电子设备的控制单元,可以为各种电子控制单元(Electronic Control Unit,ECU)、远程信息控制单元(Transmission Control Unit,TCU)或车身控制单元(Body Control Management,BCM)等。车载控制器130与车载通信设备120之间使用的车内通信链路可以为控制器域网总线或以太网等。
可以理解的是,图1中的车载通信设备120和至少一个车载控制器130均位于车端。
本实施例中,各车载控制器130中均设置有第一存储分区和第二存储分区,其中,一个存储分区的激活存储分区,另一个存储分区为非激活存储分区。其中,激活存储分区是指当前为激活状态的存储分区,也即当前处于工作状态的存储分区,非激活存储分区是指当前为非激活状态的存储分区,也即当前处于非工作状态的存储分区。示例性地,若第一存储分区为激活存储分区,则第二存储分区为非激活存储分区;若第一存储分区为非激活存储分区,则第二存储分区为激活存储分区。
在一种可能的实施方式中,本实施例中,云端110负责新的OTA升级任务的推送,当用户确定需要对车辆进行软件升级时,由车载通信设备120向云端110发送软件升级请求,云端110基于接收到软件升级请求开始以数据流的形式发送升级软件包的数据,即将升级软件的数据以多个数据包的形式分次发送到位于车端的车载通信设备120。
以其中一个车载控制器130的软件升级过程为例,假设将当前传输的数据包叫做目标数据包,示例性地,本实施例中,当车载通信设备120接收到目标数据包后,会将目标数据包转发给需要进行软件升级的车载控制器130,为便于区分,将需要进行软件升级的车载控制器,叫做目标车载控制器,目标车载控制器接收到目标数据包后,按照预设的软件升级流程对目标数据包进行处理。
在一种可能的实施方式中,目标车载控制器在接收到的目标数据包后,确定当前为非激活状态的存储分区,为便于区分,将当前为非激活状态的存储分区,叫做目标存储分区,并将目标数据包中的数据写入到目标存储分区中。在将目标数据包的数据写入完毕之后,确定目标存储分区中升级软件包的数据是否写入完毕,即判断目标数据包是否为升级软件包的最后一个数据包,若是,
则校验目标存储分区中升级软件包的数据完整性,即判断目标存储分区中升级软件包的数据是否为云端110发送的数据,也即判断升级软件包的数据在传输过程中是否被篡改,若校验通过,说明软件升级成功,则对第一存储分区和第二存储分区进行状态切换,以使原来的非激活存储分区转换为激活存储分区,原来的激活存储分区转换为非激活存储分区。若校验不通过,说明软件升级失败,则保持第一存储分区和第二存储分区的状态不变,从而保证了激活存储分区始终为存储有已刷写成功最新版本的软件数据的分区。由于本实施例在每次软件升级成功时,才会进行存储分区的切换,使目标车载控制器采用该存储分区中的数据运行软件,在软件升级失败时,不进行存储分区的切换,使目标车载控制器仍采用原存储分区中的数据运行软件,避免了软件升级失败对用户造成的影响,提升了用户的使用体验。
示例性地,若目标存储分区为第一存储分区,本实施方式中,在软件升级成功时,将第一存储分区转换为激活存储分区,将第二存储分区转换为非激活存储分区。在软件升级失败时,仍保持第一存储分区为非激活存储分区,第二存储分区为激活存储分区。
可选地,本实施例中,通过更改第一存储分区和第二存储分区的状态标识,从而实现第一存储分区和第二存储分区进行状态切换。在一种可能的实施方式中,可以预先定义激活状态和非激活状态的标识,示例性地,用数字“1”表示激活状态,用数字“0”表示非激活状态,若目标存储分区为第一存储分区,则可以确定第一存储分区当前的状态标识为“0”,第二存储分区当前的状态标识为“1”。在进行状态切换时,将第一存储分区当前的状态标识改为“1”,将第二存储分区当前的状态标识改为“0”即可。
由于本实施例中目标车载控制器的两个存储分区只有一个为激活状态,而另一个为非激活状态,为此,本实施例中,可以只读取其中一个存储分区的状态标识就可以确定目标存储分区(为非激活状态的存储分区)。在一种可能的实施方式中,根据第一存储分区的状态标识,确定第一存储分区是否为目标存储分区,响应于确定第一存储分区为目标存储分区,将目标数据包的数据写入到第一存储分区中;响应于确定第一存储分区不是目标存储分区,将目标数据包的数据写入到所述第二存储分区中。类似地,也可以根据第二存储分区的状态标识,确定第二存储分区是否为目标存储分区,响应于第二存储分区为目标存储分区,将目标数据包的数据写入到第二存储分区中;响应于确定第二存储分区不是目标存储分区,将目标数据包的数据写入到所述第一存储分区中。
可选地,在开始升级之前,云端110还可以先将升级任务信息发送给车载通信设备120,升级任务信息中可以包括升级软件包的名称、版本号、数据长度
值和校验值等信息。车载通信设备120在接收到升级任务信息后,可以先根据升级软件的名称和版本号等基本信息以及各车载控制器130中当前运行软件的名称和版本号等基本信息,确定是否需要对车辆进行软件升级,并在确定需要对车辆进行软件升级时,确定需要进行软件升级的目标车载控制器等操作。此过程中可能涉及与用户(驾驶人员)的人机交互过程,由用户最终选择是否要进行升级,也可能不涉及,在目标车载控制器完成软件刷写之后,再与用户进行人机交互,具体可根据实际情况或场景进行设定。
在一种可能的实施方式中,在确定需要对目标车载控制器进行软件升级时,车载通信设备120向云端110发送升级请求的同时,将升级任务信息中的升级软件包的数据长度值和校验值等信息发送给目标车载控制器。在进行软件升级的过程中,目标车载控制器根据升级任务信息中数据长度值,确定目标存储分区中升级软件包的数据是否写入完毕,根据升级任务信息中校验值信息,校验目标存储分区中升级软件包的数据完整性。
为便于区分,本实施例中,将升级任务信息中数据长度值和校验值,分别叫做第一长度值和第一校验值。
在一种可能的实施方式中,目标车载控制器通过计算目标存储分区中已写入数据的长度值,记为第二长度值,并判断第二长度值与第一长度值是否一致,确定升级软件包的数据是否已写入完毕。示例性地,若第二长度值等于第一长度值,说明目标存储分区中升级软件包的数据已写入完毕;若第二长度值小于第一长度值,说明目标存储分区中升级软件包的数据未写入完毕,需要继续进行升级软件包的数据的接收和刷写。
可选地,升级任务信息中的第一校验值为循环冗余校验(cyclic redundancy check,CRC)值,在一种可能的实施方式中,目标车载控制器根据目标存储分区中已写入的数据,通过CRC算法,计算升级软件包的校验值,记为第二校验值,并判断第二校验值与第一校验值是否一致,校验目标存储分区中升级软件包的数据完整性。若第二校验值与第一校验值一致,说明目标存储分区中升级软件包的数据在传输过程中没有被篡改,即已写入的数据是可信的,则校验通过;若第二校验值与第一校验值不一致,说明目标存储分区中升级软件包在传输过程中数据被篡改了,即已写入的数据是不可信的,则校验不通过,需要删除已写入的升级软件包的数据,并重新进行升级软件包的获取和刷写。
本实施例中,通过云端将升级软件包拆分成多个数据包的形式逐一发送,车载通信设备在接收到数据包后,直接将数据包发送给目标车载控制器,由目标车载控制器将数据包中的数据刷写到其存储器中的非激活存储分区中,目标车载控制器在接收并完成升级软件包的所有数据的刷写之后,通过校验升级软
件包的完整性,确定是否升级成功,在确定升级成功时,由目标车载控制器对其激活存储分区与非激活存储进行切换,在升级不成功时,目标车载控制器不进行激活存储分区与非激活存储分区的切换,并设置目标车载控制器始终采用激活分区中的数据运行。一方面,由于车载通信设备只需要预留出足以存储单个数据包的大小的空间即可,而不需要预留较大的存储空间来保存各个车载控制器的整个升级软件包,解决了相关技术中车载通信设备的存储空间开销大的问题,节约了车载通信设备硬件成本,从而降低单车成本,另一方面,基于存储分区的状态(激活状态或非激活状态),确定运行目标车载控制器的软件数据的存储分区,由于刷写失败时,不需要进行版本回退操作,解决了相关技术中软件版本回退造成的相关功能或车辆不可用的问题,降低待升级目标车载控制器功能失效风险,有利于提升用户的使用体验。
实施例二
示例性地,图2为本申请实施例二提供的一种车载控制器的软件升级方法的流程示意图,本实施例的方法可以由本申请实施例所提供的车载控制器的软件升级装置执行,该装置可以由软件和/或硬件的方式来实现,并可集成于如图1所示的各个车载控制器中。以目标车载控制器的软件升级为例,如图2所示,本实施例的车载控制器的软件升级方法,包括:
S201、接收升级软件包的目标数据包。
本实施例中,在开始进行软件升级时,云端以数据流的形式通过车载通信设备向目标车载控制器发送升级软件包的数据包,相应地,目标控制器接收云端通过车载通信设备发送的升级软件包的数据包。
其中,目标数据包为目标车载控制器当前接收到的数据包,目标数据包中包括升级软件包的一部分数据。目标数据包可为升级软件包可以是升级软件包的第一个数据包,也可以是升级软件包的最后一个数据包,还可以是第一数据包与最后一个数据包之间的数据包。
S202、将目标数据包的数据写入到目标存储分区中。
本实施例中,目标车载控制器在接收到的目标数据包后,确定当前为非激活状态的存储分区,为便于区分,将当前为非激活状态的存储分区,叫做目标存储分区,并将目标数据包中的数据写入到目标存储分区中。
本实施例中,根据第一存储分区和第二存储分区的状态(激活状态或非激活状态),目标存储分区可以是第一存储分区,也可以是第二存储分区。
可选地,本实施例中,根据第一存储分区或第二存储分区的状态标识,确
定当前为非激活状态的存储分区。
在一种可能的实施方式中,本实施例中,根据第一存储分区的状态标识,确定第一存储分区是否为目标存储分区,响应于确定第一存储分区为目标存储分区,将目标数据包的数据写入到第一存储分区中;响应于确定第一存储分区不是目标存储分区,将目标数据包的数据写入到所述第二存储分区中。
在另一种可能实施方式中,本实施例中,根据第二存储分区的状态标识,确定第二存储分区是否为目标存储分区,响应于第二存储分区为目标存储分区,将目标数据包的数据写入到第二存储分区中;响应于第二存储分区不是目标存储分区,将目标数据包的数据写入到所述第一存储分区中。
S203、确定目标存储分区中升级软件包的数据是否写入完毕。
通过S202将目标数据包中的数据定入到目标存储分区以后,本步骤中,需要确定目标存储分区中升级软件包的数据是否写入完毕,即判断目标数据包是否为升级软件包的最后一个数据包,响应于目标存储分区中升级软件包的数据写入完毕,执行S204,响应于目标存储分区中升级软件包的数据未写入完毕,继续进行升级软件包的数据的接收和刷写。
在一种可能的实施方式中,本步骤中,目标车载控制器通过计算目标存储分区中已写入数据的第二长度值,并判断第二长度值与接收到的升级任务信息中的第一长度值是否一致,确定升级软件包的数据是否已写入完毕。示例性地,若第二长度值等于第一长度值,说明目标存储分区中升级软件包的数据已写入完毕;若第二长度值小于第一长度值,说明目标存储分区中升级软件包的数据未写入完毕。
S204、响应于确定目标存储分区中升级软件包的数据写入完毕,校验目标存储分区中升级软件包的数据完整性。
若根据S203确定升级软件包的数据已写入完毕,本步骤中,需要校验目标存储分区中升级软件包的数据完整性,即判断目标存储分区中升级软件包的数据是否为云端110发送的数据,也即判断升级软件包的数据在传输过程中是否被篡改,从而确定已写入的升级软件包的数据是否可信。若校验通过,则执行S205,否则,继续保持原来的运行状态不变,并删除目标存储分区中已写入的升级软件包的数据,同时,重新进行升级软件包的获取和刷写。
在一种可能的实施方式中,目标车载控制器根据目标存储分区中已写入的数据,计算升级软件包的第二校验值,并判断第二校验值与第一校验值是否一致,以校验目标存储分区中升级软件包的数据完整性。示例性地,若第二校验值与第一校验值一致,说明目标存储分区中升级软件包的数据在传输过程中没
有被篡改,即已写入的数据是可信的,则校验通过;若第二校验值与第一校验值不一致,说明目标存储分区中升级软件包在传输过程中数据被篡改了,即已写入的数据是不可信的,则校验不通过。
其中,第一校验值和第二校验值是采用相同的算法计算得到的,区别在于,第一校验值是云端基于待发送的升级软件包的数据计算得到的,第二校验值是目标车载控制器基于接收到的升级软件包的数据计算得到的。因此,通过比较第二校验值与第一校验值是否一致,就能确定升级软件包的数据在传输过程中有没有被篡改。
可选地,本实施例中,第一校验值和第二校验值为采用相同的CRC算法计算得到的CRC值。
S205、响应于校验通过,将目标存储分区的状态变更为激活状态。
若S204中对目标存储分区中升级软件包数据的校验结果为通过,说明软件升级成功,则本步骤中,对第一存储分区和第二存储分区进行状态切换,即将目标存储分区(即原来的非激活存储分区)变为激活存储分区,将非目标存储分区(即原来的激活存储分区)变为非激活存储分区。示例性地,若目标存储分区为第一存储分区,则本步骤中,将第一存储分区转换为激活存储分区,将第二存储分区转换为非激活存储分区。
可选地,本实施例中,通过更改第一存储分区和第二存储分区的状态标识,从而实现第一存储分区和第二存储分区进行状态切换。在一种可能的实施方式中,可以预先定义激活状态和非激活状态的标识,示例性地,用数字“1”表示激活状态,用数字“0”表示非激活状态,若目标存储分区为第一存储分区,则可以确定第一存储分区当前的状态标识为“0”,第二存储分区当前的状态标识为“1”。在进行状态切换时,将第一存储分区当前的状态标识改为“1”,将第二存储分区当前的状态标识改为“0”即可。
S206、基于目标存储分区中升级软件包的数据,控制车载控制器运行。
在通过S205完成两个存储分区的状态切换以后,本步骤中,通过基于目标存储分区中的升级软件包的数据运行,控制目标车载控制器运行,从而使目标车载控制器能够切换到升级后的软件为用户提供服务。
本实施例中,若S204中对目标存储分区中升级软件包数据的校验结果为不通过,说明软件升级失败,则继续使基于非目标存储分区中升级软件包的数据,控制目标车载控制器运行。该情况下,不对第一存储分区和第二存储分区进行切换,使第一存储分区和第二存储分区保持原来的状态即可,即继续保持目标存储分区为非激活状态,保持非目标存储分区为激活状态。示例性地,若目标
存储分区为第一存储分区,则在校验失败时,继续保持第一存储分区为非激活存储分区不变,同时,保持第二存储分区为激活存储分区不变,从而保证目标车载控制器始终基于存储有已刷写成功最新版本的软件数据的存储分区运行。
可选地,在S202之前,本实施例的方法还包括:
接收升级任务信息,升级任务信息是由云端发送给车载通信设备,并由车载通信设备发送给目标车载控制器的。可选地,升级任务信息中包括升级软件包数据长度值(即第一长度值)和校验值(即第一校验值)等信息,以便后续确定升级软件包的数据是否写入完毕以及校验升级软件包的数据完整性时使用。
本实施例中,通过接收升级软件包的目标数据包,目标数据包中包括升级软件包的一部分数据,将目标数据包的数据写入到当前为非激活状态的目标存储分区中,目标存储分区为第一存储分区或第二存储分区,确定目标存储分区中升级软件包的数据是否写入完毕,响应于确定目标存储分区中升级软件包的数据写入完毕,校验目标存储分区中升级软件包的数据完整性,响应于目标存储分区中升级软件包的数据完整性校验通过,将目标存储分区的状态变更为激活状态,并基于目标存储分区中升级软件包的数据,控制车载控制器运行,从而实现边下载边将升级软件包的数据刷写到目标车载控制器的非激活分区中,不仅减少了车载通信设备的存储开销,节约了车载通信设备硬件成本,降低了单车成本,还解决了相关技术中软件升级失败时,软件版本回退造成的相关功能或车辆不可用的问题,降低目标车载控制器功能失效的风险,提升了用户的使用体验。
实施例三
下面将一个具体的实施例对车载控制器的软件升级流程加以说明。示例性地,图3为本申请实施例三提供的一种车载控制器的软件升级方法的流程示意图,本实施例的方法可以由车载通信设备和车载控制器共同执行。以目标车载控制器的软件升级为例,如图3所示,本实施例的车载控制器的软件升级方法主要包括以下步骤:
(1)车载通信设备周期性检测云端是否有新的OTA升级任务,在检测到有新的OTA升级任务时,车载通信设备从云端获取升级任务信息;
(2)车载通信设备以数据流的形式从云端下载升级文件(即升级软件包)的数据,并且,边下载边将升级文件的数据传输给目标车载控制器;
(3)目标车载控制器在接收到升级文件的数据,判断当前激活分区是否为
A分区,若是,则将升级文件的数据写入到B分区,若否,则将升级文件的数据写入到A分区;
(4)目标车载控制器判断升级文件的数据是否写入完毕,若是,则进行升级文件的数据完整性校验,否则,返回继续执行步骤(2)-(3);
(5)目标车载控制器确定升级文件的数据完整性校验是否通过,若通过,则升级成功,交换AB分区的激活标志,若不通过,则升级失败,保持AB分区的激活标志不变,结束本次升级任务。
(6)目标车载控制器在升级成功时进行重启,并在重启完成后,切换到新激活分区运行,结束本次升级任务。
需要说明的是,本实施例中,A分区可对应实施例二中第一存储分区,B分区可对应实施例二中的第二存储分区。
实施例四
图4为本申请实施例四提供的一种车载控制器的软件升级装置的结构示意图,该装置可以由软件和/或硬件的方式来实现,并可集成于图1所示的各车载控制器中。如图4所示,本实施例中车载控制器的软件升级装置400包括:
通信模块410、处理模块420和控制模块430。
通信模块410,设置为接收升级软件包的目标数据包,目标数据包中包括升级软件包的一部分数据;
处理模块420,设置为将目标数据包的数据写入到目标存储分区中,目标存储分区是指当前为非激活状态的存储分区,目标存储分区为第一存储分区或第二存储分区;确定目标存储分区中升级软件包的数据是否写入完毕;响应于确定目标存储分区中升级软件包的数据写入完毕,校验目标存储分区中升级软件包的数据完整性;响应于目标存储分区中升级软件包的数据完整性校验通过,将目标存储分区的状态变更为激活状态;
控制模块430,设置为基于目标存储分区中升级软件包的数据,控制车载控制器运行。
可选地,处理模块420设置为通过如下方式将所述目标数据包的数据写入到非激活状态的目标存储分区中:
根据第一存储分区的状态标识,确定第一存储分区是否为目标存储分区,状态标识包括激活状态标识和非激活状态标识;
响应于确定第一存储分区为目标存储分区,将目标数据包的数据写入到第
一存储分区中;
响应于确定第一存储分区不是目标存储分区,将目标数据包的数据写入到第二存储分区中。
可选地,处理模块420设置为通过如下方式将所述目标存储分区的状态变更为激活状态:
将目标存储分区的状态标识变更为激活状态标识。
可选地,通信模块410设置为在接收升级软件包的目标数据包之前,
接收升级任务信息,升级任务信息中包括升级软件包的第一长度值;
可选地,处理模块420设置为通过如下方式确定所述目标存储分区中所述升级软件包的数据是否写入完毕:
计算目标存储分区中已写入数据的第二长度值;
响应于确定第二长度值等于第一长度值,确定目标存储分区中升级软件包的数据已写入完毕。
可选地,处理模块420设置为通过如下方式校验所述目标存储分区中所述升级软件包的数据完整性:
根据目标存储分区中已写入的数据,计算升级软件包的第二校验值;
响应于确定第二校验值与第一校验值一致,确定校验通过。
可选地,控制模块430还设置为:
响应于校验不通过,基于非目标存储分区中升级软件包的数据,控制车载控制器运行。
本实施例所提供的车载控制器的软件升级装置可执行上述方法实施例所提供的车载控制器的软件升级方法,具备执行方法相应的功能模块和有益效果。本实施例的实现原理和技术效果与上述方法实施例类似,此处不再一一赘述。
实施例五
图5为本申请实施例五提供的一种车载控制器的结构示意图,如图5所示,该车载控制器130包括存储器131、处理器132及存储在存储器上并可在处理器上运行的计算机程序,车载控制器130中处理器132的数量可以是一个或多个,图5中以一个处理器132为例;车载控制器130中的处理器132、存储器131可以通过总线或其他方式连接,图5中以通过总线连接为例。
本实施例中,在存储器131中设置两个存储分区,分别为第一存储区和第二存储区,以备软件升级时使用,第一存储区和第二存储区均存储实现本方案的软件升级流程的计算机程序。
存储器131作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请实施例中的通信模块410、处理模块420和控制模块430对应的程序指令/模块。处理器132通过运行存储在存储器131中的软件程序、指令以及模块,从而执行车载控制器的各种功能应用以及数据处理,即实现上述的车载控制器的软件升级方法。
存储器131可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器131可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器131可包括相对于处理器132远程设置的存储器,这些远程存储器可以通过网格连接至车载控制器。上述网格的实例包括互联网、企业内部网、局域网、移动通信网及其组合。
实施例六
本申请实施例六还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序在由计算机处理器执行时用于执行一种车载控制器的软件升级方法,该方法包括:
接收升级软件包的目标数据包,目标数据包中包括升级软件包的一部分数据;
将目标数据包的数据写入到目标存储分区中,目标存储分区是指当前为非激活状态的存储分区,目标存储分区为第一存储分区或第二存储分区;
确定目标存储分区中升级软件包的数据是否写入完毕;
响应于确定目标存储分区中升级软件包的数据写入完毕,校验目标存储分区中升级软件包的数据完整性;
响应于目标存储分区中升级软件包的数据完整性校验通过,将目标存储分区的状态变更为激活状态;
基于目标存储分区中升级软件包的数据,控制车载控制器运行。
当然,本申请实施例所提供的一种包计算机可读存储介质,其计算机程序还可以执行本申请任意实施例所提供的车载控制器的软件升级方法中的相关操
作。
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括多条指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网格设备等)执行本申请各个实施例所述的方法。
值得注意的是,上述车载控制器的软件升级装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,实际划分只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分。
Claims (10)
- 一种车载控制器的软件升级方法,应用于车载控制器,所述车载控制器的存储器中设置有第一存储分区和第二存储分区,所述方法包括:接收升级软件包的目标数据包,所述目标数据包中包括所述升级软件包的一部分数据;将所述目标数据包的数据写入到目标存储分区中,所述目标存储分区是指当前为非激活状态的存储分区,所述目标存储分区为所述第一存储分区或所述第二存储分区;确定所述目标存储分区中所述升级软件包的数据是否写入完毕;响应于确定所述目标存储分区中所述升级软件包的数据写入完毕,校验所述目标存储分区中所述升级软件包的数据完整性;响应于所述目标存储分区中所述升级软件包的数据完整性校验通过,将所述目标存储分区的状态变更为激活状态;基于所述目标存储分区中升级软件包的数据,控制所述车载控制器运行。
- 根据权利要求1所述的方法,其中,所述将所述目标数据包的数据写入到非激活状态的目标存储分区中,包括:根据所述第一存储分区的状态标识,确定所述第一存储分区是否为目标存储分区,所述状态标识包括激活状态标识和非激活状态标识;响应于确定所述第一存储分区为目标存储分区,将所述目标数据包的数据写入到所述第一存储分区中;响应于确定所述第一存储分区不是目标存储分区,将所述目标数据包的数据写入到所述第二存储分区中。
- 根据权利要求1所述的方法,其中,所述将所述目标存储分区的状态变更为激活状态,包括:将所述目标存储分区的状态标识变更为激活状态标识。
- 根据权利要求1所述的方法,所述接收升级软件包的目标数据包之前,所述方法还包括:接收升级任务信息,所述升级任务信息中包括所述升级软件包的第一长度值;所述确定所述目标存储分区中所述升级软件包的数据是否写入完毕,包括:计算目标存储分区中已写入数据的第二长度值;响应于确定所述第二长度值等于所述第一长度值,确定所述目标存储分区中所述升级软件包的数据已写入完毕。
- 根据权利要求4所述的方法,其中,所述升级任务信息中还包括所述升级软件包的第一校验值,所述校验所述目标存储分区中所述升级软件包的数据完整性,包括:根据所述目标存储分区中已写入的数据,计算所述升级软件包的第二校验值;响应于确定所述第二校验值与所述第一校验值一致,确定校验通过。
- 根据权利要求1所述的方法,所述方法还包括:响应于校验不通过,基于非目标存储分区中升级软件包的数据,控制所述车载控制器运行。
- 一种车载控制器的软件升级装置,集成于车载控制器,所述车载控制器的存储器中设置有第一存储分区和第二存储分区,所述装置包括:通信模块,设置为接收升级软件包的目标数据包,所述目标数据包中包括所述升级软件包的一部分数据;处理模块,设置为将所述目标数据包的数据写入到目标存储分区中,所述目标存储分区是指当前为非激活状态的存储分区,所述目标存储分区为所述第一存储分区或所述第二存储分区;确定所述目标存储分区中所述升级软件包的数据是否写入完毕;响应于所述目标存储分区中所述升级软件包的数据写入完毕,校验所述目标存储分区中所述升级软件包的数据完整性;响应于所述目标存储分区中所述升级软件包的数据完整性校验通过,将所述目标存储分区的状态变更为激活状态;控制模块,设置为基于所述目标存储分区中升级软件包的数据,控制所述车载控制器运行。
- 一种车载控制器,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述存储器中包括第一存储分区和第二存储分区,所述处理器执行所述程序时实现如权利要求1-6中任一所述的车载控制器的软件升级方法。
- 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-6中任一所述的车载控制器的软件升级方法。
- 一种车载控制器的软件升级系统,包括:云端、车载通信设备和至少一 个如权利要求8所述的车载控制器;所述云端与所述车载通信设备通过无线网络连接,所述车载通信设备与所述至少一个车载控制器通过车内通信链路连接。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210669229.9A CN114895947A (zh) | 2022-06-14 | 2022-06-14 | 车载控制器的软件升级方法、装置、设备和存储介质 |
CN202210669229.9 | 2022-06-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023241458A1 true WO2023241458A1 (zh) | 2023-12-21 |
Family
ID=82727412
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/099216 WO2023241458A1 (zh) | 2022-06-14 | 2023-06-08 | 车载控制器的软件升级方法、装置、设备和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114895947A (zh) |
WO (1) | WO2023241458A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117978853A (zh) * | 2024-03-29 | 2024-05-03 | 成都智邦科技有限公司 | 一种充电桩的远程升级控制方法 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114895947A (zh) * | 2022-06-14 | 2022-08-12 | 中国第一汽车股份有限公司 | 车载控制器的软件升级方法、装置、设备和存储介质 |
CN118708500A (zh) * | 2024-08-30 | 2024-09-27 | 宁德时代新能源科技股份有限公司 | 软件的检测方法及装置、设备、存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018160207A (ja) * | 2017-03-24 | 2018-10-11 | 日立オートモティブシステムズ株式会社 | 車載制御装置、及び、プログラム更新ソフトウェア |
WO2021244143A1 (zh) * | 2020-05-30 | 2021-12-09 | 展讯通信(上海)有限公司 | 一种软件升级方法及装置 |
CN114064095A (zh) * | 2020-08-10 | 2022-02-18 | 威马智慧出行科技(上海)有限公司 | 车载软件的升级方法、车载控制器、车辆及存储介质 |
CN114895947A (zh) * | 2022-06-14 | 2022-08-12 | 中国第一汽车股份有限公司 | 车载控制器的软件升级方法、装置、设备和存储介质 |
-
2022
- 2022-06-14 CN CN202210669229.9A patent/CN114895947A/zh active Pending
-
2023
- 2023-06-08 WO PCT/CN2023/099216 patent/WO2023241458A1/zh unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018160207A (ja) * | 2017-03-24 | 2018-10-11 | 日立オートモティブシステムズ株式会社 | 車載制御装置、及び、プログラム更新ソフトウェア |
WO2021244143A1 (zh) * | 2020-05-30 | 2021-12-09 | 展讯通信(上海)有限公司 | 一种软件升级方法及装置 |
CN114064095A (zh) * | 2020-08-10 | 2022-02-18 | 威马智慧出行科技(上海)有限公司 | 车载软件的升级方法、车载控制器、车辆及存储介质 |
CN114895947A (zh) * | 2022-06-14 | 2022-08-12 | 中国第一汽车股份有限公司 | 车载控制器的软件升级方法、装置、设备和存储介质 |
Non-Patent Citations (1)
Title |
---|
LERCH SEBASTIAN, JONAS WOLF: "Software Update and Upgrade Over the Air SOTA", VECTOR INDIA CONFERENCE 2019, PUNE, 16 July 2019 (2019-07-16), Pune, pages 1 - 25, XP093117525, Retrieved from the Internet <URL:https://cdn.vector.com/cms/content/events/2019/VH/VIC2019/7_Software_Update_and_Upgrade_Over_the_Air__SOTA_.pdf> [retrieved on 20240110] * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117978853A (zh) * | 2024-03-29 | 2024-05-03 | 成都智邦科技有限公司 | 一种充电桩的远程升级控制方法 |
Also Published As
Publication number | Publication date |
---|---|
CN114895947A (zh) | 2022-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023241458A1 (zh) | 车载控制器的软件升级方法、装置、设备和存储介质 | |
CN111343064A (zh) | 汽车控制系统软件升级系统及方法 | |
WO2021168840A1 (zh) | 一种软件版本回滚方法、装置及系统 | |
WO2019021064A1 (en) | CONSTRUCTION OF SOFTWARE DELTA UPDATES FOR VEHICLE ECU SOFTWARE AND TOOL-BASED ANOMALY DETECTION | |
US20220156057A1 (en) | In-vehicle update device, update processing program, and program update method | |
CN112134940A (zh) | 一种ota升级任务生命周期策略管理方法 | |
CN111886576A (zh) | 用于更新远程网络设备的方法和装置 | |
JP6902722B2 (ja) | プログラム更新システム、制御システム、移動体、プログラム更新方法及びプログラム | |
US20240069906A1 (en) | Server, software update system, distribution method, and non-transitory storage medium | |
US11803364B2 (en) | Server, software updating device, vehicle, software updating system, control method, and non-transitory storage medium | |
JP7540394B2 (ja) | Otaマスタ、システム、方法、プログラム、及び車両 | |
WO2022205443A1 (zh) | 软件升级方法及装置 | |
US20240004640A1 (en) | Computer-Implemented Method And Device For The Automated Update Of A Communication Unit Of A Control Unit Of A Vehicle | |
JP7396229B2 (ja) | ソフトウェア更新装置、更新制御方法、更新制御プログラム及びotaマスタ | |
US20220391193A1 (en) | Ota master, system, method, non-transitory storage medium, and vehicle | |
JP2021015618A (ja) | 車載更新装置、更新処理プログラム及び、プログラムの更新方法 | |
JP7559684B2 (ja) | Otaマスタ、システム、方法、プログラム、及び車両 | |
CN111722856A (zh) | 车载微控制器中固件的升级方法和装置 | |
CN113824620A (zh) | 一种分区切换方法、装置、车辆和存储介质 | |
WO2024197570A1 (zh) | 一种升级检测方法及装置 | |
WO2024152367A1 (zh) | 软件升级系统、方法、设备以及车辆 | |
US20230333838A1 (en) | Method and device for updating software of an onboard computer in a vehicle, comprising a runtime memory, a backup memory and a control memory | |
WO2024152148A1 (zh) | 一种设备救援方法及相关设备 | |
JP7540386B2 (ja) | Otaマスタ、更新制御方法、更新制御プログラム及びotaセンタ | |
US20220284743A1 (en) | Center device and in-vehicle electronic control device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23823026 Country of ref document: EP Kind code of ref document: A1 |