CN101794255A - Paperless recorder and method for storing data of same - Google Patents

Paperless recorder and method for storing data of same Download PDF

Info

Publication number
CN101794255A
CN101794255A CN200910247783A CN200910247783A CN101794255A CN 101794255 A CN101794255 A CN 101794255A CN 200910247783 A CN200910247783 A CN 200910247783A CN 200910247783 A CN200910247783 A CN 200910247783A CN 101794255 A CN101794255 A CN 101794255A
Authority
CN
China
Prior art keywords
data
index
ram
record
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN200910247783A
Other languages
Chinese (zh)
Other versions
CN101794255B (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.)
ZHONGKONG SCIENCE AND TECHNOLOGY GROUP Co Ltd
ZHEJIANG ZHONGKONG AUTOMATION INSTRUMENT CO Ltd
Zhejiang University ZJU
Supcon Group Co Ltd
Original Assignee
ZHONGKONG SCIENCE AND TECHNOLOGY GROUP Co Ltd
ZHEJIANG ZHONGKONG AUTOMATION INSTRUMENT CO Ltd
Zhejiang University ZJU
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 ZHONGKONG SCIENCE AND TECHNOLOGY GROUP Co Ltd, ZHEJIANG ZHONGKONG AUTOMATION INSTRUMENT CO Ltd, Zhejiang University ZJU filed Critical ZHONGKONG SCIENCE AND TECHNOLOGY GROUP Co Ltd
Priority to CN2009102477832A priority Critical patent/CN101794255B/en
Publication of CN101794255A publication Critical patent/CN101794255A/en
Application granted granted Critical
Publication of CN101794255B publication Critical patent/CN101794255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a paperless recorder and a method for storing data of the same. The method comprises the following steps of: firstly, corresponding to the applied record channel, building an index for each record channel in an RAM index area after starting up, wherein data starting time, record points, starting positions of corresponding data blocks and record cycle information are stored in the index; then storing the data of all the record channels into an RAM data area; transferring the data stored in the RAM data area into corresponding data blocks in a memory data area according to the starting positions of the data blocks of corresponding index records when the RAM data area is full; continuously storing new data into the RAM data area; and transferring the data into a memory after the RAM data area is full until shutdown to complete data storage. The method effectively solves the problems that the conventional paperless recorder has the disadvantages of need of filling historical data for powering on, large data offset, necessary consistency of record cycles, and invalidity of existing data after the record cycles are changed.

Description

