CN117667522A - Firmware information cloning method based on MCU - Google Patents

Firmware information cloning method based on MCU Download PDF

Info

Publication number
CN117667522A
CN117667522A CN202311864541.4A CN202311864541A CN117667522A CN 117667522 A CN117667522 A CN 117667522A CN 202311864541 A CN202311864541 A CN 202311864541A CN 117667522 A CN117667522 A CN 117667522A
Authority
CN
China
Prior art keywords
firmware
information
mcu
instruction
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.)
Granted
Application number
CN202311864541.4A
Other languages
Chinese (zh)
Other versions
CN117667522B (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.)
Axd Anxinda Memory Technology Co ltd
Original Assignee
Axd Anxinda Memory 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 Axd Anxinda Memory Technology Co ltd filed Critical Axd Anxinda Memory Technology Co ltd
Priority to CN202311864541.4A priority Critical patent/CN117667522B/en
Priority claimed from CN202311864541.4A external-priority patent/CN117667522B/en
Publication of CN117667522A publication Critical patent/CN117667522A/en
Application granted granted Critical
Publication of CN117667522B publication Critical patent/CN117667522B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a firmware information cloning method based on MCU, which relates to the technical field of data flash memory, and comprises the steps of dividing an operation instruction sent by MCU into a plurality of execution operation nodes according to operation content, associating a firmware object required by completing corresponding operation content with the corresponding instruction operation node, carrying out information backup on the firmware object associated with the instruction operation node when the instruction operation node is executed, storing the backed-up information when the MCU is impacted in a working state, cloning the stored backup information into the corresponding firmware object when the MCU is not impacted and the working state is stable, and realizing re-opening the card of the firmware object, thereby realizing more perfect retention of the effect generated by the execution operation after the MCU is impacted in the working state.

Description

Firmware information cloning method based on MCU
Technical Field
The invention relates to the technical field of data flash memories, in particular to a firmware information cloning method based on MCU.
Background
Cloning techniques are mainly used to meet the needs of people for duplicate data. In practical applications, it is often faced with a scenario that a copy of data stored on a block device is intended to be modified, and the original data is not intended to be lost completely, so that a relatively fast solution is to clone a copy, modify and cover the copy, and keep the copy unchanged originally;
when the MCU runs in the space environment, if the MCU is impacted in the process of executing the operation, the effect generated in the operation process is possibly lost, and how to avoid the effect generated by the execution operation after the MCU is impacted in the space environment is more perfectly reserved, so that the problem which needs to be solved is solved.
Disclosure of Invention
The invention aims to provide a firmware information cloning method based on MCU.
The aim of the invention can be achieved by the following technical scheme: a firmware information cloning method based on MCU includes the following steps:
step S1: reading an operation instruction sent by the MCU in real time, and generating a firmware information retrieval instruction according to the operation instruction of the MCU;
step S2: acquiring firmware state information in the current state according to the generated firmware information retrieval instruction, and backing up the acquired firmware state information;
step S3: detecting whether the MCU is impacted in real time, and if so, automatically storing the firmware state information backed up in real time;
step S4: and cloning information of the firmware object according to the automatically stored firmware state information.
Further, the generating process of the firmware information retrieval instruction includes:
reading the firmware objects required to be executed by the operation instructions, marking the firmware objects required to be executed respectively, and sequencing the firmware objects marked by the operation instructions according to the priorities of the firmware objects;
setting a corresponding number of instruction operation nodes according to the number of firmware objects required to be executed by the operation instructions, and associating the set instruction operation nodes with the firmware objects;
sequencing the instruction operation nodes according to the priority of the firmware object, and acquiring the initial state of the instruction operation nodes;
generating a corresponding firmware information retrieval instruction according to each instruction operation node;
when the operation instruction is executed to the corresponding instruction operation node, the corresponding firmware object is searched through the corresponding firmware information search instruction to obtain the corresponding firmware state information.
Further, the process of acquiring the firmware state information in the current state according to the generated firmware information retrieval instruction includes:
when the method is executed to the corresponding instruction operation node, marking a firmware object associated with the instruction operation node, acquiring firmware state information in the current state, and marking the firmware state information as initial state information;
and acquiring the operation content of the instruction operation node, operating the firmware object according to the operation content, acquiring the firmware state information in the current state after the operation of the firmware object is completed, and marking the firmware state information as the completion state information.
Further, the process of backing up the acquired firmware state information in real time includes:
acquiring initial state information of a firmware object corresponding to an instruction operation node with the index of i=1, generating a corresponding first initial firmware information backup instruction, and feeding back the first initial firmware information backup instruction to the MCU;
the MCU constructs a backup node associated with the first firmware information backup instruction according to the fed back first initial firmware information backup instruction, and marks the backup node as a first backup node;
when the completion state information is acquired, a first completion firmware information backup instruction is generated, and the generated first completion firmware information backup instruction is fed back to the MCU;
the MCU matches the first completion firmware information backup instruction with the first initial firmware information backup instruction, uploads the obtained completion state information into the first backup node according to the first initial firmware information backup instruction, and covers the completion state information with the initial state information, so that the firmware state information of the firmware object corresponding to the instruction operation node is backed up, and the firmware state information of each firmware object is backed up by the MCU.
Further, when the MCU is detected to be impacted in the working state, the process of storing the firmware state information in each backup node in the MCU comprises the following steps:
when each instruction operation node in the operation instructions is executed, detecting whether the MCU in the working state is impacted or not, and obtaining a corresponding detection result;
when the detection result is that the MCU is not impacted, after the operation contents corresponding to all instruction operation nodes are finished, all backup nodes in the MCU are cleared;
and when the MCU is impacted as a detection result, the completion state information in the backup node is stored, an information cloning instruction is generated, and the information cloning instruction is uploaded into the MCU.
Further, after the information cloning instruction is generated, the working state of the MCU is detected in real time, a corresponding state change diagram is generated according to the working state of the MCU, and whether the information cloning instruction is executed is judged according to the generated state change diagram.
Further, the generating process of the state change diagram includes:
establishing a two-dimensional coordinate system of time with respect to state coefficients;
setting detection periods, and acquiring whether the MCU is impacted in each detection period, wherein if the MCU is impacted, the state coefficient of the MCU corresponding to the period is 1, otherwise, if the MCU is not impacted, the state coefficient of the MCU corresponding to the period is 0;
mapping the obtained state coefficient of the MCU into a two-dimensional coordinate system to obtain a corresponding state change curve;
setting a time window in a two-dimensional coordinate system so as to obtain a state change diagram; the duration of the time window is T;
and acquiring a state change curve in the time window, and judging whether to execute the information cloning instruction according to the state change curve in the time window.
Further, the process of judging whether to execute the information cloning instruction comprises the following steps:
when the state coefficient corresponding to the state change curve in the time window is 1, the MCU is still in the state of being impacted, and no operation is performed;
when the state coefficients corresponding to the state change curves in the time window are all 0, the MCU is not in a state of being impacted, and the running state of the MCU is stable, and then the information cloning instruction is executed.
Further, the process of cloning the information of the firmware object comprises the following steps:
reading all backup nodes in the MCU, and further obtaining instruction operation nodes associated with each backup node;
marking the firmware object associated with the obtained instruction operation node, importing the firmware state information backed up in the backup node into the firmware object, and covering the firmware state information in the firmware object so as to finish information cloning of the firmware object;
and after the information cloning of the firmware objects corresponding to all the backup nodes is completed, continuing to execute the unfinished instruction operation nodes, and backing up the firmware state information of the firmware objects corresponding to the unfinished instruction operation nodes.
Compared with the prior art, the invention has the beneficial effects that: when the MCU is impacted in a working state, the backed-up information is stored, when the MCU is not impacted, and the working state is stable, the stored backup information is cloned into the corresponding firmware object, so that the firmware object can be re-opened, and the effect generated by the execution operation can be more perfectly reserved after the MCU is impacted in the working state.
Drawings
Fig. 1 is a schematic diagram of the present invention.
Detailed Description
As shown in fig. 1, a firmware information cloning method based on an MCU includes the following steps:
step S1: reading an operation instruction sent by the MCU in real time, and generating a firmware information retrieval instruction according to the operation instruction of the MCU;
step S2: acquiring firmware state information in the current state according to the generated firmware information retrieval instruction, and backing up the acquired firmware state information;
step S3: detecting whether the MCU is impacted in real time, and if so, automatically storing the firmware state information backed up in real time;
step S4: and cloning information of the firmware object according to the automatically stored firmware state information.
It should be further noted that, in the implementation process, the generating process of the firmware information retrieval instruction includes:
reading the firmware objects required to be executed by the operation instructions, marking the firmware objects required to be executed respectively, and sequencing the firmware objects marked by the operation instructions according to the priorities of the firmware objects; it should be further noted that, in the implementation process, the priority of the firmware object is determined by the specific operation content of the operation instruction;
setting a corresponding number of instruction operation nodes according to the number of firmware objects required to be executed by the operation instructions, and associating the set instruction operation nodes with the firmware objects; it should be further noted that, in the implementation process, one instruction operation node is associated with only one firmware object, and each instruction operation node is associated with corresponding operation content;
sequencing instruction operation nodes according to the priority of the firmware object, marking each instruction operation node as i, wherein i=1, 2, … …, n, n is an integer, n is more than or equal to 1, and acquiring the initial state of the instruction operation node; it should be further noted that, in the implementation process, the initial state of the instruction operation node includes a state "1" and a state "0", and the initial state of the instruction operation node is a state "0";
generating a corresponding firmware information retrieval instruction according to each instruction operation node;
when the operation instruction is executed to the corresponding instruction operation node, the corresponding firmware object is searched through the corresponding firmware information search instruction to obtain the corresponding firmware state information.
It should be further noted that, in the implementation process, the process of obtaining the firmware state information in the current state according to the generated firmware information retrieval instruction includes:
when the method is executed to the corresponding instruction operation node, marking a firmware object associated with the instruction operation node, acquiring firmware state information in the current state, and marking the firmware state information as initial state information;
and acquiring the operation content of the instruction operation node, operating the firmware object according to the operation content, acquiring the firmware state information in the current state after the operation of the firmware object is completed, marking the firmware state information as the completion state information, and updating the initial state of the instruction operation node to be a state of 1.
The process of backing up the acquired firmware state information in real time comprises the following steps:
acquiring initial state information of a firmware object corresponding to an instruction operation node with the index of i=1, generating a corresponding first initial firmware information backup instruction, and feeding back the first initial firmware information backup instruction to the MCU;
the MCU constructs a backup node associated with the first firmware information backup instruction according to the fed back first initial firmware information backup instruction, and marks the backup node as a first backup node;
when the completion state information is acquired, a first completion firmware information backup instruction is generated, and the generated first completion firmware information backup instruction is fed back to the MCU;
the MCU matches the first completion firmware information backup instruction with the first initial firmware information backup instruction, uploads the obtained completion state information into the first backup node according to the first initial firmware information backup instruction, and covers the completion state information with the initial state information, thereby completing the backup of the firmware state information of the firmware object corresponding to the instruction operation node;
acquiring initial state information of the firmware objects corresponding to the instruction operation nodes with the index of i=2, and so on, and finishing backup of the firmware state information of each firmware object; it should be further noted that, in the implementation process, each firmware object corresponds to a backup node.
It should be further noted that, in the implementation process, when the MCU is detected to be impacted in the working state, the process of saving the firmware state information in each backup node in the MCU includes:
when each instruction operation node in the operation instructions is executed, detecting whether the MCU in the working state is impacted or not, and obtaining a corresponding detection result;
when the MCU is not impacted as a detection result, after the initial states of all instruction operation nodes in the operation instruction are all changed into a state of 1, all backup nodes in the MCU are cleared;
and when the MCU is impacted as a detection result, storing the completion state information in the backup node corresponding to the instruction operation node with the initial state of '1' in the operation instruction, generating an information cloning instruction, and uploading the information cloning instruction to the MCU.
It should be further noted that, in the implementation process, the process of cloning the firmware information includes:
after an information cloning instruction is generated, detecting the working state of the MCU in real time, generating a corresponding state change diagram according to the working state of the MCU, and judging whether to execute the information cloning instruction according to the generated state change diagram;
it should be further noted that, in the implementation process, the generating process of the state change diagram includes:
establishing a two-dimensional coordinate system of time with respect to state coefficients;
setting detection periods, and acquiring whether the MCU is impacted in each detection period, wherein if the MCU is impacted, the state coefficient of the MCU corresponding to the period is 1, otherwise, if the MCU is not impacted, the state coefficient of the MCU corresponding to the period is 0;
mapping the obtained state coefficient of the MCU into a two-dimensional coordinate system to obtain a corresponding state change curve;
setting a time window in a two-dimensional coordinate system so as to obtain a state change diagram; the duration of the time window is T; it should be further noted that, in the implementation process, the time window is composed of a first time axis and a second time axis, where the second time axis is the current time, and the first time axis is the previous time with a distance duration of T from the second time axis;
and acquiring a state change curve in the time window, and judging whether to execute the information cloning instruction according to the state change curve in the time window.
It should be further noted that, in the implementation process, the process of determining whether to execute the information cloning instruction includes:
when the state coefficient corresponding to the state change curve in the time window is 1, the MCU is still in the state of being impacted, and no operation is performed;
when the state coefficients corresponding to the state change curves in the time window are all 0, the MCU is not in a state of being impacted, and the running state of the MCU is stable, and then the information cloning instruction is executed.
It should be further noted that, in the implementation process, the process of cloning the information of the firmware object includes:
reading all backup nodes in the MCU, and further obtaining instruction operation nodes associated with each backup node;
marking the firmware object associated with the obtained instruction operation node, importing the firmware state information backed up in the backup node into the firmware object, and covering the firmware state information in the firmware object so as to finish information cloning of the firmware object;
after the information cloning of the firmware objects corresponding to all the backup nodes is completed, continuing to execute the unfinished instruction operation nodes, and backing up the firmware state information of the firmware objects corresponding to the unfinished instruction operation nodes;
when the MCU works in the space environment, the operation instruction sent by the MCU is divided into a plurality of execution operation nodes according to the operation content, then the firmware object required by completing the corresponding operation content is associated with the corresponding instruction operation node, when the instruction operation node is executed, the information backup is carried out on the firmware object associated with the instruction operation node, when the MCU is impacted in the working state, the backed-up information is stored, when the MCU is not impacted, and the working state is stable, the stored backup information is cloned into the corresponding firmware object, so that the re-opening of the firmware object is realized, and the effect generated by the execution operation is more perfectly reserved after the MCU is impacted in the working state.
The above embodiments are only for illustrating the technical method of the present invention and not for limiting the same, and it should be understood by those skilled in the art that the technical method of the present invention may be modified or substituted without departing from the spirit and scope of the technical method of the present invention.

Claims (9)

1. The firmware information cloning method based on the MCU is characterized by comprising the following steps of:
step S1: reading an operation instruction sent by the MCU in real time, and generating a firmware information retrieval instruction according to the operation instruction of the MCU;
step S2: acquiring firmware state information in the current state according to the generated firmware information retrieval instruction, and backing up the acquired firmware state information;
step S3: detecting whether the MCU is impacted in real time, and if so, automatically storing the firmware state information backed up in real time;
step S4: and cloning information of the firmware object according to the automatically stored firmware state information.
2. The method for cloning firmware information based on the MCU according to claim 1, wherein the process of generating the firmware information retrieval instruction comprises:
reading the firmware objects required to be executed by the operation instructions, marking the firmware objects required to be executed respectively, and sequencing the firmware objects marked by the operation instructions according to the priorities of the firmware objects;
setting a corresponding number of instruction operation nodes according to the number of firmware objects required to be executed by the operation instructions, and associating the set instruction operation nodes with the firmware objects;
sequencing the instruction operation nodes according to the priority of the firmware object, and acquiring the initial state of the instruction operation nodes;
generating a corresponding firmware information retrieval instruction according to each instruction operation node;
when the operation instruction is executed to the corresponding instruction operation node, the corresponding firmware object is searched through the corresponding firmware information search instruction to obtain the corresponding firmware state information.
3. The method of cloning firmware information based on an MCU according to claim 2, wherein the process of acquiring firmware state information in a current state according to the generated firmware information retrieval instruction comprises:
when the method is executed to the corresponding instruction operation node, marking a firmware object associated with the instruction operation node, acquiring firmware state information in the current state, and marking the firmware state information as initial state information;
and acquiring the operation content of the instruction operation node, operating the firmware object according to the operation content, acquiring the firmware state information in the current state after the operation of the firmware object is completed, and marking the firmware state information as the completion state information.
4. A method for cloning firmware information based on an MCU according to claim 3, wherein the process of backing up the acquired firmware state information in real time comprises:
acquiring initial state information of a firmware object corresponding to an instruction operation node with the index of i=1, generating a corresponding first initial firmware information backup instruction, and feeding back the first initial firmware information backup instruction to the MCU;
the MCU constructs a backup node associated with the first firmware information backup instruction according to the fed back first initial firmware information backup instruction, and marks the backup node as a first backup node;
when the completion state information is acquired, a first completion firmware information backup instruction is generated, and the generated first completion firmware information backup instruction is fed back to the MCU;
the MCU matches the first completion firmware information backup instruction with the first initial firmware information backup instruction, uploads the obtained completion state information into the first backup node according to the first initial firmware information backup instruction, and covers the completion state information with the initial state information, so that the firmware state information of the firmware object corresponding to the instruction operation node is backed up, and the firmware state information of each firmware object is backed up by the MCU.
5. The method of claim 4, wherein when the MCU is detected to be impacted in the operation state, the process of saving the firmware state information in each backup node in the MCU comprises:
when each instruction operation node in the operation instructions is executed, detecting whether the MCU in the working state is impacted or not, and obtaining a corresponding detection result;
when the detection result is that the MCU is not impacted, after the operation contents corresponding to all instruction operation nodes are finished, all backup nodes in the MCU are cleared;
and when the MCU is impacted as a detection result, the completion state information in the backup node is stored, an information cloning instruction is generated, and the information cloning instruction is uploaded into the MCU.
6. The method for cloning firmware information based on MCU according to claim 5, wherein after generating the information cloning instruction, detecting the operating state of MCU in real time, generating a corresponding state change map according to the operating state of MCU, and judging whether to execute the information cloning instruction according to the generated state change map.
7. The method for cloning firmware information based on MCU according to claim 6, wherein the generation process of the state change map comprises:
establishing a two-dimensional coordinate system of time with respect to state coefficients;
setting detection periods, and acquiring whether the MCU is impacted in each detection period, wherein if the MCU is impacted, the state coefficient of the MCU corresponding to the period is 1, otherwise, if the MCU is not impacted, the state coefficient of the MCU corresponding to the period is 0;
mapping the obtained state coefficient of the MCU into a two-dimensional coordinate system to obtain a corresponding state change curve;
setting a time window in a two-dimensional coordinate system so as to obtain a state change diagram; the duration of the time window is T;
and acquiring a state change curve in the time window, and judging whether to execute the information cloning instruction according to the state change curve in the time window.
8. The method of claim 7, wherein determining whether to execute the information cloning instruction comprises:
when the state coefficient corresponding to the state change curve in the time window is 1, the MCU is still in the state of being impacted, and no operation is performed;
when the state coefficients corresponding to the state change curves in the time window are all 0, the MCU is not in a state of being impacted, and the running state of the MCU is stable, and then the information cloning instruction is executed.
9. The method for cloning information of firmware on the basis of MCU according to claim 8, wherein the process of cloning information of the firmware object comprises:
reading all backup nodes in the MCU, and further obtaining instruction operation nodes associated with each backup node;
marking the firmware object associated with the obtained instruction operation node, importing the firmware state information backed up in the backup node into the firmware object, and covering the firmware state information in the firmware object so as to finish information cloning of the firmware object;
and after the information cloning of the firmware objects corresponding to all the backup nodes is completed, continuing to execute the unfinished instruction operation nodes, and backing up the firmware state information of the firmware objects corresponding to the unfinished instruction operation nodes.
CN202311864541.4A 2023-12-29 Firmware information cloning method based on MCU Active CN117667522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311864541.4A CN117667522B (en) 2023-12-29 Firmware information cloning method based on MCU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311864541.4A CN117667522B (en) 2023-12-29 Firmware information cloning method based on MCU

Publications (2)

Publication Number Publication Date
CN117667522A true CN117667522A (en) 2024-03-08
CN117667522B CN117667522B (en) 2024-07-02

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098390A1 (en) * 2006-10-18 2008-04-24 International Business Machines Corporation Guaranteeing authentic firmware for purposes of cloning
CN105740034A (en) * 2016-04-13 2016-07-06 深圳市高巨创新科技开发有限公司 System and method for upgrading firmware of MCU on line
CN111769966A (en) * 2020-05-08 2020-10-13 厦门亿联网络技术股份有限公司 Clone upgrading method, system and application
CN114138497A (en) * 2021-12-08 2022-03-04 中国人民解放军军事科学院国防科技创新研究院 Satellite-borne intelligent data processing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080098390A1 (en) * 2006-10-18 2008-04-24 International Business Machines Corporation Guaranteeing authentic firmware for purposes of cloning
CN105740034A (en) * 2016-04-13 2016-07-06 深圳市高巨创新科技开发有限公司 System and method for upgrading firmware of MCU on line
CN111769966A (en) * 2020-05-08 2020-10-13 厦门亿联网络技术股份有限公司 Clone upgrading method, system and application
CN114138497A (en) * 2021-12-08 2022-03-04 中国人民解放军军事科学院国防科技创新研究院 Satellite-borne intelligent data processing device

