WO2024087234A1 - Method and apparatus for updating software, and intelligent device - Google Patents

Method and apparatus for updating software, and intelligent device Download PDF

Info

Publication number
WO2024087234A1
WO2024087234A1 PCT/CN2022/128452 CN2022128452W WO2024087234A1 WO 2024087234 A1 WO2024087234 A1 WO 2024087234A1 CN 2022128452 W CN2022128452 W CN 2022128452W WO 2024087234 A1 WO2024087234 A1 WO 2024087234A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
program
storage partition
functional module
module
Prior art date
Application number
PCT/CN2022/128452
Other languages
French (fr)
Chinese (zh)
Inventor
罗毅
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2022/128452 priority Critical patent/WO2024087234A1/en
Publication of WO2024087234A1 publication Critical patent/WO2024087234A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Definitions

  • the present application relates to the field of computer technology, and more specifically, to a method, apparatus and intelligent device for updating software.
  • the speed of software updates in intelligent devices is also gradually accelerating.
  • multiple software updates may be required.
  • the software of the vehicle controller is usually updated through over the air (OTA).
  • OTA over the air
  • the controller is usually required to have storage partitions, one of which is used to store new data.
  • the new data is generally received and stored in the corresponding storage partition when the controller executes the application code.
  • the bootloader of the controller jumps to the starting address to run the new software program.
  • the embodiments of the present application provide a method, apparatus and intelligent device for updating software, which can enable the controller to run the latest software program without re-powering on, thereby helping to improve the speed and convenience of software updates.
  • a method for updating software is provided, which can be executed by a smart device; or, it can also be executed by a controller of the smart device; or, it can also be executed by a chip or circuit used for the smart device, which is not limited in the present application.
  • the smart devices involved in this application may include road vehicles, water vehicles, air vehicles, industrial equipment, agricultural equipment, or entertainment equipment, etc.
  • the smart device can be a vehicle, which is a vehicle in a broad sense, and can be a vehicle (such as a commercial vehicle, a passenger car, a motorcycle, a flying car, a train, etc.), an industrial vehicle (such as a forklift, a trailer, a tractor, etc.), an engineering vehicle (such as an excavator, a bulldozer, a crane, etc.), agricultural equipment (such as a lawn mower, a harvester, etc.), amusement equipment, a toy vehicle, etc.
  • the embodiment of this application does not specifically limit the type of vehicle.
  • the smart device can be a vehicle such as an airplane or a ship.
  • the smart device can also include devices such as a smart phone and a smart home.
  • the method includes: when controlling a first functional module to run a first program in a first storage partition, detecting a second storage partition, the first functional module is a functional module of a first software of a controller, and a storage area of the controller includes the first storage partition and the second storage partition; when detecting data of a second program in the second storage partition, controlling the first functional module to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
  • control function module when the control function module is running the software program in the first storage partition and detects that the second storage partition has data of a new software program, the new software program in the second storage partition can be run, so that the latest software program can be run without re-powering the controller, which helps to improve the speed and convenience of software updates.
  • the software update process only individual function modules that need to be updated can be updated, reducing the time required for software updates.
  • a controller may include only one software, or may include two or more software.
  • the first software may include only the first functional module; or, in addition to the first functional module, the first software may also include other functional modules.
  • the first software can be software that can realize power steering.
  • the software can include functions such as sensor signal acquisition, torque calculation, and motor control.
  • the software can be divided into multiple functional modules according to the above functions.
  • the software is divided into at least three functional modules, wherein the three functional modules are respectively used to realize the functions of sensor signal acquisition, torque calculation, and motor control.
  • the first functional module can be one of the above three functional modules; or, in some possible implementations, the functions such as sensor signal acquisition, torque calculation, and motor control can be further refined into smaller functional modules, and the first functional module can also be one of the above smaller functional modules.
  • a second storage partition when controlling a first functional module to run a first program in a first storage partition, a second storage partition is detected, and the first functional module is a functional module of a controller, and a storage area of the controller includes the first storage partition and the second storage partition; when data of a second program in the second storage partition is detected, the first functional module is controlled to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
  • the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  • the first software includes more than M functional modules, but only M functional modules need to be updated, and the flash file may only include data corresponding to the M functional modules.
  • the information of the first data may include a start address and an end address of the first data in the storage area; or, the information of the first data may include a start address and a data length of the first data in the storage area.
  • the address allocated to the first data in the storage area is pre-set, and verification information can be added to the end of the first data, and padding data is added after the verification information, then the padding data can indicate the end position of the first data, and the padding data can be understood as a kind of information of the first data.
  • the starting position and the end position of the storage data are pre-configured for the first functional module in the storage area of the controller (such as the first storage partition and/or the second storage partition), for example, 300 bytes are pre-configured for the first functional module, and the first data occupies a total of 150 bytes in the second storage partition; if the length of the verification information is 2 bytes, the 299th byte and the 300th byte are reserved for storing the verification information, and the remaining bytes at the end of the first data (i.e., the 151st byte to the 298th byte) are used to store the padding data. It should be understood that the end position of the first data can be determined based on the padding data.
  • the flash files are modularly divided according to the functional modules of the software, which can reduce the possibility of all data being unavailable due to a sudden interruption of data flashing.
  • the flash file consists of M module data
  • the M module data correspond one-to-one to the M functional modules
  • the M module data include first module data
  • the first module data include the first data and first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module.
  • the first description information may include identification information of the first functional module, for example, may include the first functional module ID; or, the first description information may also include information of the storage space associated with the first functional module, for example, may include information of the starting position and/or ending position for storing the first data; or, the first description information may also include information of the data length of the first data.
  • the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
  • integrity and/or consistency verification is performed on the first data using the first verification information, which helps to improve data security.
  • the flash file consists of description information and module data
  • the description information includes first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module
  • the module data includes the first data
  • the description information may also include quantity information of the module data, where the quantity information is used to indicate that the module data includes data of several functional modules.
  • the flash file also includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
  • the integrity and/or consistency of the entire flash file is checked through the second verification information to prevent the situation where the entire flash file has problems when the data verification of each functional module passes, which helps to improve data security.
  • the storage area also includes a third storage partition, which is used to store data of a third program of a second functional module, and the second functional module is a new functional module of the first software.
  • the method also includes: when the data of the third program is detected in the third storage partition, controlling the second functional module to run the third program.
  • storage space is reserved for the new functions of the first software.
  • the first software needs a new function, there is no need to reconfigure the controller because of the new function.
  • the program in the reserved storage space is controlled to run successfully, so as to achieve the successful operation of the new function, which helps to reduce the cost of software updates and save the time required for software updates.
  • the first functional module includes a first function and a second function
  • the interface address of the first function is associated with the first storage partition
  • the interface address of the second function is associated with the second storage partition
  • controlling the first functional module to run the second program includes: controlling the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and running the second program in the second storage partition through the interface address of the second function.
  • the first function may be a function of the first functional module in the first storage partition
  • the second function may be a function of the first functional module in the second storage partition.
  • the interface address of the first function is associated with the first storage partition may be understood as: data in the first storage partition may be read through the interface address, and/or a program in the first storage partition may be run.
  • the address of the data of the second program in the second storage partition is a pre-set fixed address
  • the storage area includes a fourth storage partition, which is used to store the fixed address; before controlling the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, the method also includes: determining that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
  • the validity of the interface address is first determined, which can prevent the running of unsafe programs when the interface address is tampered with, and help improve the security of the functional module.
  • the data of the second program includes functional data and configuration data
  • the method before controlling the first functional module to run the second program, the method also includes: performing integrity and/or consistency checks on the configuration data and the functional data, respectively.
  • the configuration data and the functional function data are verified separately, which can shorten the time required for data verification and improve the efficiency of data verification.
  • the method further includes: controlling erasure of data of the first program in the first storage partition.
  • the data of the old program is controlled to be erased so that the storage partition storing the old program data can be used to receive the new program data, so that the storage partition can receive the data required for the next program update.
  • the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written in the second storage partition, and when data of the second program in the second storage partition is detected, the first functional module is controlled to run the second program, including: when data in the second storage partition and the identification information of the first functional module in the fifth storage partition are detected, the first functional module is controlled to run the second program in the second storage partition.
  • a fifth storage partition which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written in the second storage partition, and when data of the second program in the second storage partition is detected, the first functional module is controlled to run the second program, including: when data in the second storage partition and the identification information of the first functional module in the fifth storage partition are detected, the first functional module is controlled to run the second program in the second storage partition.
  • whether the data required for program update has been written is determined based on the identification information.
  • the identification information of the first functional module is detected, it is determined that the first data has been written. Otherwise, it is considered that the first data has not been written, which helps to improve data retrieval efficiency.
  • a device for updating software comprising: a detection unit, for detecting a second storage partition when controlling a first functional module to run a first program in a first storage partition, the first functional module being a functional module of a first software of a controller, and a storage area of the controller including the first storage partition and the second storage partition; a processing unit, for controlling the first functional module to run the second program when the detection unit detects data of the second program in the second storage partition, wherein the data of the second program includes data associated with the update of the first functional module.
  • the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program data of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  • the flash file consists of M module data
  • the M module data correspond one-to-one to the M functional modules
  • the M module data include first module data
  • the first module data include the first data and first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module.
  • the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
  • the flash file consists of description information and module data
  • the description information includes first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module
  • the module data includes the first data
  • the flash file also includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
  • the storage area also includes a third storage partition
  • the third storage partition is used to store data of a third program of the second functional module
  • the second functional module is a newly added functional module of the first software
  • the processing unit is also used to: when the detection unit detects the data of the third program in the third storage partition, control the second functional module to run the third program.
  • the first functional module includes a first function and a second function
  • the interface address of the first function is associated with the first storage partition
  • the interface address of the second function is associated with the second storage partition
  • the processing unit is used to: control the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and run the second program in the second storage partition through the interface address of the second function.
  • the address of the data of the second program in the second storage partition is a pre-set fixed address
  • the storage area includes a fourth storage partition, which is used to store the fixed address; before the control of the first functional module changes from scheduling the interface address of the first function to scheduling the interface address of the second function, the processing unit is also used to: determine that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
  • the data of the second program includes functional data and configuration data
  • the processing unit before the first functional module that controls the second program runs the second program, the processing unit is also used to: perform integrity and/or consistency checks on the configuration data and the functional data, respectively.
  • the processing unit is further used to: control erasing of data of the first program in the first storage partition.
  • the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written in the second storage partition, and the processing unit is used to: when the detection unit detects the data in the second storage partition and the identification information of the first functional module in the fifth storage partition, control the first functional module to run the second program of the second storage partition.
  • a device for updating software comprising: a memory for storing a computer program; and a processor for executing the computer program stored in the memory, so that the device performs a method as in any possible implementation of the first aspect.
  • a smart device which includes an apparatus as in any possible implementation of the second aspect or the third aspect.
  • the intelligent driving device is a vehicle.
  • a computer program product comprising: a computer program code, when the computer program code is run on a computer, the computer executes the method in any possible implementation of the first aspect.
  • the above-mentioned computer program code may be stored in whole or in part on a first storage medium, wherein the first storage medium may be packaged together with the processor or may be packaged separately from the processor.
  • a computer-readable medium stores instructions, and when the instructions are executed by a processor, the processor implements the method in any possible implementation manner of the first aspect.
  • a chip comprising a circuit, the circuit being used to execute the method in any possible implementation manner of the first aspect above.
  • FIG1 is a schematic block diagram of a system architecture required for implementing a method for updating software provided in an embodiment of the present application
  • FIG2 is a schematic diagram of a storage area division of a controller provided in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of address mapping between data of a program of a functional module and a storage partition provided in an embodiment of the present application;
  • FIG4 is a schematic flow chart of a method for updating software provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a flash file provided in an embodiment of the present application.
  • FIG6 is another schematic diagram of a flash file provided in an embodiment of the present application.
  • FIG. 7 is a schematic flow chart of data verification in the software update process provided by an embodiment of the present application.
  • FIG8 is a schematic block diagram of a device for updating software provided in an embodiment of the present application.
  • FIG. 9 is another schematic block diagram of the apparatus for updating software provided in an embodiment of the present application.
  • At least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple.
  • prefixes such as "first" and “second” used in the embodiments of the present application are only used to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects.
  • the use of prefixes such as ordinal numbers used to distinguish description objects in the embodiments of the present application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and the use of such prefixes should not constitute an unnecessary limitation.
  • the OTA method is used to write the data of the new software program to the unused storage partition when the vehicle is running or stationary.
  • the starting address jumps to run the new software program in the storage partition.
  • the present application provides a method, apparatus and intelligent device for updating software, which partitions the storage area of the controller according to the functional modules, and each functional module with an update requirement corresponds to at least two storage partitions, wherein one storage partition (hereinafter referred to as the active area) is used to store the data of the running software program, and the other storage partition (hereinafter referred to as the backup area) is used to store the data of the new software program.
  • the active area one storage partition
  • the backup area is used to store the data of the new software program.
  • the new software program in the backup area can be run in the form of a pointer, so that the controller can run the latest software program without re-powering on, which helps to improve the speed and convenience of software updates.
  • the software program is divided into one or more functional modules, each of which can complete a sub-function of the software program, and the one or more functional modules as a whole can meet the required functions of the entire software program.
  • FIG1 is a schematic block diagram of a system architecture required for implementing a method for updating software provided in an embodiment of the present application.
  • the system includes a communication bus, a controller, a gateway, and a host computer.
  • the data of the new software program can be transmitted to the controller via a wireless communication system such as wireless fidelity (Wi-Fi) via a gateway; or, the data of the new software program can be transmitted to the controller via a host computer.
  • Wi-Fi wireless fidelity
  • the communication bus can be a controller area network/local interconnect network bus (controller area network/local interconnect network bus, CAN/LIN bus), and the controller can include at least one of an electronic control unit (ECU), a micro control unit (MCU), a vehicle domain controller (VDC), a mobile data center (MDC), and a chassis domain controller (CDC), or the controller can also be other programmable electronic control units with storage functions.
  • ECU electronice control unit
  • MCU micro control unit
  • VDC vehicle domain controller
  • MDC mobile data center
  • CDC chassis domain controller
  • the storage area of the controller is partitioned according to the functional modules.
  • only one storage partition such as an active area
  • at least two storage partitions for example, including an active area and a backup area
  • Figure 2 shows a schematic diagram of the storage area division of a controller provided by an embodiment of the present application. As shown in Figure 2, for all functional modules (i.e., functional modules 1 to m), an active area is divided for them in the storage area; for functional modules with update requirements (such as functional modules 3 to m), a backup area is divided for them in the storage area.
  • the active area is the storage partition required for the operation of the functional module, which is used to store the data of the running program;
  • the backup area is a storage partition for storing the data of the new program of the functional module, and the new data is used for the update of the functional module.
  • a cache area can also be divided in the storage area for caching the data of the above-mentioned new program.
  • the space of the cache area is greater than or equal to the space required for the maximum functional module to store program data.
  • reserved storage partitions can also be divided in the storage area, such as reserved active areas and reserved backup areas, which are used to meet the operation requirements of the newly added functional modules and the update requirements of the newly added functional modules, respectively.
  • the interfaces also need to be designed and the addresses need to be fixed in the above-mentioned reserved storage partitions.
  • the number of newly added functional modules and the size of the space occupied need to be simulated and scheduled in the operating system in advance to prevent uncontrollable phenomena in the operating system scheduling timing or insufficient storage space.
  • a timing analysis tool can be used to simulate the mounting test of the new functional module, and appropriate storage space and interface addresses can be reserved in the storage space and operating system without affecting the safe operation of the controller.
  • the data of the program of the functional module is composed of a functional function and configuration data.
  • Each functional module may include one or more functional functions and configuration data.
  • the one or more functional functions may be placed in a main function, or may be placed in multiple main functions.
  • Each main function includes a logic code that implements the corresponding function of the functional module.
  • the operating system of the controller implements the normal operation of the functional module by calling the main function interface.
  • the configuration data, the functional function interface, and the main function interface in the functional module are respectively set to correspond to the address in the storage area.
  • FIG3 shows a schematic diagram of the address mapping between the data of the program of a functional module and a storage partition (active area or backup area). It should be understood that other configuration data can be found based on the first address of the configuration data in the storage area.
  • FIG4 shows a schematic flow chart of a method 400 for updating software provided in an embodiment of the present application.
  • the method may be executed by a controller, and exemplarily, may be executed by an operating system of the controller.
  • the method 400 may include:
  • the first functional module can be one of the functional modules 3 to m in the above-mentioned embodiment, or it can also be other functional modules with update requirements;
  • the first storage partition can be an active area pre-configured for the first functional module;
  • the second storage partition can be a backup area pre-configured for the first functional module.
  • S402 When detecting data of a second program in a second storage partition, control the first functional module to run the second program, wherein the data of the second program includes data associated with updating of the first functional module.
  • the validity, integrity and consistency of the data of the second program need to be checked before controlling the first functional module to run the second program. After the check passes, the first functional module is controlled to run the second program of the second storage partition.
  • the first functional module runs the second program of the second storage partition and detects the data of the new program of the first storage partition, the first functional module can be controlled to run the new data of the first storage partition.
  • the pointer variables of the configuration data of the first storage partition and the second storage partition, and the function pointers pointing to the function functions of the first storage partition and the second storage partition can be pre-defined for the first functional module, and the addresses of the function functions in the first storage partition and the second storage partition are solidified respectively.
  • the function functions of the first functional module corresponding to the first storage partition and the second storage partition are defined.
  • the function function can use the if-else logic structure to determine the configuration data it calls.
  • the operating system controls the operation of the first functional module
  • the modules when the module is initialized, the addresses of the configuration data of the pre-configured first functional module in the first storage partition and the second storage partition, and the address of the main function interface are assigned to the pointer variable and the function pointer respectively.
  • the function pointer pointing to the interface address of the first functional module in the first storage partition and the second storage partition is set in the main function of the first functional module, and the program of only one storage partition is run through conditional judgment.
  • the operating system when the operating system runs the program of the first functional module, it scans all reserved new module interface addresses. If it detects that there is new program data in the reserved storage partition, it means that there is a new functional module; the operating system then performs corresponding scheduling to run the program of the new functional module.
  • the data of the second program is derived from a flash file.
  • the flash file includes first data and information about the first data, which is used to indicate the start and/or end of the first data; wherein the first data is any data in the data of the program of the M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  • keywords are used to segment the header and tail of each functional module, so that when the controller receives the data, the start and end of each functional module data (i.e., the data of the above-mentioned new program) can be determined.
  • the information of the first data can include the start address of functional module 1, and at least one of the end address and data length.
  • the flash file is composed of M module data, the M module data correspond one-to-one to the M functional modules, and the M module data include first module data, the first module data includes the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
  • the first data is the data of the program of functional module 1 (i.e., the functional module 1 data shown in the figure)
  • the first module data can be as shown in the dotted box 501 in FIG5.
  • the first description information can include adding a unique code (Identity document, ID) of the module to the header of the functional module data, or can also include one or more of the starting address, data length, end address, and security check value.
  • the flash file is composed of description information and module data
  • the description information includes first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module
  • the module data includes the first data.
  • the description information may be as shown in the dotted box 601 in FIG. 6, the description information may include relevant information of all functional modules of the software that need to be updated, and the module data may be as shown in the dotted box 602 in FIG. 6.
  • relevant information of the data may be added to the header and/or tail of each functional module data, so that the operating system can perform integrity and consistency checks on the received data.
  • the security check value is used to perform cyclic redundancy check (CRC) or other types of checks on the functional module data.
  • CRC cyclic redundancy check
  • null bytes or other byte data may be filled at both the header and tail of the functional module data to align the file width.
  • a security check value (such as a check value of all module data) may be written into the header and/or tail of the flash file shown in FIG. 5 to verify the entire file.
  • a security check value (such as a check value of all module data) may be written at the head and/or tail of the flash file to verify the entire file.
  • the method for updating software provided in the embodiment of the present application can realize that when the functional module is running the software program in the active area and detects that there is new software program data in the backup area, the new software program in the backup area can be run, so that the controller can run the latest software program without re-powering on, which helps to improve the speed and convenience of software updates.
  • the software by modularizing the software, only individual functional modules or new functional modules can be updated, and online real-time updates of the software can be achieved without recompiling the entire software, which helps to reduce the time required for software updates.
  • the data block segmentation of the flash file according to the functional module can prevent the situation where all data is unavailable due to a sudden interruption of data flashing, and the security of the data can be improved by adding security checks.
  • pointer variables pointing to the configuration data of the first storage partition and the second storage partition, as well as function pointers pointing to the function functions of the first storage partition and the second storage partition corresponding to the first functional module can be defined respectively.
  • the implementation code is as follows (lines 1 to 36), using memory mapping (memorymap, memmap) for address fixing:
  • the function functions of the first function module corresponding to the first storage partition and the second storage partition are defined respectively, and the above function functions can determine the configuration data they call through logical structures such as if-else.
  • the implementation code is as follows (lines 37 to 75):
  • the operating system controls the operation of the first functional module
  • the module when the module is initialized, the address of the configuration data of the pre-configured first functional module in the first storage partition and the second storage partition, and the address of the main function interface are assigned to the pointer variable and the function pointer respectively.
  • the main function of the first functional module sets a function pointer pointing to the interface address of the first functional module in the first storage partition and the second storage partition, and only runs the program of one storage partition through conditional judgment.
  • the following code (lines 76 to 104) can be used to implement running only the program in one storage partition at a time:
  • the operating system in order to achieve real-time update of the first functional module during operation, the operating system will scan the second storage area for new program data when controlling the operation of the program in the first storage area. If the second storage area has new program data written, and the validity, integrity, and consistency of the data are verified, the operating system controls the functional module to run the program in the second storage area.
  • the process is shown in FIG7 and may include:
  • the data of the update program may be data for updating the first functional module. It should be understood that the data of the update program includes configuration data and functional data of the first functional module.
  • S705 Determine whether the validity check of the data in the second storage partition passes.
  • S706 Determine whether the integrity and consistency check of the second storage partition configuration data passes.
  • control function calls the second storage partition configuration data.
  • the operating system can perform integrity and consistency checks by comparing the module ID and address information recorded at the beginning and end of the first module data with the pre-set information, and comparing the calculated check value with the security check value to see if they are consistent. If the comparison results are the same, the data is considered to be received complete and consistent.
  • the first storage partition can be used to store data required for the next software update.
  • the solutions of any one of S704', S7065, S7075 and S709 are implemented by a function for erasing a storage area.
  • a function for erasing a storage area at least one of the following information needs to be included in the function parameters: the starting address and length of the target location of the storage area, and the starting address and length of the data to be written.
  • the function needs to be designed as a non-reentrant type, and has corresponding return values for the erasing results and errors in the process.
  • the above-mentioned processing measure for data verification failure can be to copy the data multiple times and verify, and if the number of failures exceeds a preset number, the data copying is stopped and the error type is returned.
  • the preset number of failures can be 10 times, or 20 times, or other values.
  • the first software when the first software in the above embodiment is updated, the first software may have a corresponding new function module after the update, and the main function interface pointer of the new function module may be set in advance in the operating system.
  • the operating system will scan the reserved storage partition (such as the third storage partition) used to store the interface address of the new module during operation. If it is checked that the reserved storage partition has the data of the program of the new function module, and the verification result of the data is valid, the operating system schedules the corresponding function pointer and runs the function of the new module.
  • the operation of the new function module can be implemented by the following code (lines 105 to 117):
  • the address pointed to by the pointer is valid. If the address is valid, the pointer is scheduled, otherwise an error value is returned and the scheduling of the pointer is stopped. In one example, it is possible to determine whether the address pointed to by the pointer is a null address to determine whether the address is valid. If the address is not a null address, the address is valid, otherwise the address is invalid. In another example, when it is determined that the address pointed to by the pointer is not a null address, it is determined whether the address pointed to by the pointer is consistent with the address expected by the pointer. If they are consistent, the address is valid, otherwise the address is invalid.
  • the interface address data of all functional modules are saved to a certain area of the controller (e.g., the fourth storage partition) for solidification when the controller leaves the factory, wherein the interface addresses of all functional modules include the pre-designed interface addresses of newly added functional modules. Furthermore, when judging the validity of the backup area data, the operating system compares the pointer value with the pre-stored functional module interface address. If they are consistent, the validity of the backup area data can be further judged; if they are inconsistent, the corresponding error value is returned.
  • the functional module ID is written into an array or an allocated fixed storage area (e.g., the fifth storage partition).
  • the operating system can determine which functional module data has been written by cyclically searching the array data or the functional module ID of the fixed storage area. Furthermore, the security and consistency of the functional module data can be checked, and the functional module ID is deleted from the fixed storage area after the check is successful.
  • the address allocation of configuration data and function functions in the above embodiments is to facilitate the main function call within a function module.
  • configuration data and function functions that need to be called between function modules it is necessary to set up an independent storage space in the storage area to store the configuration data and function functions called across function modules.
  • a spin lock can also be used for protection.
  • FIG8 shows a schematic block diagram of a software updating device 800 provided in an embodiment of the present application.
  • the device 800 includes a detection unit 810 and a processing unit 820 .
  • the device 800 may include units for executing the method in Fig. 4. Moreover, each unit in the device 800 and the other operations and/or functions described above are respectively for implementing the corresponding processes of the method embodiment in Fig. 4.
  • the detection unit 810 may be used to execute S401 in the method 400
  • the processing unit 820 may be used to execute S402 in the method 400 .
  • the detection unit 810 is used to: detect the second storage partition when controlling the first functional module to run the first program of the first storage partition, the first functional module is a functional module of the first software of the controller, and the storage area of the controller includes the first storage partition and the second storage partition; the processing unit 820 is used to: when the detection unit 810 detects data of the second program of the second storage partition, control the first functional module to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
  • the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  • the flash file consists of M module data
  • the M module data correspond one-to-one to the M functional modules
  • the M module data include first module data
  • the first module data includes the first data and first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module.
  • the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
  • the flash file consists of description information and module data
  • the description information includes first description information of the first data
  • the first description information is used to describe the relationship between the first data and the first functional module
  • the module data includes the first data
  • the flash file further includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
  • the storage area also includes a third storage partition, which is used to store data of a third program of a second functional module.
  • the second functional module is a new functional module of the first software.
  • the processing unit 820 is also used to control the second functional module to run the third program when the detection unit 810 detects the data of the third program in the third storage partition.
  • the third storage partition may include the reserved backup area and/or the reserved active area in the above embodiment.
  • the first functional module includes a first function and a second function
  • the interface address of the first function is associated with the first storage partition
  • the interface address of the second function is associated with the second storage partition
  • the processing unit 820 is used to: control the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and run the second program in the second storage partition through the interface address of the second function.
  • the address of the data of the second program in the second storage partition is a pre-set fixed address
  • the storage area includes a fourth storage partition, which is used to store the fixed address; before the control of the first functional module changes from scheduling the interface address of the first function to scheduling the interface address of the second function, the processing unit 820 is also used to: determine that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
  • the data of the second program includes functional data and configuration data.
  • the processing unit 820 is further used to perform integrity and/or consistency checks on the configuration data and the functional data, respectively.
  • the processing unit 820 is further used to: control erasure of data of the first program in the first storage partition.
  • the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written into the second storage partition.
  • the processing unit 820 is used to: when the detection unit 810 detects the data of the second storage partition and the identification information of the first functional module in the fifth storage partition, control the first functional module to run the second program of the second storage partition.
  • the identification information of the first functional module may include the functional module ID in the above embodiment.
  • the device 800 may be provided in the controller shown in FIG. 1 .
  • the division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated.
  • the units in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory.
  • the processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of the units of the device, wherein the processor is, for example, a general-purpose processor, such as a CPU or a microprocessor, and the memory is a memory in the device or a memory outside the device.
  • the units in the device can be implemented in the form of hardware circuits, and the functions of some or all of the units can be realized by designing the hardware circuits.
  • the hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for example, in another implementation, the hardware circuit can be implemented by PLD.
  • FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured through the configuration file, so as to realize the functions of some or all of the above units. All units of the above device may be implemented entirely in the form of a processor calling software, or entirely in the form of a hardware circuit, or partially in the form of a processor calling software and the rest in the form of a hardware circuit.
  • the processor is a circuit with the ability to process signals.
  • the processor can be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor can implement certain functions through the logical relationship of the hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA.
  • the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units.
  • it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
  • each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
  • processors or processing circuits
  • the units in the above device can be fully or partially integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device.
  • the type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
  • FIG9 is a schematic block diagram of a device for updating software according to an embodiment of the present application.
  • the device 900 for updating software shown in FIG9 may include: a processor 910, a transceiver 920, and a memory 930.
  • the processor 910, the transceiver 920, and the memory 930 are connected via an internal connection path, the memory 930 is used to store instructions, the processor 910 is used to execute the instructions stored in the memory 930, and the transceiver 920 receives/sends some parameters.
  • the memory 930 may be coupled to the processor 910 via an interface, or may be integrated with the processor 910.
  • transceiver 920 may include but is not limited to a transceiver device such as an input/output interface to achieve communication between the device 900 and other devices or communication networks.
  • Memory 930 can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).
  • ROM read-only memory
  • RAM random access memory
  • the transceiver 920 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the apparatus 900 and other devices or a communication network.
  • a transceiver device such as, but not limited to, a transceiver to implement communication between the apparatus 900 and other devices or a communication network.
  • the device 900 may be disposed in the controller shown in FIG. 1 .
  • An embodiment of the present application further provides a smart device, which may include the above-mentioned device 800 or the above-mentioned device 900.
  • the smart device may be a vehicle.
  • the embodiment of the present application also provides a computer program product, which includes a computer program code.
  • the computer program code runs on a computer, the computer implements the method in the embodiment of the present application.
  • the embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions.
  • the computer instructions When the computer instructions are executed on a computer, the computer implements the method in the embodiment of the present application.
  • the embodiment of the present application also provides a chip, including a circuit, for executing the method in the embodiment of the present application.
  • each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution.
  • the software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or a power-on erasable programmable memory, a register, etc.
  • the storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application can essentially or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application.
  • the aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

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

A method and apparatus for updating software, and an intelligent device. The method comprises: when a first functional module is controlled to run a first program in a first storage partition, performing detection on a second storage partition, wherein the first functional module is a functional module of first software of a controller, and a storage area of the controller comprises the first storage partition and the second storage partition; and when data of a second program in the second storage partition is detected, controlling the first functional module to run the second program, wherein the data of the second program comprises data associated with the updating of the first functional module. The method of the present application can be applied to intelligent devices such as an intelligent vehicle and an electric vehicle, and the latest software program can be run without the need for powering on a controller of an intelligent device again, thereby facilitating an improvement in the speed and convenience of software updating.

Description

更新软件的方法、装置和智能设备Method, device and intelligent device for updating software 技术领域Technical Field
本申请涉及计算机技术领域,更具体地,涉及一种更新软件的方法、装置和智能设备。The present application relates to the field of computer technology, and more specifically, to a method, apparatus and intelligent device for updating software.
背景技术Background technique
随着智能技术的发展,智能设备中的软件更新换代的速度也逐渐加快,在一个智能设备的生命周期中,可能需要进行多次软件更新。以车辆为例,通常会通过空中下载技术(over the air,OTA)进行车辆控制器的软件更新。采用OTA的方式进行软件更新时,通常要求控制器具备存储分区,其中一个存储分区用于存储新的数据。在软件需要更新时,一般在控制器执行应用代码时接收新的数据并存储至相应存储分区,待控制器重新上电时,控制器的引导装载程序(bootloader)进行起始地址跳转来运行新的软件程序。上述控制器重新上电的过程,影响软件更新过程的速度以及便捷度。With the development of intelligent technology, the speed of software updates in intelligent devices is also gradually accelerating. During the life cycle of an intelligent device, multiple software updates may be required. Taking vehicles as an example, the software of the vehicle controller is usually updated through over the air (OTA). When the software is updated by OTA, the controller is usually required to have storage partitions, one of which is used to store new data. When the software needs to be updated, the new data is generally received and stored in the corresponding storage partition when the controller executes the application code. When the controller is powered on again, the bootloader of the controller jumps to the starting address to run the new software program. The above-mentioned process of re-powering the controller affects the speed and convenience of the software update process.
鉴于此,一种无需控制器重新上电即可运行新的软件的更新方案亟待开发。In view of this, an update solution that can run new software without restarting the controller needs to be developed urgently.
发明内容Summary of the invention
本申请实施例提供一种更新软件的方法、装置和智能设备,能够使得控制器无需重新上电,即可运行最新的软件程序,有助于提高软件更新的速度和便捷性。The embodiments of the present application provide a method, apparatus and intelligent device for updating software, which can enable the controller to run the latest software program without re-powering on, thereby helping to improve the speed and convenience of software updates.
第一方面,提供了一种更新软件的方法,该方法可以由智能设备执行;或者,也可以由智能设备的控制器执行;或者,还可以由用于智能设备的芯片或电路执行,本申请对此不作限定。In a first aspect, a method for updating software is provided, which can be executed by a smart device; or, it can also be executed by a controller of the smart device; or, it can also be executed by a chip or circuit used for the smart device, which is not limited in the present application.
本申请涉及的智能设备可以包括路上交通工具、水上交通工具、空中交通工具、工业设备、农业设备、或娱乐设备等。例如智能设备可以为车辆,该车辆为广义概念上的车辆,可以是交通工具(如商用车、乘用车、摩托车、飞行车、火车等),工业车辆(如:叉车、挂车、牵引车等),工程车辆(如挖掘机、推土车、吊车等),农用设备(如割草机、收割机等),游乐设备,玩具车辆等,本申请实施例对车辆的类型不作具体限定。再如,智能设备可以为飞机、或轮船等交通工具。或者,该智能设备还可以包括智能手机、智能家居等设备。The smart devices involved in this application may include road vehicles, water vehicles, air vehicles, industrial equipment, agricultural equipment, or entertainment equipment, etc. For example, the smart device can be a vehicle, which is a vehicle in a broad sense, and can be a vehicle (such as a commercial vehicle, a passenger car, a motorcycle, a flying car, a train, etc.), an industrial vehicle (such as a forklift, a trailer, a tractor, etc.), an engineering vehicle (such as an excavator, a bulldozer, a crane, etc.), agricultural equipment (such as a lawn mower, a harvester, etc.), amusement equipment, a toy vehicle, etc. The embodiment of this application does not specifically limit the type of vehicle. For another example, the smart device can be a vehicle such as an airplane or a ship. Alternatively, the smart device can also include devices such as a smart phone and a smart home.
该方法包括:在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,该第一功能模块为控制器的第一软件的一个功能模块,该控制器的存储区域包括该第一存储分区和该第二存储分区;在检测到该第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,其中,该第二程序的数据包括与该第一功能模块更新相关联的数据。The method includes: when controlling a first functional module to run a first program in a first storage partition, detecting a second storage partition, the first functional module is a functional module of a first software of a controller, and a storage area of the controller includes the first storage partition and the second storage partition; when detecting data of a second program in the second storage partition, controlling the first functional module to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
在上述技术方案中,在控制功能模块在运行第一存储分区的软件程序,且检测到第二存储分区有新的软件程序的数据时,可以运行该第二存储分区的新的软件程序,能够实现无需控制器重新上电,即可运行最新的软件程序,有助于提高软件更新的速度和便捷性。 并且在软件更新过程中,可以只更新个别有更新需求的功能模块,减少软件更新所需时长。In the above technical solution, when the control function module is running the software program in the first storage partition and detects that the second storage partition has data of a new software program, the new software program in the second storage partition can be run, so that the latest software program can be run without re-powering the controller, which helps to improve the speed and convenience of software updates. In addition, during the software update process, only individual function modules that need to be updated can be updated, reducing the time required for software updates.
在一些可能的实现方式中,一个控制器可以只包括一个软件,或者也可以包括两个及以上软件。In some possible implementations, a controller may include only one software, or may include two or more software.
在一些可能的实现方式中,该第一软件可以只包括第一功能模块;或者,除了第一功能模块以外,该第一软件还可以包括其他功能模块。In some possible implementations, the first software may include only the first functional module; or, in addition to the first functional module, the first software may also include other functional modules.
以控制器为车辆的助力转向控制器为例,则该第一软件可以为能够实现助力转向的软件,该软件可以包括传感器信号采集、扭矩计算、电机控制等功能,则根据上述功能可以将该软件划分为多个功能模块。例如,将软件划分为至少三个功能模块,其中,三个功能模块分别用于实现传感器信号采集、扭矩计算、电机控制的功能。示例性地,该第一功能模块可以为上述三个功能模块中的一个;或者,在一些可能的实现方式中,传感器信号采集、扭矩计算、电机控制等功能还可以进一步细化为更小的功能模块,则该第一功能模块也可以为上述更小的功能模块中的一个。Taking the controller as a power steering controller of a vehicle as an example, the first software can be software that can realize power steering. The software can include functions such as sensor signal acquisition, torque calculation, and motor control. The software can be divided into multiple functional modules according to the above functions. For example, the software is divided into at least three functional modules, wherein the three functional modules are respectively used to realize the functions of sensor signal acquisition, torque calculation, and motor control. Exemplarily, the first functional module can be one of the above three functional modules; or, in some possible implementations, the functions such as sensor signal acquisition, torque calculation, and motor control can be further refined into smaller functional modules, and the first functional module can also be one of the above smaller functional modules.
在一些可能的实现方式中,在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,该第一功能模块为控制器的一个功能模块,该控制器的存储区域包括该第一存储分区和该第二存储分区;在检测到该第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,其中,该第二程序的数据包括与该第一功能模块更新相关联的数据。In some possible implementations, when controlling a first functional module to run a first program in a first storage partition, a second storage partition is detected, and the first functional module is a functional module of a controller, and a storage area of the controller includes the first storage partition and the second storage partition; when data of a second program in the second storage partition is detected, the first functional module is controlled to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
结合第一方面,在第一方面的某些实现方式中,该第二程序的数据来源于刷写文件,该刷写文件包括第一数据以及第一数据的信息,该信息用于指示该第一数据的起始和/或终止;其中,该第一数据为该第一软件的M个功能模块的程序的数据中任一数据,该M个功能模块包括该第一功能模块,M为大于或等于1的整数。In combination with the first aspect, in certain implementations of the first aspect, the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
在一些可能的实现方式中,第一软件中的包括多于M个功能模块的功能模块,但是只有M个功能模块需要进行更新,则刷写文件中可以只包括与该M个功能模块对应的数据。In some possible implementations, the first software includes more than M functional modules, but only M functional modules need to be updated, and the flash file may only include data corresponding to the M functional modules.
示例性地,该第一数据的信息可以包括第一数据在存储区域的起始地址和结束地址;或者,第一数据的信息可以包括第一数据在存储区域的起始地址和数据长度。Exemplarily, the information of the first data may include a start address and an end address of the first data in the storage area; or, the information of the first data may include a start address and a data length of the first data in the storage area.
在一些可能的实现方式中,存储区域中为第一数据分配的地址为预先设置的,在该第一数据的尾部可以增加校验信息,在该校验信息后增加填充数据,则该填充数据可以指示第一数据的结束位置,该填充数据可以理解为第一数据的信息的一种。示例性地,在控制器的存储区域(如,第一存储分区和/或第二存储分区)中为第一功能模块预先配置存储数据的起始位置和终止位置,例如,为第一功能模块预配置300个字节,则第一数据在第二存储分区中共占用150个字节;若校验信息长度为2字节,则预留第299字节和第300字节存储校验信息,第一数据末尾的剩余字节(即第151字节至第298字节)用于存储填充数据,应理解,根据该填充数据可以确定第一数据的结束位置。In some possible implementations, the address allocated to the first data in the storage area is pre-set, and verification information can be added to the end of the first data, and padding data is added after the verification information, then the padding data can indicate the end position of the first data, and the padding data can be understood as a kind of information of the first data. Exemplarily, the starting position and the end position of the storage data are pre-configured for the first functional module in the storage area of the controller (such as the first storage partition and/or the second storage partition), for example, 300 bytes are pre-configured for the first functional module, and the first data occupies a total of 150 bytes in the second storage partition; if the length of the verification information is 2 bytes, the 299th byte and the 300th byte are reserved for storing the verification information, and the remaining bytes at the end of the first data (i.e., the 151st byte to the 298th byte) are used to store the padding data. It should be understood that the end position of the first data can be determined based on the padding data.
在上述技术方案中,根据软件的功能模块对刷写文件进行模块化划分,可以降低数据刷写突然中断造成全部数据不可用的可能性。In the above technical solution, the flash files are modularly divided according to the functional modules of the software, which can reduce the possibility of all data being unavailable due to a sudden interruption of data flashing.
结合第一方面,在第一方面的某些实现方式中,该刷写文件由M个模块数据组成,该M个模块数据与该M个功能模块一一对应,该M个模块数据包括第一模块数据,该第一模块数据包括该第一数据和该第一数据的第一描述信息,该第一描述信息用于描述该第 一数据与该第一功能模块的关系。In combination with the first aspect, in certain implementations of the first aspect, the flash file consists of M module data, the M module data correspond one-to-one to the M functional modules, the M module data include first module data, the first module data include the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
示例性地,该第一描述信息可以包括第一功能模块的标识信息,例如,可以包括第一功能模块ID;或者,该第一描述信息还可以包括与第一功能模块相关联的存储空间的信息,例如,可以包括用于存储第一数据的起始位置和/或终止位置的信息;或者,该第一描述信息还可以包括第一数据的数据长度的信息。Exemplarily, the first description information may include identification information of the first functional module, for example, may include the first functional module ID; or, the first description information may also include information of the storage space associated with the first functional module, for example, may include information of the starting position and/or ending position for storing the first data; or, the first description information may also include information of the data length of the first data.
结合第一方面,在第一方面的某些实现方式中,该第一描述信息还包括第一校验信息,该第一校验信息设置在该第一数据的头部和/或尾部,用于对该第一数据进行完整性和/或一致性校验。In combination with the first aspect, in certain implementations of the first aspect, the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
在上述技术方案中,通过第一校验信息对第一数据进行完整性和/或一致性校验,有助于提高数据安全性。In the above technical solution, integrity and/or consistency verification is performed on the first data using the first verification information, which helps to improve data security.
结合第一方面,在第一方面的某些实现方式中,该刷写文件由描述信息和模块数据组成,该描述信息包括该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系,该模块数据包括该第一数据。In combination with the first aspect, in certain implementations of the first aspect, the flash file consists of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data.
示例性地,该描述信息中还可以包括模块数据的数量信息,该数量信息用于表示模块数据中包括几个功能模块的数据。Exemplarily, the description information may also include quantity information of the module data, where the quantity information is used to indicate that the module data includes data of several functional modules.
结合第一方面,在第一方面的某些实现方式中,该刷写文件还包括第二校验信息,该第二校验信息设置在该刷写文件的头部和/或尾部,用于对该刷写文件进行完整性和/或一致性校验。In combination with the first aspect, in certain implementations of the first aspect, the flash file also includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
在上述技术方案中,通过第二校验信息对刷写文件的整体进行完整性和/或一致性校验,以防止对每个功能模块的数据校验通过的情况下刷写文件整体出现问题的情况,有助于提高数据安全性。In the above technical solution, the integrity and/or consistency of the entire flash file is checked through the second verification information to prevent the situation where the entire flash file has problems when the data verification of each functional module passes, which helps to improve data security.
结合第一方面,在第一方面的某些实现方式中,该存储区域还包括第三存储分区,该第三存储分区用于存储第二功能模块的第三程序的数据,该第二功能模块为该第一软件的新增功能模块,该方法还包括:在该第三存储分区检测到该第三程序的数据时,控制该第二功能模块运行该第三程序。In combination with the first aspect, in certain implementations of the first aspect, the storage area also includes a third storage partition, which is used to store data of a third program of a second functional module, and the second functional module is a new functional module of the first software. The method also includes: when the data of the third program is detected in the third storage partition, controlling the second functional module to run the third program.
在上述技术方案中,为第一软件的新增功能预留存储空间,在第一软件需要新增功能时,无需因为新增功能对控制器进行重新配置,只需在检测到该预留存储空间中的程序的数据时,控制该预留存储空间中的程序运行,即可实现新增功能的成功运行,有助于降低软件更新成本,节省软件更新所需时长。In the above technical solution, storage space is reserved for the new functions of the first software. When the first software needs a new function, there is no need to reconfigure the controller because of the new function. When the data of the program in the reserved storage space is detected, the program in the reserved storage space is controlled to run successfully, so as to achieve the successful operation of the new function, which helps to reduce the cost of software updates and save the time required for software updates.
结合第一方面,在第一方面的某些实现方式中,该第一功能模块包括第一函数和第二函数,该第一函数的接口地址与该第一存储分区相关联,该第二函数的接口地址与该第二存储分区相关联,控制该第一功能模块运行该第二程序,包括:控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址,通过该第二函数的接口地址运行该第二存储分区中的该第二程序。In combination with the first aspect, in certain implementations of the first aspect, the first functional module includes a first function and a second function, the interface address of the first function is associated with the first storage partition, and the interface address of the second function is associated with the second storage partition, and controlling the first functional module to run the second program includes: controlling the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and running the second program in the second storage partition through the interface address of the second function.
示例性地,第一函数可以为第一功能模块在第一存储分区中的功能函数,第二函数可以为第一功能模块在第二存储分区中的功能函数。“该第一函数的接口地址与该第一存储分区相关联”可以理解为:通过该接口地址可以读取第一存储分区中的数据,和/或运行第一存储分区中的程序。Exemplarily, the first function may be a function of the first functional module in the first storage partition, and the second function may be a function of the first functional module in the second storage partition. “The interface address of the first function is associated with the first storage partition” may be understood as: data in the first storage partition may be read through the interface address, and/or a program in the first storage partition may be run.
结合第一方面,在第一方面的某些实现方式中,该第二程序的数据在该第二存储分区 中的地址为预先设定的固定地址,该存储区域包括第四存储分区,该第四存储分区用于存储该固定地址;控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址之前,该方法还包括:确定该第二函数的接口地址与该第四存储分区中的该固定地址一致。In combination with the first aspect, in certain implementations of the first aspect, the address of the data of the second program in the second storage partition is a pre-set fixed address, and the storage area includes a fourth storage partition, which is used to store the fixed address; before controlling the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, the method also includes: determining that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
在上述技术方案中,在控制运行第二存储分区的第二程序之前,先判断接口地址的有效性,能够防止在接口地址被篡改的情况下运行不安全程序的情况,有助于提升功能模块的安全性。In the above technical solution, before controlling the running of the second program in the second storage partition, the validity of the interface address is first determined, which can prevent the running of unsafe programs when the interface address is tampered with, and help improve the security of the functional module.
结合第一方面,在第一方面的某些实现方式中,该第二程序的数据包括功能函数数据和配置数据,控制该第一功能模块运行该第二程序之前,该方法还包括:对该配置数据和该功能函数数据分别进行完整性和/或一致性校验。In combination with the first aspect, in certain implementations of the first aspect, the data of the second program includes functional data and configuration data, and before controlling the first functional module to run the second program, the method also includes: performing integrity and/or consistency checks on the configuration data and the functional data, respectively.
在上述技术方案中,对配置数据和功能函数数据分别进行校验,能够缩短数据校验所需时长,提高数据校验效率。In the above technical solution, the configuration data and the functional function data are verified separately, which can shorten the time required for data verification and improve the efficiency of data verification.
结合第一方面,在第一方面的某些实现方式中,该方法还包括:控制擦除该第一存储分区中的该第一程序的数据。In combination with the first aspect, in some implementations of the first aspect, the method further includes: controlling erasure of data of the first program in the first storage partition.
在上述技术方案中,在运行更新的程序后,控制擦除之前旧程序的数据,以使得该存储旧程序数据的存储分区可以用于接收新的程序数据,以便于该存储分区接收下次程序更新所需数据。In the above technical solution, after running the updated program, the data of the old program is controlled to be erased so that the storage partition storing the old program data can be used to receive the new program data, so that the storage partition can receive the data required for the next program update.
结合第一方面,在第一方面的某些实现方式中,该存储区域还包括第五存储分区,该第五存储分区用于存储该第一功能模块的标识信息,该标识信息用于表示与第一功能模块更新相关联的数据在该第二存储分区中写入完成,在检测到该第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,包括:在检测到该第二存储分区中的数据,以及该第五存储分区中该第一功能模块的标识信息时,控制该第一功能模块运行该第二存储分区的该第二程序。In combination with the first aspect, in certain implementations of the first aspect, the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written in the second storage partition, and when data of the second program in the second storage partition is detected, the first functional module is controlled to run the second program, including: when data in the second storage partition and the identification information of the first functional module in the fifth storage partition are detected, the first functional module is controlled to run the second program in the second storage partition.
在上述技术方案中,根据标识信息确定程序更新所需数据是否写入完成,在检测到第一功能模块的标识信息时,确定第一数据写入完成,否则认为第一数据未写入完成,有助于提高数据检索效率。In the above technical solution, whether the data required for program update has been written is determined based on the identification information. When the identification information of the first functional module is detected, it is determined that the first data has been written. Otherwise, it is considered that the first data has not been written, which helps to improve data retrieval efficiency.
第二方面,提供了一种更新软件的装置,该装置包括:检测单元,用于在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,该第一功能模块为控制器的第一软件的一个功能模块,该控制器的存储区域包括该第一存储分区和该第二存储分区;处理单元,用于在该检测单元检测到该第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,其中,该第二程序的数据包括与该第一功能模块更新相关联的数据。In a second aspect, a device for updating software is provided, the device comprising: a detection unit, for detecting a second storage partition when controlling a first functional module to run a first program in a first storage partition, the first functional module being a functional module of a first software of a controller, and a storage area of the controller including the first storage partition and the second storage partition; a processing unit, for controlling the first functional module to run the second program when the detection unit detects data of the second program in the second storage partition, wherein the data of the second program includes data associated with the update of the first functional module.
结合第二方面,在第二方面的某些实现方式中,该第二程序的数据来源于刷写文件,该刷写文件包括第一数据以及第一数据的信息,该信息用于指示该第一数据的起始和/或终止;其中,该第一数据为该第一软件的M个功能模块的程序的数据中任一数据,该M个功能模块包括该第一功能模块,M为大于或等于1的整数。In combination with the second aspect, in certain implementations of the second aspect, the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program data of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
结合第二方面,在第二方面的某些实现方式中,该刷写文件由M个模块数据组成,该M个模块数据与该M个功能模块一一对应,该M个模块数据包括第一模块数据,该第一模块数据包括该第一数据和该第一数据的第一描述信息,该第一描述信息用于描述该第 一数据与该第一功能模块的关系。In combination with the second aspect, in certain implementations of the second aspect, the flash file consists of M module data, the M module data correspond one-to-one to the M functional modules, the M module data include first module data, the first module data include the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
结合第二方面,在第二方面的某些实现方式中,该第一描述信息还包括第一校验信息,该第一校验信息设置在该第一数据的头部和/或尾部,用于对该第一数据进行完整性和/或一致性校验。In combination with the second aspect, in certain implementations of the second aspect, the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
结合第二方面,在第二方面的某些实现方式中,该刷写文件由描述信息和模块数据组成,该描述信息包括该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系,该模块数据包括该第一数据。In combination with the second aspect, in certain implementations of the second aspect, the flash file consists of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data.
结合第二方面,在第二方面的某些实现方式中,该刷写文件还包括第二校验信息,该第二校验信息设置在该刷写文件的头部和/或尾部,用于对该刷写文件进行完整性和/或一致性校验。In combination with the second aspect, in certain implementations of the second aspect, the flash file also includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
结合第二方面,在第二方面的某些实现方式中,该存储区域还包括第三存储分区,该第三存储分区用于存储第二功能模块的第三程序的数据,该第二功能模块为该第一软件的新增功能模块,该处理单元还用于:在该检测单元在该第三存储分区检测到该第三程序的数据时,控制该第二功能模块运行该第三程序。结合第二方面,在第二方面的某些实现方式中,该第一功能模块包括第一函数和第二函数,该第一函数的接口地址与该第一存储分区相关联,该第二函数的接口地址与该第二存储分区相关联,该处理单元用于:控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址,通过该第二函数的接口地址运行该第二存储分区中的该第二程序。In combination with the second aspect, in some implementations of the second aspect, the storage area also includes a third storage partition, the third storage partition is used to store data of a third program of the second functional module, the second functional module is a newly added functional module of the first software, and the processing unit is also used to: when the detection unit detects the data of the third program in the third storage partition, control the second functional module to run the third program. In combination with the second aspect, in some implementations of the second aspect, the first functional module includes a first function and a second function, the interface address of the first function is associated with the first storage partition, and the interface address of the second function is associated with the second storage partition, and the processing unit is used to: control the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and run the second program in the second storage partition through the interface address of the second function.
结合第二方面,在第二方面的某些实现方式中,该第二程序的数据在该第二存储分区中的地址为预先设定的固定地址,该存储区域包括第四存储分区,该第四存储分区用于存储该固定地址;该控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址之前,该处理单元还用于:确定该第二函数的接口地址与该第四存储分区中的该固定地址一致。In combination with the second aspect, in certain implementations of the second aspect, the address of the data of the second program in the second storage partition is a pre-set fixed address, and the storage area includes a fourth storage partition, which is used to store the fixed address; before the control of the first functional module changes from scheduling the interface address of the first function to scheduling the interface address of the second function, the processing unit is also used to: determine that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
结合第二方面,在第二方面的某些实现方式中,该第二程序的数据包括功能函数数据和配置数据,该控制该第一功能模块运行该第二程序之前,该处理单元还用于:对该配置数据和该功能函数数据分别进行完整性和/或一致性校验。In combination with the second aspect, in certain implementations of the second aspect, the data of the second program includes functional data and configuration data, and before the first functional module that controls the second program runs the second program, the processing unit is also used to: perform integrity and/or consistency checks on the configuration data and the functional data, respectively.
结合第二方面,在第二方面的某些实现方式中,该处理单元还用于:控制擦除该第一存储分区中的该第一程序的数据。In combination with the second aspect, in some implementations of the second aspect, the processing unit is further used to: control erasing of data of the first program in the first storage partition.
结合第二方面,在第二方面的某些实现方式中,该存储区域还包括第五存储分区,该第五存储分区用于存储该第一功能模块的标识信息,该标识信息用于表示与第一功能模块更新相关联的数据在该第二存储分区中写入完成,该处理单元用于:在该检测单元检测到该第二存储分区中的数据,以及该第五存储分区中该第一功能模块的标识信息时,控制该第一功能模块运行该第二存储分区的该第二程序。In combination with the second aspect, in certain implementations of the second aspect, the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written in the second storage partition, and the processing unit is used to: when the detection unit detects the data in the second storage partition and the identification information of the first functional module in the fifth storage partition, control the first functional module to run the second program of the second storage partition.
第三方面,提供了一种更新软件的装置,该装置包括:存储器,用于存储计算机程序;处理器,用于执行该存储器中存储的计算机程序,以使得该装置执行如第一方面任一种可能实现方式中的方法。In a third aspect, a device for updating software is provided, the device comprising: a memory for storing a computer program; and a processor for executing the computer program stored in the memory, so that the device performs a method as in any possible implementation of the first aspect.
第四方面,提供了一种智能设备,该智能设备包括如第二方面或第三方面任一种可能实现方式中的装置。In a fourth aspect, a smart device is provided, which includes an apparatus as in any possible implementation of the second aspect or the third aspect.
结合第四方面,在第四方面的某些实现方式中,该智能驾驶设备为车辆。In combination with the fourth aspect, in certain implementations of the fourth aspect, the intelligent driving device is a vehicle.
第五方面,提供了一种计算机程序产品,上述计算机程序产品包括:计算机程序代码,当上述计算机程序代码在计算机上运行时,使得计算机执行上述第一方面中任一种可能实现方式中的方法。In a fifth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run on a computer, the computer executes the method in any possible implementation of the first aspect.
需要说明的是,上述计算机程序代码可以全部或部分存储在第一存储介质上,其中第一存储介质可以与处理器封装在一起的,也可以与处理器单独封装。It should be noted that the above-mentioned computer program code may be stored in whole or in part on a first storage medium, wherein the first storage medium may be packaged together with the processor or may be packaged separately from the processor.
第六方面,提供了一种计算机可读介质,上述计算机可读介质存储有指令,当上述指令被处理器执行时,使得处理器实现上述第一方面中任一种可能实现方式中的方法。In a sixth aspect, a computer-readable medium is provided, wherein the computer-readable medium stores instructions, and when the instructions are executed by a processor, the processor implements the method in any possible implementation manner of the first aspect.
第七方面,提供了一种芯片,该芯片包括电路,该电路用于执行上述第一方面中任一种可能实现方式中的方法。In a seventh aspect, a chip is provided, the chip comprising a circuit, the circuit being used to execute the method in any possible implementation manner of the first aspect above.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请实施例提供的更新软件的方法实施所需的系统架构的示意性框图;FIG1 is a schematic block diagram of a system architecture required for implementing a method for updating software provided in an embodiment of the present application;
图2是本申请实施例提供的一种控制器的存储区域划分的示意图;FIG2 is a schematic diagram of a storage area division of a controller provided in an embodiment of the present application;
图3是本申请实施例提供的一个功能模块的程序的数据与一个存储分区之间的地址映射的示意图;3 is a schematic diagram of address mapping between data of a program of a functional module and a storage partition provided in an embodiment of the present application;
图4是本申请实施例提供的更新软件的方法的示意性流程图;FIG4 is a schematic flow chart of a method for updating software provided in an embodiment of the present application;
图5是本申请实施例提供的刷写文件的示意图;FIG5 is a schematic diagram of a flash file provided in an embodiment of the present application;
图6是本申请实施例提供的刷写文件的又一示意图;FIG6 is another schematic diagram of a flash file provided in an embodiment of the present application;
图7是本申请实施例提供的更新软件过程中进行数据校验的示意性流程图;7 is a schematic flow chart of data verification in the software update process provided by an embodiment of the present application;
图8是本申请实施例提供的更新软件的装置的一种示意性框图;FIG8 is a schematic block diagram of a device for updating software provided in an embodiment of the present application;
图9是本申请实施例提供的更新软件的装置的又一种示意性框图。FIG. 9 is another schematic block diagram of the apparatus for updating software provided in an embodiment of the present application.
具体实施方式Detailed ways
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is a kind of association relationship that describes associated objects, indicating that three relationships can exist, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In the present application, "at least one" means one or more, and "multiple" means two or more. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple.
本申请实施例中采用诸如“第一”、“第二”的前缀词,仅仅为了区分不同的描述对象,对被描述对象的位置、顺序、优先级、数量或内容等没有限定作用。本申请实施例中对序数词等用于区分描述对象的前缀词的使用不对所描述对象构成限制,对所描述对象的陈述参见权利要求或实施例中上下文的描述,不应因为使用这种前缀词而构成多余的限制。The prefixes such as "first" and "second" used in the embodiments of the present application are only used to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers used to distinguish description objects in the embodiments of the present application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and the use of such prefixes should not constitute an unnecessary limitation.
当前车辆的控制器中,常采用如下方式进行软件更新:In current vehicle controllers, software updates are often performed in the following ways:
其一,车辆在静止状态下,将上位机与车辆的控制器连接,控制器的bootloader将上位机下发的新的软件程序的数据写入控制器,待数据写入完成后,控制器重新上电开始运行更新后的软件程序。First, when the vehicle is stationary, connect the host computer to the vehicle's controller, and the controller's bootloader writes the data of the new software program sent by the host computer into the controller. After the data is written, the controller is powered on again to start running the updated software program.
其二,在车辆的控制器具备存储分区的条件下,车辆在运行或者静止状态下,采用 OTA的方式将新的软件程序的数据写入未使用的存储分区,待控制器重新上电时,进行起始地址跳转来运行存储分区中新的软件程序。Secondly, under the condition that the vehicle's controller has storage partitions, the OTA method is used to write the data of the new software program to the unused storage partition when the vehicle is running or stationary. When the controller is powered on again, the starting address jumps to run the new software program in the storage partition.
上述两种方式,都需要控制器重新上电才可以运行新的软件程序,不具备同一上电循环实时更新运行的能力。Both of the above methods require the controller to be powered on again before the new software program can be run, and do not have the ability to update and run in real time during the same power-on cycle.
鉴于此,本申请提供一种更新软件的方法、装置和智能设备,将控制器的存储区域按照功能模块进行分区,每个有更新需求的功能模块对应至少两个存储分区,其中,一个存储分区(以下称活动区)用于存储正在运行的软件程序的数据,另一个存储分区(以下称备份区)用于存储新的软件程序的数据。通过对功能模块的配置数据和主函数接口进行地址固化,并结合活动区和备份区与功能模块之间的地址映射,以使得功能模块在运行活动区的软件程序,且检测到备份区有新的软件程序的数据时,可以通过指针的形式运行备份区的新的软件程序,以使得控制器无需重新上电,即可运行最新的软件程序,有助于提高软件更新的速度和便捷性。In view of this, the present application provides a method, apparatus and intelligent device for updating software, which partitions the storage area of the controller according to the functional modules, and each functional module with an update requirement corresponds to at least two storage partitions, wherein one storage partition (hereinafter referred to as the active area) is used to store the data of the running software program, and the other storage partition (hereinafter referred to as the backup area) is used to store the data of the new software program. By solidifying the address of the configuration data and the main function interface of the functional module, and combining the address mapping between the active area and the backup area and the functional module, when the functional module is running the software program in the active area and detects that there is data of the new software program in the backup area, the new software program in the backup area can be run in the form of a pointer, so that the controller can run the latest software program without re-powering on, which helps to improve the speed and convenience of software updates.
需要说明的是,在本申请中,将软件程序划分为一个或多个功能模块,每个功能模块可以完成一个软件程序的子功能,该一个或多个功能模块组成的整体可以满足所要求的整个软件程序的功能。It should be noted that, in the present application, the software program is divided into one or more functional modules, each of which can complete a sub-function of the software program, and the one or more functional modules as a whole can meet the required functions of the entire software program.
下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
图1是本申请实施例提供的一种更新软件的方法实施所需的系统架构的示意性框图。如图1所示,该系统包括通信总线、控制器、网关和上位机。其中,在控制器需要进行软件更新时,新的软件程序的数据可以通过无线通信系统如无线保真技术(wireless fidelity,Wi-Fi),经由网关传输至控制器;或者,新的软件程序的数据可以经由上位机传输至控制器。以该系统处于车辆中为例,上述通信总线可以为控制器局域网络/局域互连网络总线(controller area network/local interconnect network bus,CAN/LIN bus),上述控制器可以包括电子控制单元(electronic control unit,ECU)、微控制单元(micro controller unit,MCU)车辆域控制器(vehicle domain controller,VDC)、移动数据中心(mobile data center,MDC)、底盘域控制器(chassis domain controller,CDC)中的至少一种,或者,该控制器还可以为其他带有存储功能的可编程电子控制单元。FIG1 is a schematic block diagram of a system architecture required for implementing a method for updating software provided in an embodiment of the present application. As shown in FIG1 , the system includes a communication bus, a controller, a gateway, and a host computer. Wherein, when the controller needs to perform a software update, the data of the new software program can be transmitted to the controller via a wireless communication system such as wireless fidelity (Wi-Fi) via a gateway; or, the data of the new software program can be transmitted to the controller via a host computer. Taking the system in a vehicle as an example, the communication bus can be a controller area network/local interconnect network bus (controller area network/local interconnect network bus, CAN/LIN bus), and the controller can include at least one of an electronic control unit (ECU), a micro control unit (MCU), a vehicle domain controller (VDC), a mobile data center (MDC), and a chassis domain controller (CDC), or the controller can also be other programmable electronic control units with storage functions.
为了实施本申请实施例提供的更新软件的方法,需要预先对控制器的存储区域进行划分,配置存储分区与功能模块之间的地址映射。In order to implement the method for updating software provided in the embodiment of the present application, it is necessary to divide the storage area of the controller in advance and configure the address mapping between the storage partitions and the functional modules.
示例性地,将控制器的存储区域按照功能模块进行分区,例如,对于没有更新需求的功能模块可以只设置一个存储分区(如活动区),对于每个有更新需求的功能模块可以对应设置至少两个存储分区(例如,包括活动区和备份区)。图2示出了本申请实施例提供的一种控制器的存储区域划分的示意图,如图2所示,对于所有功能模块(即功能模块1至m),在存储区域为其划分活动区;对于有更新需求的功能模块(如功能模块3至m),在存储区域为其划分备份区。其中,活动区是功能模块运行所需的存储分区,用于存储正在运行的程序的数据;备份区为用于存储功能模块的新程序的数据的存储分区,该新数据用于功能模块的更新。示例性地,还可以在存储区域划分缓存区,用于缓存上述新程序的数据。其中,该缓存区的空间要大于或等于最大功能模块存储程序数据所需空间。在一些可能的实现方式中,还可以在存储区域中划分预留存储分区,如预留活动区和预留备份区,分别用于满足新增功能模块的运行需求以及新增功能模块的更新需求。针对新增功能模块, 在上述预留存储分区中同样需要设计好接口并固定地址。在一些可能的实现方式中,对于新增功能模块数量和占用空间大小需要提前在操作系统进行模拟调度,防止操作系统调度时序出现不可控现象或者存储空间不足的问题。示例性地,在设计新增功能模块时,可以使用时序分析工具对新增功能模块进行模拟挂载测试,在不影响控制器运行安全的前提下,在存储空间和操作系统预留合适的存储空间和接口地址。Exemplarily, the storage area of the controller is partitioned according to the functional modules. For example, only one storage partition (such as an active area) can be set for the functional modules without update requirements, and at least two storage partitions (for example, including an active area and a backup area) can be set for each functional module with update requirements. Figure 2 shows a schematic diagram of the storage area division of a controller provided by an embodiment of the present application. As shown in Figure 2, for all functional modules (i.e., functional modules 1 to m), an active area is divided for them in the storage area; for functional modules with update requirements (such as functional modules 3 to m), a backup area is divided for them in the storage area. Among them, the active area is the storage partition required for the operation of the functional module, which is used to store the data of the running program; the backup area is a storage partition for storing the data of the new program of the functional module, and the new data is used for the update of the functional module. Exemplarily, a cache area can also be divided in the storage area for caching the data of the above-mentioned new program. Among them, the space of the cache area is greater than or equal to the space required for the maximum functional module to store program data. In some possible implementations, reserved storage partitions can also be divided in the storage area, such as reserved active areas and reserved backup areas, which are used to meet the operation requirements of the newly added functional modules and the update requirements of the newly added functional modules, respectively. For the newly added functional modules, the interfaces also need to be designed and the addresses need to be fixed in the above-mentioned reserved storage partitions. In some possible implementations, the number of newly added functional modules and the size of the space occupied need to be simulated and scheduled in the operating system in advance to prevent uncontrollable phenomena in the operating system scheduling timing or insufficient storage space. For example, when designing a new functional module, a timing analysis tool can be used to simulate the mounting test of the new functional module, and appropriate storage space and interface addresses can be reserved in the storage space and operating system without affecting the safe operation of the controller.
示例性地,功能模块的程序的数据由功能函数和配置数据组成,每个功能模块内部可以包括一个或多个功能函数以及配置数据,该一个或多个功能函数可以放在一个主函数内,或者可以放在多个主函数内,每个主函数包括实现功能模块相应功能的逻辑代码。进一步地,控制器的操作系统通过调用主函数接口的方式,实现功能模块的正常运行。在本申请实施例中,在配置存储分区与功能模块之间的地址映射时,分别设置好功能模块中的配置数据、功能函数接口、主函数接口对应在存储区域的地址。示例性地,图3所示为一个功能模块的程序的数据与一个存储分区(活动区或备份区)之间的地址映射示意。应理解,依据配置数据在存储区域的首地址,可以找到其他配置数据。Exemplarily, the data of the program of the functional module is composed of a functional function and configuration data. Each functional module may include one or more functional functions and configuration data. The one or more functional functions may be placed in a main function, or may be placed in multiple main functions. Each main function includes a logic code that implements the corresponding function of the functional module. Furthermore, the operating system of the controller implements the normal operation of the functional module by calling the main function interface. In an embodiment of the present application, when configuring the address mapping between the storage partition and the functional module, the configuration data, the functional function interface, and the main function interface in the functional module are respectively set to correspond to the address in the storage area. Exemplarily, FIG3 shows a schematic diagram of the address mapping between the data of the program of a functional module and a storage partition (active area or backup area). It should be understood that other configuration data can be found based on the first address of the configuration data in the storage area.
图4示出了本申请实施例提供的一种更新软件的方法400的示意性流程图,该方法可以由控制器执行,示例性地,可以由控制器的操作系统执行。该方法400可以包括:FIG4 shows a schematic flow chart of a method 400 for updating software provided in an embodiment of the present application. The method may be executed by a controller, and exemplarily, may be executed by an operating system of the controller. The method 400 may include:
S401,在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,该第一功能模块为控制器的第一软件的一个功能模块,该控制器的存储区域包括该第一存储分区和该第二存储分区。S401, detecting a second storage partition when controlling a first function module to run a first program of a first storage partition, wherein the first function module is a function module of a first software of a controller, and a storage area of the controller includes the first storage partition and the second storage partition.
示例性地,该第一功能模块可以为上述实施例中功能模块3至m中的一个,或者也可以为其他有更新需求的功能模块;该第一存储分区可以为预先为第一功能模块配置的活动区;该第二存储分区可以为预先为第一功能模块配置的备份区。Exemplarily, the first functional module can be one of the functional modules 3 to m in the above-mentioned embodiment, or it can also be other functional modules with update requirements; the first storage partition can be an active area pre-configured for the first functional module; the second storage partition can be a backup area pre-configured for the first functional module.
S402,在检测到第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,其中,该第二程序的数据包括与该第一功能模块更新相关联的数据。S402: When detecting data of a second program in a second storage partition, control the first functional module to run the second program, wherein the data of the second program includes data associated with updating of the first functional module.
在一些可能的实现方式中,控制该第一功能模块运行该第二程序之前,还需对该第二程序的数据进行有效性、完整性和一致性校验,在校验通过之后,再控制该第一功能模块运行该第二存储分区的第二程序。In some possible implementations, before controlling the first functional module to run the second program, the validity, integrity and consistency of the data of the second program need to be checked. After the check passes, the first functional module is controlled to run the second program of the second storage partition.
应理解,在第一功能模块运行第二存储分区的第二程序,且检测到第一存储分区的新程序的数据时,可以控制第一功能模块运行该第一存储分区的新的数据。It should be understood that when the first functional module runs the second program of the second storage partition and detects the data of the new program of the first storage partition, the first functional module can be controlled to run the new data of the first storage partition.
在一些可能的实现方式中,为了实现第一存储区域和第二存储区域中程序的交替运行,针对第一功能模块可以分别预先定义第一存储分区、第二存储分区的配置数据的指针变量,以及指向第一存储分区、第二存储分区的功能函数的函数指针,并分别对功能函数在第一存储分区以及第二存储分区的地址进行固化。进一步地,定义第一功能模块对应于第一存储分区和第二存储分区的功能函数。示例性地,该功能函数可以使用if-else的逻辑结构确定其调用的配置数据。进一步地,在操作系统控制第一功能模块运行时,在模块初始化时,将预先配置的第一功能模块在上述第一存储分区和第二存储分区的配置数据的地址、以及主函数接口的地址,分别赋给指针变量和函数指针。第一功能模块的主函数内设置指向该第一功能模块在第一存储分区和第二存储分区的接口地址的函数指针,通过条件判断只运行一个存储分区的程序。In some possible implementations, in order to realize the alternating operation of the program in the first storage area and the second storage area, the pointer variables of the configuration data of the first storage partition and the second storage partition, and the function pointers pointing to the function functions of the first storage partition and the second storage partition can be pre-defined for the first functional module, and the addresses of the function functions in the first storage partition and the second storage partition are solidified respectively. Further, the function functions of the first functional module corresponding to the first storage partition and the second storage partition are defined. Exemplarily, the function function can use the if-else logic structure to determine the configuration data it calls. Further, when the operating system controls the operation of the first functional module, when the module is initialized, the addresses of the configuration data of the pre-configured first functional module in the first storage partition and the second storage partition, and the address of the main function interface are assigned to the pointer variable and the function pointer respectively. The function pointer pointing to the interface address of the first functional module in the first storage partition and the second storage partition is set in the main function of the first functional module, and the program of only one storage partition is run through conditional judgment.
在一些可能的实现方式中,操作系统在运行第一功能模块的程序时,对所有预留的新 增模块接口地址进行扫描,若检测到预留存储分区有新的程序的数据时,代表有新增功能模块;则操作系统进行相应调度,运行该新增功能模块的程序。In some possible implementations, when the operating system runs the program of the first functional module, it scans all reserved new module interface addresses. If it detects that there is new program data in the reserved storage partition, it means that there is a new functional module; the operating system then performs corresponding scheduling to run the program of the new functional module.
在一些可能的实现方式中,该第二程序的数据来源于刷写文件,为了通过本申请实施例提供的更新软件的方法进行软件更新,需要对刷写文件(包括用于更新软件的数据)进行模块化划分。示例性地,该刷写文件包括第一数据以及第一数据的信息,该信息用于指示该第一数据的起始和/或终止;其中,该第一数据为该第一软件的M个功能模块的程序的数据中任一数据,该M个功能模块包括该第一功能模块,M为大于或等于1的整数。一示例中,如图5所示,对于软件的所有功能模块(如功能模块1至n),在每个功能模块的头部和尾部均使用关键字进行分割,使控制器接收到数据时,可以确定每个功能模块数据(即上述新的程序的数据)的起始和终止。又一示例中,如图6所示,以第一数据为功能模块1数据为例,第一数据的信息可以包括功能模块1的起始地址,以及结束地址和数据长度中的至少一个。In some possible implementations, the data of the second program is derived from a flash file. In order to perform software updates through the method for updating software provided in the embodiment of the present application, it is necessary to modularize the flash file (including the data for updating the software). Exemplarily, the flash file includes first data and information about the first data, which is used to indicate the start and/or end of the first data; wherein the first data is any data in the data of the program of the M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1. In one example, as shown in FIG5, for all functional modules of the software (such as functional modules 1 to n), keywords are used to segment the header and tail of each functional module, so that when the controller receives the data, the start and end of each functional module data (i.e., the data of the above-mentioned new program) can be determined. In another example, as shown in FIG6, taking the first data as the data of functional module 1 as an example, the information of the first data can include the start address of functional module 1, and at least one of the end address and data length.
在一些可能的实现方式中,该刷写文件由M个模块数据组成,该M个模块数据与该M个功能模块一一对应,该M个模块数据包括第一模块数据,该第一模块数据包括该第一数据和该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系。示例性地,以刷写文件为图5所示的文件为例,若第一数据为功能模块1的程序的数据(即图中所示功能模块1数据),则该第一模块数据可以如图5中的虚线框501框出部分所示。进一步地,第一描述信息可以包括在功能模块数据的头部添加模块的唯一编码(Identity document,ID),或者,也可以包括起始地址、数据长度、结束地址、安全校验值中的一个或多个。In some possible implementations, the flash file is composed of M module data, the M module data correspond one-to-one to the M functional modules, and the M module data include first module data, the first module data includes the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module. Exemplarily, taking the flash file as the file shown in FIG5 as an example, if the first data is the data of the program of functional module 1 (i.e., the functional module 1 data shown in the figure), the first module data can be as shown in the dotted box 501 in FIG5. Further, the first description information can include adding a unique code (Identity document, ID) of the module to the header of the functional module data, or can also include one or more of the starting address, data length, end address, and security check value.
在一些可能的实现方式中,该刷写文件由描述信息和模块数据组成,该描述信息包括该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系,该模块数据包括该第一数据。示例性地,以刷写文件为图6所示的文件为例,则描述信息可以如图6中的虚线框601框出部分所示,该描述信息可以包括软件的所有需要更新的功能模块的相关信息,模块数据可以如图6中的虚线框602框出部分所示。In some possible implementations, the flash file is composed of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data. Exemplarily, taking the flash file as the file shown in FIG. 6 as an example, the description information may be as shown in the dotted box 601 in FIG. 6, the description information may include relevant information of all functional modules of the software that need to be updated, and the module data may be as shown in the dotted box 602 in FIG. 6.
在一些可能的实现方式中,图5所示的刷写文件中,还可以在每个功能模块数据的头部和/或尾部增加该数据的相关信息,用于操作系统对接收到的数据进行完整性和一致性校验。安全校验值用于对功能模块数据进行循环冗余校验码(cyclic redundancy check,CRC)校验或者其他类型的校验。在一些可能的实现方式中,可以在功能模块数据的头部和尾部均填充空字节或者其他字节数据使文件宽度对齐。In some possible implementations, in the flash file shown in FIG5 , relevant information of the data may be added to the header and/or tail of each functional module data, so that the operating system can perform integrity and consistency checks on the received data. The security check value is used to perform cyclic redundancy check (CRC) or other types of checks on the functional module data. In some possible implementations, null bytes or other byte data may be filled at both the header and tail of the functional module data to align the file width.
在一些可能的实现方式中,还可以在图5所示的刷写文件头部和/或尾部写入一个安全校验值(如所有模块数据校验值)用于校验整个文件。In some possible implementations, a security check value (such as a check value of all module data) may be written into the header and/or tail of the flash file shown in FIG. 5 to verify the entire file.
在一些可能的实现方式中,图6所示的刷写文件中,可以在刷写文件头部和/或尾部写入一个安全校验值(如所有模块数据校验值)用于校验整个文件。In some possible implementations, in the flash file shown in FIG. 6 , a security check value (such as a check value of all module data) may be written at the head and/or tail of the flash file to verify the entire file.
本申请实施例提供的更新软件的方法,能够实现功能模块在运行活动区的软件程序,且检测到备份区有新的软件程序的数据时,可以运行备份区的新的软件程序,以使得控制器无需重新上电,即可运行最新的软件程序,有助于提高软件更新的速度和便捷性。此外,通过对软件进行模块化划分,可以只更新个别功能模块或者新增功能模块,无需重新编译整个软件就可以实现软件的在线实时更新,有助于减少软件更新所需时长。并且,对刷写 文件的根据功能模块进行数据块分割,可以预防数据刷写突然中断造成全部数据不可用的情况发生,通过增加安全校验可以提高数据的安全性。The method for updating software provided in the embodiment of the present application can realize that when the functional module is running the software program in the active area and detects that there is new software program data in the backup area, the new software program in the backup area can be run, so that the controller can run the latest software program without re-powering on, which helps to improve the speed and convenience of software updates. In addition, by modularizing the software, only individual functional modules or new functional modules can be updated, and online real-time updates of the software can be achieved without recompiling the entire software, which helps to reduce the time required for software updates. In addition, the data block segmentation of the flash file according to the functional module can prevent the situation where all data is unavailable due to a sudden interruption of data flashing, and the security of the data can be improved by adding security checks.
示例性地,以下以C语言环境为例,对S402中实现第一存储区域和第二存储区域中数据的交替运行的原理进行说明。需要说明的是,符号“/*…*/”内的文字用于解释其紧邻的下一段代码的含义,符号“//”后的文字用于解释其前面代码的含义。By way of example, the principle of implementing the alternating operation of data in the first storage area and the second storage area in S402 is described below by taking the C language environment as an example. It should be noted that the text within the symbol "/*...*/" is used to explain the meaning of the next code segment, and the text after the symbol "//" is used to explain the meaning of the previous code segment.
首先,针对第一功能模块可以分别定义指向第一存储分区、第二存储分区的配置数据的指针变量,以及指向第一功能模块对应的第一存储分区、第二存储分区的功能函数的函数指针。示例性地,实现代码如下(第1至36行),使用内存映射(memorymap,memmap)进行地址固定:First, for the first functional module, pointer variables pointing to the configuration data of the first storage partition and the second storage partition, as well as function pointers pointing to the function functions of the first storage partition and the second storage partition corresponding to the first functional module can be defined respectively. Exemplarily, the implementation code is as follows (lines 1 to 36), using memory mapping (memorymap, memmap) for address fixing:
Figure PCTCN2022128452-appb-000001
Figure PCTCN2022128452-appb-000001
Figure PCTCN2022128452-appb-000002
Figure PCTCN2022128452-appb-000002
进一步地,分别定义第一功能模块对应于第一存储分区以及第二存储分区的功能函数,上述功能函数可以通过if-else等逻辑结构确定其调用的配置数据。示例性地,实现代码如下(第37至75行):Furthermore, the function functions of the first function module corresponding to the first storage partition and the second storage partition are defined respectively, and the above function functions can determine the configuration data they call through logical structures such as if-else. Exemplarily, the implementation code is as follows (lines 37 to 75):
Figure PCTCN2022128452-appb-000003
Figure PCTCN2022128452-appb-000003
Figure PCTCN2022128452-appb-000004
Figure PCTCN2022128452-appb-000004
在操作系统控制第一功能模块运行时,在模块初始化时,将预先配置的第一功能模块在上述第一存储分区和第二存储分区的配置数据的地址、以及主函数接口的地址,分别赋给指针变量和函数指针。第一功能模块的主函数内设置指向该第一功能模块在第一存储分区和第二存储分区的接口地址的函数指针,通过条件判断只运行一个存储分区的程序。示例性地,可以通过如下代码(第76至104行)实现每次只运行一个存储分区中的程序:When the operating system controls the operation of the first functional module, when the module is initialized, the address of the configuration data of the pre-configured first functional module in the first storage partition and the second storage partition, and the address of the main function interface are assigned to the pointer variable and the function pointer respectively. The main function of the first functional module sets a function pointer pointing to the interface address of the first functional module in the first storage partition and the second storage partition, and only runs the program of one storage partition through conditional judgment. Exemplarily, the following code (lines 76 to 104) can be used to implement running only the program in one storage partition at a time:
Figure PCTCN2022128452-appb-000005
Figure PCTCN2022128452-appb-000005
Figure PCTCN2022128452-appb-000006
Figure PCTCN2022128452-appb-000006
应理解,上述代码仅为示例性说明,在具体实现过程中,还可以使用其他语言实现上述第一存储区域和第二存储区域中程序的交替运行。It should be understood that the above codes are only exemplary. In the specific implementation process, other languages may be used to implement the alternating operation of the programs in the first storage area and the second storage area.
在一些可能的实现方式中,为了实现第一功能模块在运行过程中的实时更新,操作系统在控制运行第一存储区域的程序时,同时会扫描第二存储区域是否有新程序的数据写入,如果第二存储区域有新程序的数据写入,且该对数据的有效性、完整性、一致性验证通过,则操作系统控制功能模块运行该第二存储区域的程序。示例性地,该过程如图7所示,可以包括:In some possible implementations, in order to achieve real-time update of the first functional module during operation, the operating system will scan the second storage area for new program data when controlling the operation of the program in the first storage area. If the second storage area has new program data written, and the validity, integrity, and consistency of the data are verified, the operating system controls the functional module to run the program in the second storage area. Exemplarily, the process is shown in FIG7 and may include:
S701,控制运行第一功能模块在第一存储分区的程序。S701, controlling the program of the first functional module in the first storage partition to run.
S702,检测到缓存区的更新程序的数据。S702, detecting data of an update program in a cache area.
示例性地,该更新程序的数据可以为用于第一功能模块更新的数据。应理解,该更新程序的数据包括第一功能模块的配置数据和功能函数数据。Exemplarily, the data of the update program may be data for updating the first functional module. It should be understood that the data of the update program includes configuration data and functional data of the first functional module.
S703,判断更新程序的数据的完整性和一致性校验是否通过。S703, determining whether the integrity and consistency check of the data of the update program has passed.
具体地,若更新程序的数据的完整性和一致性校验通过,则执行S704,否则执行S704’。Specifically, if the integrity and consistency check of the data of the update program passes, execute S704, otherwise execute S704'.
S704,控制将更新程序的数据写入第二存储分区。S704, controlling the writing of the data of the update program into the second storage partition.
S704’,擦除缓存区的更新程序的数据。S704’, erase the data of the update program in the cache area.
进一步地,在擦除更新程序的数据后,该软件更新过程结束。Further, after erasing the data of the update program, the software update process ends.
S705,确定第二存储分区的数据的有效性校验通过。S705: Determine whether the validity check of the data in the second storage partition passes.
S706,判断第二存储分区配置数据的完整性和一致性校验是否通过。S706: Determine whether the integrity and consistency check of the second storage partition configuration data passes.
具体地,若第二存储分区配置数据的完整性和一致性校验通过,则执行S7063;否则执行S7061。Specifically, if the integrity and consistency check of the second storage partition configuration data passes, execute S7063; otherwise, execute S7061.
S707,判断第二存储分区功能函数数据的完整性和一致性校验是否通过。S707, determine whether the integrity and consistency check of the function data of the second storage partition passes.
具体地,若第二存储分区功能函数数据的完整性和一致性校验通过,则执行S7073;否则执行S7071。Specifically, if the integrity and consistency check of the functional data of the second storage partition passes, execute S7073; otherwise, execute S7071.
S7061,重新将相应数据从缓存区写入至第二存储分区,并做校验。S7061, rewrite the corresponding data from the cache area to the second storage partition and perform verification.
S7062,判断第二存储分区配置数据的完整性和一致性校验是否通过。S7062, determine whether the integrity and consistency check of the second storage partition configuration data passes.
具体地,若第二存储分区配置数据的完整性和一致性校验通过,则执行S7063;否则执行S708。Specifically, if the integrity and consistency check of the second storage partition configuration data passes, execute S7063; otherwise, execute S708.
S7063,控制第二存储分区配置数据有效标志位置位。S7063, control the second storage partition configuration data valid flag to be set.
S7064,控制功能函数调用第二存储分区配置数据。S7064, the control function calls the second storage partition configuration data.
S7065,控制擦除第一存储分区配置数据。S7065, control erasing the first storage partition configuration data.
S7071,重新将相应数据从缓存区写入至第二存储分区,并做校验。S7071, rewrite the corresponding data from the cache area to the second storage partition and perform verification.
S7072,判断第二存储分区功能函数数据的完整性和一致性校验是否通过。S7072, determine whether the integrity and consistency check of the function data of the second storage partition passes.
具体地,若第二存储分区功能函数数据的完整性和一致性校验通过,则执行S7073;否则执行S708。Specifically, if the integrity and consistency check of the functional data of the second storage partition passes, execute S7073; otherwise, execute S708.
S7073,控制第二存储分区功能函数数据有效标志位置位。S7073, control the second storage partition function data valid flag bit to be set.
S7074,控制主函数调用第二存储分区功能函数数据。S7074, control the main function to call the second storage partition function data.
S7075,控制擦除第一存储分区功能函数数据。S7075, control erasing the function data of the first storage partition.
S708,确定校验失败。S708, determining that the verification has failed.
S709,控制擦除第二存储分区(和缓存区)对应的数据。S709, controlling erasure of data corresponding to the second storage partition (and the cache area).
S710,结束。S710, end.
在一些可能的实现方式中,若刷写数据的格式如图5所示,则操作系统在进行完整性和一致性校验时,可以通过对比第一模块数据起始和结束处记录的模块ID、地址信息与预先设定的信息是否一致,以及对比计算的校验值与安全校验值是否一致,对比结果相同则认为数据接收完整且一致。In some possible implementations, if the format of the flash data is as shown in Figure 5, the operating system can perform integrity and consistency checks by comparing the module ID and address information recorded at the beginning and end of the first module data with the pre-set information, and comparing the calculated check value with the security check value to see if they are consistent. If the comparison results are the same, the data is considered to be received complete and consistent.
需要说明的是,在控制器的存储区域未设置缓存区时,执行S701后,可以跳过S702至S704,直接执行S705。It should be noted that when the storage area of the controller is not configured with a cache area, after executing S701, S702 to S704 may be skipped and S705 may be directly executed.
可以理解的是,控制擦除第一存储分区功能函数数据和配置数据后,该第一存储分区可以用于存储下次软件更新所需的数据。It can be understood that after the function data and configuration data of the first storage partition are controlled to be erased, the first storage partition can be used to store data required for the next software update.
在一些可能的实现方式中,通过擦写存储区域的函数实现S704’、S7065、S7075以及S709中任一项的方案。示例性地,在设计擦写存储区域的函数时,需要在函数形参中包含入下信息中的至少一种:存储区目标位置的起始地址和长度、待写入数据的起始地址和长度。并且,函数需要被设计为不可重入类型,对擦写结果和过程中的错误有相应的返回值。In some possible implementations, the solutions of any one of S704', S7065, S7075 and S709 are implemented by a function for erasing a storage area. Exemplarily, when designing a function for erasing a storage area, at least one of the following information needs to be included in the function parameters: the starting address and length of the target location of the storage area, and the starting address and length of the data to be written. In addition, the function needs to be designed as a non-reentrant type, and has corresponding return values for the erasing results and errors in the process.
在一些可能的实现方式中,上述对数据校验失败的处理措施可以为多次拷贝数据并校验,超过预设失败次数,则停止数据拷贝,返回错误类型。示例性地,该预设失败次数可以为10次,或者也可以为20次,或者还可以为其他数值。In some possible implementations, the above-mentioned processing measure for data verification failure can be to copy the data multiple times and verify, and if the number of failures exceeds a preset number, the data copying is stopped and the error type is returned. Exemplarily, the preset number of failures can be 10 times, or 20 times, or other values.
在一些可能的实现方式中,在更新上述实施例中的第一软件时,该第一软件更新后可能会有对应的新增功能模块,则可以预先在操作系统中设置新增功能模块的主函数接口指针,操作系统在运行时会对用于存储新增模块接口地址的预留存储分区(例如第三存储分区)进行扫描,如果检查到预留存储分区有新增功能模块的程序的数据,且对数据的校验结果有效,则操作系统调度相应函数指针,运行新增模块功能。示例性地,可以通过如下代码(第105至117行)实现新增功能模块的运行:In some possible implementations, when the first software in the above embodiment is updated, the first software may have a corresponding new function module after the update, and the main function interface pointer of the new function module may be set in advance in the operating system. The operating system will scan the reserved storage partition (such as the third storage partition) used to store the interface address of the new module during operation. If it is checked that the reserved storage partition has the data of the program of the new function module, and the verification result of the data is valid, the operating system schedules the corresponding function pointer and runs the function of the new module. Exemplarily, the operation of the new function module can be implemented by the following code (lines 105 to 117):
Figure PCTCN2022128452-appb-000007
Figure PCTCN2022128452-appb-000007
在一些可能的实现方式中,为了提高安全性,在上述调度指针之前,先判断指针所指向的地址是否有效,若地址有效则调度指针,否则返回错误值,停止调度指针。一示例中,可以通过判断指针指向的地址是否为空地址判断地址是否有效,若地址不为空地址,则地址有效,否则地址无效。又一示例中,在确定指针指向的地址不是空地址时,判断指针指向的地址与该指针预期的地址是否一致,若一致,则地址有效,否则地址无效。In some possible implementations, in order to improve security, before the above-mentioned scheduling of the pointer, it is first determined whether the address pointed to by the pointer is valid. If the address is valid, the pointer is scheduled, otherwise an error value is returned and the scheduling of the pointer is stopped. In one example, it is possible to determine whether the address pointed to by the pointer is a null address to determine whether the address is valid. If the address is not a null address, the address is valid, otherwise the address is invalid. In another example, when it is determined that the address pointed to by the pointer is not a null address, it is determined whether the address pointed to by the pointer is consistent with the address expected by the pointer. If they are consistent, the address is valid, otherwise the address is invalid.
在一些可能的实现方式中,在控制器对所有功能模块进行存储分区后,在控制器出厂时将所有功能模块的接口地址数据保存到控制器某一区域(例如第四存储分区)进行固化,其中,所有功能模块的接口地址包括提前设计好的新增功能模块接口地址。进一步地,操作系统在判断备份区数据有效性时,将指针数值与预先存储的功能模块接口地址进行比较,若一致,则可以继续判断备份区数据有效性;若不一致,则返回相应的错误值。In some possible implementations, after the controller performs storage partitioning on all functional modules, the interface address data of all functional modules are saved to a certain area of the controller (e.g., the fourth storage partition) for solidification when the controller leaves the factory, wherein the interface addresses of all functional modules include the pre-designed interface addresses of newly added functional modules. Furthermore, when judging the validity of the backup area data, the operating system compares the pointer value with the pre-stored functional module interface address. If they are consistent, the validity of the backup area data can be further judged; if they are inconsistent, the corresponding error value is returned.
由于数据写入存储区域需要一定时间,因此,相应存储区域有数据不代表数据已经写入完成。在一些可能的实现方式中,为了提高软件更新效率,在功能模块新的程序的数据写入完成后,将该功能模块ID写入一个数组或者一段分配好的固定存储区域(例如第五存储分区),操作系统通过循环查找数组数据或者固定存储区域的功能模块ID,即可确定哪些功能模块数据已经写入完成。进一步地,可以对该功能模块数据进行安全性和一致 性校验,校验成功后在该固定存储区域删除该功能模块ID。Since it takes a certain amount of time to write data into a storage area, the presence of data in the corresponding storage area does not mean that the data has been written. In some possible implementations, in order to improve the efficiency of software updates, after the data of the new program of the functional module is written, the functional module ID is written into an array or an allocated fixed storage area (e.g., the fifth storage partition). The operating system can determine which functional module data has been written by cyclically searching the array data or the functional module ID of the fixed storage area. Furthermore, the security and consistency of the functional module data can be checked, and the functional module ID is deleted from the fixed storage area after the check is successful.
上述实施例中对配置数据和功能函数的地址分配,都是为了方便一个功能模块内部的主函数调用。在一些可能的实现方式中,对于需要功能模块之间被调用的配置数据和功能函数,需要在存储区域设置一块独立的存储空间存放跨功能模块调用的配置数据和功能函数。对于需要多处读/写操作使用的配置数据,还可以使用自旋锁进行保护。The address allocation of configuration data and function functions in the above embodiments is to facilitate the main function call within a function module. In some possible implementations, for configuration data and function functions that need to be called between function modules, it is necessary to set up an independent storage space in the storage area to store the configuration data and function functions called across function modules. For configuration data that needs to be used for multiple read/write operations, a spin lock can also be used for protection.
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,各个实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。In the various embodiments of the present application, unless otherwise specified or provided for by logic, the terms and/or descriptions between the various embodiments are consistent and may be referenced to each other, and the technical features in different embodiments may be combined to form new embodiments according to their inherent logical relationships.
上文中结合图1至图7详细说明了本申请实施例提供的方法。下面将结合图8和图9详细说明本申请实施例提供的装置。应理解,装置实施例的描述与方法实施例的描述相互对应,因此,未详细描述的内容可以参见上文方法实施例,为了简洁,这里不再赘述。The method provided by the embodiment of the present application is described in detail above in conjunction with Figures 1 to 7. The device provided by the embodiment of the present application will be described in detail below in conjunction with Figures 8 and 9. It should be understood that the description of the device embodiment corresponds to the description of the method embodiment. Therefore, the content not described in detail can be referred to the method embodiment above, and for the sake of brevity, it will not be repeated here.
图8示出了本申请实施例提供的更新软件的装置800的示意性框图,该装置800包括检测单元810和处理单元820。FIG8 shows a schematic block diagram of a software updating device 800 provided in an embodiment of the present application. The device 800 includes a detection unit 810 and a processing unit 820 .
该装置800可以包括用于执行图4中的方法的单元。并且,该装置800中的各单元和上述其他操作和/或功能分别为了实现图4中的方法实施例的相应流程。The device 800 may include units for executing the method in Fig. 4. Moreover, each unit in the device 800 and the other operations and/or functions described above are respectively for implementing the corresponding processes of the method embodiment in Fig. 4.
其中,当该装置800用于执行图4中的方法400时,检测单元810可用于执行方法400中的S401,处理单元820可用于执行方法400中的S402。When the device 800 is used to execute the method 400 in FIG. 4 , the detection unit 810 may be used to execute S401 in the method 400 , and the processing unit 820 may be used to execute S402 in the method 400 .
具体地,该检测单元810用于:用于在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,该第一功能模块为控制器的第一软件的一个功能模块,该控制器的存储区域包括该第一存储分区和该第二存储分区;该处理单元820用于:在该检测单元810检测到该第二存储分区的第二程序的数据时,控制该第一功能模块运行该第二程序,其中,该第二程序的数据包括与该第一功能模块更新相关联的数据。Specifically, the detection unit 810 is used to: detect the second storage partition when controlling the first functional module to run the first program of the first storage partition, the first functional module is a functional module of the first software of the controller, and the storage area of the controller includes the first storage partition and the second storage partition; the processing unit 820 is used to: when the detection unit 810 detects data of the second program of the second storage partition, control the first functional module to run the second program, wherein the data of the second program includes data associated with the update of the first functional module.
在一些可能的实现方式中,该第二程序的数据来源于刷写文件,该刷写文件包括第一数据以及第一数据的信息,该信息用于指示该第一数据的起始和/或终止;其中,该第一数据为该第一软件的M个功能模块的程序的数据中任一数据,该M个功能模块包括该第一功能模块,M为大于或等于1的整数。In some possible implementations, the data of the second program comes from a flash file, which includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
在一些可能的实现方式中,该刷写文件由M个模块数据组成,该M个模块数据与该M个功能模块一一对应,该M个模块数据包括第一模块数据,该第一模块数据包括该第一数据和该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系。In some possible implementations, the flash file consists of M module data, the M module data correspond one-to-one to the M functional modules, the M module data include first module data, the first module data includes the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
在一些可能的实现方式中,该第一描述信息还包括第一校验信息,该第一校验信息设置在该第一数据的头部和/或尾部,用于对该第一数据进行完整性和/或一致性校验。In some possible implementations, the first description information also includes first verification information, which is set at the header and/or tail of the first data and is used to perform integrity and/or consistency verification on the first data.
在一些可能的实现方式中,该刷写文件由描述信息和模块数据组成,该描述信息包括该第一数据的第一描述信息,该第一描述信息用于描述该第一数据与该第一功能模块的关系,该模块数据包括该第一数据。In some possible implementations, the flash file consists of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data.
在一些可能的实现方式中,该刷写文件还包括第二校验信息,该第二校验信息设置在该刷写文件的头部和/或尾部,用于对该刷写文件进行完整性和/或一致性校验。In some possible implementations, the flash file further includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
在一些可能的实现方式中,该存储区域还包括第三存储分区,该第三存储分区用于存储第二功能模块的第三程序的数据,该第二功能模块为该第一软件的新增功能模块,该处 理单元820还用于:在该检测单元810在该第三存储分区检测到该第三程序的数据时,控制该第二功能模块运行该第三程序。In some possible implementations, the storage area also includes a third storage partition, which is used to store data of a third program of a second functional module. The second functional module is a new functional module of the first software. The processing unit 820 is also used to control the second functional module to run the third program when the detection unit 810 detects the data of the third program in the third storage partition.
示例性地,该第三存储分区可以包括上述实施例中的预留备份区和/或预留活动区。Exemplarily, the third storage partition may include the reserved backup area and/or the reserved active area in the above embodiment.
在一些可能的实现方式中,该第一功能模块包括第一函数和第二函数,该第一函数的接口地址与该第一存储分区相关联,该第二函数的接口地址与该第二存储分区相关联,该处理单元820用于:控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址,通过该第二函数的接口地址运行该第二存储分区中的该第二程序。In some possible implementations, the first functional module includes a first function and a second function, the interface address of the first function is associated with the first storage partition, and the interface address of the second function is associated with the second storage partition, and the processing unit 820 is used to: control the first functional module to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and run the second program in the second storage partition through the interface address of the second function.
在一些可能的实现方式中,该第二程序的数据在该第二存储分区中的地址为预先设定的固定地址,该存储区域包括第四存储分区,该第四存储分区用于存储该固定地址;该控制该第一功能模块由调度该第一函数的接口地址改为调度该第二函数的接口地址之前,该处理单元820还用于:确定该第二函数的接口地址与该第四存储分区中的该固定地址一致。In some possible implementations, the address of the data of the second program in the second storage partition is a pre-set fixed address, and the storage area includes a fourth storage partition, which is used to store the fixed address; before the control of the first functional module changes from scheduling the interface address of the first function to scheduling the interface address of the second function, the processing unit 820 is also used to: determine that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
在一些可能的实现方式中,该第二程序的数据包括功能函数数据和配置数据,该控制该第一功能模块运行该第二程序之前,该处理单元820还用于:对该配置数据和该功能函数数据分别进行完整性和/或一致性校验。In some possible implementations, the data of the second program includes functional data and configuration data. Before controlling the first functional module to run the second program, the processing unit 820 is further used to perform integrity and/or consistency checks on the configuration data and the functional data, respectively.
在一些可能的实现方式中,该处理单元820还用于:控制擦除该第一存储分区中的该第一程序的数据。In some possible implementations, the processing unit 820 is further used to: control erasure of data of the first program in the first storage partition.
在一些可能的实现方式中,该存储区域还包括第五存储分区,该第五存储分区用于存储该第一功能模块的标识信息,该标识信息用于表示与第一功能模块更新相关联的数据在该第二存储分区中写入完成,该处理单元820用于:在该检测单元810检测到该第二存储分区的数据,以及该第五存储分区中该第一功能模块的标识信息时,控制该第一功能模块运行该第二存储分区的该第二程序。In some possible implementations, the storage area also includes a fifth storage partition, which is used to store identification information of the first functional module, and the identification information is used to indicate that data associated with the update of the first functional module has been written into the second storage partition. The processing unit 820 is used to: when the detection unit 810 detects the data of the second storage partition and the identification information of the first functional module in the fifth storage partition, control the first functional module to run the second program of the second storage partition.
示例性地,该第一功能模块的标识信息可以包括上述实施例中的功能模块ID。Exemplarily, the identification information of the first functional module may include the functional module ID in the above embodiment.
示例性地,该装置800可以设置在图1所示的控制器中。Exemplarily, the device 800 may be provided in the controller shown in FIG. 1 .
应理解,以上装置中各单元的划分仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。此外,装置中的单元可以以处理器调用软件的形式实现;例如装置包括处理器,处理器与存储器连接,存储器中存储有指令,处理器调用存储器中存储的指令,以实现以上任一种方法或实现该装置各单元的功能,其中处理器例如为通用处理器,例如CPU或微处理器,存储器为装置内的存储器或装置外的存储器。或者,装置中的单元可以以硬件电路的形式实现,可以通过对硬件电路的设计实现部分或全部单元的功能,该硬件电路可以理解为一个或多个处理器;例如,在一种实现中,该硬件电路为ASIC,通过对电路内元件逻辑关系的设计,实现以上部分或全部单元的功能;再如,在另一种实现中,该硬件电路为可以通过PLD实现,以FPGA为例,其可以包括大量逻辑门电路,通过配置文件来配置逻辑门电路之间的连接关系,从而实现以上部分或全部单元的功能。以上装置的所有单元可以全部通过处理器调用软件的形式实现,或全部通过硬件电路的形式实现,或部分通过处理器调用软件的形式实现,剩余部分通过硬件电路的形式实现。It should be understood that the division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the units in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of the units of the device, wherein the processor is, for example, a general-purpose processor, such as a CPU or a microprocessor, and the memory is a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all of the units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for example, in another implementation, the hardware circuit can be implemented by PLD. Taking FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured through the configuration file, so as to realize the functions of some or all of the above units. All units of the above device may be implemented entirely in the form of a processor calling software, or entirely in the form of a hardware circuit, or partially in the form of a processor calling software and the rest in the form of a hardware circuit.
在本申请实施例中,处理器是一种具有信号的处理能力的电路,在一种实现中,处理器可以是具有指令读取与运行能力的电路,例如CPU、微处理器、GPU、或DSP等;在另一种实现中,处理器可以通过硬件电路的逻辑关系实现一定功能,该硬件电路的逻辑关 系是固定的或可以重构的,例如处理器为ASIC或PLD实现的硬件电路,例如FPGA。在可重构的硬件电路中,处理器加载配置文档,实现硬件电路配置的过程,可以理解为处理器加载指令,以实现以上部分或全部单元的功能的过程。此外,还可以是针对人工智能设计的硬件电路,其可以理解为一种ASIC,例如NPU、TPU、DPU等。In the embodiment of the present application, the processor is a circuit with the ability to process signals. In one implementation, the processor can be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor can implement certain functions through the logical relationship of the hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
可见,以上装置中的各单元可以是被配置成实施以上方法的一个或多个处理器(或处理电路),例如:CPU、GPU、NPU、TPU、DPU、微处理器、DSP、ASIC、FPGA,或这些处理器形式中至少两种的组合。It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
此外,以上装置中的各单元可以全部或部分可以集成在一起,或者可以独立实现。在一种实现中,这些单元集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。该SOC中可以包括至少一个处理器,用于实现以上任一种方法或实现该装置各单元的功能,该至少一个处理器的种类可以不同,例如包括CPU和FPGA,CPU和人工智能处理器,CPU和GPU等。In addition, the units in the above device can be fully or partially integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
图9是本申请实施例的一种更新软件的装置的示意性框图。图9所示的更新软件的装置900可以包括:处理器910、收发器920以及存储器930。其中,处理器910、收发器920以及存储器930通过内部连接通路相连,该存储器930用于存储指令,该处理器910用于执行该存储器930存储的指令,以收发器920接收/发送部分参数。在一些可能的实现方式中,存储器930既可以和处理器910通过接口耦合,也可以和处理器910集成在一起。FIG9 is a schematic block diagram of a device for updating software according to an embodiment of the present application. The device 900 for updating software shown in FIG9 may include: a processor 910, a transceiver 920, and a memory 930. The processor 910, the transceiver 920, and the memory 930 are connected via an internal connection path, the memory 930 is used to store instructions, the processor 910 is used to execute the instructions stored in the memory 930, and the transceiver 920 receives/sends some parameters. In some possible implementations, the memory 930 may be coupled to the processor 910 via an interface, or may be integrated with the processor 910.
需要说明的是,上述收发器920可以包括但不限于输入/输出接口(input/output interface)一类的收发装置,来实现装置900与其他设备或通信网络之间的通信。It should be noted that the above-mentioned transceiver 920 may include but is not limited to a transceiver device such as an input/output interface to achieve communication between the device 900 and other devices or communication networks.
存储器930可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。Memory 930 can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).
收发器920使用例如但不限于收发器一类的收发装置,来实现装置900与其他设备或通信网络之间的通信。The transceiver 920 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the apparatus 900 and other devices or a communication network.
在一些可能的实现方式中,该装置900可以设置于图1所示的控制器中。In some possible implementations, the device 900 may be disposed in the controller shown in FIG. 1 .
本申请实施例还提供一种智能设备,该智能设备可以包括上述装置800,或者上述装置900。An embodiment of the present application further provides a smart device, which may include the above-mentioned device 800 or the above-mentioned device 900.
在一些可能的实现方式中,该智能设备可以为车辆。In some possible implementations, the smart device may be a vehicle.
本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机程序代码,当计算机程序代码在计算机上运行时,使得计算机实现本申请实施例中的方法。The embodiment of the present application also provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer implements the method in the embodiment of the present application.
本申请实施例还提供一种计算机可读存储介质,该计算机可读介质存储有计算机指令,当计算机指令在计算机上运行时,使得计算机实现本申请实施例中的方法。The embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer implements the method in the embodiment of the present application.
本申请实施例还提供一种芯片,包括电路,用于执行本申请实施例中的方法。The embodiment of the present application also provides a chip, including a circuit, for executing the method in the embodiment of the present application.
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者上电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or a power-on erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (30)

  1. 一种更新软件的方法,其特征在于,包括:A method for updating software, comprising:
    在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,所述第一功能模块为控制器的第一软件的一个功能模块,所述控制器的存储区域包括所述第一存储分区和所述第二存储分区;When controlling a first function module to run a first program of a first storage partition, detecting a second storage partition, the first function module being a function module of a first software of a controller, and the storage area of the controller including the first storage partition and the second storage partition;
    在检测到所述第二存储分区的第二程序的数据时,控制所述第一功能模块运行所述第二程序,其中,所述第二程序的数据包括与所述第一功能模块更新相关联的数据。When data of a second program in the second storage partition is detected, the first functional module is controlled to run the second program, wherein the data of the second program includes data associated with updating of the first functional module.
  2. 如权利要求1所述的方法,其特征在于,所述第二程序的数据来源于刷写文件,所述刷写文件包括第一数据以及第一数据的信息,所述信息用于指示所述第一数据的起始和/或终止;其中,所述第一数据为所述第一软件的M个功能模块的程序的数据中任一数据,所述M个功能模块包括所述第一功能模块,M为大于或等于1的整数。The method as claimed in claim 1 is characterized in that the data of the second program comes from a flash file, the flash file includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program data of M functional modules of the first software, the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  3. 如权利要求2所述的方法,其特征在于,所述刷写文件由M个模块数据组成,所述M个模块数据与所述M个功能模块一一对应,所述M个模块数据包括第一模块数据,所述第一模块数据包括所述第一数据和所述第一数据的第一描述信息,所述第一描述信息用于描述所述第一数据与所述第一功能模块的关系。The method as claimed in claim 2 is characterized in that the flash file is composed of M module data, the M module data correspond one-to-one to the M functional modules, the M module data include first module data, the first module data includes the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
  4. 如权利要求3所述的方法,其特征在于,所述第一描述信息还包括第一校验信息,所述第一校验信息设置在所述第一数据的头部和/或尾部,用于对所述第一数据进行完整性和/或一致性校验。The method as claimed in claim 3 is characterized in that the first description information also includes first verification information, and the first verification information is set at the header and/or tail of the first data, and is used to perform integrity and/or consistency verification on the first data.
  5. 如权利要求2所述的方法,其特征在于,所述刷写文件由描述信息和模块数据组成,所述描述信息包括所述第一数据的第一描述信息,所述第一描述信息用于描述所述第一数据与所述第一功能模块的关系,所述模块数据包括所述第一数据。The method as claimed in claim 2 is characterized in that the flash file consists of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data.
  6. 如权利要求2至5中任一项所述的方法,其特征在于,所述刷写文件还包括第二校验信息,所述第二校验信息设置在所述刷写文件的头部和/或尾部,用于对所述刷写文件进行完整性和/或一致性校验。The method as described in any one of claims 2 to 5 is characterized in that the flash file also includes second verification information, and the second verification information is set at the header and/or tail of the flash file, and is used to perform integrity and/or consistency verification on the flash file.
  7. 如权利要求1至6中任一项所述的方法,其特征在于,所述存储区域还包括第三存储分区,所述第三存储分区用于存储第二功能模块的第三程序的数据,所述第二功能模块为所述第一软件的新增功能模块,所述方法还包括:The method according to any one of claims 1 to 6, characterized in that the storage area further includes a third storage partition, the third storage partition is used to store data of a third program of a second functional module, the second functional module is a newly added functional module of the first software, and the method further includes:
    在所述第三存储分区检测到所述第三程序的数据时,控制所述第二功能模块运行所述第三程序。When the third storage partition detects data of the third program, the second functional module is controlled to run the third program.
  8. 如权利要求1至7中任一项所述的方法,其特征在于,所述第一功能模块包括第一函数和第二函数,所述第一函数的接口地址与所述第一存储分区相关联,所述第二函数的接口地址与所述第二存储分区相关联,所述控制所述第一功能模块运行所述第二程序,包括:The method according to any one of claims 1 to 7, characterized in that the first functional module includes a first function and a second function, the interface address of the first function is associated with the first storage partition, the interface address of the second function is associated with the second storage partition, and the controlling the first functional module to run the second program comprises:
    控制所述第一功能模块由调度所述第一函数的接口地址改为调度所述第二函数的接口地址,通过所述第二函数的接口地址运行所述第二存储分区中的所述第二程序。The first functional module is controlled to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and the second program in the second storage partition is run through the interface address of the second function.
  9. 如权利要求8中所述的方法,其特征在于,所述第二程序的数据在所述第二存储分区中的地址为预先设定的固定地址,所述存储区域包括第四存储分区,所述第四存储分 区用于存储所述固定地址;The method as claimed in claim 8, characterized in that the address of the data of the second program in the second storage partition is a preset fixed address, the storage area includes a fourth storage partition, and the fourth storage partition is used to store the fixed address;
    所述控制所述第一功能模块由调度所述第一函数的接口地址改为调度所述第二函数的接口地址之前,所述方法还包括:Before controlling the first functional module to change the interface address for scheduling the first function to the interface address for scheduling the second function, the method further includes:
    确定所述第二函数的接口地址与所述第四存储分区中的所述固定地址一致。It is determined that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
  10. 如权利要求1至9中任一项所述的方法,其特征在于,所述第二程序的数据包括功能函数数据和配置数据,所述控制所述第一功能模块运行所述第二程序之前,所述方法还包括:The method according to any one of claims 1 to 9, characterized in that the data of the second program includes functional data and configuration data, and before controlling the first functional module to run the second program, the method further comprises:
    对所述配置数据和所述功能函数数据分别进行完整性和/或一致性校验。The configuration data and the functional function data are respectively checked for integrity and/or consistency.
  11. 如权利要求1至10中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 10, characterized in that the method further comprises:
    控制擦除所述第一存储分区中的所述第一程序的数据。Control erasing data of the first program in the first storage partition.
  12. 如权利要求1至11中任一项所述的方法,其特征在于,所述存储区域还包括第五存储分区,所述第五存储分区用于存储所述第一功能模块的标识信息,所述标识信息用于表示与第一功能模块更新相关联的数据在所述第二存储分区中写入完成,所述在检测到所述第二存储分区的第二程序的数据时,控制所述第一功能模块运行所述第二程序,包括:The method according to any one of claims 1 to 11, characterized in that the storage area further includes a fifth storage partition, the fifth storage partition is used to store identification information of the first functional module, the identification information is used to indicate that data associated with the update of the first functional module is written to the second storage partition, and when the data of the second program of the second storage partition is detected, controlling the first functional module to run the second program comprises:
    在检测到所述第二存储分区中的数据,以及所述第五存储分区中所述第一功能模块的标识信息时,控制所述第一功能模块运行所述第二存储分区的所述第二程序。When the data in the second storage partition and the identification information of the first functional module in the fifth storage partition are detected, the first functional module is controlled to run the second program of the second storage partition.
  13. 一种更新软件的装置,其特征在于,包括:A device for updating software, comprising:
    检测单元,用于在控制第一功能模块运行第一存储分区的第一程序时,检测第二存储分区,所述第一功能模块为控制器的第一软件的一个功能模块,所述控制器的存储区域包括所述第一存储分区和所述第二存储分区;a detection unit, configured to detect the second storage partition when controlling a first function module to run a first program of a first storage partition, wherein the first function module is a function module of a first software of a controller, and a storage area of the controller includes the first storage partition and the second storage partition;
    处理单元,用于在所述检测单元检测到所述第二存储分区的第二程序的数据时,控制所述第一功能模块运行所述第二程序,其中,所述第二程序的数据包括与所述第一功能模块更新相关联的数据。A processing unit is used to control the first functional module to run the second program when the detection unit detects the data of the second program in the second storage partition, wherein the data of the second program includes data associated with the update of the first functional module.
  14. 如权利要求13所述的装置,其特征在于,所述第二程序的数据来源于刷写文件,所述刷写文件包括第一数据以及第一数据的信息,所述信息用于指示所述第一数据的起始和/或终止;其中,所述第一数据为所述第一软件的M个功能模块的程序的数据中任一数据,所述M个功能模块包括所述第一功能模块,M为大于或等于1的整数。The device as described in claim 13 is characterized in that the data of the second program comes from a flash file, and the flash file includes first data and information about the first data, and the information is used to indicate the start and/or end of the first data; wherein the first data is any data of the program data of M functional modules of the first software, and the M functional modules include the first functional module, and M is an integer greater than or equal to 1.
  15. 如权利要求14所述的装置,其特征在于,所述刷写文件由M个模块数据组成,所述M个模块数据与所述M个功能模块一一对应,所述M个模块数据包括第一模块数据,所述第一模块数据包括所述第一数据和所述第一数据的第一描述信息,所述第一描述信息用于描述所述第一数据与所述第一功能模块的关系。The device as described in claim 14 is characterized in that the flash file is composed of M module data, the M module data correspond one-to-one to the M functional modules, the M module data include first module data, the first module data includes the first data and first description information of the first data, and the first description information is used to describe the relationship between the first data and the first functional module.
  16. 如权利要求15所述的装置,其特征在于,所述第一描述信息还包括第一校验信息,所述第一校验信息设置在所述第一数据的头部和/或尾部,用于对所述第一数据进行完整性和/或一致性校验。The device as described in claim 15 is characterized in that the first description information also includes first verification information, and the first verification information is set at the header and/or tail of the first data, and is used to perform integrity and/or consistency verification on the first data.
  17. 如权利要求14所述的装置,其特征在于,所述刷写文件由描述信息和模块数据组成,所述描述信息包括所述第一数据的第一描述信息,所述第一描述信息用于描述所述第一数据与所述第一功能模块的关系,所述模块数据包括所述第一数据。The device as described in claim 14 is characterized in that the flash file consists of description information and module data, the description information includes first description information of the first data, the first description information is used to describe the relationship between the first data and the first functional module, and the module data includes the first data.
  18. 如权利要求14至17中任一项所述的装置,其特征在于,所述刷写文件还包括第二校验信息,所述第二校验信息设置在所述刷写文件的头部和/或尾部,用于对所述刷写 文件进行完整性和/或一致性校验。The device as described in any one of claims 14 to 17 is characterized in that the flash file also includes second verification information, which is set at the header and/or tail of the flash file and is used to perform integrity and/or consistency verification on the flash file.
  19. 如权利要求13至18中任一项所述的装置,其特征在于,所述存储区域还包括第三存储分区,所述第三存储分区用于存储第二功能模块的第三程序的数据,所述第二功能模块为所述第一软件的新增功能模块,所述处理单元还用于:The device according to any one of claims 13 to 18, characterized in that the storage area further includes a third storage partition, the third storage partition is used to store data of a third program of a second functional module, the second functional module is a newly added functional module of the first software, and the processing unit is further used to:
    在所述检测单元在所述第三存储分区检测到所述第三程序的数据时,控制所述第二功能模块运行所述第三程序。When the detection unit detects the data of the third program in the third storage partition, the second functional module is controlled to run the third program.
  20. 如权利要求13至19中任一项所述的装置,其特征在于,所述第一功能模块包括第一函数和第二函数,所述第一函数的接口地址与所述第一存储分区相关联,所述第二函数的接口地址与所述第二存储分区相关联,所述处理单元用于:The device according to any one of claims 13 to 19, characterized in that the first functional module includes a first function and a second function, the interface address of the first function is associated with the first storage partition, the interface address of the second function is associated with the second storage partition, and the processing unit is used to:
    控制所述第一功能模块由调度所述第一函数的接口地址改为调度所述第二函数的接口地址,通过所述第二函数的接口地址运行所述第二存储分区中的所述第二程序。The first functional module is controlled to change from scheduling the interface address of the first function to scheduling the interface address of the second function, and the second program in the second storage partition is run through the interface address of the second function.
  21. 如权利要求20中所述的装置,其特征在于,所述第二程序的数据在所述第二存储分区中的地址为预先设定的固定地址,所述存储区域包括第四存储分区,所述第四存储分区用于存储所述固定地址;The device as claimed in claim 20, characterized in that the address of the data of the second program in the second storage partition is a preset fixed address, and the storage area includes a fourth storage partition, and the fourth storage partition is used to store the fixed address;
    所述控制所述第一功能模块由调度所述第一函数的接口地址改为调度所述第二函数的接口地址之前,所述处理单元还用于:Before controlling the first functional module to change the interface address for scheduling the first function to the interface address for scheduling the second function, the processing unit is further configured to:
    确定所述第二函数的接口地址与所述第四存储分区中的所述固定地址一致。It is determined that the interface address of the second function is consistent with the fixed address in the fourth storage partition.
  22. 如权利要求13至21中任一项所述的装置,其特征在于,所述第二程序的数据包括功能函数数据和配置数据,所述控制所述第一功能模块运行所述第二程序之前,所述处理单元还用于:The device according to any one of claims 13 to 21, characterized in that the data of the second program includes functional data and configuration data, and before the controlling the first functional module to run the second program, the processing unit is further used to:
    对所述配置数据和所述功能函数数据分别进行完整性和/或一致性校验。The configuration data and the functional function data are respectively checked for integrity and/or consistency.
  23. 如权利要求13至22中任一项所述的装置,其特征在于,所述处理单元还用于:The device according to any one of claims 13 to 22, characterized in that the processing unit is further used for:
    控制擦除所述第一存储分区中的所述第一程序的数据。Control erasing data of the first program in the first storage partition.
  24. 如权利要求13至23中任一项所述的装置,其特征在于,所述存储区域还包括第五存储分区,所述第五存储分区用于存储所述第一功能模块的标识信息,所述标识信息用于表示与第一功能模块更新相关联的数据在所述第二存储分区中写入完成,所述处理单元用于:The device according to any one of claims 13 to 23, characterized in that the storage area further includes a fifth storage partition, the fifth storage partition is used to store identification information of the first functional module, the identification information is used to indicate that data associated with the update of the first functional module is written in the second storage partition, and the processing unit is used to:
    在所述检测单元检测到所述第二存储分区中的数据,以及所述第五存储分区中所述第一功能模块的标识信息时,控制所述第一功能模块运行所述第二存储分区的所述第二程序。When the detection unit detects the data in the second storage partition and the identification information of the first functional module in the fifth storage partition, the first functional module is controlled to run the second program of the second storage partition.
  25. 一种更新软件的装置,其特征在于,包括:A device for updating software, characterized by comprising:
    存储器,用于存储计算机程序;Memory for storing computer programs;
    处理器,用于执行所述存储器中存储的计算机程序,以使得所述装置执行如权利要求1至12中任一项所述的方法。A processor, configured to execute the computer program stored in the memory, so that the apparatus performs the method according to any one of claims 1 to 12.
  26. 一种智能设备,其特征在于,包括如权利要求13至25中任一项所述的装置。A smart device, characterized by comprising the apparatus as described in any one of claims 13 to 25.
  27. 如权利要求26所述的智能设备,其特征在于,所述智能设备为车辆。The smart device as described in claim 26 is characterized in that the smart device is a vehicle.
  28. 一种计算机可读存储介质,其特征在于,其上存储有指令,所述指令被处理器执行时,以使得处理器实现如权利要求1至12中任一项所述的方法。A computer-readable storage medium, characterized in that instructions are stored thereon, and when the instructions are executed by a processor, the processor implements the method as claimed in any one of claims 1 to 12.
  29. 一种芯片,其特征在于,所述芯片包括电路,所述电路用于执行如权利要求1至12中任一项所述的方法。A chip, characterized in that the chip comprises a circuit, and the circuit is used to execute the method according to any one of claims 1 to 12.
  30. 一种计算机程序产品,其特征在于,所述计算机程序产品包括:计算机程序代码,当上述计算机程序代码在计算机上运行时,使得计算机执行如权利要求1至12中任一项所述的方法。A computer program product, characterized in that the computer program product comprises: computer program code, when the computer program code is run on a computer, the computer executes the method as described in any one of claims 1 to 12.
PCT/CN2022/128452 2022-10-29 2022-10-29 Method and apparatus for updating software, and intelligent device WO2024087234A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/128452 WO2024087234A1 (en) 2022-10-29 2022-10-29 Method and apparatus for updating software, and intelligent device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/128452 WO2024087234A1 (en) 2022-10-29 2022-10-29 Method and apparatus for updating software, and intelligent device

Publications (1)

Publication Number Publication Date
WO2024087234A1 true WO2024087234A1 (en) 2024-05-02

Family

ID=90829814

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/128452 WO2024087234A1 (en) 2022-10-29 2022-10-29 Method and apparatus for updating software, and intelligent device

Country Status (1)

Country Link
WO (1) WO2024087234A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111336A (en) * 2017-12-05 2018-06-01 宁波三星医疗电气股份有限公司 A kind of Power Line Carrier Communication Module program startup, upgrading and switching method
WO2021249266A1 (en) * 2020-06-12 2021-12-16 成都极米科技股份有限公司 System updating method and apparatus, electronic device, and computer readable storage medium
CN113821246A (en) * 2021-09-22 2021-12-21 四川虹美智能科技有限公司 Software non-inductive incremental updating method, device, system and storage medium
CN114153484A (en) * 2021-11-20 2022-03-08 浙江智柔科技有限公司 Operation method and device for updating program, electronic device and storage medium
CN115016823A (en) * 2022-08-09 2022-09-06 禾多科技(北京)有限公司 Target software upgrading method, device, electronic equipment, medium and program product
CN115061713A (en) * 2021-03-08 2022-09-16 华为技术有限公司 Method and device for upgrading electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111336A (en) * 2017-12-05 2018-06-01 宁波三星医疗电气股份有限公司 A kind of Power Line Carrier Communication Module program startup, upgrading and switching method
WO2021249266A1 (en) * 2020-06-12 2021-12-16 成都极米科技股份有限公司 System updating method and apparatus, electronic device, and computer readable storage medium
CN115061713A (en) * 2021-03-08 2022-09-16 华为技术有限公司 Method and device for upgrading electronic equipment
CN113821246A (en) * 2021-09-22 2021-12-21 四川虹美智能科技有限公司 Software non-inductive incremental updating method, device, system and storage medium
CN114153484A (en) * 2021-11-20 2022-03-08 浙江智柔科技有限公司 Operation method and device for updating program, electronic device and storage medium
CN115016823A (en) * 2022-08-09 2022-09-06 禾多科技(北京)有限公司 Target software upgrading method, device, electronic equipment, medium and program product

