CN109634781B - Double-area backup image system based on embedded program and starting method - Google Patents

Double-area backup image system based on embedded program and starting method Download PDF

Info

Publication number
CN109634781B
CN109634781B CN201811487126.0A CN201811487126A CN109634781B CN 109634781 B CN109634781 B CN 109634781B CN 201811487126 A CN201811487126 A CN 201811487126A CN 109634781 B CN109634781 B CN 109634781B
Authority
CN
China
Prior art keywords
image
area
mapping
updating
state
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.)
Active
Application number
CN201811487126.0A
Other languages
Chinese (zh)
Other versions
CN109634781A (en
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.)
Luoyang Institute of Electro Optical Equipment AVIC
Original Assignee
Luoyang Institute of Electro Optical Equipment AVIC
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 Luoyang Institute of Electro Optical Equipment AVIC filed Critical Luoyang Institute of Electro Optical Equipment AVIC
Priority to CN201811487126.0A priority Critical patent/CN109634781B/en
Publication of CN109634781A publication Critical patent/CN109634781A/en
Application granted granted Critical
Publication of CN109634781B publication Critical patent/CN109634781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides an embedded program based double-area backup mapping system and a starting method, wherein a CPU and a FLASH of the embedded program based double-area backup mapping system are interconnected through a Local Bus, and the CPU completes data interaction between the CPU and a DDR through a DDR controller integrated inside; in the power-on starting of the embedded equipment, the CPU end reads the image stored on the FLASH and loads the image into the DDR; and after the image loading is finished, the CPU reads the image data from the DDR and executes the image, thereby finishing the relevant functions of the embedded device. The invention judges the validity of the double-area image through the image updating state and the image starting state, thereby ensuring that the image with correct operation can be loaded after being electrified, and effectively solving the problem that the equipment cannot be started due to the failure of upgrading the embedded equipment or the error of upgrading the image.

Description

