Method, device and equipment for realizing OTA function occupied by simplified FLASH
By dividing FLASH storage space in embedded devices and using a minimizing operating system, the OTA function is efficiently completed in one storage space, solving the problems of space waste and cost increase, and reducing development complexity and cost.
Patent Information
- Application Number
- CN202411324977.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In embedded devices, implementing OTA functions requires occupancy of a large amount of FLASH storage space, resulting in waste of space and increased costs. The prior art requires additional allocation of FLASH storage space to realize OTA functions, affecting device performance.
By dividing the target FLASH storage space into two areas, one for the complete operating system and the other for minimizing the operating system, the OTA function is achieved using the minimization operating system, including verifying update files, managing FLASH rewritten and performing system switching Function, avoiding additional FLASH storage space allocation.
It realizes efficient completion of OTA functions in a FLASH storage space, reducing space consumption and cost, while avoiding compression and complex coding support for firmware, reducing development costs and cycles.
Smart Images

Figure CN119149080A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of embedded devices, and in particular to an OTA (Over-The-Air Technology) function implementation method, device and equipment for reducing FLASH occupancy. Background Art
[0002] In the field of embedded devices, in order to improve user experience and product competitiveness, it is generally necessary to implement OTA functions so as to update device software in a timely manner. However, implementing OTA functions requires a lot of FLASH storage space, because there is no way to update itself in the currently running firmware, so it is generally necessary to allocate another FLASH storage space to store the downloaded OTA firmware, and then restart to switch or update the OTA firmware as the main running firmware.
[0003] However, in the above process, a FLASH storage space of a size similar to that of the current firmware needs to be allocated, and the additional FLASH storage space is used to implement the OTA function. However, the additional FLASH storage space is only used to implement the OTA function, resulting in a waste of FLASH storage space. At the same time, the FLASH storage space is increased to implement the OTA function, which also increases the cost of the embedded device. Summary of the invention
[0004] The present invention provides a method, device and equipment for realizing an OTA function by streamlining FLASH occupancy, so as to solve the problems such as how to reduce the occupied space and cost of an embedded device to realize an OTA function.
[0005] The first aspect of the present invention provides a method for implementing an OTA function by streamlining FLASH occupancy, comprising the following steps: dividing the target FLASH storage space of an embedded device into a first storage space and a second storage space, wherein the space size of the first storage space is larger than the space size of the second storage space; running a complete operating system of the target software on the first storage space, and creating a minimized operating system that implements the OTA function on the second storage space, wherein the minimized operating system has the minimized functions and boot loader required for the OTA update task; and updating the target software using the complete operating system, the minimized operating system, and the boot loader.
[0006] Optionally, the minimized functions include verifying and updating file functions, managing FLASH erasing functions, and executing system switching functions.
[0007] Optionally, the target software is updated using a complete operating system, a minimized operating system and a boot loader, including: after detecting the OTA update task using the complete operating system, using the complete operating system to set the boot loader to load the minimized operating system at the next startup, and the download location of the software update package of the target software to the first storage space; controlling the embedded device to load the minimized operating system using the boot loader after restarting, using the minimized operating system to execute the OTA update task, and during the execution of the OTA update task, using the minimized operating system's FLASH erase management function to manage the erase of the first storage space, and using the minimized operating system's update file verification function to verify the integrity and security of the software update package; if it is detected that the OTA update task is completed, using the minimized operating system's execution system switching function to set the boot loader to load the complete operating system at the next startup, and controlling the embedded device to load the complete operating system using the boot loader after restarting.
[0008] Optionally, during the execution of the OTA update task, the software update package overwrites the firmware of the target software in the first storage space.
[0009] Optionally, if the embedded device includes one core, the target FLASH storage space is the FLASH storage space of the corresponding core; if the embedded device includes multiple cores, the target FLASH storage space is the FLASH storage space of any one of the cores.
[0010] Optionally, the FLASH storage space of each core of the embedded device allows a minimized operating system that reuses the target FLASH storage space to implement an OTA function.
[0011] Optionally, if the FLASH storage spaces of multiple cores reuse the minimized operating system of the target FLASH storage space at the same time to implement the OTA function, it includes: obtaining the execution priority of each core in the multiple cores; and determining the reuse order of each core in the multiple cores according to the execution priority.
[0012] Optionally, the execution priority of the core corresponding to the target FLASH storage space is set to the highest priority.
[0013] The second aspect of the present invention provides an OTA function implementation device that streamlines FLASH occupancy, including: a partitioning module, used to divide the target FLASH storage space of an embedded device into a first storage space and a second storage space; a creation module, used to run a complete operating system of the target software on the first storage space, and create a minimized operating system that implements the OTA function on the second storage space, wherein the minimized operating system has the minimized functions and boot loader required for the OTA update task; an update module, used to update the target software using the complete operating system, the minimized operating system and the boot loader.
[0014] The third aspect of the present invention provides an embedded device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the above-mentioned OTA function implementation method for streamlining FLASH occupancy.
[0015] Thus, the present invention includes the following beneficial effects: The embodiment of the present invention can create a minimized operating system on the target FLASH storage space, and realize the OTA function by minimizing the operating system. Since the minimized operating system can minimize the space occupied by the FLASH storage space, and the OTA function can be realized based on one FLASH storage space, there is no need to increase the FLASH storage space to realize the OTA function, which can greatly reduce the space consumption of the FLASH storage space by the OTA function, thereby achieving the purpose of saving costs without affecting the OTA function; at the same time, there is no need to compress the updated firmware, so there is no need to encode complex function codes such as compression and decompression, which has lower development costs and development cycles, and better applicability and practicality. Therefore, the technical problems of how to reduce the space occupied and cost of the device to realize the OTA function are solved.
[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a method for implementing an OTA function of reducing FLASH usage according to an embodiment of the present invention; Figure 2 It is a block diagram of an OTA function implementation device for reducing FLASH usage according to an embodiment of the present invention; Figure 3 It is a structural diagram of an embedded device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0019] Embedded devices are computer systems designed specifically to perform specific tasks. They are usually embedded in the device they control and are not as general-purpose as personal computers. These devices usually have the following characteristics: Specialized: They are usually designed for a specific application and cannot run many different software like general-purpose computers. Resource limitations: Embedded devices often have limited computing resources, such as processor speed, memory size, and storage space; Real-time: Many embedded systems need to respond to external events within strict time constraints; Reliability: They need to operate stably under a variety of environmental conditions, sometimes even harsh environments; Small size: In order to be embedded in various devices, embedded devices are usually designed to be very small; Low power consumption: To extend battery life or reduce energy consumption, embedded devices are often designed to operate at low power; Network connectivity: Many modern embedded devices have network connectivity to communicate with other devices or the Internet.
[0020] Embedded devices have a wide range of applications, including but not limited to: Household appliances: such as smart refrigerators, washing machines, ovens, etc.; Automotive electronics: such as engine management systems, safety systems, infotainment systems, etc.; Industrial control: such as automated production lines, sensor networks, etc.; Medical equipment: such as patient monitoring equipment, diagnostic tools, etc.; Consumer electronics: such as smartphones, tablets, smart watches, etc.; Internet of Things devices: such as smart door locks, environmental monitoring equipment, etc.
[0021] It can be seen that due to the limitation of computing resources, OTA updates of embedded devices usually require a lot of storage space. Therefore, in related technologies, it is usually impossible to implement the OTA function on a FLASH storage space. It is necessary to add an additional FLASH storage space on the basis of the original FLASH storage space to implement the OTA function. The details are as follows: In related technology 1, in order to realize the OTA function on the FLASH storage space, two pieces of FLASH storage space with equal memory space are usually allocated. The two pieces of FLASH storage space include AB firmware partitions, wherein the A firmware partition first runs the software firmware. When performing an OTA update, the OTA firmware download program is executed in the A firmware partition, and the OTA firmware is downloaded to the B firmware partition. After the download is completed, the updated software firmware is run in the B firmware partition. When the OTA update is performed next time, the B firmware partition executes the OTA firmware download program and downloads the OTA firmware to the A firmware partition. After the download is completed, the updated software firmware is run in the A firmware partition. The above update process is subsequently repeated, and the OTA firmware download program is alternately run through the AB firmware partitions, and the other firmware partition is used as the download partition, so as to realize the OTA function.
[0022] However, the above-mentioned related technology 1 requires two pieces of FLASH storage space with equal memory space, which wastes FLASH storage space and greatly increases the cost of the device.
[0023] In related technology 2, in order to realize the OTA function on the FLASH storage space, two FLASH storage spaces with unequal memory spaces can also be allocated. The larger space memory is the A firmware partition, and the smaller space memory is the B firmware partition. The A firmware partition is used to run the software firmware. When performing the OTA update, the OTA firmware download program is executed in the A firmware partition; the B firmware partition is used to store the updated software firmware, but the updated software firmware needs to be compressed and stored in the B firmware partition; after the download is complete, it is decompressed to the A firmware partition, and then the program after the upgrade is successfully run from A continues.
[0024] However, the above-mentioned related technology 2 requires two pieces of FLASH storage space, which wastes FLASH storage space and greatly increases the cost of the device. At the same time, it is also necessary to encode complex functional codes such as compression and decompression, which increases the development cost and development cycle.
[0025] It can be seen that in the related art, usually two pieces of FLASH storage space are required to realize the OTA function, which wastes partition space and increases costs. The embodiments of the present invention can realize the OTA function with only one piece of FLASH storage space and greatly reduce the consumption of FLASH by the OTA function, thereby achieving the purpose of saving costs without affecting functions. At the same time, there is no need to compress when downloading software firmware, and there is no need to encode complex functional codes such as compression and decompression, thereby reducing development costs and development cycles.
[0026] The following will describe the method, device and apparatus for implementing the OTA function of reducing FLASH usage according to an embodiment of the present invention with reference to the accompanying drawings. Specifically, Figure 1 The figure is a flow chart of a method for implementing an OTA function to reduce FLASH usage according to an embodiment of the present invention.
[0027] like Figure 1 As shown, the method for implementing the OTA function of reducing FLASH usage includes the following steps: In step S101, a target FLASH storage space of an embedded device is divided into a first storage space and a second storage space, wherein the space size of the first storage space is larger than the space size of the second storage space.
[0028] The embedded device may include one core or multiple cores. If the embedded device includes one core, the target FLASH storage space may be the FLASH storage space of the corresponding core; if the embedded device includes multiple cores, the target FLASH storage space may be the FLASH storage space of any core. Core: usually refers to the processing unit in the central processing unit. FLASH storage space: refers to the non-volatile storage area in the storage device used to store firmware or operating system.
[0029] It is understandable that, in order to streamline the storage space occupied by FLASH when implementing the OTA function, the embodiment of the present invention provides sufficient storage space for software operation while ensuring that one partition implements the OTA function with the minimum storage space as much as possible. To this end, the embodiment of the present invention divides the target FLASH storage space into two storage spaces of different sizes, and usually the size of the first storage space is larger than the size of the second storage space, so as to achieve the purpose of implementing the OTA function with one FLASH storage space.
[0030] In step S102, a complete operating system of the target software is run on the first storage space, and a minimized operating system implementing the OTA function is created on the second storage space, wherein the minimized operating system has the minimized functions and a boot loader required for the OTA update task.
[0031] Among them, the target software can be specifically selected according to the operating requirements of the embedded device.
[0032] It is understandable that the complete operating system refers to the operating system of the target software, which has complete functions. Different from the complete operating system, the minimized operating system does not have complete functions. It is limited by the resource limitation of the FLASH storage space. In the embodiment of the present invention, the minimized functions required to run the OTA function are retained. Therefore, the minimized operating system refers to the minimum operating system that implements the OTA function. It is an operating system with the most necessary functions reduced to the most necessary. It only provides the operating environment and the most basic services for implementing the core of the OTA function, and is a simplified operating system. Therefore, the storage space occupied by the minimized operating system is much smaller than the storage space occupied by the complete operating system, thereby maximizing the reduction of the storage space occupied by the OTA function while providing sufficient storage space for the complete operating system to ensure the normal operation and OTA update of the target software.
[0033] In the embodiment of the present invention, the minimized functions include verifying the update file function, managing the FLASH erase function, and executing the system switching function. That is to say, the minimized operating system of the embodiment of the present invention retains the necessary basic functions for realizing the OTA function, such as network communication, file system operation, Flash management, etc. At the same time, a boot loader is provided in the minimized operating system, and the switching between the minimized operating system and the complete operating system is realized through the boot loader.
[0034] Specifically, the process of creating a minimized operating system is as follows: 1. Write or obtain a boot loader: The boot loader is the first piece of code that runs when the operating system starts. It is responsible for initializing the hardware and loading the operating system kernel.
[0035] 2. Set up BIOS / UEFI: Make sure the BIOS or UEFI settings allow booting from the media where the boot loader is located.
[0036] 3. Write kernel code: The kernel is the core of the operating system, responsible for managing system resources and controlling hardware. Among them, those skilled in the art can use a simple kernel or use existing kernel code as a basis.
[0037] 4. Minimize kernel functionality: In order to create a minimal operating system, it is necessary to minimize the kernel functionality.
[0038] 5. Write a startup script: Write a script to initialize the system environment, mount the file system, start necessary services, etc.
[0039] 6. Compile and link: Compile and link the kernel code and boot loader into executable binary files, and create a minimized operating system based on the executable binary files.
[0040] In step S103, the target software is updated using the complete operating system, the minimized operating system and the boot loader.
[0041] It can be understood that the embodiments of the present invention can create a minimized operating system on the target FLASH storage space and implement the OTA function by minimizing the operating system. Since the minimized operating system can minimize the space occupied by the FLASH storage space, and the OTA function can be implemented based on one FLASH storage space, there is no need to increase the FLASH storage space additionally to implement the OTA function. The space consumption of the FLASH storage space by the OTA function can be greatly reduced, thereby achieving the purpose of saving costs without affecting the OTA function.
[0042] In an embodiment of the present invention, a target software is updated using a complete operating system, a minimized operating system and a boot loader, including: after an OTA update task is detected using the complete operating system, using the complete operating system to set the boot loader to load the minimized operating system at the next startup, and the download location of the software update package of the target software is the first storage space; after controlling the embedded device to restart, use the boot loader to load the minimized operating system, use the minimized operating system to execute the OTA update task, and during the execution of the OTA update task, use the minimized operating system's FLASH erase management function to manage the erase of the first storage space, and use the minimized operating system's update file verification function to verify the integrity and security of the software update package; if it is detected that the OTA update task is completed, use the minimized operating system's execution system switching function to set the boot loader to load the complete operating system at the next startup, and control the embedded device to restart and use the boot loader to load the complete operating system.
[0043] In the process of executing the OTA update task, the software update package overwrites the firmware of the target software in the first storage space.
[0044] It is understandable that the embodiment of the present invention realizes the OTA function by minimizing the cooperation between the operating system and the complete operating system, and can complete the OTA update without allocating two FLASH chips, which can effectively streamline the FLASH occupation and save hardware costs. At the same time, since the first storage area of the FLASH storage area allows direct overwriting, it can allow the downloaded software firmware to be stored normally without compressing the firmware, so there is no need to encode complex function codes such as compression and decompression, which has lower development costs and development cycles, and better applicability and practicality.
[0045] Specifically, the minimized operating system should be simple enough to perform necessary OTA update tasks, such as verifying update files, managing Flash erase and write, and performing system switching. The FLASH storage space is divided into at least two main areas: one for running the complete operating system and the other for the minimized operating system, namely the first storage space and the second storage space, where the first storage space should have enough space to store OTA update files. The OTA update process is as follows: Step 1: The full operating system detects available OTA updates over the network.
[0046] Step 2: User confirms downloading the update.
[0047] Step 3: Full operating system settings for software update package download location.
[0048] Step 4: Verify the integrity and security of the software update package using a minimal operating system.
[0049] Step 5: The software update package prepares for the update process.
[0050] Step 6: Reboot the device and the bootloader hands control to the minimized operating system.
[0051] Step 7: Minimize the operating system to perform an update process, including erasing old system data and writing a new system image to the first storage space.
[0052] Step 8: After the update is complete, minimize the operating system to verify whether the new system is bootable.
[0053] Step 9: Reboot the device and the bootloader will hand over control to the new system image.
[0054] In the embodiment of the present invention, the FLASH storage space of each core of the embedded device allows a minimized operating system that reuses the target FLASH storage space to implement the OTA function.
[0055] It can be understood that when there are multiple cores in the device, the embodiment of the present invention can reuse the minimum system established above, without the need to allocate at least 2 partitions to the running firmware of each core to realize the OTA function, thereby greatly reducing the consumption of FLASH by the OTA function, achieving the purpose of saving costs without affecting the function.
[0056] In an embodiment of the present invention, if the FLASH storage space of multiple cores simultaneously reuses the minimized operating system of the target FLASH storage space to implement the OTA function, it includes: obtaining the execution priority of each core in the multiple cores; determining the reuse order of each core of the multiple cores according to the execution priority.
[0057] It is understandable that when there are multiple cores in a device, there may be a situation where multiple cores need to be updated at the same time. When the OTA function needs to be implemented at the same time, since the minimized operating system of the target FLASH storage space needs to be reused to implement the OTA function, there may be a reuse conflict problem. Therefore, the embodiment of the present invention determines the execution priority of each core and solves the reuse conflict problem through the execution priority.
[0058] It should be noted that the execution priority can be set according to actual conditions and is not specifically limited.
[0059] For example, the execution priority of the core corresponding to the target FLASH storage space may be set to the highest priority.
[0060] According to the method for implementing the OTA function by streamlining the FLASH usage proposed in the embodiment of the present invention, a minimized operating system can be created on the target FLASH storage space, and the OTA function can be implemented by minimizing the operating system. Since the minimized operating system can minimize the space usage of the FLASH storage space, and the OTA function can be implemented based on one FLASH storage space, there is no need to increase the FLASH storage space additionally to implement the OTA function, which can greatly reduce the space consumption of the FLASH storage space by the OTA function, thereby achieving the purpose of saving costs without affecting the OTA function. At the same time, there is no need to compress the updated firmware, so there is no need to encode complex function codes such as compression and decompression support, which has lower development costs and development cycles, and better applicability and practicality.
[0061] Next, a device for realizing an OTA function for reducing FLASH usage according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0062] Figure 2 It is a block diagram of a device for realizing an OTA function by reducing FLASH occupancy according to an embodiment of the present invention.
[0063] like Figure 2 As shown, the OTA function implementation device 10 for reducing FLASH usage includes: a division module 100 , a creation module 200 and an update module 300 .
[0064] Among them, the division module 100 is used to divide the target FLASH storage space of the embedded device into a first storage space and a second storage space, wherein the space size of the first storage space is larger than the space size of the second storage space; the creation module 200 is used to run a complete operating system of the target software on the first storage space, and create a minimized operating system that implements the OTA function on the second storage space, wherein the minimized operating system has the minimized functions and boot loader required for the OTA update task; the update module 300 is used to update the target software using the complete operating system, the minimized operating system and the boot loader.
[0065] It should be noted that the above explanation of the embodiment of the method for implementing the OTA function by reducing the FLASH occupancy is also applicable to the device for implementing the OTA function by reducing the FLASH occupancy of this embodiment, and will not be repeated here.
[0066] According to the OTA function implementation device for streamlining FLASH occupancy proposed in an embodiment of the present invention, a minimized operating system can be created on the target FLASH storage space, and the OTA function can be implemented by minimizing the operating system. Since the minimized operating system can minimize the space occupation of the FLASH storage space, and the OTA function can be implemented based on one FLASH storage space, there is no need to increase the FLASH storage space to implement the OTA function, which can greatly reduce the space consumption of the FLASH storage space by the OTA function, thereby achieving the purpose of saving costs without affecting the OTA function; at the same time, there is no need to compress the updated firmware, so there is no need to encode complex function codes such as compression and decompression support, which has lower development costs and development cycles, and better applicability and practicality.
[0067] Figure 3 A schematic diagram of the structure of an embedded device provided in an embodiment of the present invention. The embedded device may include: A memory 301 , a processor 302 , and a computer program stored in the memory 301 and executable on the processor 302 .
[0068] When the processor 302 executes the program, the OTA function implementation method for reducing FLASH usage provided in the above embodiment is implemented.
[0069] Furthermore, the embedded device further comprises: The communication interface 303 is used for communication between the memory 301 and the processor 302 .
[0070] The memory 301 is used to store computer programs that can be run on the processor 302 .
[0071] The memory 301 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0072] If the memory 301, the processor 302 and the communication interface 303 are implemented independently, the communication interface 303, the memory 301 and the processor 302 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0073] Optionally, in a specific implementation, if the memory 301, the processor 302 and the communication interface 303 are integrated on a chip, the memory 301, the processor 302 and the communication interface 303 can communicate with each other through an internal interface.
[0074] The processor 302 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0075] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0076] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0077] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0078] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, the steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0079] A person of ordinary skill in the art may understand that all or part of the steps carried by the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the above-mentioned program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0080] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for implementing OTA functions by reducing FLASH usage. It is characterized in that The following steps are involved: Divide the target FLASH storage space of the embedded device into a first storage space and a second storage space, wherein the space size of the first storage space is larger than the space size of the second storage space; Running a complete operating system of the target software on the first storage space, and creating a minimized operating system implementing OTA functions on the second storage space, wherein the minimized operating system has the minimized functions and boot loader required for the OTA update task; The target software is updated using the full operating system, the minimized operating system, and the boot loader.
2. The method for realizing OTA function by reducing FLASH usage according to claim 1, It is characterized in that The minimization functions include a file verification and update function, a FLASH management and a system switching execution function.
3. The method for realizing OTA function by reducing FLASH usage according to claim 2, It is characterized in that The updating of the target software using the complete operating system, the minimized operating system and the boot loader comprises: After detecting the OTA update task by using the complete operating system, setting the boot loader to load the minimized operating system and the download location of the software update package of the target software to the first storage space by using the complete operating system when the boot loader is started next time; Controlling the embedded device to load the minimized operating system using the boot loader after restarting, using the minimized operating system to execute the OTA update task, and in the process of executing the OTA update task, using the management FLASH erase function of the minimized operating system to manage the erase of the first storage space, and using the verification update file function of the minimized operating system to verify the integrity and security of the software update package; If it is detected that the OTA update task is completed, the execution system switching function of the minimized operating system is used to set the boot loader to load the complete operating system when it is started next time, and the boot loader is used to load the complete operating system after the embedded device is restarted.
4. The method for realizing OTA function by reducing FLASH usage according to claim 3, It is characterized in that During the execution of the OTA update task, the software update package overwrites the firmware of the target software in the first storage space.
5. The method for realizing OTA function by reducing FLASH usage according to claim 1, It is characterized in that If the embedded device includes one core, the target FLASH storage space is the FLASH storage space of the corresponding core; if the embedded device includes multiple cores, the target FLASH storage space is the FLASH storage space of any one of the cores.
6. The method for realizing OTA function by reducing FLASH usage according to claim 1 or 5, It is characterized in that The FLASH storage space of each core of the embedded device allows the minimized operating system of the target FLASH storage space to be reused to implement the OTA function.
7. The method for realizing OTA function by reducing FLASH usage according to claim 6, It is characterized in that If the FLASH storage spaces of multiple cores reuse the minimized operating system of the target FLASH storage space to implement the OTA function, it includes: Obtaining an execution priority of each core in the plurality of cores; The multiplexing order of each core of the plurality of cores is determined according to the execution priority.
8. The method for realizing OTA function by reducing FLASH usage according to claim 7, It is characterized in that The execution priority of the core corresponding to the target FLASH storage space is set to the highest priority.
9. A device for realizing OTA function with reduced FLASH usage. It is characterized in that include: A partitioning module, used for partitioning a target FLASH storage space of an embedded device into a first storage space and a second storage space, wherein the space size of the first storage space is larger than the space size of the second storage space; A creation module is used to run a complete operating system of the target software on the first storage space, and to create a minimized operating system for implementing the OTA function on the second storage space, wherein the minimized operating system has the minimized functions and a boot loader required for the OTA update task; An update module is used to update the target software using the complete operating system, the minimized operating system and the boot loader.
10. An embedded device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the OTA function implementation method for streamlining FLASH occupancy as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Partition and firmware upgrading method based on minimum operating system
CN104063256A
Chip verification method based on configurable operating system and equipment thereof
CN112363752A
Embedded device and firmware upgrading method and device
CN114296765A
