CN112596672B - Storage processing method and device of main control chip, processor and electronic equipment - Google Patents

Storage processing method and device of main control chip, processor and electronic equipment Download PDF

Info

Publication number
CN112596672B
CN112596672B CN202011508035.8A CN202011508035A CN112596672B CN 112596672 B CN112596672 B CN 112596672B CN 202011508035 A CN202011508035 A CN 202011508035A CN 112596672 B CN112596672 B CN 112596672B
Authority
CN
China
Prior art keywords
sector
storage
backup
main
data
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
CN202011508035.8A
Other languages
Chinese (zh)
Other versions
CN112596672A (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.)
Gree Zhongshan Small Home Appliances Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011508035.8A priority Critical patent/CN112596672B/en
Publication of CN112596672A publication Critical patent/CN112596672A/en
Application granted granted Critical
Publication of CN112596672B publication Critical patent/CN112596672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • 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
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a storage processing method and device of a main control chip, a processor and electronic equipment. Wherein, the method comprises the following steps: obtaining a storage sector in a use state in a main control chip, wherein the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation; verifying the read storage data of the storage sector to obtain a verification result; and if the verification result indicates a verification error, rewriting the storage sector and performing backup processing on the storage data. The invention solves the technical problem that the main control chip in the prior art has the condition of loss of the stored data.

Description