Double-area backup image system based on embedded program and starting method
Technical Field
The invention relates to the technical field of electronics, in particular to a double-area backup image system and a starting method thereof.
Background
With the continuous development of electronic technology, the software updating speed of the embedded device is increased at present, so that the software updating of the embedded device needs to be continuously carried out. The existing embedded device adopts a single image form, the image loaded and operated by the device is only stored on a storage medium, and the image is loaded from the storage medium after the device is powered on, so that the image is executed, and the starting operation of the device is completed.
If the image is damaged due to abnormal operation, for example, abnormal power failure in the process of updating the product image, the device cannot correctly load and run the system image after running again, the device fails to start, and cannot normally work and use, so that the device has a high upgrading risk, and the reliability and maintainability of the device are poor.
The existing image starting method has the following problems:
the embedded device is powered on, loads and runs the image and only stores one copy of the image on the storage medium;
in the upgrading process of the embedded equipment, the power failure condition of the equipment occurs occasionally, and the power failure can cause the updating failure of the equipment, so that the equipment cannot be started to operate;
in the process of upgrading the embedded device, wrong images can be upgraded due to improper operation, so that the device cannot be started and operated normally;
only one image is stored on the storage medium, and if the image data is damaged, the equipment cannot be started and operated normally.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a dual-area backup image system based on an embedded program and a starting method thereof, which realize the dual-area starting technology of embedded equipment and improve the maintainability of the embedded equipment. The dual-area backup image refers to an image storage medium divided into an a-area and a B-area, both of which hold the same image data.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a double-area backup mapping system based on an embedded program comprises a Central Processing Unit (CPU) for executing a mapping program, a FLASH for storing a double-area backup mapping, a mapping update mark and a starting state mark, and a DDR for storing a mapping during operation; the FLASH storage area address space is divided into an A area mapping starting mark, an A area mapping updating mark, an A area mapping, a B area mapping updating mark and a B area mapping from low to high in sequence; the A area image starting mark comprises a normal starting mark and a failed starting mark; the area A image updating mark is divided into an initial state, an updating state and an updating completion state; loading the running image when the A area image storage equipment is started; the B area image updating mark is divided into an initial state and an updating state; the B area image stores the backup version of the A area image;
the CPU and the FLASH are interconnected through a Local Bus, and the CPU completes data interaction between the CPU and the DDR through a DDR controller integrated inside; in the power-on starting of the embedded equipment, a CPU end reads the mapping stored in the FLASH and loads the mapping into the DDR; and after the image loading is finished, the CPU reads the image data from the DDR and executes the image to finish the relevant functions of the embedded equipment.
The invention also provides a starting method of the double-area backup image system based on the embedded program, the double-area backup image starting method disclosed by the invention definitely specifies the image updating state and the image starting running state of the embedded equipment, and the detailed steps are as follows:
step 1: when the image is started, entering step 2; when the image needs to be updated, entering step 3;
step 2, in the image starting process, intelligently selecting the image to be loaded and run according to the A area image updating mark and the A area image starting state, thereby ensuring normal starting, wherein the image starting process is as follows:
1) Whether the state is a starting failure state, if so, jumping to the step 7), otherwise, jumping to the step 2);
2) Whether the updating mark is in an initialization state or not, if so, jumping to the step 8), otherwise, jumping to the step 3);
3) Whether the updating mark is in an updating completion state, if so, turning to the step 4), otherwise, turning to the step 7);
4) Mapping the starting mark to be in a starting failure state;
5) Loading the image from the area A and starting and running the image of the area A;
6) Judging whether the A area image is started successfully, if so, jumping to the step 9), otherwise, jumping to the step 7);
7) Loading the image from the B area, starting the running B area image, and jumping to the step 14);
8) Loading the image from the area A and starting to run the area A image, and jumping to the step 14);
9) Setting an A area image starting mark as a starting normal state, and setting an A area image updating mark as an initialization state;
10 Setting the B-zone mapping state to an updating state;
11 Updating the mapping of the area A to an area B of a FLASH mapping storage area to cover the original mapping of the area B;
12 Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) way, and jumping to the step 11) if the checking is wrong, or jumping to the step 13);
13 Set the B-zone map update flag to an initialized state;
14 Image boot ends;
and step 3: in the image updating state, firstly, the B area image can be ensured to be normally loaded and started, and for the new image, only the A area image is updated, so that the system can be ensured to be normally loaded and operated from the B area image even if the A area image fails to be updated. The image updating process comprises the following steps:
1) Judging whether the B area image updating mark is in an initialized state, if so, jumping to the step 5), otherwise, jumping to the step 2);
2) Updating the mapping of the area A to an area B of a FLASH mapping storage area, and covering the original mapping of the area B;
3) Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
4) Setting a B area mapping updating mark as an initialization state;
5) Setting an A area image updating mark as an updating state;
6) Updating the new version image to an area A of a FLASH image storage area, and covering the original image of the area A;
7) Checking whether the updated mapping data of the area A is correct by a CRC (Cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
8) Setting an A area image updating mark as an updating completion state;
9) The area A image boot state is set to the boot normal state.
The method has the advantages that the double-area backup image starting technology is adopted, the image to be loaded and operated by the embedded equipment is stored in the area A and the area B of the FLASH in a redundant backup storage mode in a FLASH storage space, and the validity of the double-area image is judged according to the image updating state and the image starting state, so that the correct image can be loaded and operated after power-on, and the problem that the equipment cannot be started due to the fact that the embedded equipment is failed to be upgraded or the image is wrongly upgraded is effectively solved.
Drawings
FIG. 1 is a diagram of a dual-zone map boot cross-linking relationship according to the present invention.
FIG. 2 is a flowchart of a new image update process according to the present invention.
FIG. 3 is a flowchart illustrating image booting according to the present invention.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
A double-area backup mapping system based on an embedded program comprises a Central Processing Unit (CPU) for executing a mapping program, a FLASH for storing a double-area backup mapping, a mapping update mark and a starting state mark, and a DDR for storing a mapping during operation; the FLASH storage area address space is divided into an A area mapping starting mark, an A area mapping updating mark, an A area mapping, a B area mapping updating mark and a B area mapping from low to high in sequence; the A area image starting mark is divided into a normal starting mark (0) and a failed starting mark (1); the area A image updating mark is divided into an initial state (0), an updating state (1) and an updating completion state (2); loading running images when the A area image storage equipment is started; the B area image updating mark is divided into an initial state (0) and an updating state (1); the B area image stores the backup version of the A area image.
The CPU and the FLASH are interconnected through a Local Bus, and the CPU completes data interaction between the CPU and the DDR through a DDR controller integrated inside; in the power-on starting of the embedded equipment, a CPU end reads the mapping stored in the FLASH and loads the mapping into the DDR; and after the image loading is finished, the CPU reads the image data from the DDR and executes the image, thereby finishing the relevant functions of the embedded device.
The invention discloses a starting method of a double-area backup image system based on an embedded program, which definitely specifies the image updating state and the image starting running state of embedded equipment and comprises the following detailed steps:
step 1: when the image is started, entering step 2; when the image needs to be updated, entering step 3;
step 2, in the image starting process, intelligently selecting the image to be loaded and run according to the A area image updating mark and the A area image starting state, thereby ensuring normal starting, wherein the image starting process is as follows:
1) Whether the state is a starting failure state, if so, jumping to the step 7), otherwise, jumping to the step 2);
2) Whether the updating mark is in an initialization state or not, if so, jumping to the step 8), otherwise, jumping to the step 3);
3) Whether the updating mark is in an updating completion state, if so, turning to the step 4), otherwise, turning to the step 7);
4) Mapping the starting mark to be in a starting failure state;
5) Loading the image from the area A and starting and running the image of the area A;
6) Judging whether the A area image is started successfully, if so, jumping to the step 9), otherwise, jumping to the step 7);
7) Loading the image from the B area and starting to run the B area image, and jumping to the step 14);
8) Loading the image from the area A and starting to run the area A image, and jumping to the step 14);
9) Setting an A area image starting mark as a starting normal state, and setting an A area image updating mark as an initialization state;
10 Setting the B-zone mapping state to an updating state;
11 Updating the mapping of the area A to an area B of a FLASH mapping storage area to cover the original mapping of the area B;
12 Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) way, and jumping to the step 11) if the checking is wrong, or jumping to the step 13);
13 Set the B-zone map update flag to an initialized state;
14 Image boot ends;
and step 3: in the image updating state, firstly, the B area image can be ensured to be normally loaded and started, and for the new image, only the A area image is updated, so that the system can be ensured to be normally loaded and operated from the B area image even if the A area image fails to be updated. The image updating process comprises the following steps:
1) Judging whether the B area image updating mark is in an initialized state, if so, jumping to the step 5), otherwise, jumping to the step 2);
2) Updating the mapping of the area A to an area B of a FLASH mapping storage area to cover the original mapping of the area B;
3) Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
4) Setting a B area mapping updating mark as an initialization state;
5) Setting an A area image updating mark as an updating state;
6) Updating the new version image to an area A of a FLASH image storage area, and covering the original image of the area A;
7) Checking whether the updated mapping data of the area A is correct by a CRC (Cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
8) Setting an A area image updating mark as an updating completion state;
9) The area A image boot state is set to the boot normal state.
By effectively processing the image updating state and the image starting running state, at least one effective executable image in the A area image and the B area image on the FLASH is ensured in any state, so that the embedded equipment can normally work after being upgraded, the phenomenon that the equipment cannot normally run due to upgrading failure is avoided, and the reliability of the equipment is improved.
The invention constructs a double-area image starting system, which comprises the following steps:
the system comprises a central processing unit, a data processing unit and a data processing unit, wherein the central processing unit is used for executing a burning mapping program, adopts a Feichalcar Power series P2020 processor, and is matched with a wind river VxWorks6.9 operating system;
the FLASH adopts a magnesium light 128MB FLASH chip, is hung on a LOCAL bus of a P2020 processor, and has an address space of 0xF 8000000-0 xFFFFFFFF, wherein an A area image is deployed at an address of 0xFA100000, and a B area image is deployed at an address of 0xFC 100000;
DDR adopts a W3J128M72G-800LBI chip of Microsmi company, the capacity of which is 1GB, and is hung on a P2020 processor DDR control.

Claims (1)

1. A double-area backup image system based on an embedded program is characterized in that:
the double-area backup mapping system based on the embedded program comprises a Central Processing Unit (CPU) for executing the mapping program, a FLASH for storing the double-area backup mapping, a mapping update mark and a starting state mark, and a DDR for storing the mapping when in operation; the FLASH storage area address space is divided into an A area mapping starting mark, an A area mapping updating mark, an A area mapping, a B area mapping updating mark and a B area mapping from low to high in sequence; the A area image starting mark comprises a normal starting mark and a failed starting mark; the area A image updating mark is divided into an initial state, an updating state and an updating completion state; loading running images when the A area image storage equipment is started; the B area image updating mark is divided into an initial state and an updating state; the B area image stores the backup version of the A area image;
the CPU and the FLASH are interconnected through a Local Bus, and the CPU completes data interaction between the CPU and the DDR through a DDR controller integrated inside; in the power-on starting of the embedded equipment, the CPU end reads the image stored on the FLASH and loads the image into the DDR; after the image loading is finished, the CPU reads the image data from the DDR and executes the image, and the relevant functions of the embedded device are finished;
the starting method based on the embedded program double-area backup image system is characterized by comprising the following steps:
step 1: when the image is started, entering step 2; when the image needs to be updated, entering step 3;
step 2, in the image starting process, intelligently selecting the image to be loaded and operated according to the A area image updating mark and the A area image starting state, thereby ensuring normal starting, wherein the image starting process is as follows:
1) Whether the state is a starting failure state, if so, jumping to the step 7), otherwise, jumping to the step 2);
2) Whether the updating mark is in an initialization state or not, if so, jumping to the step 8), otherwise, jumping to the step 3);
3) Whether the updating mark is in an updating completion state, if so, turning to the step 4), otherwise, turning to the step 7);
4) Mapping the starting mark to be in a starting failure state;
5) Loading the image from the area A and starting and running the image of the area A;
6) Judging whether the A area image is started successfully, if so, jumping to the step 9), otherwise, jumping to the step 7);
7) Loading the image from the B area and starting to run the B area image, and jumping to the step 14);
8) Loading the image from the area A and starting to run the area A image, and jumping to the step 14);
9) Setting an A area image starting mark as a starting normal state, and setting an A area image updating mark as an initialization state;
10 Setting the B-zone mapping state to an updating state;
11 Updating the mapping of the area A to an area B of a FLASH mapping storage area to cover the original mapping of the area B;
12 Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) way, and jumping to the step 11) if the checking is wrong, or jumping to the step 13);
13 Set the B-zone map update flag to the initialized state;
14 Image boot ends;
and 3, step 3: the image updating process comprises the following steps:
1) Judging whether the B area image updating mark is in an initialized state, if so, jumping to the step 5), otherwise, jumping to the step 2);
2) Updating the mapping of the area A to an area B of a FLASH mapping storage area to cover the original mapping of the area B;
3) Checking the correctness of the updated mapping data in the B area in a CRC (cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
4) Setting a B area mapping updating mark as an initialization state;
5) Setting an A area image updating mark as an updating state;
6) Updating the new version image to an area A of a FLASH image storage area, and covering the original image of the area A;
7) Checking whether the updated mapping data of the area A is correct by a CRC (Cyclic redundancy check) mode, and jumping to the step 2) if the checking is wrong;
8) Setting an A area image updating mark as an updating completion state;
9) The area A image boot state is set to the boot normal state.
CN201811487126.0A 2018-12-06 2018-12-06 Double-area backup image system based on embedded program and starting method Active CN109634781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811487126.0A CN109634781B (en) 2018-12-06 2018-12-06 Double-area backup image system based on embedded program and starting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811487126.0A CN109634781B (en) 2018-12-06 2018-12-06 Double-area backup image system based on embedded program and starting method

