CN116880885A - SD card-based embedded system upgrading method and related equipment - Google Patents

SD card-based embedded system upgrading method and related equipment Download PDF

Info

Publication number
CN116880885A
CN116880885A CN202310844973.2A CN202310844973A CN116880885A CN 116880885 A CN116880885 A CN 116880885A CN 202310844973 A CN202310844973 A CN 202310844973A CN 116880885 A CN116880885 A CN 116880885A
Authority
CN
China
Prior art keywords
component
card
embedded system
recovery
upgrade
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310844973.2A
Other languages
Chinese (zh)
Inventor
刘旺
王俊红
宋平
马也
刘涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yinwo Automotive Technology Co ltd
Original Assignee
Beijing Yinwo Automotive Technology Co ltd
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 Beijing Yinwo Automotive Technology Co ltd filed Critical Beijing Yinwo Automotive Technology Co ltd
Priority to CN202310844973.2A priority Critical patent/CN116880885A/en
Publication of CN116880885A publication Critical patent/CN116880885A/en
Pending legal-status Critical Current

Links

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

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

The application provides an embedded system upgrading method based on an SD card and related equipment, wherein the method comprises the following steps: the Bootloader component is used for bootloading the recovery component and the minifs component; starting a minifs component, identifying the SD card, detecting an upgrade package in the SD card and decompressing the upgrade package; finding a recoveryfs component in the upgrade package and mounting the recoveryfs component to a designated directory; deriving environment variables required by the operation of the recover fs component; the udev application of the recoveryfs component is run and the app is upgraded, and relevant resources and display firmware are loaded. According to the application, the layout of the main system and the recovery system is optimized, so that the use space of Flash is reduced and the hardware cost is reduced under the condition that the upgrading function effect is not influenced.

Description