Similar Documents

Publication Publication Date Title
US20200310782A1 (en) Gateway device, in-vehicle network system, and firmware update method
US20200050378A1 (en) Vehicle information communication system
CN109189405B (en) Method and system for verifying Flash data consistency of program
US11842185B2 (en) Gateway device, in-vehicle network system, and firmware update method
CN105608370A (en) ECU program flashing and detection method
CN111176739A (en) System starting method, device, equipment and storage medium
EP3920020A1 (en) Electronic control device and program update method
CN109614265A (en) The double copies system and its configuration starting method of intelligent inertial navigation sensor-based system
CN112540778A (en) Vehicle data flashing method, diagnostic equipment and flashing system
CN108389600B (en) Data storage device and parameter rewriting method
CN110764486B (en) Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
US7934050B2 (en) Microcomputer for flash memory rewriting
WO2024087234A1 (en) Method and apparatus for updating software, and intelligent device
CN111857882B (en) Extensible SSD card opening firmware loading method and device, computer equipment and storage medium
CN112099877B (en) Method for loading FPGA and DSP by remote programming
CN101398874A (en) Method for loading program to internal SRAM of MPU by utilizing hash function and operation method
CN116560688A (en) Software updating method for domain controller
US20240054002A1 (en) Vehicle-mounted computer, computer execution method, and computer program
CN114780114A (en) Firmware upgrading method, system, vehicle and storage medium
US20230143921A1 (en) Electronic control system, storage medium storing data structure of software package, and storage medium storing computer program
JP2001125790A (en) Program reloading method for on-vehicle electronics
CN117369905B (en) Starting method and system of flash memory platform, electronic equipment and storage medium
US20240004635A1 (en) Electronic control device, reprogram execution method, and non-transitory computer readable storage medium
CN109614112B (en) Radar signal processor and program programming and loading method thereof
CN116909609B (en) Software upgrading method and device of vehicle-mounted intelligent equipment and vehicle-mounted intelligent equipment

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: 22963215

Country of ref document: EP

Kind code of ref document: A1