Storage processing method and device of main control chip, processor and electronic equipment
Technical Field
The invention relates to the field of storage processing, in particular to a storage processing method and device of a main control chip, a processor and electronic equipment.
Background
Along with the improvement of the technical level, various living electric appliances gradually tend to be automated and intelligent, and along with the increasing appearance of intelligent electric appliances in the lives of people, the intelligent electric appliances bring more humanized experience to users through a one-stop use mode of the intelligent electric appliances, and as the requirements of people on intelligent household appliances are higher and higher, the requirements on a control system are higher and higher, so that the performance requirements of developers on a Main Control Unit (MCU) are higher and higher.
However, most of the existing main control chips do not have the memory function, and the design causes the main control chip to stop working and cause the loss of stored data when the main control chip is working and meets emergency situations such as power failure and the like suddenly, and after the main control chip is recovered again, the equipment operation is wrong due to incomplete data, and the user experience is poor, so that the problem of power failure memory of the chip is solved, and therefore, the equipment can be ensured to normally operate under any conditions, which is particularly important
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a storage processing method and device of a main control chip, a processor and electronic equipment, and aims to at least solve the technical problem that the main control chip in the prior art has the storage data loss condition.
According to an aspect of the embodiments of the present invention, a storage processing method of a master control chip is provided, including: obtaining a storage sector in a use state in a main control chip, wherein the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation; verifying the read storage data of the storage sector to obtain a verification result; and if the verification result indicates a verification error, rewriting the storage sector and performing backup processing on the storage data.
Optionally, the step of verifying the read storage data of the storage sector to obtain a verification result includes: when reading the storage data in the main sector, acquiring a first sector position of a target main sector in a use state; reading the storage data of the target main sector based on the first sector position; verifying the read storage data of the target main sector to obtain a first verification result; if the check result indicates a check error, the rewriting the storage sector and performing backup processing on the storage data includes: and if the first check result indicates a check error, rewriting the target main sector and writing the storage data into a backup sector corresponding to the target main sector.
Optionally, the step of verifying the read storage data of the storage sector to obtain a verification result includes: when the storage data in the backup sector is read, acquiring a second sector position of the target backup sector in a use state; reading the storage data of the target backup sector based on the position of the second sector, and verifying the read storage data of the target backup sector to obtain a second verification result; if the check result indicates a check error, the rewriting the storage sector and performing backup processing on the storage data includes: and if the second check result indicates a check error, rewriting the target backup sector and a main sector corresponding to the target backup sector based on the storage data.
Optionally, the method further includes: if any one of the main sector and the backup sector has the check error, rewriting the main sector and the backup sector, wherein the sector with the check error is rewritten first and then the sector without the check error is rewritten; if the check error exists in both the main sector and the backup sector, rewriting the storage data into the main sector and the backup sector; if the check error does not exist in the main sector and the backup sector, the storage data is written into the main sector first, and then the storage data is written into the backup sector.
Optionally, the method further includes: after the storage data of the storage sector is acquired each time, whether the storage sector needs to be switched to the next storage sector of the storage sector is judged, and the erasing times of the storage sector are recorded.
Optionally, the method further includes: before writing the storage data into the storage sector, judging whether the storage data needs to be written into a storage sector next to the storage sector.
Optionally, each of the storage sectors includes at least one storage page, and the method further includes: judging whether all storage pages of the storage sector are completely written to obtain a judgment result; and if the judgment result indicates that all the data is written, performing data erasing processing on the storage sector, wherein if power failure occurs in the process of erasing the main sector of the storage sector, performing data recovery processing on the main sector by reading the storage data of the backup sector of the storage sector.
According to another aspect of the embodiments of the present invention, there is also provided a storage processing apparatus of a master control chip, including: the device comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring a storage sector in a use state in a main control chip, the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation; the verification module is used for verifying the read storage data of the storage sector to obtain a verification result; and the processing module is used for rewriting the storage sector and carrying out backup processing on the storage data if the verification result indicates that the verification is wrong.
According to another aspect of the embodiments of the present invention, a non-volatile storage medium is further provided, where the non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing any one of the storage processing methods of the main control chip.
According to another aspect of the embodiments of the present invention, there is further provided a processor, where the processor is configured to execute a program, where the program is configured to execute any one of the storage processing methods of the main control chip when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores therein a computer program, and the processor is configured to execute the computer program to perform any one of the storage processing methods of the main control chip.
In the embodiment of the present invention, a storage sector in a use state in a main control chip is obtained, wherein the main control chip includes at least one storage block, each storage block includes a plurality of storage sectors, each storage sector includes a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have an erasing operation; verifying the read storage data of the storage sector to obtain a verification result; if the check result indicates a check error, the storage sector is rewritten and the storage data is backed up, so that the purpose of avoiding the loss of the storage data of the main control chip is achieved, the technical effect of ensuring the safe and stable operation of the device is achieved, and the technical problem that the storage data of the main control chip in the prior art is lost is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a storage processing method of a master control chip according to an embodiment of the present invention;
fig. 2 is a flowchart of an alternative storage processing method of a master control chip according to an embodiment of the present invention;
fig. 3 is a flowchart of an alternative storage processing method of a master control chip according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a storage processing apparatus of a master control chip according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an embodiment of the present invention, there is provided an embodiment of a storage processing method of a main control chip, it should be noted that the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that here.
Fig. 1 is a flowchart of a storage processing method of a master control chip according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step S102, obtaining a storage sector in a use state in a main control chip, wherein the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation;
step S104, verifying the read storage data of the storage sector to obtain a verification result;
and step S106, if the verification result indicates a verification error, rewriting the storage sector and performing backup processing on the storage data.
In the embodiment of the present invention, a storage sector in a use state in a main control chip is obtained, wherein the main control chip includes at least one storage block, each storage block includes a plurality of storage sectors, each storage sector includes a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have an erasing operation; verifying the read storage data of the storage sector to obtain a verification result; if the check result indicates a check error, the storage sector is rewritten and the storage data is backed up, so that the purpose of avoiding the loss of the storage data of the main control chip is achieved, the technical effect of ensuring the safe and stable operation of the device is achieved, and the technical problem that the storage data of the main control chip in the prior art is lost is solved.
Due to data erasing of the MCU storage module of the existing main control chip, data stored during erasing can not be memorized, the stored data can be lost when abnormal states such as power failure occur, the data erasing frequency is limited, and the service life of the main control chip is relatively short.
Optionally, the main control chip should at least include one storage block, each block includes a plurality of sectors, each sector should include at least one storage page, the sector should be divided into two parts, one part is a main sector, and the other part is a backup sector, each sector should have the same storage space, and can satisfy the required erasing operation.
Optionally, by the embodiment of the present application, computer software may be used to read data from a storage sector, where a flowchart of reading data is shown in fig. 2, or write data, where a flowchart of writing data is shown in fig. 3, or erase data, or perform other operations including, but not limited to, the above-described operations on the required sector data by a program.
Optionally, in the embodiment of the present application, the storage sector of the storage module is subdivided into a plurality of storage pages, and after all the storage pages in the sector are written, the entire sector is erased, so that the number of times of erasing and writing is increased, and the service life is prolonged; when one main sector is written, the other backup sectors are used for data backup, and data loss caused by sudden power failure is avoided.
In an optional embodiment, verifying the read storage data of the storage sector, and obtaining a verification result includes:
step S202, when reading the storage data in the main sector, acquiring the first sector position of the target main sector in the use state;
step S204, based on the first sector position, reading the storage data of the target main sector;
step S206, verifying the read storage data of the target main sector to obtain a first verification result.
In another optional embodiment, if the verification result indicates a verification error, the rewriting the storage sector and performing backup processing on the storage data includes:
in step S208, if the first verification result indicates a verification error, the target main sector is rewritten, and the storage data is written into the backup sector corresponding to the target main sector.
Optionally, after the main control chip is powered on and initialized, reading data stored in the sector, after the data is read, verifying the data, and if the data is verified to be incorrect, rewriting the sector; when reading the sector, the data is checked for errors or the data is needed to be recorded, and the data writing operation is carried out on the sector.
Optionally, after the main control chip is powered on and initialized, when the main sector data is read, the currently used main sector position is obtained first, then the current sector data is read, then the read data is verified, and if the verification is wrong, the data is considered to be wrong.
As an optional embodiment, after the main control chip is powered on and initialized, the currently used main sector is obtained first, then the data of the current main sector is read, when the data of the main sector is read, the data is verified, if the data is verified incorrectly, whether the sector needs to be switched is judged, then the data is written into the corresponding sector, when the data is faulty, the faulty sector is written first, then the other sectors are written, and when the data is faulty, the main sector is written first, and then the backup sector is written.
In an optional embodiment, verifying the read storage data of the storage sector, and obtaining a verification result includes:
step S302, when reading the storage data in the backup sector, acquiring a second sector position of the target backup sector in a use state; and reading the storage data of the target backup sector based on the position of the second sector, and verifying the read storage data of the target backup sector to obtain a second verification result.
In another optional embodiment, if the verification result indicates a verification error, the rewriting the storage sector and performing backup processing on the storage data includes:
in step S304, if the second check result indicates a check error, the target backup sector and the main sector corresponding to the target backup sector are rewritten based on the storage data.
Optionally, after the main control chip is powered on and initialized, if the currently read sector data is judged to be the backup sector, the currently used backup sector should be obtained first, then the current backup sector data is read, then the read data is verified, and if the verification is wrong, the data is considered to be wrong.
As another alternative embodiment, after the main control chip is powered on and initialized, when reading the backup sector, the currently used backup sector is obtained first, then the data of the current backup sector is read, then the data is verified, and if the data is verified to be wrong, the data of the sector is rewritten. And if the two sectors have errors, writing default data into the corresponding sectors, and recording the erasing times of the current sector after the data is electrically read each time.
In an optional embodiment, the method further includes:
step S402, if any one of the main sector and the backup sector has the check error, rewriting the main sector and the backup sector, wherein the sector having the check error is rewritten first and then the sector not having the check error is rewritten;
step S404, if the verification error exists in both the main sector and the backup sector, the storage data is rewritten into the main sector and the backup sector;
step S406, if the verification error does not exist in both the main sector and the backup sector, the storage data is written into the main sector first, and then the storage data is written into the backup sector.
Optionally, in this embodiment of the present application, if one of the main sector and the backup sector has an error, the two sectors are rewritten, the sector with the error is written first, and if both the sectors have errors, the default data is rewritten into the two sectors.
In an optional embodiment, the method further includes:
step S502, after the storage data of the storage sector is acquired each time, determining whether it is necessary to switch to the next storage sector of the storage sector, and recording the erasing times of the storage sector.
In the above optional embodiment, after the storage data of the storage sector is acquired each time, it is determined whether a handover to a next storage sector of the storage sector is required, and the number of times of erasing and writing of the storage sector is recorded.
In an optional embodiment, the method further includes:
step S602, before writing the storage data into the storage sector, determines whether the storage data needs to be written into a storage sector next to the storage sector.
In the above optional embodiment, in the case of data error, the error sector is written first, in the case of writing the non-error sector, in other cases, the main sector is written first, and then the backup sector is written; it should be determined whether data needs to be written to the next sector before data writing is performed.
In an alternative embodiment, each of the memory sectors includes at least one memory page, and the method further includes:
step S702, judging whether all storage pages of the storage sector are completely written to obtain a judgment result;
step S704, if the determination result indicates that all the data is written, performing data erasing processing on the storage sector, wherein if power is off during erasing the main sector of the storage sector, performing data recovery processing on the main sector by reading the storage data of the backup sector of the storage sector.
In the above optional embodiment, when data is erased, it is determined whether all the storage pages of the current sector are completely written, and then an erase operation is performed after all the storage pages are completely written; when power is off in the process of erasing the main sector, the main sector can be restored by reading the backup data.
Through the scheme provided by the embodiment of the application, the storage block is subdivided into the plurality of sectors and is subdivided into the plurality of pages, the whole sector is erased after all the pages in the sector are written, the erasing times can be increased, and when one sector is subjected to writing operation, the rest sectors are used for data backup, so that the data loss caused by sudden power failure is avoided, the memory function is achieved, the erasing times are increased at first, the service life of the main control chip is prolonged, and meanwhile, the problem of data loss during power failure is solved through a data backup mode.
Example 2
According to an embodiment of the present invention, an embodiment of an apparatus for implementing the storage processing method of the main control chip is further provided, and fig. 4 is a schematic structural diagram of a storage processing apparatus of a main control chip according to an embodiment of the present invention, and as shown in fig. 4, the storage processing apparatus of a main control chip includes: an obtaining module 400, a checking module 402 and a processing module 404, wherein:
an obtaining module 400, configured to obtain a memory sector in a use state in a main control chip, where the main control chip includes at least one memory block, each memory block includes a plurality of memory sectors, each memory sector includes a main sector and a backup sector, and the main sector and the backup sector have the same memory space and have an erasing operation; a verification module 402, configured to verify the read storage data of the storage sector to obtain a verification result; a processing module 404, configured to, if the check result indicates a check error, rewrite the storage sector and perform backup processing on the storage data.
It should be noted that the above modules may be implemented by software or hardware, for example, for the latter, the following may be implemented: the modules can be located in the same processor; alternatively, the modules may be located in different processors in any combination.
It should be noted here that the above-mentioned obtaining module 400, the verifying module 402 and the processing module 404 correspond to steps S102 to S106 in embodiment 1, and the above-mentioned modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of embodiment 1. It should be noted that the modules described above may be implemented in a computer terminal as part of an apparatus.
It should be noted that, reference may be made to the relevant description in embodiment 1 for alternative or preferred embodiments of this embodiment, and details are not described here again.
The storage processing device of the main control chip may further include a processor and a memory, where the obtaining module 400, the verifying module 402, the processing module 404, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory, wherein one or more than one kernel can be arranged. The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to an embodiment of the present application, there is also provided an embodiment of a non-volatile storage medium. Optionally, in this embodiment, the nonvolatile storage medium includes a stored program, and when the program runs, the device where the nonvolatile storage medium is located is controlled to execute the storage processing method of any one of the main control chips.
Optionally, in this embodiment, the nonvolatile storage medium may be located in any one of a group of computer terminals in a computer network, or in any one of a group of mobile terminals, and the nonvolatile storage medium includes a stored program.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: obtaining a storage sector in a use state in a main control chip, wherein the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation; verifying the read storage data of the storage sector to obtain a verification result; and if the verification result indicates a verification error, rewriting the storage sector and performing backup processing on the storage data.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: when reading the storage data in the main sector, acquiring a first sector position of a target main sector in a use state; reading the storage data of the target main sector based on the first sector position; verifying the read storage data of the target main sector to obtain a first verification result; and if the first check result indicates a check error, rewriting the target main sector and writing the storage data into a backup sector corresponding to the target main sector.
Optionally, the apparatus in which the nonvolatile storage medium is controlled when the program is running performs the following functions: when the storage data in the backup sector is read, acquiring a second sector position of the target backup sector in a use state; reading the storage data of the target backup sector based on the position of the second sector, and verifying the read storage data of the target backup sector to obtain a second verification result; and if the second check result indicates a check error, rewriting the target backup sector and a main sector corresponding to the target backup sector based on the storage data.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: if any one of the main sector and the backup sector has the check error, rewriting the main sector and the backup sector, wherein the sector with the check error is rewritten first and then the sector without the check error is rewritten; if the check error exists in both the main sector and the backup sector, rewriting the storage data into the main sector and the backup sector; if the check error does not exist in the main sector and the backup sector, the storage data is written into the main sector first, and then the storage data is written into the backup sector.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: after the storage data of the storage sector is acquired each time, whether the storage sector needs to be switched to the next storage sector of the storage sector is judged, and the erasing times of the storage sector are recorded.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: before writing the storage data into the storage sector, judging whether the storage data needs to be written into a storage sector next to the storage sector.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: judging whether all storage pages of the storage sector are completely written to obtain a judgment result; and if the judgment result indicates that all the data is written, performing data erasing processing on the storage sector, wherein if power failure occurs in the process of erasing the main sector of the storage sector, performing data recovery processing on the main sector by reading the storage data of the backup sector of the storage sector.
According to an embodiment of the present application, there is also provided an embodiment of a processor. Optionally, in this embodiment, the processor is configured to execute a program, where the program executes the storage processing method of any one of the main control chips when running.
According to an embodiment of the present application, there is further provided an embodiment of an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the storage processing methods of the main control chip.
According to an embodiment of the present application, there is further provided an embodiment of a computer program product, which is adapted to execute a program initializing a storage processing method step of a main control chip of any one of the above when executed on a data processing device.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable non-volatile storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a non-volatile storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned nonvolatile storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and amendments can be made without departing from the principle of the present invention, and these modifications and amendments should also be considered as the protection scope of the present invention.

