CN104717558A - Backing up and restoring method of set top box data - Google Patents

Backing up and restoring method of set top box data Download PDF

Info

Publication number
CN104717558A
CN104717558A CN201510097859.3A CN201510097859A CN104717558A CN 104717558 A CN104717558 A CN 104717558A CN 201510097859 A CN201510097859 A CN 201510097859A CN 104717558 A CN104717558 A CN 104717558A
Authority
CN
China
Prior art keywords
data
value
subregion
taga
tagb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510097859.3A
Other languages
Chinese (zh)
Inventor
李必龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Newland Communication Science Technology Co Ltd
Original Assignee
Fujian Newland Communication Science 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 Fujian Newland Communication Science Technology Co Ltd filed Critical Fujian Newland Communication Science Technology Co Ltd
Priority to CN201510097859.3A priority Critical patent/CN104717558A/en
Publication of CN104717558A publication Critical patent/CN104717558A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a backing up and restoring method of set top box data, and one additional subarea which is the same as the maximum subarea needed by data to be backed up in size is opened in flash. The backing up method of the data comprises the steps that when the data to be backed up are written in, the data are stored in the two subareas alternately, every time the data are written in one of the subareas, a zone bit of the last byte written in the subarea is set to be a zone bit plus one of the last byte of another subarea in the meantime; the restoring method of the data comprises the step of conducting data restore by judging the zone bits of the last bytes of the two subareas. By means of the backing up and restoring method of the set top box data, the zone bits of the two subareas and an incremental rule of the zone bits are applied to the processing process of the data back up, when the data are restored, the data saved last time can be obtained by just judging the values of the zone bits, the massive loss of the data is avoided, the method is simple and effective, and the data read-write speed is fast.

Description

