BOOT updating method and device based on OTA function, equipment and medium
By dividing the subpartitions used to store BOOT programs in the memory of the vehicle device, and using the OTA function to independently update the BOOT program, the problem that OTA updates can only update the application software in the existing technology are solved, and the update of the BOOT program and the system are realized stability.
Patent Information
- Application Number
- CN202411343968.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-17
AI Technical Summary
In the prior art, the OTA update method can only update the application software, but cannot update the BOOT software, resulting in the hidden danger of functional failure of BOOT.
By dividing the first and second running partitions in the memory of the vehicle device, and setting a sub-partition in it to store BOOT programs and applications, the OTA function is used to update the BOOT program to ensure that it does not affect the update of other programs when updating other programs. BOOT program, realize independent update of BOOT program.
It effectively eliminates the hidden danger of BOOT program function failure, ensures continuous optimization and security of the software, and realizes the ability to update the entire software system.
Smart Images

Figure CN119322624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automotive electronic technology, and in particular to a BOOT update method, device, equipment and medium based on OTA function. Background Art
[0002] OTA (Over-the-Air Technology) upgrade is a standard software upgrade method provided by the Android system. It is a technology for remote management through mobile communication networks. With the rapid development of existing automotive electronic equipment, the application of OTA remote upgrade of the software of various controllers in automobiles is becoming more and more widespread. It can effectively solve the functional and safety-related problems caused by software, realize functional iteration, and improve customer experience and satisfaction.
[0003] In the prior art, the application software of the car can be stored in the A and B areas with SWAP capability, and the BOOTLoader (usually referred to as BOOT) can be stored in the C area without SWAP capability. The A and B areas are a whole. When the software is updated, the entire memory area will be erased. If the BOOT is also placed in the A and B areas, the APP program will be erased when the BOOT is updated, and the BOOT will be erased when the APP is updated. Therefore, it is placed in the C area, which also causes the BOOT to be unable to be updated through the OTA function. If there is a problem with the BOOT software, the entire software cannot run, and there is a hidden danger of functional failure.
[0004] Therefore, it is urgent to propose a BOOT update method, device, equipment and medium based on the OTA function to solve the technical problem that the OTA update method in the prior art can only update the application software but cannot update the BOOT, thereby causing the hidden danger of BOOT function failure. Summary of the invention
[0005] In view of this, it is necessary to provide a BOOT update method, device, equipment and medium based on OTA function to solve the technical problem that the OTA update method in the prior art can only update the application software but cannot update the BOOT, thereby causing the hidden danger of BOOT function failure.
[0006] In order to solve the above problems, the present invention provides a BOOT update method based on OTA function, comprising: Determine a memory partition of the vehicle device, the memory partition includes a first running partition and a second running partition; the first running partition and the second running partition have an OTA function, the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; When the first running partition receives an erase command, determining an update program according to the erase command; When the update program is a BOOT program, OTA update is performed on the BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
[0007] In a possible implementation, performing OTA updating on a BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program includes: When the update program is a BOOT program, it is determined that the current BOOT program is stored in the first sub-partition, the memory of the second sub-partition is erased, and based on the OTA function, the update data of the current BOOT program in the first sub-partition is written into the memory of the second sub-partition to obtain the updated target BOOT program.
[0008] In a possible implementation, the first running partition further includes a third sub-partition, the second running partition includes a fourth sub-partition, the third sub-partition and the fourth sub-partition are used to store application programs, and the method further includes: When the update program is an application, it is determined that the current application is stored in the third sub-partition, the memory of the fourth sub-partition is erased, and based on the OTA function, the update data of the current application in the third sub-partition is written to the memory of the fourth sub-partition to obtain the updated target application.
[0009] In a possible implementation, the method further includes: When the second running partition receives an erase command, determining an update program according to the erase command; When the update program is a BOOT program, it is determined that the current BOOT program is stored in the second sub-partition, the memory of the first sub-partition is erased, and based on the OTA function, the update data of the current BOOT program in the second sub-partition is written to the memory of the first sub-partition to obtain the updated target BOOT program.
[0010] In a possible implementation, when the second running partition receives the erase command, after determining the update program according to the erase command, the method further includes: When the update program is an application, it is determined that the current application is stored in the fourth sub-partition, the memory of the third sub-partition is erased, and based on the OTA function, the update data of the current application in the fourth sub-partition is written to the memory of the third sub-partition to obtain the updated target application.
[0011] In a possible implementation manner, writing the update data of the current BOOT program in the first sub-partition into the memory of the second sub-partition based on the OTA function to obtain the updated target BOOT program includes: When the first running partition receives the update data address, offset the update data address to obtain the first target address of the second sub-partition; Based on the OTA function, the update data of the current BOOT program in the first sub-partition is written into the memory of the second sub-partition through the first target address to obtain an updated target BOOT program; The step of writing the update data of the current application in the third sub-partition into the memory of the fourth sub-partition based on the OTA function to obtain an updated target application includes: When the first running partition receives the update data address, the update data address is offset to obtain the second target address of the fourth sub-partition; Based on the OTA function, the update data of the current application in the third sub-partition is written into the memory of the fourth sub-partition through the second target address to obtain an updated target application.
[0012] In a possible implementation manner, after performing OTA updating on the BOOT program according to the first sub-partition and the second sub-partition to obtain the target BOOT program, the method includes: Verify the target BOOT program by a CRC verification method to obtain a verification result; When the verification result is correct, it is determined that the current BOOT program update is completed.
[0013] On the other hand, the present invention also provides a BOOT update device based on OTA function, comprising: A partition determination module, used to determine the memory partition of the vehicle device, the memory partition includes a first operation partition and a second operation partition; the first operation partition and the second operation partition have an OTA function, the first operation partition includes a first sub-partition, the second operation partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; a program determination module, configured to determine an update program according to an erase command when the first running partition receives the erase command; The program update module is used for, when the update program is a BOOT program, performing OTA update on the BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
[0014] On the other hand, an embodiment of the present invention discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the various steps of the above-mentioned BOOT update method embodiment based on the OTA function are implemented.
[0015] On the other hand, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various steps of the above-mentioned OTA-based BOOT update method embodiment are implemented.
[0016] The beneficial effects of the present invention are as follows: determining the memory partition of a vehicle device, the memory partition including a first running partition and a second running partition; wherein the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; when the first running partition receives an erase command, determining an update program according to the erase command; when the update program is a BOOT program, updating the current BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program; thereby, the BOOT program can be stored by dividing the first running partition and the second running partition into sub-partitions, and when other programs are updated, the BOOT programs in the first sub-partition and the second sub-partition will not be affected, and the current BOOT program can be updated through the first sub-partition and the second sub-partition, thereby eliminating the hidden danger of functional failure that may exist in the BOOT. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic flow chart of an embodiment of a BOOT update method based on OTA function provided by the present invention; Figure 2 A schematic diagram of the structure of an embodiment of the memory operation partition provided by the present invention; Figure 3 A schematic diagram of the structure of an embodiment of a BOOT update device based on OTA function provided by the present invention; Figure 4 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0019] OTA (Over The Air) is a data value-added service (referred to as OTA service) based on the short message mechanism, which can dynamically download, delete and update the service menu in the SIM card through the mobile terminal or server (online), so that users can obtain personalized information services. It is a technology for remotely managing SIM card data and applications through the air interface of mobile communications. The application of OTA technology enables mobile communications to provide not only voice and data services, but also new service downloads. In this way, application and content service providers can continuously develop more personalized services that are close to user needs without being limited by the platform, such as information on demand, interactive entertainment, location services, and banking transactions. Through OTA air download technology, mobile phone users can download various service menus provided by the network to their mobile phones according to their personal preferences using the OTA mechanism with simple operations, and can also customize specific services according to their own wishes.
[0020] Updating BOOT means updating the bootloader (BOOTLoader) of the car controller. In the automotive field, the main function of BOOTLoader is to update the application. By updating BOOTLoader, the software can be updated without opening the controller, thereby achieving the upgrade and maintenance of the car control system. This update process usually involves updating the BOOTLoader itself and the application loaded through the BOOTLoader. The process of updating BOOT can be regarded as a way to upgrade and maintain the software of the car control system to ensure the continuous optimization of the system's security, performance and functions.
[0021] like Figure 1 As shown, a specific embodiment of the present invention discloses a BOOT update method based on OTA function, including: S101, determining a memory partition of a vehicle device, wherein the memory partition includes a first running partition and a second running partition; the first running partition and the second running partition have OTA functions, the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; S102, when the first running partition receives an erase command, determining an update program according to the erase command; S103: When the update program is a BOOT program, perform OTA update on the current BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
[0022] In a specific embodiment of the present invention, it can be applied to the automotive field, and the memory can be partitioned according to actual needs through the vehicle controller on the vehicle equipment, such as Figure 2 As shown, a first operation partition (area A), a second operation partition (area B), and a third operation partition (area C) can be obtained, wherein area A and area B are areas with SWAP capability and can be updated via OTA, while area C is an area without SWAP capability and does not have the function of being updated via OTA. Area C can be reserved or some data that does not need to be updated can be placed therein, which can be public data. The embodiment of the present invention does not limit area C here. Figure 2 In the prior art, when updating area A and area B, since area A and area B are respectively a whole, when updating the program, the entire memory area will be erased. If the BOOT program is also placed in area A and area B, the application will be erased when the BOOT program is updated, and the BOOT program will be erased when the application is updated, so it is placed in area C, which also causes the BOOT program to be unable to be updated through the OTA function. The embodiment of the present invention divides the first running partition (area A) and the second running partition (area B) again. Area A includes the first sub-partition and the third sub-partition, and area B includes the second sub-partition and the fourth sub-partition, wherein the first sub-partition and the second sub-partition can be used to store the BOOT program; the third sub-partition and the fourth sub-partition are used to store the application. The specific division method of area A and area B and the number of sub-partitions can be set according to actual conditions, and the embodiment of the present invention is not limited here. The relationship between sub-partitions and the programs that can be stored can also be set according to actual conditions, and the embodiment of the present invention is not limited here. The host computer or TBOX can transmit an erase command, which can be identified through a register. When the first running partition receives the erase command, the register can identify that the program is running in the first running partition. The erase command can include parameter instructions with multiple numerical values, and each parameter can include different meanings. The update program can be determined based on the parameters, wherein the update program can include a BOOT program and an application program. When the update program is a BOOT program, since the first sub-partition and the second sub-partition are used to store the BOOT program, the current BOOT program can be updated according to the first sub-partition and the second sub-partition to obtain the target BOOT program.
[0023] Compared with the prior art, the present embodiment provides a method for determining the memory partition of a vehicle device, wherein the memory partition includes a first operating partition and a second operating partition; wherein the first operating partition includes a first sub-partition, the second operating partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; when the first operating partition receives an erase command, an update program is determined according to the erase command; when the update program is a BOOT program, the current BOOT program is updated according to the first sub-partition and the second sub-partition to obtain a target BOOT program; thus, the BOOT program can be stored by dividing the first operating partition and the second operating partition into sub-partitions, and when other programs are updated, the BOOT programs in the first sub-partition and the second sub-partition will not be affected, and the current BOOT program can be updated through the first sub-partition and the second sub-partition, thereby eliminating the hidden danger of functional failure that may exist in the BOOT.
[0024] In some embodiments of the present invention, step S103 includes: When the update program is a BOOT program, determine that the current BOOT program is stored in the first sub-partition, erase the memory of the second sub-partition, and write the update data of the current BOOT program in the first sub-partition to the memory of the second sub-partition based on the OTA function to obtain the updated target BOOT program.
[0025] In a specific embodiment of the present invention, when the update program is a BOOT program, since the program runs in the first running partition, it can be determined that the current BOOT program is stored in the first sub-partition. Since the first sub-partition and the second sub-partition are in a corresponding relationship for storing the BOOT program, the memory of the second sub-partition can be erased through the underlying driver function of MCAL to remove the data in the second sub-partition, and then the second sub-partition can be OTA updated.
[0026] Furthermore, the first running partition can also receive the update data address transmitted by the host computer or TBOX through the 34 service of UDS. When the first running partition receives the update data address, the first running partition needs to offset the update data address to obtain the flashed data address as the memory where the BOOT program in area B is stored, that is, the first target address of the second sub-partition; then, based on the underlying driver function of the OTA function, the update data of the current BOOT program in the first sub-partition can be written to the memory of the second sub-partition through the first target address, and then the updated target BOOT program can be obtained.
[0027] In some embodiments of the present invention, the first running partition further includes a third sub-partition, the second running partition includes a fourth sub-partition, the third sub-partition and the fourth sub-partition are used to store application programs, and the method further includes: When the update program is an application, determine that the current application is stored in the third subpartition, erase the memory of the fourth subpartition, and write the update data of the current application in the third subpartition to the memory of the fourth subpartition based on the OTA function to obtain the updated target application.
[0028] In a specific embodiment of the present invention, when the update program is an application, because the third sub-partition and the fourth sub-partition are used to store the application, and since the program runs in the first running partition, it can be determined that the current application is stored in the third sub-partition, and then the memory of the fourth sub-partition can be erased through the underlying driver function of MCAL to remove the data in the fourth sub-partition, and then the fourth sub-partition can be updated OTA.
[0029] Furthermore, the first running partition can also receive the update data address transmitted by the host computer or TBOX through the 34 service of UDS. When the first running partition receives the update data address, the first running partition needs to offset the update data address to obtain the flashed data address as the memory for storing the application in zone B, that is, the second target address of the fourth sub-partition; then, based on the underlying driver function of the OTA function, the update data of the current application in the third sub-partition can be written to the memory of the fourth sub-partition through the second target address, thereby obtaining the updated target application.
[0030] In some embodiments of the present invention, the method further comprises: When the second running partition receives the erase command, determining an update program according to the erase command; When the update program is a BOOT program, determine that the current BOOT program is stored in the second sub-partition, erase the memory of the first sub-partition, and write the update data of the current BOOT program in the second sub-partition to the memory of the first sub-partition based on the OTA function to obtain the updated target BOOT program.
[0031] In a specific embodiment of the present invention, when the second running partition receives an erase command, the register can recognize that the program is running in the second running partition, and can also identify the update program according to the parameters in the erase command. When the update program is a BOOT program, since the program is running in the second running partition, it can be determined that the current BOOT program is stored in the second sub-partition. Since the first sub-partition and the second sub-partition are in a corresponding relationship for storing the BOOT program, the memory of the first sub-partition can be erased through the underlying driver function of MCAL to remove the data in the first sub-partition, and then the first sub-partition can be OTA updated.
[0032] Furthermore, the second running partition can also receive the update data address transmitted by the host computer or TBOX through the 34 service of UDS. When the second running partition receives the update data address, the second running partition does not offset the update data address, and the data address obtained by flashing is the memory where the BOOT program in area A is stored, that is, the third target address of the first sub-partition; then, based on the underlying driver function of the OTA function, the update data of the current BOOT program in the second sub-partition can be written to the memory of the first sub-partition through the second target address, and then the updated target BOOT program can be obtained.
[0033] In some embodiments of the present invention, when the second running partition receives an erase command, after determining the update program according to the erase command, the method further includes: When the update program is an application, determine that the current application is stored in the fourth subpartition, erase the memory of the third subpartition, and write the update data of the current application in the fourth subpartition to the memory of the third subpartition based on the OTA function to obtain the updated target application.
[0034] In a specific embodiment of the present invention, when the update program is an application, because the third sub-partition and the fourth sub-partition are used to store the application, and since the program runs in the second running partition, it can be determined that the current application is stored in the fourth sub-partition, and then the memory of the third sub-partition can be erased through the underlying driver function of MCAL to remove the data in the third sub-partition, and then the third sub-partition can be updated OTA.
[0035] Furthermore, the second running partition can also receive the update data address transmitted by the host computer or TBOX through the 34 service of UDS. When the second running partition receives the update data address, the second running partition does not need to offset the update data address, and the data address to be flashed is the memory where the application in area A is stored, that is, the fourth target address of the third sub-partition; then, based on the underlying driver function of the OTA function, the update data of the current application in the fourth sub-partition can be written to the memory of the third sub-partition through the fourth target address, and the updated target application can be obtained.
[0036] In some embodiments of the present invention, after step S103, the following steps are included: Verify the target BOOT program through the CRC verification method to obtain the verification result; When the verification result is correct, it is determined that the current BOOT program update is complete.
[0037] In a specific embodiment of the present invention, CRC (Cyclic Redundancy Check) is a channel coding technology that generates a short fixed-bit check code based on data such as network data packets or computer files, and is mainly used to detect or verify errors that may occur after data transmission or storage. CRC verification uses the principle of division and remainder for error detection. The target BOOT program can be verified by the CRC verification method, and then the verification result can be obtained. When the verification result is correct, it can be determined that the current BOOT program update is completed. If there is an error, the erase command of the host computer or TBOX can be received again, and the steps after step S101 can be performed.
[0038] In the embodiment of the present invention, taking the TC387 chip as an example, before software development, the memory is reasonably divided according to the requirements, such as: in area A, the address 0x80000000~0x800FFFFF is used to store the BOOT program, and the address 0x8040000~0x803FFFFF is used to store the application program. In area B, the address 0x80600000~0x806FFFFF is used to store the BOOT program, and the address 0x80700000~0x809FFFFF is used to store the application program.
[0039] When designing the BOOT program, the Linker file is used to divide the storage location of the BOOT program into 0x80000000~0x800FFFFF. When designing the application program, the Linker file is used to divide the storage location of the application program into 0x8040000~0x803FFFFF.
[0040] First, use the debugger to flash the BOOT program and application's hex file to area A.
[0041] Then flash the B area software based on the OTA function of the A area software: 1. Flash the B area BOOT: During memory erasing, the host computer or TBOX transmits the erase command (31 01 FF 00 80 00 00 00), where 31 is the UDS routine control command, FF 00 is the DID for erasing memory, and 80 00 00 00 is the storage start address of the BOOT program (automatically identified by the host computer or TBOX through the BOOT hex file). After receiving the erase name, the software in area A first recognizes that the current program is running in area A (identified by register SCU_STMEM1), and then recognizes that the memory to be erased is the BOOT program (because the transmitted address 80 00 00 00 is the BOOT address). In this way, it is confirmed that the memory currently to be erased is the storage memory of the BOOT program in area B, and is erased through the MCAL's underlying driver function "FlsLoader_Erase(FlsLoader_AddressTypeTargetAddress, FlsLoader_LengthType Length)", where TargetAddress is 0x80600000 and Length is 0xfffff.
[0042] During the flash update process, the host computer or TBOX transmits the address of the updated data through the 34 service of UDS, and transmits the updated data through the 36 service. After receiving the address of the BOOT program data, the software in Area A needs to offset the address by 0x600000 to get the first target address. The data address to be flashed is the storage memory of the BOOT program in Area B. The received data is written to the storage memory of the BOOT in Area B through the underlying driver function "FlsLoader_Write (TargetAddress, Length, SourceAddressPtr)", where TargetAddress is the first target address after the offset, Length is the size of the flash data, and SourceAddressPtr is the received data Buffer. Finally, after the CRC check is correct, the update is completed.
[0043] 2. Flash the B zone application During the memory erasing process, the host computer or TBOX transmits the erase command (31 01 FF 00 80 10 00 00), where 80 10 00 00 is the storage start address of the APP (automatically identified by the host computer or TBOX program through the hex file of the application). After receiving the erase command, the software in Area A first identifies that the current program is running in Area A (identified by register SCU_STMEM1), and then identifies the erased memory as the application (because the transmitted address 80 10 00 00 is the APP address), thereby confirming that the memory currently to be erased is the storage memory of the application in Area B, and erasing is performed through the MCAL underlying driver function "FlsLoader_Erase(FlsLoader_AddressType TargetAddress, FlsLoader_LengthType Length )", where TargetAddress is 0x80700000 and Length is 0x2fffff.
[0044] During the flash update process, the host computer or TBOX transmits the address of the updated data through the 34 service of UDS, and transmits the updated data through the 36 service. After receiving the address of the application data, the software in Area A needs to offset the address by 0x600000 to obtain the second target address. The data address to be flashed is used as the storage memory of the application in Area B. The received data is written to the storage memory of the application in Area B through the underlying driver function "FlsLoader_Write (TargetAddress, Length, SourceAddressPtr)", where TargetAddress is the second target address after the offset, Length is the size of the flash data, and SourceAddressPtr is the received data Buffer. Finally, after the CRC check is correct, the update is completed.
[0045] The embodiment of the present invention can re-partition the memory for storing BOOT and application programs; make full use of the OTA function to update BOOT with OTA; the OTA function can not only update the application program, but also has the function of updating BOOT. In this way, all software in the memory can be updated; the old and new versions of BOOT can be stored in the A and B areas for debugging comparison, and can also be used for rolling back the old and new versions of BOOT.
[0046] In order to better implement the BOOT update method based on the OTA function in the embodiment of the present invention, on the basis of the BOOT update method based on the OTA function, the embodiment of the present invention also provides a BOOT update device based on the OTA function, such as Figure 3 As shown, the BOOT update device 300 based on the OTA function includes: A partition determination module 301 is used to determine a memory partition of a vehicle device, the memory partition includes a first operation partition and a second operation partition; the first operation partition and the second operation partition have OTA functions, the first operation partition includes a first sub-partition, the second operation partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; A program determination module 302, configured to determine an update program according to the erase command when the first running partition receives the erase command; The program update module 303 is used to perform OTA update on the current BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program when the update program is a BOOT program.
[0047] The BOOT update device 300 based on OTA function provided in the above embodiment can implement the technical solution described in the above embodiment of the BOOT update method based on OTA function. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above embodiment of the BOOT update method based on OTA function, which will not be repeated here.
[0048] like Figure 4 As shown, the present invention also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402 and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0049] In some embodiments, the memory 402 may be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. In other embodiments, the memory 402 may also be an external storage device of the electronic device 400, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 400.
[0050] Furthermore, the memory 402 may include both an internal storage unit of the electronic device 400 and an external storage device. The memory 402 is used to store application software installed in the electronic device 400 and various data.
[0051] In some embodiments, the processor 401 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 402, such as the BOOT update method based on the OTA function in the present invention.
[0052] In some embodiments, the display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 403 is used to display information of the electronic device 400 and to display a visual user interface. The components 401-403 of the electronic device 400 communicate with each other via a system bus.
[0053] In some embodiments of the present invention, when the processor 401 executes the BOOT update program based on the OTA function in the memory 402, the following steps may be implemented: Determine the memory partition of the vehicle device, the memory partition includes a first running partition and a second running partition; the first running partition and the second running partition have OTA functions, the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store the BOOT program; When the first running partition receives an erase command, determining an update program according to the erase command; When the update program is a BOOT program, an OTA update is performed on the current BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
[0054] It should be understood that: when the processor 401 executes the OTA function-based BOOT update program in the memory 402, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0055] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 400 mentioned, and the electronic device 400 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 400 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0056] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by the processor, the BOOT update method steps or functions based on the OTA function provided in the above-mentioned method embodiments can be implemented.
[0057] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0058] The above is a detailed introduction to the BOOT update method, device, equipment and medium based on the OTA function provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A BOOT update method based on OTA function, characterized in that: include: Determining a memory partition of a vehicle device, wherein the memory partition includes a first operation partition and a second operation partition; The first running partition and the second running partition have OTA functions, the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; When the first running partition receives an erase command, determining an update program according to the erase command; When the update program is a BOOT program, OTA update is performed on the BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
2. The BOOT update method based on OTA function according to claim 1, characterized in that: The step of performing OTA updating on the BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program includes: When the update program is a BOOT program, it is determined that the current BOOT program is stored in the first sub-partition, the memory of the second sub-partition is erased, and based on the OTA function, the update data of the current BOOT program in the first sub-partition is written into the memory of the second sub-partition to obtain the updated target BOOT program.
3. The BOOT update method based on OTA function according to claim 2 is characterized in that: The first running partition further includes a third sub-partition, the second running partition includes a fourth sub-partition, the third sub-partition and the fourth sub-partition are used to store application programs, and the method further includes: When the update program is an application, it is determined that the current application is stored in the third sub-partition, the memory of the fourth sub-partition is erased, and based on the OTA function, the update data of the current application in the third sub-partition is written to the memory of the fourth sub-partition to obtain the updated target application.
4. The BOOT update method based on OTA function according to claim 3 is characterized in that: The method further comprises: When the second running partition receives an erase command, determining an update program according to the erase command; When the update program is a BOOT program, it is determined that the current BOOT program is stored in the second sub-partition, the memory of the first sub-partition is erased, and based on the OTA function, the update data of the current BOOT program in the second sub-partition is written to the memory of the first sub-partition to obtain the updated target BOOT program.
5. The BOOT update method based on OTA function according to claim 4 is characterized in that: When the second running partition receives the erase command, after determining the update program according to the erase command, the method further includes: When the update program is an application, it is determined that the current application is stored in the fourth sub-partition, the memory of the third sub-partition is erased, and based on the OTA function, the update data of the current application in the fourth sub-partition is written to the memory of the third sub-partition to obtain the updated target application.
6. The BOOT update method based on OTA function according to claim 3 is characterized in that: The step of writing the update data of the current BOOT program in the first sub-partition into the memory of the second sub-partition based on the OTA function to obtain an updated target BOOT program includes: When the first running partition receives the update data address, offset the update data address to obtain the first target address of the second sub-partition; Based on the OTA function, the update data of the current BOOT program in the first sub-partition is written into the memory of the second sub-partition through the first target address to obtain an updated target BOOT program; The step of writing the update data of the current application in the third sub-partition into the memory of the fourth sub-partition based on the OTA function to obtain an updated target application includes: When the first running partition receives the update data address, the update data address is offset to obtain the second target address of the fourth sub-partition; Based on the OTA function, the update data of the current application in the third sub-partition is written into the memory of the fourth sub-partition through the second target address to obtain an updated target application.
7. The BOOT update method based on OTA function according to claim 1, characterized in that: After performing OTA updating on the BOOT program according to the first sub-partition and the second sub-partition to obtain the target BOOT program, the method includes: Verify the target BOOT program by a CRC verification method to obtain a verification result; When the verification result is correct, it is determined that the current BOOT program update is completed.
8. A BOOT update device based on OTA function, characterized in that: include: A partition determination module, used to determine a memory partition of a vehicle device, wherein the memory partition includes a first operation partition and a second operation partition; The first running partition and the second running partition have OTA functions, the first running partition includes a first sub-partition, the second running partition includes a second sub-partition, and the first sub-partition and the second sub-partition are used to store a BOOT program; a program determination module, configured to determine an update program according to an erase command when the first running partition receives the erase command; The program update module is used for, when the update program is a BOOT program, performing OTA update on the BOOT program according to the first sub-partition and the second sub-partition to obtain a target BOOT program.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the BOOT update method based on the OTA function as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the BOOT update method based on the OTA function are implemented as described in any one of claims 1 to 7.