Recording instrument without paper and recording instrument without paper date storage method
Technical field
The present invention relates to the industrial instrument field, relate in particular to a kind of recording instrument without paper date storage method and recording instrument without paper.
Background technology
Make a general survey of the development course of registering instrument, roughly having experienced machinery has paper registering instrument registering instrument and two developing stage of recording instrument without paper.Before nineteen ninety-five, be that mechanical type has pen that the paper registering instrument arranged basically, this kind registering instrument is by recording pointer curve plotting on recording chart, thereby reaches record and preserve the purpose of data.Because its written servo-drive system complexity, the mechanical type movable part is many, so reliability is relatively poor.Simultaneously, mechanical oscillograph can only carry out curve record, and display mode is single.And, its follow-up data processing difficulty, long-time running need regularly replace recording chart and ink, the operating cost height.
1996, SUPCON took the lead in having released JL20 series recording instrument without paper to market.This recording instrument without paper adopts microprocessor, LCDs and semiconductor memory.It has abandoned recording pointer and the recording chart that uses in the mechanical oscillograph, the various input signals that need monitor record of industry spot, carry out data processing by microprocessor, on the one hand in a variety of forms picture shows on LCDs, on the other hand the deposit data of these supervisory signals in semiconductor memory, so that on registering instrument, directly carry out data and graphical query, browse and operation such as printing.And recording instrument without paper also can have flexible plastic disc and drive, and the user can copy file to the data of recording instrument without paper record, and reappears historical data and history curve on host computer.
Recording instrument without paper has thoroughly overcome the existing deficiency of mechanical oscillograph, and it replaces mechanical oscillograph has become undisputable fact.In recent years, along with the development of mechanics of communication, the function of recording instrument without paper also becomes increasingly abundant.Existing recording instrument without paper not only has abundant graphic picture, possess multiple functions such as real time data, real-time curve, warning message, historical record, report printing, also have the hyperchannel of support, network enabled connection, support USB device, data can directly adopt advantages such as flash disk backup.In addition, existing recording instrument without paper extensively adopts the FLASH storer, also has never obliterated data of power down, the advantage of good stability.Yet along with the continuous development of recording instrument without paper, the shortcoming of the date storage method of traditional recording instrument without paper also highlights day by day, is having a strong impact on the work efficiency of recording instrument without paper.
The data storage procedure of existing recording instrument without paper is: adopt RAM and storer to constitute a data circulation, in each work period the instantaneous value of all passages is deposited in this datacycle, data at first deposit among the RAM, RAM be filled with the back data again by the RAM unloading to storer, the storage space of storer is filled with back removing data the earliest automatically, and Free up Memory deposits new data in, constantly substitute old data, realize data storage with new data.But this kind method only writes down the position of latest data, calculates the time by the data number again.Therefore, must fill the data in the power-off time when starting shooting, otherwise data can't be searched at every turn.Usually with 0 or power down before value fill data in the power-off time, and this part data is nonsensical, has caused the waste of data space.And, because power down and when powering on system be in an unsure state, whether need to write down for the data of power down time point and power-on time point does not have clear and definite standard, simultaneously, the data in the consumed time section of filling process own also will be filled once more, cause each power down and may be how when powering on data or data less, and the data of all storages constitute an integral body in the existing method, therefore, the power down meeting causes the skew of overall data repeatedly, influences the accuracy of data.
In addition, existing method need preestablish the record cycle of all passages, and the record cycle unanimity of all passages.And the passage of recording instrument without paper is a lot, and each passage may write down flow, pressure etc. simultaneously and change the slower signal of variation such as signal and temperature, liquid level faster, and the record cycle unanimity between each passage can cause the waste or the loss of data of record space.And, in case the record cyclomorphosis can cause existing data invalid.
Summary of the invention
At above-mentioned defective, the object of the present invention is to provide a kind of recording instrument without paper, the recording instrument without paper start needs padding data in the prior art to solve, and wastes storage space, is easy to generate data-bias, and poor accuracy and record cycle need unanimity and immutable technical matters of record cycle.
Another object of the present invention is to provide a kind of recording instrument without paper date storage method, the recording instrument without paper start needs padding data in the prior art to solve, waste storage space, be easy to generate data-bias, poor accuracy and record cycle need unanimity and immutable technical matters of record cycle.
For achieving the above object, the invention provides a kind of recording instrument without paper, comprising:
One RAM comprises RAM index area and RAM data field, and the RAM index area is the storage space that each recording channel allocated size equates, in order to store the index of each recording channel; The RAM data field is in order to store the real time data of each recording channel;
One storer, be connected with RAM, comprise memory index district and memory data district, the memory index district is the storage space that each recording channel allocated size equates, after being filled with when the RAM index area, the index of the corresponding record passage of storing in the storage RAM index area; The memory data district stores the data in the RAM data field, the log history data in order to after being filled with when the RAM data field; And,
One microprocessor is connected with storer with RAM respectively, comprises some channel managements unit, the corresponding recording channel in each channel management unit, and in order to the index and the data of management corresponding record passage, it further comprises:
The management subelement preserved in index: in order to the storage space information in record RAM index area and memory index district, and with index by the unloading of RAM index area to the reservoir index area;
Data are preserved the management subelement: in order to the storage space information in record RAM data field and memory data district, and with data by the unloading of RAM data field to the reservoir data field.
According to the described recording instrument without paper of preferred embodiment of the present invention, its memory data district comprises the plurality of data piece, the equal and opposite in direction of each data block.
According to the described recording instrument without paper of preferred embodiment of the present invention, its microprocessor also comprises a block-chaining administrative unit, the block-chaining administrative unit is connected with storer, in order to the incidence relation and the freed data blocks reference position of each data block in the memory data field.
According to the described recording instrument without paper of preferred embodiment of the present invention, its index in order to storage data zero-time, record count, corresponding data piece reference position and record cycle information.
According to the described recording instrument without paper of preferred embodiment of the present invention, its recording instrument without paper also comprises a battery, and this battery is connected with RAM, in order to when the power down to be the RAM power supply.
According to the described recording instrument without paper of preferred embodiment of the present invention, its storer is the FLASH storer.
The present invention also provides a kind of recording instrument without paper date storage method, may further comprise the steps:
(1) after the start, the recording channel that correspondence is applied to is set up an index for each recording channel in the RAM index area, and this index stores data zero-time, record are counted, corresponding data piece reference position and write down cycle information;
(2) with the data storage of each recording channel to the RAM data field;
(3) after the RAM data field is filled with, with the data of storing in the RAM data field according to the data block reference position unloading of manipulative indexing record to the memory data district in the corresponding data block, and RAM continues the data field to deposit in new data, after being filled with again with data conversion storage to storer, until shutdown, finish data storage.
According to the described recording instrument without paper date storage method of preferred embodiment of the present invention, also comprise,
(4) after the RAM index area is filled with, with the index unloading of storing in the RAM index area to the memory index district.
According to the described recording instrument without paper date storage method of preferred embodiment of the present invention, step (1) recording data blocks reference position further comprises:
A1: whether the data of judging preceding this passage of index foundation are filled with a data block, if data are not filled with a data block, the end position that then writes down previous index is this indexed data piece reference position; Otherwise,, carry out steps A 2 if data are filled with a data block;
A2: the search idle data is fast, if search freed data blocks, then writing down this freed data blocks is this indexed data piece reference position, otherwise, carry out release data block flow process;
A3: after discharging data block and finishing, search for freed data blocks again, find that this freed data blocks of record is this indexed data piece reference position after the freed data blocks.
According to the described recording instrument without paper date storage method of preferred embodiment of the present invention, step (3) also comprises:
B1: after data were filled with a data block, the search freed data blocks if search freed data blocks, then write new data this freed data blocks; Otherwise, carry out release data block flow process;
B2: after discharging data block and finishing, search for freed data blocks again, find freed data blocks after.New data is write this freed data blocks.
According to the described recording instrument without paper date storage method of preferred embodiment of the present invention, discharge the data block flow process among steps A 2 and the step B1 and specifically may further comprise the steps:
C1:, calculate the quantity of the data block that each recording channel should discharge according to account form in advance according to the current record cycle of each recording channel;
C2: according to the result of calculation of step C1, discharge corresponding data block, and delete or revise the index that each recording channel is managed those data blocks that discharge, then delete this index if the total data of index control all is released; Otherwise, revise indexed data reference position and data bulk;
C3: revise the block-chaining unit, the new data block that discharges of record is a freed data blocks, and the reference position of data block search is set to the data block of the new the most close data field reference position that discharges.
According to the described recording instrument without paper date storage method of preferred embodiment of the present invention, the unloading of index is preserved in the round-robin mode in the step (4), and the memory index district is filled with the back the oldest index of deletion automatically, deposits new index in.
The present invention introduces index the data of recording instrument without paper is managed, and each index record the information such as record cycle, corresponding data piece reference position, zero-time and data number of each recording channel of recording instrument without paper data in each work period.Each index and the data corresponding with it are formed a file, write down the data that corresponding recording channel write down in a work period.The present invention stores the data that each recording channel writes down separately with the form of file in a work period, after re-powering or writing down cyclomorphosis, can be the newly-built index of corresponding record passage.Therefore, each section historical data is exactly an independent file, and historical data is searched by index, needn't recharge historical data after instrument re-powers, and has effectively saved storage space.And the instrument power down data error that causes that powers on only acts in the index, can not cause the skew of all data, the accuracy height.In addition, each recording channel is set up index respectively, has solved necessary consistent problem of the record cycle of all recording channels in the prior art, and, rebuliding new index behind the record cyclomorphosis and get final product, existing data are still effective.
Description of drawings
Fig. 1 is the structural principle synoptic diagram of recording instrument without paper of the present invention;
Fig. 2 is the structural principle synoptic diagram of the FLASH storer of the embodiment of the invention;
Fig. 3 is the systematic schematic diagram of recording instrument without paper date storage method of the present invention.
Embodiment
Below in conjunction with accompanying drawing, specify the present invention.
See also Fig. 1, it is for the structural principle synoptic diagram of recording instrument without paper of the present invention.This recording instrument without paper comprises RAM10, FLASH storer 20, microprocessor 30 and battery 40.Wherein,
RAM10 comprises RAM index area 101 and RAM data field 102, and RAM index area 101 is the storage space that each recording channel allocated size equates, in order to store the index of each recording channel.RAM data field 102 is in order to store the real time data of each recording channel.
FLASH storer 20 is connected with RAM10, in order to store final index and historical data.As shown in Figure 2, FLASH storer 20 comprises FLASH memory index district 201 and FLASH memory data district 202.FLASH memory index district 201 stores the index of the corresponding record passage of storage in the RAM index area 101 in order to after being filled with when RAM index area 101.The recording channel of FLASH memory index district 201 corresponding recording instrument without paper has been divided a plurality of passages, passage 1, passage 2 ... passage n, and for each recording channel has distributed equal-sized storage space, each passage comprises the data block that quantity equates, the equal and opposite in direction of each data block.FLASH memory data district 202 stores the data in the RAM data field 102, the log history data in order to after being filled with when RAM data field 102.FLASH memory data district 202 comprises a plurality of data blocks, and the equal and opposite in direction of each data block.
In this example, the storage space in FLASH memory index district 201 is a static division, is the continuous space of the identical size of each channel allocation, and minimum memory unit is a data block.And consider the different of record cycle and change that the storage space in FLASH memory data district 202 be dynamically to divide, and dynamically apply for when needing, dynamically release when not required, its minimum memory unit also is a data block.
Microprocessor 30 is connected with FLASH storer 20 with RAM10 respectively, comprises some channel managements unit 301 and block-chaining administrative unit 302.Each channel management unit 301 corresponding recording channel, in order to the index and the data of management corresponding record passage, it further comprises:
Management subelement 3011 preserved in index: in order to the storage space information of record RAM index area and reservoir index area, and with index by the unloading of RAM index area to the reservoir index area.
Data are preserved management subelement 3012: in order to the storage space information of record RAM data field and reservoir data field, and with data by the unloading of RAM data field to the reservoir data field.
Block-chaining administrative unit 302 is connected with FLASH storer 20, in order to the position corresponding relation of each data block and the quantity of freed data blocks in the storage FLASH memory data district 202.
In this example, in order to improve data management efficiency, the present invention is respectively the index of each recording channel and the buffer memory that historical data has been opened up a certain size in RAM, be RAM index area and RAM data field, when adding index or data, in RAM index area and RAM data field, add earlier, after RAM index area or RAM data field are filled with, the channel management unit can be saved to the data of RAM index area or RAM data field in FLASH memory index district or the FLASH memory data district, and the data of remainder are copied to the buffer memory reference position.But, in this example, need to prove that the present invention does not limit and must divide RAM index area and RAM data field in RAM, in actual applications, RAM also can not carry out subregion, and index and historical data are directly stored.Therefore, more than adopt and in RAM, divide the RAM index area and the RAM data field is an example, and be not used in qualification the present invention.
In this example, adopted the FLASH storer.But, need to prove that the present invention is only limited to the FLASH storer, in actual applications, recording instrument without paper of the present invention can adopt existing any one storer, and more than adopting the FLASH storer is an example, and is not used in qualification the present invention.In addition, can not lose during power down in order to make the data of storing among the RAM, it is the RAM power supply that the present invention also is provided with battery, but, the present invention does not limit must be for RAM be equipped with battery, and whether in actual applications, can be provided with arbitrarily is that RAM is equipped with battery, more than adopting battery is set is just example of RAM power supply, and is not used in qualification the present invention.
Recording instrument without paper of the present invention power at every turn or write down cyclomorphosis after all can set up a new index, the indexed data structure is as follows:
Struct?HisIndexSt
{
U32 HisChStartTime; The start time of the data of // index control and the deviate of instrument time
HsChNum; The record of // index control is counted
The sequence number of the starting block of U16 HisChFirstBlock // corresponding data piece
U16 HisChFirstOffset // corresponding data piece is in the skew (byte) of starting block
U8 HisChCycle; The record cycle of // index correspondence
U8 HisChType; // simplify/complexity
U16 IndexCRC; // index CRC
}
By above-mentioned indexed data structure as can be seen, index record data zero-times, record count, information such as corresponding data piece reference position and record cycle, wherein, start time information comprises the deviate of the start time and the instrument time of data, start position information comprises the skew at starting block of the sequence number of starting block of corresponding data piece and data block, the corresponding phase of history data of each index, therefore, the present invention has realized with the form of file data being managed by index, has avoided the various defectives of existing recording instrument without paper.
Corresponding each recording channel of the present invention is provided with a corresponding channel management unit and carries out data management, each channel management unit comprises that the management subelement preserved in index and data preservation management subelement is managed the preservation of index and the preservation of data respectively, and the channel management unit also writes down first index (time index the earliest) information.In preferred embodiment of the present invention, it is identical with the structure of data preservation management subelement that the management subelement preserved in index.Below be respectively channel management of the present invention unit and index and preserve the data structure of management subelement and data preservation management subelement:
The channel management unit:
Struct?HisChCU
{
Struct RecordSaveSt IndexCtrl; Control module preserved in // index
Struct RecordSaveSt DataCtrl; // data are preserved control module
Struct HisIndexSt FirstIndexItem; The first index of // passage
};
The management subelement preserved in index and data are preserved the management subelement:
Struct?RecordSaveSt
{
U32 BufSize; The size of // buffer memory
U32 ItemSize; The size of // record
Void*pDataBuf; The pointer of // buffer memory
U32 SaveCur_Ram; The writing position of // new record is also indicated the record quantity in the buffer memory
U32 SaveCur_Flash; The target FLASH page or leaf of // next unloading
U32 StartRecordPos_Flash; // be recorded in the reference position among the Flash
U32 RecordNum_Flash; Record quantity among the //Flash
U32 TotalRecordNum; The total quantity of // record
U8 IsRecordCopyToFlash; Whether record is replicated the zone bit that dumps to Flash in the // buffer memory
};
By above-mentioned data structure as can be seen, the channel management unit preserves the management subelement by index respectively and data are preserved management subelement record RAM index area and the storage space information of FLASH reservoir index area and the storage space information of RAM data field and FLASH reservoir data field, and with index and data respectively by RAM index area and the unloading of RAM data field to FLASH reservoir index area and FLASH reservoir data field, thereby realize management to index and data.By the channel management unit just can realize data interpolation, operation such as discharge, search.
In order to realize dynamic management to FLASH memory data district, microprocessor also is provided with the block-chaining administrative unit, is that unit is associated together by the block-chaining administrative unit with the piece with the data field in the FLASH storer, improves the efficient of searching, discharging.
The block-chaining administrative unit:
Struct?FLASHCU
{
Struct?FLASHLINK?FlashLinkTab[BLOCKNUM];
U32 SearchFreeBlockPos; // search for the reference position of idle BLOCK (data block)
};
Struct?FLASHLINK
{
U16?Last;
U16?Next;
};
The present invention controls the application and the release of FLASH memory data area resource by above-mentioned block-chaining administrative unit.FLASH memory data district is unit application and release with the piece.This block-chaining administrative unit is the space (struct FLASHLINK) of one 4 byte of data block allocations in each FLASH memory data district, writes down the front and back data block of this data block.And, the reference position of the data block of the free time that the SearchFreeBlockPos record is current, data block of every application, SearchFreeBlockPos just increases by 1, after freed data blocks had been assigned with, according to the record cycle size of passage, different passages discharged different number of data blocks, can evenly use each data block like this, prolong the service time of instrument.In the data structure of above-mentioned block-chaining administrative unit, when Last and Next are 0 simultaneously, represent this BLOCK free time; When Next is 0xFFFF, represent that current BLOCK is last BLOCK; When Last is 0xFFFF, represent that current BLOCK is BLOCK the earliest.
See also Fig. 3, the present invention also provides a kind of recording instrument without paper date storage method, may further comprise the steps:
S11: after the start, the recording channel that correspondence is applied to is set up an index for each recording channel in the RAM index area, this index stores data zero-time, the record count, corresponding data piece reference position and the record cycle information.
The recording data blocks reference position further comprises in this step:
A1: whether the data of judging preceding this passage of index foundation are filled with a data block, if data are not filled with a data block, the end position that then writes down previous index is this indexed data piece reference position; Otherwise,, carry out steps A 2 if data are filled with a data block.
A2: the search idle data is fast, if search freed data blocks, then writing down this freed data blocks is this indexed data piece reference position, otherwise, carry out release data block flow process.
A3: after discharging data block and finishing, search for freed data blocks again, find that this freed data blocks of record is this indexed data piece reference position after the freed data blocks.
S12: with the data storage of each recording channel to the RAM data field.
After the S13:RAM data field is filled with, with the data of storing in the RAM data field according to the data block reference position unloading of manipulative indexing record to the memory data district in the corresponding data block, and RAM continues the data field to deposit in new data, after being filled with again with data conversion storage to storer, until shutdown, finish data storage.
In this step, there have new data to write again after data are filled with a data block to be fashionable, needs the search freed data blocks, applies for a freed data blocks, so that new data is write, specifically comprises:
B1: after data were filled with a data block, the search freed data blocks if search freed data blocks, then write new data this freed data blocks; Otherwise, carry out release data block flow process.
B2: after discharging data block and finishing, search for freed data blocks again, find freed data blocks after.New data is write this freed data blocks.
In above-mentioned step S11 and step S13, be filled with a data block to have new data to write again fashionable setting up new index or data, need carry out the data block search, the application freed data blocks, i.e. steps A 2 and step B1 are if can search idle data block, just success finishes the data block application, at this moment, the block-chaining unit also will carry out corresponding modification, and this freed data blocks is recorded as busy data block.For example, the data of a recording channel are recorded in respectively in data block 0 and the data block 21, data block 0 is the initial data piece, data block 0 is pointed to data block 21, and data block 21 is pointed to data block 43, and data block 43 is last data block, suppose that this moment, SearchFreeBlockPos pointed to 43, after applying for a freed data blocks so, SearchFreeBlockPos just points to data block 44, and data block 43 is registered as busy data block and points to 44.If search is less than the data block of free time, during the failure of application freed data blocks, then execution discharges the data block flow process, discharges data block and specifically may further comprise the steps:
C1:, calculate the quantity of the data block that each recording channel should discharge according to account form in advance according to the current record cycle of each recording channel.
Data block of the present invention discharges account form and follows following principle:
(1) the total data number of blocks of Shi Fanging must be greater than one.
(2) fast recording channel discharges more the current record cycle, and the current record cycle, slow passage discharged less.
(3) after release finished, each recording channel must have at least one data block.
(4) when the conflict of principle (1) and principle (3), the quantity of the data block that takies by each recording channel discharges, and takies many many releases, takies few few release.
C2: according to the result of calculation of step C1, discharge corresponding data block, and delete or revise the index that each recording channel is managed those data blocks that discharge, then delete this index if the total data of index control all is released; Otherwise, revise indexed data reference position and data bulk.
C3: revise the block-chaining unit, the new data block that discharges of record is a freed data blocks, and the reference position of data block search is set to the data block of the new the most close data field reference position that discharges.
In preferred embodiment of the present invention, in order to prevent the situation of request for data piece failure, the present invention is provided with the memory data district and guarantees to leave N freed data blocks all the time, when not enough N of freed data blocks, just carries out data block release.
After the S14:RAM index area is filled with, with the index unloading of storing in the RAM index area to the memory index district.
In this step, the unloading of index is preserved in the round-robin mode, and the memory index district is filled with the back the oldest index of deletion automatically, deposits new index in.Be specially:
With 10 data block store index of each channels designs maximum storage is example, the actual storage space that need open up 11 data blocks altogether.After being filled with 10 data blocks, the data in the data block 1 will be expired successively, and new index data adds in the data block 11.After data block 11 was also filled up, all index of data block 1 were all expired, and data block 1 will be wiped free of, and the data of data block 2 will be expired successively.
In above-mentioned step, for convenience of explanation, set the sequencing of step S13 and step S14.But, need to prove, there are not absolute sequencing in step S13 of the present invention and step S14, when actual storage, after the RAM index area is filled with or the RAM data field is filled with, just carry out corresponding unloading, therefore, more than the sequencing of step S13 of She Dinging and step S14 is an example, and is not used in qualification the present invention.In addition, need to prove also that above step is applicable to that RAM is equipped with battery, the situation that the data of preserving among the RAM after the power down can not be lost.When RAM not being equipped with battery, no matter whether the storage of RAM full before each power down, all want first with the data storage among the RAM in storer, and, next time after the start, the data that be earlier are stored in the storer during with shutdown return among the RAM, carry out above step again.
Method of the present invention manages by the data of introducing index to recording instrument without paper, and it is applicable to various types of storeies.But, method of the present invention is if more can realize better effect by means of the data block of FLASH storer and the physical arrangement of data page, and therefore, efficient was higher when method of the present invention was applied in the FLASH storer.
The present invention just can carry out data search by channel number and data time.When searching data, at first in respective channel, find the oldest index position, travel through index afterwards according to channel number, search the index that mates with the time,, illustrate that the data of this time are replaced by new data if fail to find the index that mates with the time, there are not these data, exit find; If find the index with time coupling, the information such as record cycle, data bulk that then read this index record obtain storing the starting block sequence number of data block of the data of this index correspondence, calculate the position of the data that will search; Continue to judge whether these data are stored in the data block afterwards, if be stored in the data block, directly sense data is finished and is searched; Otherwise, read the data in the current data block earlier, find data block and the sense data that next piece is stored these data by the block-chaining administrative unit then, up to running through desired data or no datat is readable, finish data search so repeatedly.
In the real data search procedure, after finding the data of certain time point, also need to check near the situation of the adjacent data of these data sometimes, at this moment, need search forward or backward.When the present invention checks forward or backward at first according to the direction and the data bulk n that check, with mobile forward or backward n data position, current position location, if current data block is shifted out in the position location, then find next piece or lastblock data block by the block-chaining unit, and sense data, finish data and check; If the position location is moved to up-to-date or the oldest data block, represent that this direction has not had the data can be for watching, then stop forward direction or back to search.
The present invention need not to locate by the time again when searching forward or backward, and data bulk of checking as required and the direction of checking just can be carried out Search and Orientation, search conveniently.
The present invention introduces index the data of recording instrument without paper is managed, and each index record the information such as record cycle, corresponding data piece reference position, zero-time and data number of each recording channel of recording instrument without paper data in each work period.Each index and the data corresponding with it are formed a file, write down the data that corresponding recording channel write down in a work period.The present invention stores the data that each recording channel writes down separately with the form of file in a work period, after re-powering or writing down cyclomorphosis, can be the newly-built index of corresponding record passage.Therefore, each section historical data is exactly an independent file, and historical data is searched by index, needn't recharge historical data after instrument re-powers, and has effectively saved storage space.And the instrument power down data error that causes that powers on only acts in the index, can not cause the skew of all data, the accuracy height.In addition, each recording channel is set up index respectively, has solved necessary consistent problem of the record cycle of all recording channels in the prior art, and, rebuliding new index behind the record cyclomorphosis and get final product, existing data are still effective.
More than disclosed only be several specific embodiment of the present invention, but the present invention is not limited thereto, any those skilled in the art can think variation, all should drop in protection scope of the present invention.