A kind of backup of data of set top box and method of reducing
[technical field]
The present invention relates to a kind of backup and method of reducing of data of set top box.
[background technology]
In present stage, some terminal equipment storage mediums such as Set Top Box are flash memory flash and its master chip does not support the operating system such as linux or unix or android, so existing Set Top Box does not just have file system, also change with regard to not carrying out additions and deletions by filename operations such as looking into, therefore, in Set Top Box, store binary bin data that data are all is directly stored in flash memory flash, first in flash memory flash, first distribute each piece of block to which data be used for storing, and then change by the additions and deletions that data are carried out in this block address operations such as looking into.The storage of the data often become for some or the data of some important sensitivities, will consider the situation that may occur loss of data, particularly write flash memory flash, when unexpected power-off when data.Therefore, for needing the data of backup just must back up when write data, data convert can be realized when loss of data.Method about data backup memory in flash memory flash is exactly that data block storage hockets, and its specific implementation has multiple, but all there is algorithm complexity, the problems such as data read-write operation is slow.
[summary of the invention]
The technical problem to be solved in the present invention, is the backup and the method for reducing that provide a kind of data of set top box, and it avoids a large amount of loss of data by simple effective method, particularly some important sensitive datas, and the speed of service is fast, the speed that reads and writes data is fast, simple and clear, be easy to realize.
The present invention is achieved in that
A kind of backup of data of set top box and method of reducing, open in flash memory flash more one with the subregion needing the equal size of maximum subregion needed for Backup Data, the backup method of data is: when needing the data write of backup, alternately store respectively in these two subregions, and while data being write one of them subregion at every turn, the flag bit that the flag bit of last byte of this write subregion is set to another last byte of subregion is added 1, the value of flag bit increases progressively circulation from 0X01 to 0XFE, during more than 0XFE, restart to increase progressively from 0X01; The method of reducing of data is: by judging that the flag bit of last byte in described two subregions carries out data convert.
Further, the backup method of described data is specially:
Step 10, described two subregions are labeled as A subregion and B subregion respectively, and the flag bit of A subregion and last byte corresponding to B subregion is labeled as TAGA and TAGB respectively, when the value of flag bit is 0X00 or 0XFF, then corresponding partition data is invalid, when the value of flag bit belongs in 0X01 to 0XFE scope, then corresponding partition data is effective;
Step 11, reading TAGA and TAGB, the then value of judgement symbol position:
If when the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid, be then shown to be first time use of dispatching from the factory, data write A subregion, and the value of TAGA is set to 0X01;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, data are write B subregion, and the value of TAGB is set to TAGA+1, if the value of TAGA+1 is more than 0XFE, then the value arranging TAGB is 0X01, restarts to increase progressively;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, data being write flag bit is the subregion that 0XFE is corresponding, and the value of the flag bit of this subregion is set to 0X02;
If the value of TAGA and TAGB does not all belong to above-mentioned situation, then: if TAGA is greater than TAGB, data are write B subregion, and the value of TAGB is set to TAGA+1, if TAGA is less than TAGB, data are write A subregion, and the value of TAGA is set to TAGB+1;
If the value of TAGA and TAGB is equal, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively.
Further, the method for reducing of described data is specially: the value reading TAGA and TAGB, then does following judgement:
If the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid simultaneously, be then shown to be first time use of dispatching from the factory, the data of reading are set to 0;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, the data reading B subregion are reduced;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, the data reading A subregion are reduced;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, then the value reading flag bit is that the data in subregion that 0X01 is corresponding are reduced;
If the value of TAGA is greater than the value of TAGB, then the data reading A subregion are reduced, otherwise the data reading B subregion are reduced;
If the value of TAGA and TAGB is equal, this is abnormal situation, by the dataset 0 read.
Tool of the present invention has the following advantages:
The present invention increases progressively rule use in the processing procedure of data backup by the flag bit of two subregions and flag bit, and when needs data convert, only needs can obtain last data of preserving by the value of judgement symbol position, avoid a large amount of loss of data.The method is simple effectively, the speed of service is fast, and the speed that reads and writes data is fast, is easy to realize.
[accompanying drawing explanation]
Fig. 1 is data back up method flow chart of the present invention.
Fig. 2 is data restoration method flow chart of the present invention.
[embodiment]
Please refer to Fig. 1 and Fig. 2 below, in conjunction with a preferred embodiment of the present invention, the present invention is further illustrated.
A kind of backup of data of set top box and method of reducing, open in flash memory flash more one with the subregion needing the equal size of maximum subregion needed for Backup Data, the backup method of data is: when needing the data write of backup, alternately store respectively in these two subregions, and while data being write one of them subregion at every turn, the flag bit that the flag bit of last byte of this write subregion is set to another last byte of subregion is added 1, the value of flag bit increases progressively circulation from 0X01 to 0XFE, during more than 0XFE, restart to increase progressively from 0X01; The method of reducing of data is: by judging that the flag bit of last byte in described two subregions carries out data convert.Due to Set Top Box flash memory flash finite capacity, generally will estimate the Various types of data that will store, then reasonably allocated size gives these data.The described size of maximum subregion needed for Backup Data that needs also obtains according to above-mentioned principle, the maximum space size such as distributing to programs of set-top box library storage is 1M byte, and then open a 1M byte more and back up this library of programmes data, this 1M byte is a value of artificial setting.
The backup method of described data is specially:
Step 10, described two subregions are labeled as A subregion and B subregion respectively, and the flag bit of A subregion and last byte corresponding to B subregion is labeled as TAGA and TAGB respectively, when the value of flag bit is 0X00 or 0XFF, then corresponding partition data is invalid, when the value of flag bit belongs in 0X01 to 0XFE scope, then corresponding partition data is effective;
Step 11, reading TAGA and TAGB, the then value of judgement symbol position:
If when the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid, be then shown to be first time use of dispatching from the factory, data write A subregion, and the value of TAGA is set to 0X01;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, data are write B subregion, and the value of TAGB is set to TAGA+1, if the value of TAGA+1 is more than 0XFE, then the value arranging TAGB is 0X01, restarts to increase progressively;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, data being write flag bit is the subregion that 0XFE is corresponding, and the value of the flag bit of this subregion is set to 0X02;
If the value of TAGA and TAGB does not all belong to above-mentioned situation, then: if TAGA is greater than TAGB, data are write B subregion, and the value of TAGB is set to TAGA+1, if TAGA is less than TAGB, data are write A subregion, and the value of TAGA is set to TAGB+1;
If the value of TAGA and TAGB is equal, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively.Another kind of mode is: data are write B subregion, and the value of TAGB is set to TAGA+1, if the value of TAGA+1 is more than 0XFE, then the value arranging TAGB is 0X01, restarts to increase progressively.
When data write subregion, the mark place value value of the flag bit of this write subregion being located at another subregion (not performing the subregion of write operation) adds 1, the object of such operation is exactly in time wanting restoring data, can by judging the flag bit of these two subregions, when the flag bit of a subregion is greater than another subregion, just adopt the data of this subregion, because these data are up-to-date.The method has abandoned the drawback of complicated algorithm, and its data backup procedure is simply effective, and can fast processing data.
The method of reducing of described data is specially: the value reading TAGA and TAGB, then does following judgement:
If the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid simultaneously, be then shown to be first time use of dispatching from the factory, the data of reading are set to 0;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, the data reading B subregion are reduced;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, the data reading A subregion are reduced;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, then the value reading flag bit is that the data in subregion that 0X01 is corresponding are reduced;
If the value of TAGA is greater than the value of TAGB, then the data reading A subregion are reduced, otherwise the data reading B subregion are reduced;
If the value of TAGA and TAGB is equal, this is abnormal situation, by the dataset 0 read.
The present invention, when data backup, increases progressively the flag bit of last byte of this write subregion, and when data convert, the last data of preserving of value reduction of judgement symbol position, avoid a large amount of loss of data.The method is simple effectively, the speed of service is fast, and the speed that reads and writes data is fast, is easy to realize.
Although the foregoing describe the specific embodiment of the present invention; but be familiar with those skilled in the art to be to be understood that; specific embodiment described by us is illustrative; instead of for the restriction to scope of the present invention; those of ordinary skill in the art, in the modification of the equivalence done according to spirit of the present invention and change, should be encompassed in scope that claim of the present invention protects.

Claims (3)

1. the backup of a data of set top box and method of reducing, open in flash memory flash more one with the subregion needing the equal size of maximum subregion needed for Backup Data, it is characterized in that, the backup method of data is: when needing the data write of backup, alternately store respectively in these two subregions, and while data being write one of them subregion at every turn, the flag bit that the flag bit of last byte of this write subregion is set to another last byte of subregion is added 1, the value of flag bit increases progressively circulation from 0X01 to 0XFE, during more than 0XFE, restart to increase progressively from 0X01, the method of reducing of data is: by judging that the flag bit of last byte in described two subregions carries out data convert.
2. the backup of a kind of data of set top box according to claim 1 and method of reducing, it is characterized in that, the backup method of described data is specially:
Step 10, described two subregions are labeled as A subregion and B subregion respectively, and the flag bit of A subregion and last byte corresponding to B subregion is labeled as TAGA and TAGB respectively, when the value of flag bit is 0X00 or 0XFF, then corresponding partition data is invalid, when the value of flag bit belongs in 0X01 to 0XFE scope, then corresponding partition data is effective;
Step 11, reading TAGA and TAGB, the then value of judgement symbol position:
If when the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid, be then shown to be first time use of dispatching from the factory, data write A subregion, and the value of TAGA is set to 0X01;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, data are write B subregion, and the value of TAGB is set to TAGA+1, if the value of TAGA+1 is more than 0XFE, then the value arranging TAGB is 0X01, restarts to increase progressively;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, data being write flag bit is the subregion that 0XFE is corresponding, and the value of the flag bit of this subregion is set to 0X02;
If the value of TAGA and TAGB does not all belong to above-mentioned situation, then: if TAGA is greater than TAGB, data are write B subregion, and the value of TAGB is set to TAGA+1, if TAGA is less than TAGB, data are write A subregion, and the value of TAGA is set to TAGB+1;
If the value of TAGA and TAGB is equal, data are write A subregion, and the value of TAGA is set to TAGB+1, if the value of TAGB+1 is more than 0XFE, then the value arranging TAGA is 0X01, restarts to increase progressively.
3. the backup of a kind of data of set top box according to claim 2 and method of reducing, it is characterized in that, the method for reducing of described data is specially: the value reading TAGA and TAGB, then does following judgement:
If the value of TAGA and TAGB shows that the data of A subregion and B subregion are invalid simultaneously, be then shown to be first time use of dispatching from the factory, the data of reading are set to 0;
If the value of TAGA shows that the data of A subregion are invalid, when the value of TAGB shows that the data of B subregion are effective, the data reading B subregion are reduced;
If the value of TAGA shows that the data of A subregion are effective, when the value of TAGB shows that the data of B subregion are invalid, the data reading A subregion are reduced;
If when the value that TAGA and TAGB is corresponding is the combination of the combination of 0X01 and 0XFE or 0XFE and 0X01, then the value reading flag bit is that the data in subregion that 0X01 is corresponding are reduced;
If the value of TAGA is greater than the value of TAGB, then the data reading A subregion are reduced, otherwise the data reading B subregion are reduced;
If the value of TAGA and TAGB is equal, this is abnormal situation, by the dataset 0 read.
CN201510097859.3A 2015-03-05 2015-03-05 Backing up and restoring method of set top box data Pending CN104717558A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510097859.3A CN104717558A (en) 2015-03-05 2015-03-05 Backing up and restoring method of set top box data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510097859.3A CN104717558A (en) 2015-03-05 2015-03-05 Backing up and restoring method of set top box data

Publications (1)

Publication Number Publication Date
CN104717558A true CN104717558A (en) 2015-06-17

Family

ID=53416437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510097859.3A Pending CN104717558A (en) 2015-03-05 2015-03-05 Backing up and restoring method of set top box data

Country Status (1)

Country Link
CN (1) CN104717558A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106816175A (en) * 2015-12-01 2017-06-09 中芯国际集成电路制造(上海)有限公司 The control method and device of memory
CN110287059A (en) * 2019-05-21 2019-09-27 广东九联科技股份有限公司 A kind of more backup methods of spi flash
CN110471860A (en) * 2019-07-03 2019-11-19 深圳市九洲电器有限公司 Date storage method, set-top box and Related product
CN110619918A (en) * 2019-08-02 2019-12-27 广州妙存科技有限公司 FTL power failure test method, system, device and storage medium
CN111859458A (en) * 2020-07-31 2020-10-30 北京无线电测量研究所 Data updating recording method, system, medium and equipment
CN112053652A (en) * 2019-06-05 2020-12-08 联咏科技股份有限公司 Time schedule controller device and data read-write method
CN113126883A (en) * 2019-12-30 2021-07-16 深圳Tcl新技术有限公司 Data processing method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1204027A2 (en) * 2000-11-02 2002-05-08 Matsushita Electric Industrial Co., Ltd. On-line reconstruction processing method and on-line reconstruction processing apparatus
CN101739313A (en) * 2009-11-27 2010-06-16 华中科技大学 Method for protecting and restoring continuous data
CN103064274A (en) * 2012-12-03 2013-04-24 珠海艾派克微电子有限公司 Imaging box chip, data processing method and imaging box
CN103440205A (en) * 2013-08-21 2013-12-11 深圳市九洲电器有限公司 Method and device for storing data of set top box
CN103514063A (en) * 2012-06-21 2014-01-15 浙江大华技术股份有限公司 Method and device for processing FLASH data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1204027A2 (en) * 2000-11-02 2002-05-08 Matsushita Electric Industrial Co., Ltd. On-line reconstruction processing method and on-line reconstruction processing apparatus
CN101739313A (en) * 2009-11-27 2010-06-16 华中科技大学 Method for protecting and restoring continuous data
CN103514063A (en) * 2012-06-21 2014-01-15 浙江大华技术股份有限公司 Method and device for processing FLASH data
CN103064274A (en) * 2012-12-03 2013-04-24 珠海艾派克微电子有限公司 Imaging box chip, data processing method and imaging box
CN103440205A (en) * 2013-08-21 2013-12-11 深圳市九洲电器有限公司 Method and device for storing data of set top box

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106816175A (en) * 2015-12-01 2017-06-09 中芯国际集成电路制造(上海)有限公司 The control method and device of memory
CN110287059A (en) * 2019-05-21 2019-09-27 广东九联科技股份有限公司 A kind of more backup methods of spi flash
CN110287059B (en) * 2019-05-21 2023-12-15 广东九联科技股份有限公司 Multi-backup method of spiflash
CN112053652A (en) * 2019-06-05 2020-12-08 联咏科技股份有限公司 Time schedule controller device and data read-write method
CN110471860A (en) * 2019-07-03 2019-11-19 深圳市九洲电器有限公司 Date storage method, set-top box and Related product
CN110619918A (en) * 2019-08-02 2019-12-27 广州妙存科技有限公司 FTL power failure test method, system, device and storage medium
CN110619918B (en) * 2019-08-02 2021-05-04 广州匠芯创科技有限公司 FTL power failure test method, system, device and storage medium
CN113126883A (en) * 2019-12-30 2021-07-16 深圳Tcl新技术有限公司 Data processing method, system and storage medium
CN111859458A (en) * 2020-07-31 2020-10-30 北京无线电测量研究所 Data updating recording method, system, medium and equipment

Similar Documents

Publication Publication Date Title
CN104717558A (en) Backing up and restoring method of set top box data
US8341386B2 (en) Method for updating basic input/output system and method for repairing thereof
WO2011024688A1 (en) Firmware update system, and information apparatus, as well as program
US20140317369A1 (en) Snapshot creation from block lists
CN107807839B (en) Method and device for modifying memory data of virtual machine and electronic equipment
US10754737B2 (en) Boot assist metadata tables for persistent memory device updates during a hardware fault
CN102667703A (en) System and method for optimized reclamation processing in a virtual tape library system
US20130346711A1 (en) Source cleaning cascaded volumes
US7900003B2 (en) System, method and computer program product for storing an information block
CN111124288B (en) VPD storage management method, device, equipment and readable storage medium
US20210247921A1 (en) Systems and methods for booting from nand flash using squashfs to maximize memory
US20140372710A1 (en) System and method for recovering from an unexpected shutdown in a write-back caching environment
US9239742B2 (en) Embedded systems and methods for threads and buffer management thereof
CN103559139A (en) Data storage method and device
CN104932933A (en) Spin lock acquisition method and apparatus
CN104484240A (en) Method and device for storing terminal data
CN103229150B (en) data control method and system
CN109683983B (en) Method and equipment for generating and loading mirror image file
KR101548452B1 (en) Method and apparatus for recovering metadata in electronic device based on non-volatile memeory
US11176089B2 (en) Systems and methods for implementing dynamic file systems
CN102495838B (en) Data processing method and data processing device
CN102855162B (en) A kind of data-updating method, data update system and memorizer
CN104408126A (en) Persistent writing method, device and system of database
US9009430B2 (en) Restoration of data from a backup storage volume
CN111522598A (en) Method and device for recording restart information of embedded equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150617