Claims (10)

1. A storage processing method of a main control chip is characterized by comprising the following steps:
the method comprises the steps of obtaining a storage sector in a use state in a main control chip, wherein the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation;
verifying the read storage data of the storage sector to obtain a verification result;
if the check result indicates a check error, rewriting the storage sector and performing backup processing on the storage data;
wherein the method further comprises: if any one of the main sector and the backup sector has the check error, rewriting the main sector and the backup sector, wherein the sector with the check error is rewritten first and then the sector without the check error is rewritten;
if the check error exists in both the main sector and the backup sector, rewriting the storage data into the main sector and the backup sector;
if the verification error does not exist in both the main sector and the backup sector, the storage data is written into the main sector first, and then the storage data is written into the backup sector.
2. The method of claim 1,
verifying the read storage data of the storage sector, and obtaining a verification result comprises: when the storage data in the main sector is read, acquiring a first sector position of a target main sector in a use state; reading the storage data of the target main sector based on the first sector position; verifying the read storage data of the target main sector to obtain a first verification result;
if the check result indicates a check error, rewriting the storage sector and performing backup processing on the storage data includes: and if the first check result indicates a check error, rewriting the target main sector, and writing the storage data into a backup sector corresponding to the target main sector.
3. The method of claim 1,
verifying the read storage data of the storage sector, and obtaining a verification result comprises: when the storage data in the backup sector is read, acquiring a second sector position of the target backup sector in a use state; based on the second sector position, reading the storage data of the target backup sector, and verifying the read storage data of the target backup sector to obtain a second verification result;
if the check result indicates a check error, rewriting the storage sector and performing backup processing on the storage data includes: if the second check result indicates a check error, rewriting the target backup sector and a main sector corresponding to the target backup sector based on the storage data.
4. The method of claim 1, further comprising:
after the storage data of the storage sector is acquired each time, judging whether the next storage sector of the storage sector needs to be switched to, and recording the erasing times of the storage sector.
5. The method of claim 1, further comprising:
before writing the storage data into the storage sector, judging whether the storage data needs to be written into a next storage sector of the storage sector.
6. The method of claim 1, wherein each of the memory sectors comprises at least one memory page, the method further comprising:
judging whether all storage pages of the storage sector are completely written to obtain a judgment result;
and if the judgment result indicates that all the data are written, performing data erasing processing on the storage sector, wherein if power failure occurs in the process of erasing the main sector of the storage sector, performing data recovery processing on the main sector by reading the storage data of the backup sector of the storage sector.
7. A storage processing device of a main control chip is characterized by comprising:
the device comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring a storage sector in a use state in a main control chip, the main control chip comprises at least one storage block, each storage block comprises a plurality of storage sectors, each storage sector comprises a main sector and a backup sector, and the main sector and the backup sector have the same storage space and have erasing operation;
the verification module is used for verifying the read storage data of the storage sector to obtain a verification result;
the processing module is used for rewriting the storage sector and carrying out backup processing on the storage data if the verification result indicates that the verification is wrong;
the device is further configured to, if the check error exists in any one of the main sector and the backup sector, rewrite the main sector and the backup sector, where the check error exists in the sector before the check error does not exist in the sector;
if the verification error exists in both the main sector and the backup sector, rewriting the storage data into the main sector and the backup sector;
if the verification error does not exist in both the main sector and the backup sector, the storage data is written into the main sector first, and then the storage data is written into the backup sector.
8. A non-volatile storage medium, characterized in that the non-volatile storage medium stores a plurality of instructions, the instructions are suitable for being loaded by a processor and executing the storage processing method of the main control chip according to any one of claims 1 to 6.
9. A processor, characterized in that the processor is configured to execute a program, wherein the program is configured to execute the storage processing method of the main control chip according to any one of claims 1 to 6 when running.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the storage processing method of the main control chip according to any one of claims 1 to 6.
CN202011508035.8A 2020-12-18 2020-12-18 Storage processing method and device of main control chip, processor and electronic equipment Active CN112596672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011508035.8A CN112596672B (en) 2020-12-18 2020-12-18 Storage processing method and device of main control chip, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011508035.8A CN112596672B (en) 2020-12-18 2020-12-18 Storage processing method and device of main control chip, processor and electronic equipment

Publications (2)

Publication Number Publication Date
CN112596672A CN112596672A (en) 2021-04-02
CN112596672B true CN112596672B (en) 2022-08-02

Family

ID=75199443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011508035.8A Active CN112596672B (en) 2020-12-18 2020-12-18 Storage processing method and device of main control chip, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN112596672B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419900B (en) * 2021-06-21 2023-03-31 深圳市合广测控技术有限公司 Data read-write control method of storage device, circuit breaker and medium
CN113704028B (en) * 2021-07-21 2023-02-28 奥比中光科技集团股份有限公司 Memory, data storage method and door lock system
CN114816832B (en) * 2022-04-15 2023-03-17 巨翊科技(上海)有限公司 Data management method, device and system of single chip microcomputer
CN114942725A (en) * 2022-05-12 2022-08-26 广州小鹏汽车科技有限公司 Vehicle driving data access method and device, electronic equipment and storage medium
CN117707854B (en) * 2023-12-22 2024-07-02 深圳奥束科技有限公司 Self-recovery method and device for reading information abnormality of IC card

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216789A (en) * 2008-01-08 2008-07-09 福建星网锐捷网络有限公司 Data update method, device and system
CN102890657A (en) * 2012-10-10 2013-01-23 深圳市航盛电子股份有限公司 Method for reducing data read-write errors of EEPROM (electrically erasable programmable read-only memory)
CN103914393A (en) * 2014-04-11 2014-07-09 四川华拓光通信股份有限公司 MCU-based (microprogrammed control unit-based) non-loss FLASH storage update method
CN108228091A (en) * 2016-12-22 2018-06-29 上海未来宽带技术股份有限公司 Configuration data subregion store method and system, configuration data method of calibration and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007025821A (en) * 2005-07-12 2007-02-01 Seiko Epson Corp Information processor and control method therefor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216789A (en) * 2008-01-08 2008-07-09 福建星网锐捷网络有限公司 Data update method, device and system
CN102890657A (en) * 2012-10-10 2013-01-23 深圳市航盛电子股份有限公司 Method for reducing data read-write errors of EEPROM (electrically erasable programmable read-only memory)
CN103914393A (en) * 2014-04-11 2014-07-09 四川华拓光通信股份有限公司 MCU-based (microprogrammed control unit-based) non-loss FLASH storage update method
CN108228091A (en) * 2016-12-22 2018-06-29 上海未来宽带技术股份有限公司 Configuration data subregion store method and system, configuration data method of calibration and system

Also Published As

Publication number Publication date
CN112596672A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112596672B (en) Storage processing method and device of main control chip, processor and electronic equipment
CN103646208B (en) Monitoring method and device of eMMC
CN101593083B (en) device, computer and method for protecting and restoring computer configuration information
CN110399247B (en) Data recovery method, device and equipment and computer readable storage medium
EP2573689A1 (en) Method and device for implementing redundant array of independent disk protection in file system
CN106205731B (en) Information processing method and storage equipment
CN111143132B (en) BIOS recovery method, device, equipment and readable storage medium
CN110286853A (en) A kind of method for writing data and device, computer readable storage medium
CN109582332B (en) System upgrading method and device for Internet camera
CN110618892A (en) Bug positioning method and device for solid state disk, electronic equipment and medium
CN105404533A (en) Program upgrading method and device
CN107992268B (en) Bad block marking method and related device
CN108170456B (en) Firmware upgrading method and device for electronic equipment
CN104461791A (en) Information processing method and device
US20120011395A1 (en) Boot method under boot sector failure in hard disk and computer device using the same
CN105786545B (en) Breakpoint recovery method and system based on heterogeneous hybrid memory
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN108874318B (en) Data recovery method of solid state disk and solid state disk
CN110795155B (en) System starting method and device, electronic equipment and storage medium
CN109857708B (en) Data access method of embedded system and computer readable storage medium
CN111124760B (en) Uboot-based embedded equipment starting method and apparatus
CN104765631A (en) Restoration method and device for application program of mobile terminal
CN103189840A (en) Method for backing up startup information about storage device
CN113051184B (en) Data reading method and device, electronic equipment and storage medium
CN116072202A (en) Storage device management method, system and storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221228

Address after: Minmin Industrial Avenue, Minmin Town, Zhongshan City, Guangdong Province

Patentee after: GREE ELECTRIC APPLIANCES (ZHONGSHAN) SMALL HOUSEHOLD APPLIANCES MANUFACTURING Co.,Ltd.

Address before: 519070 No. six Jinji Road West, Zhuhai, Guangdong

Patentee before: GREE ELECTRIC APPLIANCES,Inc.OF ZHUHAI

CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Li Wencan

Inventor after: Feng Xiaoqin

Inventor after: Gong Huiping

Inventor after: Li Shuoyong

Inventor after: Li Junjie

Inventor before: Ding Tao

Inventor before: Huang Jingyi

Inventor before: Wen Zhencen

Inventor before: Feng Xiaoqin

Inventor before: Li Shuoyong