Claims (12)

1. a recording instrument without paper is characterized in that, comprising:
One RAM comprises RAM index area and RAM data field, and described RAM index area is the storage space that each recording channel allocated size equates, in order to store the index of each recording channel; Described RAM data field is in order to store the real time data of each recording channel;
One storer, be connected with described RAM, comprise memory index district and memory data district, described memory index district is the storage space that each recording channel allocated size equates, after being filled with when the RAM index area, the index of the corresponding record passage of storing in the storage RAM index area; Described memory data district stores the data in the RAM data field, the log history data in order to after being filled with when the RAM data field; And,
One microprocessor is connected with storer with described RAM respectively, comprises some channel managements unit at least, the corresponding recording channel in each channel management unit, and in order to the index and the data of management corresponding record passage, it further comprises:
The management subelement preserved in index: in order to writing down the storage space information in described RAM index area and memory index district, and with described index by described RAM index area unloading to described memory index district;
Data are preserved the management subelement: in order to writing down the storage space information in described RAM data field and memory data district, and with described data by described RAM data field unloading to described reservoir data field.
2. recording instrument without paper as claimed in claim 1 is characterized in that, described memory data district comprises the plurality of data piece, the equal and opposite in direction of each data block.
3. recording instrument without paper as claimed in claim 2, it is characterized in that, described microprocessor also comprises a block-chaining administrative unit, described block-chaining administrative unit is connected with described storer, in order to the position corresponding relation of storing each data block in the described memory data district and the reference position of freed data blocks.
4. recording instrument without paper as claimed in claim 1 is characterized in that, described index in order to storage data zero-time, record count, corresponding data piece reference position and record cycle information.
5. recording instrument without paper as claimed in claim 1 is characterized in that described recording instrument without paper also comprises a battery, and described battery is connected with described RAM, in order to when the power down to be described RAM power supply.
6. recording instrument without paper as claimed in claim 1 is characterized in that, described storer is the FLASH storer.
7. a recording instrument without paper date storage method is characterized in that, may further comprise the steps:
(1) after the start, the recording channel that correspondence is applied to is set up an index for each recording channel in the RAM index area, and this index stores data zero-time, record are counted, corresponding data piece reference position and write down cycle information;
(2) with the data storage of each recording channel to the RAM data field;
(3) after the RAM data field is filled with, with the data of storing in the RAM data field according to the data block reference position unloading of manipulative indexing record to the memory data district in the corresponding data block, and RAM continues the data field to deposit in new data, after being filled with again with data conversion storage to storer, until shutdown, finish data storage.
8. recording instrument without paper date storage method as claimed in claim 7 is characterized in that, also comprises,
(4) after the RAM index area is filled with, with the index unloading of storing in the RAM index area to the memory index district.
9. recording instrument without paper date storage method as claimed in claim 7 is characterized in that, step (1) recording data blocks reference position further comprises:
A1: whether the data of judging preceding this passage of index foundation are filled with a data block, if data are not filled with a data block, the end position that then writes down previous index is this indexed data piece reference position; Otherwise,, carry out steps A 2 if data are filled with a data block;
A2: the search idle data is fast, if search freed data blocks, then writing down this freed data blocks is this indexed data piece reference position, otherwise, carry out release data block flow process;
A3: after discharging data block and finishing, search for freed data blocks again, find that this freed data blocks of record is this indexed data piece reference position after the freed data blocks.
10. recording instrument without paper date storage method as claimed in claim 7 is characterized in that, step (3) also comprises:
B1: after data were filled with a data block, the search freed data blocks if search freed data blocks, then write new data this freed data blocks; Otherwise, carry out release data block flow process;
B2: after discharging data block and finishing, search for freed data blocks again, find freed data blocks after.New data is write this freed data blocks.
11. as claim 9 or 10 described recording instrument without paper date storage methods, it is characterized in that, discharge the data block flow process among steps A 2 and the step B1 and specifically may further comprise the steps:
C1:, calculate the quantity of the data block that each recording channel should discharge according to account form in advance according to the current record cycle of each recording channel;
C2: according to the result of calculation of step C1, discharge corresponding data block, and delete or revise the index that each recording channel is managed those data blocks that discharge, then delete this index if the total data of index control all is released; Otherwise, revise indexed data reference position and data bulk;
C3: revise the block-chaining unit, the new data block that discharges of record is a freed data blocks, and the reference position of data block search is set to the data block of the new the most close data field reference position that discharges.
12. recording instrument without paper date storage method as claimed in claim 8 is characterized in that, the unloading of index is preserved in the round-robin mode in the step (4), and the memory index district is filled with the back the oldest index of deletion automatically, deposits new index in.
CN2009102477832A 2009-12-31 2009-12-31 Paperless recorder and method for storing data of same Active CN101794255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102477832A CN101794255B (en) 2009-12-31 2009-12-31 Paperless recorder and method for storing data of same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102477832A CN101794255B (en) 2009-12-31 2009-12-31 Paperless recorder and method for storing data of same