SD card-based embedded system upgrading method and related equipment
Technical Field
The present application relates to an embedded system upgrade technology, and in particular, to an embedded system upgrade method based on an SD card and related devices.
Background
In some embedded systems, to save storage space, upgrades are typically performed using a combination of a host system and a recovery system (recovery system). The host system is the normal operating state of the embedded system, which contains all the user's applications and functions. The recovery system is a special system environment, and is mainly used for processing upgrading operation. It runs only the applications associated with the upgrade.
When upgrading, in the main system, the upgrade application program can detect an upgrade package in the SD card. Once the upgrade package is found, the system will automatically restart and enter the recovery system. In the recovery system, the upgrade application program is responsible for executing the upgrade operation of the system and displaying the progress of the upgrade.
Based on the above procedure, the size of Flash memory required by each component directly affects the size of the selected Flash memory. The selection of the appropriate Flash memory size takes into account the space required for each component, including the host system, the recovery system, and the upgrade application, among others. In order to reduce the hardware cost, the usage space of the flash needs to be optimized.
Disclosure of Invention
The application aims to provide an embedded system upgrading method based on an SD card and related equipment, wherein the flash using space is smaller.
The following presents a simplified summary of one or more aspects in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.
According to a first aspect of the present application, there is provided an embedded system upgrade method based on an SD card, comprising the steps of:
the Bootloader component is used for bootloading the recovery component and the minifs component;
starting a start_recovery.sh script in the mini module, identifying the SD card, detecting an upgrade package in the SD card and decompressing the upgrade package;
finding a recoveryfs component in the upgrade package and mounting the recoveryfs component to a designated directory;
deriving environment variables required by the operation of the recover fs component;
the udev application of the recoveryfs component is run and the app is upgraded, and relevant resources and display firmware are loaded.
In one embodiment, the mini components are connected to the mounting points of the recoveryfs components by soft links.
In an embodiment, the mount point includes firmware, udev service and linux kernel module paths.
In one embodiment, the mini component identifies the SD card using a blkid command.
According to a second aspect of the present application, there is provided an embedded system, which is upgraded by the upgrade method, including: the main system is stored in Flash and comprises a Bootloader component, a misc component, a Boot component, a rootfs component, a recovery component and a minifs component; the recovery system is stored in the SD card and comprises a boot. Img component, a rootfs. Img component and a recovery fs component.
In one embodiment, the mini components are no more than 2M in size.
In one embodiment, the size of the recover fs component is 14M-20M.
According to a third aspect of the present application, there is provided a readable storage medium having stored thereon a program which, when executed by a processor, implements the upgrade method as described in the first aspect.
According to a fourth aspect of the present application there is provided an apparatus comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to implement the upgrade method according to the first aspect when executing the computer program.
The embodiment of the application has the beneficial effects that: by optimizing the layout of the main system and the recovery system, the mini components in the flash are utilized to find the upgrade package in the SD card and mount the recovery fs components therein, so that the space use on the flash is reduced, and the hardware cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
The above features and advantages of the present application will be better understood after reading the detailed description of embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily to scale and components having similar related features or characteristics may have the same or similar reference numerals.
Fig. 1 is a diagram showing the comparison between the layout of a flash provided in the present embodiment and the existing flash layout;
fig. 2 is a diagram comparing an upgrade package in the SD card provided in the present embodiment with an existing upgrade package;
FIG. 3 is a component call flow diagram of a prior art upgrade method;
FIG. 4 is a flowchart of an upgrade method component call provided by the present embodiment;
Detailed Description
The application is described in detail below with reference to the drawings and the specific embodiments. It is noted that the aspects described below in connection with the drawings and the specific embodiments are merely exemplary and should not be construed as limiting the scope of the application in any way.
An embedded system is a special purpose computer system designed for a specific application that, unlike a general purpose computer system such as a personal computer, performs a predefined task with specific requirements.
In embedded systems, program upgrades are a basic function, often referred to as loader. The body of loader is a section of program responsible for handling upgrade data download, protocol parsing, and data storage. The program upgrade package generally mainly comprises the following parts: uboot (fastboot), kernel, rootfs, app, etc.; and (5) splicing and combining according to the program components, and finally generating a complete upgrade package.
According to the running environment of loader upgrading program, it can be divided into AppLoader and BootLoader. The Apploader program runs in a kernel environment and is mainly implemented in an application program;
the BootLoader program runs in a boot environment and is implemented in the uboot program. The program upgrading function is mainly realized in two ways. 1. Upgrade through external storage devices, such as: a U disk, an SD card and the like, and recognizing and reading an upgrade package in the storage device in a program; 2. by remote upgrade; and transmitting the upgrade package data through transmission equipment such as a USB port, a network and the like. Both upgrade modes can be implemented in an loader and a Bootloader.
The loader mainly receives, reads, analyzes and checks the upgrade data packet in the application layer software, and finally writes the upgrade data into the flash, and has the advantages that: the data processing in the application layer software is simple and convenient; the realization of various functional interfaces is simple; the disadvantages are: the application layer software erases the flash according to the program component, and if the size of a certain program component exceeds the size of the flash set in the system starting parameter, the program component cannot be normally upgraded. Because storage space is a valuable resource in embedded systems, in order to save Flash space, the present embodiment employs a combination of a host system and a recovery system for upgrades. Therefore, the user application program running in the main system is not influenced by the upgrading process, and the recovery system only comprises the application program related to the upgrading, so that the occupation of the storage space is reduced.
On the basis, the embodiment optimizes the upgrading process and the flash layout, and provides an embedded system upgrading method based on an SD card, which comprises the following steps:
step 100, loading a recovery component and a minifs component through a Bootloader component;
step 200, starting a start_recovery.sh script in a mini component, identifying an SD card, detecting an upgrade package in the SD card and decompressing the upgrade package;
step 300, finding a recoveryfs component in the upgrade package and mounting the recoveryfs component to a designated directory;
step 400, deriving environment variables required by the operation of the recover fs component;
step 500, running udev application of the recoveryfs component (to trigger loading and running of display firmware) and upgrading app (responsible for upgrading the component and displaying of upgrading progress), and loading relevant resources and display firmware to perform system upgrading.
The mini component is a component with small occupied space and is connected to the mounting point of the recover fs component through a soft link. A soft Link, i.e. symbol Link, is in fact a special text file containing the location information of another file. The mount point includes firmware, udev service and linux kernel module paths. After the mini component is started, the SD card is identified by utilizing a blkid command and is mounted to a specified directory.
The embodiment also provides an embedded system, which is updated by adopting the updating method, and the embedded system also comprises a main system and a recovery system, wherein the main system is stored in Flash and comprises a Bootloader component, a misc component, a Boot component, a rootfs component, a recovery component and a minifs component. The recovery system is stored in the SD card and comprises a boot. Img component, a rootfs. Img component and a recovery fs component.
The BootLoader component operates after the system is powered on or reset, and is used for bringing the software and hardware environment of the system to a proper state, so that the correct environment is prepared for the final calling application program.
Fig. 1 shows a comparison between the layout of the Flash provided by the embodiment and the existing Flash layout, as shown in fig. 1, in the existing Flash layout, a Bootloader component, a misc component, a Boot component, a recovery component, a rootfs component and a recovery component are generally included.
The mini components are the minimal root file system defined by the present application. Which is obtained by the disassembly of the original upgrading system. The mini components are cut to be very small, and in the process of cutting the mini, the starting flow of the linux system and the self-defined deployment of the started tasks are required to be redefined so as to ensure that smooth jump from the mini to the recovery fs can be ensured.
The clipping principle is to ensure that the mini component only has the functions of detecting the SD card, acquiring the upgrade package and decompressing, and mounting the recovery fs component. Other related upgrade functions are moved into the recover fs component.
Fig. 2 shows a comparison diagram of an upgrade package in the SD card provided in this embodiment and an existing upgrade package, and as shown in fig. 2, compared with the existing upgrade package, the upgrade package provided in this embodiment has an added recover fs. Img component.
The size of the final mini assembly can be optimized to be within 2M, and the size of the recovery fs assembly is about 16M, so that the space use on flash is greatly optimized, and the hardware cost is reduced. Thus, the smooth progress of the upgrading process can be ensured, and the storage requirement of the system can be met.
Fig. 3 illustrates a component call procedure of the existing upgrade method, and fig. 4 illustrates a component call procedure of the method provided by the present embodiment. As shown in fig. 3 and fig. 4, compared with the existing method, the method essentially puts the upgrade function originally born by the recovery fs component in flash into the SD card, so that the occupied space of the reserved mini component is very small.
It will be readily appreciated that embodiments of the present application also provide an apparatus, such as a computer or vehicle-mounted computer, comprising a memory and a processor. The memory may be used to store instructions, programs, code sets, or instruction sets. The memory may include a storage program area and a storage data area, wherein the storage program area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the above-described upgrade method, and the like; the storage data area may store data and the like involved in the above-described upgrade method. The processor may include one or more processing cores. The processor performs the various functions of the application and processes the data by executing or executing instructions, programs, code sets, or instruction sets stored in memory, calling data stored in memory. The processor may be at least one of an application specific integrated circuit, a digital signal processor, a digital signal processing device, a programmable logic device, a field programmable gate array, a central processing unit, a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronics for implementing the above-described processor functions may be other for different devices, and embodiments of the present application are not particularly limited.
The above-described embedded system of the embodiments of the present application may also be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description is only of preferred embodiments of the application and is not intended to limit the application to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the application.

Claims (9)

1. An embedded system upgrading method based on an SD card is characterized by comprising the following steps: the Bootloader component is used for bootloading the recovery component and the minifs component;
starting a start_recovery.sh script in the mini module, identifying the SD card, detecting an upgrade package in the SD card and decompressing the upgrade package;
finding a recoveryfs component in the upgrade package and mounting the recoveryfs component to a designated directory;
deriving environment variables required by the operation of the recover fs component;
the udev application of the recoveryfs component is run and the app is upgraded, and relevant resources and display firmware are loaded.
2. The method for upgrading an embedded system based on an SD card according to claim 1, wherein: the mini components are connected to the mounting points of the recoveryfs components through soft links.
3. The embedded system upgrade method based on SD card of claim 2, wherein: the mount point includes firmware, udev service and linux kernel module paths.
4. The method for upgrading an embedded system based on an SD card according to claim 1, wherein: the mini component recognizes the SD card using the blkid command.
5. An embedded system, which is upgraded by adopting the embedded system upgrading method based on the SD card as claimed in any one of claims 1 to 4, comprising:
the main system is stored in Flash and comprises a Bootloader component, a misc component, a Boot component, a rootfs component, a recovery component and a minifs component;
the recovery system is stored in the SD card and comprises a boot. Img component, a rootfs. Img component and a recovery fs component.
6. The embedded system of claim 5, wherein: the mini modules are no more than 2M in size.
7. The embedded system of claim 6, wherein: the size of the recover fs component is 14M-20M.
8. A readable storage medium, characterized in that the storage medium has stored thereon a program which, when executed by a processor, implements the upgrade method according to any one of claims 1 to 4.
9. An apparatus comprising a memory and a processor;
the memory is used for storing a computer program;
the processor being adapted to implement the upgrade method according to any one of claims 1 to 4 when executing the computer program.
CN202310844973.2A 2023-07-11 2023-07-11 SD card-based embedded system upgrading method and related equipment Pending CN116880885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310844973.2A CN116880885A (en) 2023-07-11 2023-07-11 SD card-based embedded system upgrading method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310844973.2A CN116880885A (en) 2023-07-11 2023-07-11 SD card-based embedded system upgrading method and related equipment

Publications (1)

Publication Number Publication Date
CN116880885A true CN116880885A (en) 2023-10-13

Family

ID=88254268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310844973.2A Pending CN116880885A (en) 2023-07-11 2023-07-11 SD card-based embedded system upgrading method and related equipment

Country Status (1)

Country Link
CN (1) CN116880885A (en)

Similar Documents

Publication Publication Date Title
KR100778293B1 (en) Digital tv and upgrade method of bootloader for the same
US20030221092A1 (en) Method and system of switching between two or more images of firmware on a host device
CN110825563B (en) System recovery method and device and electronic equipment
CN108829449B (en) Method, device, equipment and medium for starting operating system by BIOS (basic input output System)
CN107220085B (en) Method for automatically upgrading RAID card firmware
CN110515671B (en) Initialization method, initialization device, terminal device and readable storage medium
CN110750280A (en) Application upgrading method and system based on Android platform and storage medium
US20050010914A1 (en) Method for upgrading firmware
CN110837383B (en) Application installation-free upgrading method and device
CN117130672A (en) Server start flow control method, system, terminal and storage medium
CN116880885A (en) SD card-based embedded system upgrading method and related equipment
KR100860402B1 (en) Device and method for upgradin system using two step bootloader
CN113641389B (en) Software upgrading method, device and equipment based on OpenCPU
US8302182B2 (en) Embedded system with authentication, and associated authentication method
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN111258617B (en) Electronic equipment
CN113849230A (en) Server starting method and device, electronic equipment and readable storage medium
CN111475220B (en) Cold start method and device, electronic equipment and computer storage medium
CN113849379A (en) Method, device and equipment for collecting server asset information and readable medium
CN114625389A (en) Embedded equipment upgrading method, embedded equipment and storage device
US9081727B2 (en) Method, apparatus and computer program for loading files during a boot-up process
CN114385255B (en) POS machine control method, POS machine control system, POS machine control device and computer readable medium
CN113672238B (en) Operation method, device and equipment based on real-time operating system modularized management
CN115904820B (en) Recovery method and system for failed hard disk
CN111176735B (en) Method for accelerating startup of electrocardiograph

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination