CN102306195A - Article protecting method during updating of circular file - Google Patents
Article protecting method during updating of circular file Download PDFInfo
- Publication number
- CN102306195A CN102306195A CN 201110282540 CN201110282540A CN102306195A CN 102306195 A CN102306195 A CN 102306195A CN 201110282540 CN201110282540 CN 201110282540 CN 201110282540 A CN201110282540 A CN 201110282540A CN 102306195 A CN102306195 A CN 102306195A
- Authority
- CN
- China
- Prior art keywords
- record
- file
- circular file
- circular
- upgrades
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000010586 diagram Methods 0.000 description 2
- 239000003292 glue Substances 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses an article protecting method during updating of a circular file. The circular file comprises a file header and a main body part, wherein the main body part comprises a plurality of records which are respectively marked as a record 1, a record 2..., a record n. The article protecting method comprises the following steps: (1) adding a record with the same length of the circular file in the circular file as a backup of an oldest record, wherein the record is recorded as a record n+1; (2) when the circular file is updated, updating the content of an updated record into the record n+1; and (3) causing a record pointer in the file header of the circular file to point to the record n+1. Compared with the prior art, the article protecting method during updating of the circular file provided by the invention has the advantage that the article protecting problem during a record updating operation of the circular file is solved by utilizing the added backup record n+1.
Description
Technical field
The present invention relates to the Data Update field, exactly be meant the things guard method that a kind of circular file upgrades.
Background technology
Storing many user data in the smart card; The user is when using mobile phone communication; Mobile phone can carry out data write to the data of the storage in the smart card; Its data storage is that the form with file exists; And its file type has three kinds: transparent file; Linear glue file, circular file.
Renewal for transparent file and linear glue file in the smart card only exists write operation one time; And operate for the renewal of circular file; The write operation that has two steps; The first step is upgraded the oldest record according to record pointer; Second step was upgraded record pointer, made record pointer point to the record that is updated.Smart card only has power-off protection to single write operation, and the renewal of the record of circular file exists write operation twice, if outage has taken place after first step, so just exists record to be updated the situation of the record that record pointer is not updated.
Circular file is made up of file header and main part, and its file header comprises current record pointer, record length, and information such as record number, file body is the particular content of every record.Circular file is that when all records were occupied, new storage data will cover the oldest record with the log file of time sequencing storage.
The file of loop structure is made up of the fixed-length record of fixing record number.In this file structure, a pointer link is arranged between article one record and the last item record.When record pointer record in the end, next bar record is article one record so.Equally, when record pointer the record 1 so he on a record be exactly to write down n.The recording mechanism of latest update is 1, and the oldest recording mechanism is n, and the structure of circular file as shown in Figure 1.
For the renewal recording operation of circular file, if up-to-date recording mechanism is 1, a oldest recording mechanism is n, and the record pointer in the file header is 1, the expression recording mechanism be 1 be recorded as article one record.
When circular file upgrades recording operation, be divided into two steps:
1, the recording mechanism of updating file main body is the oldest record of n;
2, the record pointer in the updating file head is n, and expression record n is article one record.
The more new technological process of normal circular file: the record pointer of circular file points to record 1, writes down 1 so and is article one record of circular file, and record n is a last record of circular file, is a oldest record.
Concrete steps:
1, circular file record is updated to the record that recording mechanism is n to new record more, as shown in Figure 2.
2, will upgrade content recorded and write record n, again record pointer pointed to record n, as shown in Figure 3.
If outage has taken place in smart card behind the first step of the renewal recording operation of carrying out circular file; The record n that document body so just occurred is updated; Record pointer in the file header does not have the situation of modification, does not so just meet the renewal operation of cycle index.
Summary of the invention
To above-mentioned defective, the things guard method that the technical matters of the present invention's solution is to provide a kind of circular file renewal utilizes the duplicated record n+1 that adds, and has solved the problem of the things protection of circular file when the record renewal is operated.
In order to solve above technical matters, the things guard method that circular file provided by the invention upgrades, circular file comprises file header and main part, said main part comprises some records, is respectively record 1 to record n, may further comprise the steps:
(1) increase a record identical with circular file length as the backup of old record at circular file, this is recorded as and writes down n+1;
When (2) circular file upgrades, will upgrade content recorded and be updated among the record n+1;
(3), make record pointer point to record n+1 with the record pointer in the circular file head.
Preferably, said method is applied in the circular file renewal of smart card.
Compared with prior art; The things guard method that circular file provided by the invention upgrades; The interpolation of duplicated record; Effectively avoided circular file in record upgrades, outage to be taken place smart card in the two step operating process of the main body of file and file header, cause circular file outage having taken place in upgrading recording operation and cause unusual; Owing to added duplicated record; The renewal recording operation step of circular file has only and upgrades successfully relevant with the record pointer of circular file head; Simplify the flow process of things protection of the renewal recording operation of circular file, solved the problem of the things protection of circular file when record upgrades operation.
Description of drawings
Fig. 1 is the structured flowchart of circular file;
Fig. 2 is the first step figure that circular file upgrades in the prior art;
Fig. 3 is second block diagram that circular file upgrades in the prior art;
Second block diagram that Fig. 4 upgrades for circular file among the present invention;
The third step figure that Fig. 5 upgrades for circular file among the present invention.
Embodiment
For those skilled in the art can understand technical scheme provided by the present invention better, set forth below in conjunction with specific embodiment.
The things guard method that circular file provided by the invention upgrades, circular file comprises file header and main part, said main part comprises some records, is respectively record 1 to record n, may further comprise the steps:
(1) increase a record identical with circular file length as the backup of old record at circular file, this is recorded as and writes down n+1;
When (2) circular file upgrades, will upgrade content recorded and be updated among the record n+1, as shown in Figure 4;
(3), make record pointer point to record n+1, as shown in Figure 5 with the record pointer in the circular file head.
Said method can be applied in the circular file renewal of smart card.
The implementation method of the things protection of circular file record provided by the invention; In step (1); Circular file is created the backup of old record of a record conduct identical with the circular file record length; If circular file is a n bar record; Create n+1 bar record so during document creation; The same with the circular file size, this record is sightless with respect to intelligent card subscriber, only is used for the built-in function of smart card.
According to the appeal operation, the more operation normal termination of new record is for circular file; Step (2) is updated to new record more among the duplicated record n+1, and step (3) is revised as n+1 to the record pointer of the file header of circular file, and effectively recording mechanism is n+1 for the user; N, n-1..., 2.Recording mechanism is 1 the duplicated record that is, other n bar is recorded as effective record of circular file.The circular file record upgrades successfully.
If outage has taken place in smart card when circular file upgrades recording step 2; Step 3 is not carried out; For circular file; Upgrade content recorded and be updated to record n+1; But the record pointer of the file header of circular file still is not changed; Though n+1 bar record has been updated; Effective recording mechanism of circular file is 1; 2...n; Record n+1 is a duplicated record; Recording mechanism is 1, and the n bar of 2...n is recorded as effective record of circular file, and the record of the document body of circular file and the pointer of file header all are not modified; Just revised the content of duplicated record; So at step 1 operative intelligence card outage has taken place, less than changing, the protection of the things of circular file just realizes under this situation to the content of circular file.
When circular file upgraded recording operation, the oldest record of circular file was not updated, and actual being recorded as of upgrading realized the protection of circular file things and the duplicated record of interpolation.For smart card; When carrying out the more new record of circular file; No matter in execution in step 2; After the step 3 outage has taken place perhaps; Owing to added the duplicated record of a record as circular file; Last one of record pointer in the file header of circular file all is duplicated record; Circular file all is to be updated in the duplicated record writing down when upgrading; If the record pointer of the file header of circular file does not upgrade; The effective n bar record of circular file is not modified, so the content of this document does not change.If the record pointer of the file header of circular file has been updated, duplicated record just becomes circular file article one record so, and a last record of this duplicated record just becomes duplicated record, and the main body and the file header of this circular file all are updated.
A duplicated record that adds in the circular file, the recording mechanism of this duplicated record is not fixed, but last record of the record of the record pointer indication of the file header of circular file fixed in the position of duplicated record.When if the record pointer of the file header of circular file is n+1; Recording mechanism is 1 the duplicated record that is recorded as, read circular file on when record, the recorded content of reading is that recording mechanism is 2 recorded content; Need skip recording mechanism and be 1 record, because this is recorded as duplicated record.
Compared with prior art; The things guard method that circular file provided by the invention upgrades; The interpolation of duplicated record; Effectively avoided circular file in record upgrades, outage to be taken place smart card in the two step operating process of the main body of file and file header, cause circular file outage having taken place in upgrading recording operation and cause unusual; Owing to added duplicated record; The renewal recording operation step of circular file has only and upgrades successfully relevant with the record pointer of circular file head; Simplify the flow process of things protection of the renewal recording operation of circular file, solved the problem of the things protection of circular file when record upgrades operation.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.
Claims (2)
1. things guard method that circular file upgrades, circular file comprises file header and main part, said main part comprises some records, is respectively record 1 to record n, it is characterized in that, may further comprise the steps:
(1) increase a record identical with circular file length as the backup of old record at circular file, this is recorded as and writes down n+1;
When (2) circular file upgrades, will upgrade content recorded and be updated among the record n+1;
(3), make record pointer point to record n+1 with the record pointer in the circular file head.
2. the things guard method that circular file according to claim 1 upgrades is characterized in that, said method is applied in the circular file renewal of smart card.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201110282540 CN102306195A (en) | 2011-09-21 | 2011-09-21 | Article protecting method during updating of circular file |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201110282540 CN102306195A (en) | 2011-09-21 | 2011-09-21 | Article protecting method during updating of circular file |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN102306195A true CN102306195A (en) | 2012-01-04 |
Family
ID=45380057
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 201110282540 Pending CN102306195A (en) | 2011-09-21 | 2011-09-21 | Article protecting method during updating of circular file |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102306195A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107330118A (en) * | 2017-07-13 | 2017-11-07 | 北京智芯微电子科技有限公司 | A kind of method and device of storage COS files |
| CN114237494A (en) * | 2021-11-23 | 2022-03-25 | 北京谊安医疗系统股份有限公司 | Data real-time storage method suitable for embedded equipment |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1443354A (en) * | 2000-07-19 | 2003-09-17 | 施蓝姆伯格系统公司 | Secure writing of data |
| CN1836261A (en) * | 2003-06-17 | 2006-09-20 | 塔莱斯公司 | Method for carrying out update writing and allocating a memory used for file writing on a memory carrier in the form of a chip card |
| CN101256564A (en) * | 2007-12-25 | 2008-09-03 | 深圳市同洲电子股份有限公司 | Method for operating circular file |
-
2011
- 2011-09-21 CN CN 201110282540 patent/CN102306195A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1443354A (en) * | 2000-07-19 | 2003-09-17 | 施蓝姆伯格系统公司 | Secure writing of data |
| CN1836261A (en) * | 2003-06-17 | 2006-09-20 | 塔莱斯公司 | Method for carrying out update writing and allocating a memory used for file writing on a memory carrier in the form of a chip card |
| CN101256564A (en) * | 2007-12-25 | 2008-09-03 | 深圳市同洲电子股份有限公司 | Method for operating circular file |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107330118A (en) * | 2017-07-13 | 2017-11-07 | 北京智芯微电子科技有限公司 | A kind of method and device of storage COS files |
| CN114237494A (en) * | 2021-11-23 | 2022-03-25 | 北京谊安医疗系统股份有限公司 | Data real-time storage method suitable for embedded equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102135942B (en) | Method for realizing wear-leveling in storage equipment as well as the storage equipment | |
| CN101321341B (en) | smart card power-off protection method | |
| CN106095620B (en) | A kind of development approach of built-in Linux partition holding | |
| CN103780638A (en) | Data synchronization method and system | |
| CN103268294A (en) | Operation method of access data and data processing equipment | |
| CN102567146B (en) | Log backup method and device and smart card | |
| CN102081577A (en) | Data storage structure of Flash memory and data manipulation mode thereof | |
| CN103440205A (en) | Method and device for storing data of set top box | |
| CN103678638A (en) | Object caching method based on disk | |
| CN107256197A (en) | A kind of date storage method, storage device and intelligent terminal | |
| CN102402622A (en) | Memory page management scheduling method of embedded memory database | |
| CN103996412A (en) | Power-fail protection method applied to intelligent-card nonvolatile memories | |
| CN103294615A (en) | Method for storing user information of set top box | |
| CN101989305A (en) | Data incremental backup method and system | |
| CN102831072A (en) | Flash memory device, and management method, data read-write method and data read-write device thereof | |
| CN109298873A (en) | A kind of method for upgrading system and device | |
| CN103902434A (en) | Alarm log management method and system | |
| CN101876956A (en) | File access method and device of SD (Secure Digital) card | |
| CN103092849A (en) | File system cluster management method | |
| CN101408864A (en) | Data protection method for power failure and controller using the same | |
| CN102024052B (en) | Method and device for realizing transaction of data storage system | |
| CN102096613B (en) | Method and device for generating snapshot | |
| CN102306195A (en) | Article protecting method during updating of circular file | |
| CN111291022B (en) | Data storage system based on block chain | |
| CN102592678B (en) | Dynamic window management-based wear equilibrium method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C53 | Correction of patent for invention or patent application | ||
| CB02 | Change of applicant information |
Address after: 519060 Guangdong province Zhuhai Nanping Science and Technology Industrial Park Road No. 8 screen Applicant after: Eastcompeace Technology Co., Ltd. Address before: 519060 Guangdong province Zhuhai Nanping Science and Technology Industrial Park Road No. 8 screen Applicant before: Eastcompeace Smart Card Co., Ltd. |
|
| COR | Change of bibliographic data |
Free format text: CORRECT: APPLICANT; FROM: EASTCOMPEACE SMART CARD CO., LTD. TO: EASTCOMPEACE TECHNOLOGY CO., LTD. |
|
| C12 | Rejection of a patent application after its publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20120104 |