Similar Documents

Publication Publication Date Title
CN107918666B (en) Data synchronization method and system on block chain
CN107491429B (en) Method for solving conflict of simultaneously editing document contents
CN106933823B (en) Data synchronization method and device
CN111507480B (en) Labeling method, labeling device, labeling equipment and storage medium
CN111080290A (en) Block chain transaction execution and data storage method based on account classification
CN117667522B (en) Firmware information cloning method based on MCU
CN117667522A (en) Firmware information cloning method based on MCU
CN111488339A (en) NoSQ L database based on node.JS, and establishing and processing method
CN107491975B (en) Data slot data processing method and device for server and consumer
CN102096687A (en) Method and platform for scheduling tasks
US9965491B2 (en) Method and device for recording system log
CN112487092A (en) Intelligent contract calling method and device based on block chain
CN105975567B (en) Method and device for processing internal file of application program
CN107329807B (en) Data delay processing method and device, and computer readable storage medium
CN112308445B (en) Method and system for processing manufacturing process data, storage medium and electronic equipment
CN113791594A (en) Configuration establishing method, system, equipment and medium of distributed control system
CN111159313B (en) Method, system, device and storage medium for database rapid synthesis backup
CN113806365A (en) Single data source data management method, device and storage medium
CN108920749B (en) Pipeline two-dimensional and three-dimensional data updating method and device and computer readable storage medium
CN115964084A (en) Data interaction method, electronic equipment and storage medium
CN108008981B (en) Method and device for initializing program in system on chip (SoC)
CN110019266B (en) SQL statement generation method and device
CN109450966A (en) Equipment localization method, device, computer equipment and storage medium
CN116737246A (en) Task restarting method, device, equipment and medium
CN109657085B (en) Drawing linkage access method and device

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