Publications (2)

Publication Number Publication Date
CN101794255A true CN101794255A (en) 2010-08-04
CN101794255B CN101794255B (en) 2012-06-27

Family

ID=42586965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102477832A Active CN101794255B (en) 2009-12-31 2009-12-31 Paperless recorder and method for storing data of same

Country Status (1)

Country Link
CN (1) CN101794255B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468642A (en) * 2014-09-09 2016-04-06 杭州海康威视数字技术股份有限公司 Data storage method and apparatus
CN110992519A (en) * 2019-12-10 2020-04-10 厦门金龙联合汽车工业有限公司 New energy automobile fault data processing method and processing device
CN111563052A (en) * 2020-04-30 2020-08-21 深圳忆联信息系统有限公司 Cache method and device for reducing read delay, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1092193A (en) * 1993-03-10 1994-09-14 石宝山 Save driving recorder
CN1249435A (en) * 1999-09-29 2000-04-05 青岛大学 Failure recorder of electric power system
US8195037B2 (en) * 2004-11-12 2012-06-05 Pelco, Inc. Apparatus and method of storing video data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468642A (en) * 2014-09-09 2016-04-06 杭州海康威视数字技术股份有限公司 Data storage method and apparatus
CN110992519A (en) * 2019-12-10 2020-04-10 厦门金龙联合汽车工业有限公司 New energy automobile fault data processing method and processing device
CN111563052A (en) * 2020-04-30 2020-08-21 深圳忆联信息系统有限公司 Cache method and device for reducing read delay, computer equipment and storage medium
CN111563052B (en) * 2020-04-30 2023-08-08 深圳忆联信息系统有限公司 Caching method and device for reducing read delay, computer equipment and storage medium