Publications (2)

Publication Number Publication Date
CN109634781A CN109634781A (en) 2019-04-16
CN109634781B true CN109634781B (en) 2023-03-24

Family

ID=66071636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811487126.0A Active CN109634781B (en) 2018-12-06 2018-12-06 Double-area backup image system based on embedded program and starting method

Country Status (1)

Country Link
CN (1) CN109634781B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147243A (en) * 2019-06-13 2019-08-20 上海仪电汽车电子系统有限公司 A kind of multi-chip communication means and system
CN111190648A (en) * 2019-12-26 2020-05-22 湖南工程学院 NAND FLASH-based real-time embedded system and starting method thereof
CN111552592A (en) * 2020-04-24 2020-08-18 青岛矽昌通信技术有限公司 Double-backup starting method and system
CN113778553A (en) * 2021-08-27 2021-12-10 中国航空无线电电子研究所 High-reliability start loading method for embedded avionic device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631674B (en) * 2012-08-24 2016-05-04 京信通信系统(中国)有限公司 Embed FPGA and the starting method thereof of CPU
US20160092310A1 (en) * 2014-09-30 2016-03-31 Vivint, Inc. Systems and methods for managing globally distributed remote storage devices
CN104765628A (en) * 2015-03-10 2015-07-08 惠州Tcl移动通信有限公司 Method and system for updating touch screen firmware of movable terminal
CN105138430A (en) * 2015-08-24 2015-12-09 浪潮集团有限公司 Embedded operating system backup and restoration method and device
CN105808296B (en) * 2016-03-08 2019-06-25 江苏万帮德和新能源科技股份有限公司 A kind of client software starting method for itself program of charging pile safety upgrade
CN107480000B (en) * 2016-06-08 2020-12-11 瑞昱半导体股份有限公司 Method for resetting memory in computer system
US10191736B2 (en) * 2017-04-28 2019-01-29 Servicenow, Inc. Systems and methods for tracking configuration file changes

Also Published As

Publication number Publication date
CN109634781A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109634781B (en) Double-area backup image system based on embedded program and starting method
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
US9471435B2 (en) Information processing device, information processing method, and computer program
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
CN105354063B (en) Program on-line upgrading method and system
US20150199190A1 (en) System and method for updating firmware
CN101650662A (en) Memory device of embedded system and staring method and upgrading of firmware
CN105260215A (en) Method of updating vehicle-mounted automobile data recorder terminal by USB flash disk
CN105677398A (en) Universal embedded computer software on-line upgrading method
US20090271660A1 (en) Motherboard, a method for recovering the bios thereof and a method for booting a computer
US20210294593A1 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted tbox
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
US20150154091A1 (en) Bios maintenance method
US20170242685A1 (en) Updating of firmware
CN106775674B (en) Equipment based on universal boot loader and starting method thereof
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN111552592A (en) Double-backup starting method and system
CN111782246A (en) Embedded program upgrading method of multi-node equipment based on bus
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN111273928B (en) Bootloader design method for self-upgrading
CN111090443A (en) Method, equipment and storage medium for guaranteeing safe upgrade of linux system
US11169828B2 (en) Electronic control unit and method for verifying control program
CN113377425B (en) BMC firmware generation method and device, BMC starting method and device and storage medium
CN105677416A (en) Uboot upgrading control system and method
US9529581B2 (en) Circuit and method for writing program codes of basic input/output system

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
GR01 Patent grant
GR01 Patent grant