Also Published As

Publication number Publication date
CN101794255B (en) 2012-06-27

Similar Documents

Publication Publication Date Title
CN101515276B (en) Method for write operation of file data, and recovery method and recovery system for file data
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
CN100498796C (en) Logic log generation method, database backup/ restoration method and system
CN101876949B (en) Date memorizing system and method thereof
CN1331063C (en) On-line data backup method based on data volume snapshot
US7587427B2 (en) Hierarchical storage system, and control method and program therefor
CN102779096B (en) Page, block and face-based three-dimensional flash memory address mapping method
CN104461391A (en) Method and system for managing and processing metadata of storage equipment
CN105843749B (en) A kind of NAND Flash fault-tolerance approach based on FPGA
CN101446921B (en) Dynamic storage method of Flash memory
US20070162513A1 (en) Methods and apparatus for point in time data access and recovery
CN103631536B (en) A kind of method utilizing the invalid data of SSD to optimize RAID5/6 write performance
CN102023819B (en) Method for constructing double-disk fault tolerance horizontal grouping and parallel access disk array
CN101501623A (en) Filesystem-aware block storage system, apparatus, and method
CN102023809A (en) Storage system, method for reading data from storage system and method for writing data to storage system
CN104516471A (en) Method and device for managing power supply of storage system
CN101127004A (en) System and method for accessing data on flash memory
EP1307876A4 (en) Data storage system and process
CN103544110A (en) Block-level continuous data protection method based on solid-state disc
CN101777017A (en) Rapid recovery method of continuous data protection system
CN102023820A (en) Method for constructing double-disk fault-tolerant vertical packet parallel access disk array
CN104615381B (en) A kind of redundant arrays of inexpensive disks of video monitoring system
CN100437504C (en) Hard disc data backup system and method
CN101794255B (en) Paperless recorder and method for storing data of same
US20090083503A1 (en) System of creating logical volume and method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant