CN103544097B - The log storing method of embedded system, system and log read method and system - Google Patents

The log storing method of embedded system, system and log read method and system Download PDF

Info

Publication number
CN103544097B
CN103544097B CN201310496989.5A CN201310496989A CN103544097B CN 103544097 B CN103544097 B CN 103544097B CN 201310496989 A CN201310496989 A CN 201310496989A CN 103544097 B CN103544097 B CN 103544097B
Authority
CN
China
Prior art keywords
daily record
record data
random access
access memory
writing position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310496989.5A
Other languages
Chinese (zh)
Other versions
CN103544097A (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.)
Vtron Group Co Ltd
Original Assignee
Vtron Technologies 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 Vtron Technologies Ltd filed Critical Vtron Technologies Ltd
Priority to CN201310496989.5A priority Critical patent/CN103544097B/en
Publication of CN103544097A publication Critical patent/CN103544097A/en
Application granted granted Critical
Publication of CN103544097B publication Critical patent/CN103544097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of log storing method of embedded system, system and log read method and system, described log storing method comprises: the daily record data obtaining embedded system; By in described daily record data write random access memory; Daily record data in the described random access memory of write is copied in external storage.The log storing method of embedded system of the present invention, system and log read method and system, be first kept at daily record data in random access memory, then from random access memory, daily record data copied to external storage.On embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.Both from random access memory, daily record data can be read fast fast, the daily record data that random access memory is lost can be read again in time from external storage.

Description

The log storing method of embedded system, system and log read method and system
Technical field
The present invention relates to embedded system field, particularly relate to a kind of log storing method of embedded system, system and log read method and system.
Background technology
In the daily record preservation of embedded system, need the preservation to the quick out-of-order of file, and according to user's request, daily record data is read.Along with the continuous progress of technology, the demand of being preserved according to assigned address by operation file is more and more higher, and reads the different data needed according to demand, should ensure time high efficiency, also will ensure the simplification of data.In embedded systems, mainly through journal file being directly stored in the RAM(randomaccessmemory be connected with CPU, random access memory) in.
But journal file is directly stored in RAM, after system power failure, easily loses journal file.
Summary of the invention
Based on this, be necessary for exist in above-mentioned emulation technology hardware resource consumption large, operate complicated problem, a kind of log storing method of embedded system, system and log read method and system are provided.
A log storing method for embedded system, comprises the following steps:
Obtain the daily record data of embedded system;
By in described daily record data write random access memory;
Daily record data in the described random access memory of write is copied in external storage.
A daily record storage system for embedded system, comprising:
Acquiring unit, for obtaining the daily record data of embedded system;
Writing unit, for writing in random access memory by described daily record data;
Unloading unit, for copying to the daily record data in the described random access memory of write in external storage.
The log storing method of above-mentioned embedded system and system, be first kept at daily record data in random access memory, then from random access memory, daily record data is copied to external storage.On embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.
A log read method for embedded system, comprises the following steps:
Detect log read instruction, and read daily record data according to described reading command from random access memory;
If when there is not described daily record data in described random access memory, read described daily record data from external storage, wherein, the described daily record data in described external storage copies from described random access memory.
A log read system for embedded system, comprising:
First reading unit, for detecting log read instruction, and reads daily record data according to described reading command from random access memory;
Second reading unit, during for there is not described daily record data in described random access memory, reads described daily record data from external storage, and wherein, the described daily record data in described external storage copies from described random access memory.
The log read method and system of above-mentioned embedded system, from random access memory, daily record data can be read fast fast according to log read instruction, and when random access memory loses due to reasons such as power down the daily record data needing to read, described daily record data can be read in time from external storage.
A log read method for embedded system, comprises the following steps:
Obtain the daily record data of embedded system;
By in described daily record data write random access memory;
Daily record data in the described random access memory of write is copied in external storage;
Detect log read instruction, and read described daily record data according to described reading command from described random access memory;
If when there is not described daily record data in described random access memory, read described daily record data from external storage.
A log read system for embedded system, comprising:
Acquiring unit, for obtaining the daily record data of embedded system;
Writing unit, for writing in random access memory by described daily record data;
Unloading unit, for copying in external storage by the daily record data in the described random access memory of write;
First reading unit, for detecting log read instruction, and reads described daily record data according to described reading command from described random access memory;
Second reading unit, during for there is not described daily record data in described random access memory, reads described daily record data from external storage.
The log read method and system of above-mentioned embedded system, on embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.Both from random access memory, daily record data can be read fast fast simultaneously, the daily record data that random access memory is lost can be read again in time from external storage.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of log storing method first embodiment of embedded system of the present invention;
Fig. 2 is the schematic flow sheet of log storing method second embodiment of embedded system of the present invention;
Fig. 3 is the structural representation of daily record storage system first embodiment of embedded system of the present invention;
Fig. 4 is the schematic flow sheet of log read method first embodiment of embedded system of the present invention;
Fig. 5 is the structural representation of log read system first embodiment of embedded system of the present invention;
Fig. 6 is the schematic flow sheet of another log read method first embodiment of embedded system of the present invention;
Fig. 7 is the structural representation of another log read system first embodiment of embedded system of the present invention.
Embodiment
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of log storing method first embodiment of embedded system of the present invention.
The log storing method of the described embedded system of present embodiment comprises the following steps:
Step 101, obtains the daily record data of embedded system.
Step 102, by described daily record data write random access memory.
Step 103, copies to the daily record data in the described random access memory of write in external storage.
The log storing method of the embedded system described in present embodiment, is first kept at daily record data in random access memory, then from random access memory, daily record data is copied to external storage.On embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.
Wherein, for step 101, preferably obtain described daily record data from the CPU kind be connected with random access memory.The number of described daily record data can be many.
For step 102, by calling default being write in described random access memory by daily record data for the interface function writing data.
In one embodiment, described step in described daily record data write random access memory to be comprised the following steps:
Step 1021, search in described random access memory and whether there is the journal file corresponding with described daily record data, if exist, described daily record data is write in described journal file, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority.
Step 1022, if do not exist, the journal file corresponding with described daily record data is created in described random access memory, described daily record data is write in described journal file, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority.
Daily record data writes in the appointment journal file of random access memory by the present embodiment, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority, conveniently carries out the reading of daily record data.
Wherein, for step 1021, described journal file preferably includes data head and many data contents.Described data head is for recording the total quantity of current document position and write daily record data, and described data head back location is exactly concrete data content, and the form of each data content can be identical with number of words.Every bar data content can comprise write Data Position, write data time, the priority of write data content or the identify label of write data logging ID(daily record data) etc. relevant information.
Preferably, mutually corresponding journal file and daily record data have common trait.By searching common trait to judge whether there is the journal file corresponding with described daily record data in described random access memory.Also can pre-set the corresponding relation of journal file in different daily record datas and random access memory, search in described random access memory whether there is the journal file corresponding with told daily record data according to described corresponding relation.
For step 1022, if when described random storage does not have the journal file corresponding with described daily record data to deposit, create the journal file corresponding with described daily record data, and the content of the data head of journal file described in initialization, write in RAM by data head and go, the content of data head comprises current document position (CurPos), the total quantity (TotalWrite) of daily record data write and the preservable total quantity of file (TotalCount).
In other embodiments, also can be daily record data is random, unordered be stored in described random access memory.
For step 103, can directly the daily record data in described random access memory being copied in described external storage, also by copying described journal file, the daily record data in described random access memory being copied to described external storage.
Preferably, described external storage is flash storage.
Further, can in advance according to the operation conditions of embedded system, setting copies period or the time interval of described daily record data.
In one embodiment, described the step that copies in external storage of daily record data in the described random access memory of write to be comprised the following steps:
Step 1031, arranges poll time and mutex.
Step 1032, copies to described daily record data in external storage according to the poll time arranged and mutex.
Step 1033, discharges described mutex.
Wherein, for step 1031, arrange poll time, be used for regulation and control to write file in external storage every preset time period and goes from random access memory, according to the practical operation situation of embedded system, the described time period can be set to 30 minutes.
When arranging poll time, a rational time period must be set, if the described time period is oversize, once system cut-off, will lose so also do not come copy to journal file in external storage, so journal file preservation that would not obtain.If the time is too short, owing to writing the overlong time of external storage, cause taking CPU in a large number, make CPU usage too low, other business cannot be completed faster, repeatedly refresh external storage simultaneously, more easily cause the problems such as CPU efficiency is too low, and the external storage life-span is short, loss is serious.
For step 1032, newly can set up a task and be used for copying, namely not affect journal file copy RAM task, also do not affect other business and normally run.
In the present embodiment, if file is too much, repeatedly can repeat step mutex, replication log data being set and discharging mutex, if when daily record data being copied in external storage by replication log file, often copy a journal file and will re-establish mutex amount, can not make other tasks so always in wait.
Refer to Fig. 2, Fig. 2 is the schematic flow sheet of log storing method second embodiment of embedded system of the present invention.
The log storing method of the described embedded system of present embodiment and the difference of the first embodiment are: describedly the step that described daily record data writes in random access memory comprised the following steps:
Step 201, the maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting.
Step 202, if the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file.
Step 203, if the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file.
Step 204, upgrades the quantity of the current document position recorded in the data head of described journal file and the daily record data write.
The log storing method of the embedded system described in present embodiment, by the assigned address by journal file corresponding for daily record data write, facilitates the reading of daily record data on conveniently carrying out while daily record write once.
Refer to Fig. 3, Fig. 3 is the structural representation of daily record storage system first embodiment of embedded system of the present invention.
The daily record storage system of the described embedded system of present embodiment comprises acquiring unit 100, writing unit 200 and unloading unit 300, wherein:
Acquiring unit 100, for obtaining the daily record data of embedded system.
Writing unit 200, for writing described daily record data in random access memory.
Unloading unit 300, for copying to the daily record data in the described random access memory of write in external storage.
The daily record storage system of the embedded system described in present embodiment, is first kept at daily record data in random access memory, then from random access memory, daily record data is copied to external storage.On embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.
Wherein, for acquiring unit, preferably obtain described daily record data from the CPU kind be connected with random access memory.The number of described daily record data can be many.
For writing unit 200, by calling default being write in described random access memory by daily record data for the interface function writing data.
In one embodiment, writing unit 200 can be used for:
Search in described random access memory and whether there is the journal file corresponding with described daily record data, if exist, described daily record data is write in described journal file, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority.
If do not exist, the journal file corresponding with described daily record data is created in described random access memory, described daily record data is write in described journal file, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority.
Daily record data writes in the appointment journal file of random access memory by the present embodiment, and records the identify label (i.e. ID content) of described daily record data, writing position, the relevant information such as write time and priority, conveniently carries out the reading of daily record data.
Wherein, for writing unit 200, described journal file preferably includes data head and many data contents.Described data head is for recording the total quantity of current document position and write daily record data, and described data head back location is exactly concrete data content, and the form of each data content can be identical with number of words.Every bar data content can comprise write Data Position, write data time, the priority of write data content or the identify label of write data logging ID(daily record data) etc. relevant information.
Preferably, mutually corresponding journal file and daily record data have common trait.By searching common trait to judge whether there is the journal file corresponding with described daily record data in described random access memory.Also can pre-set the corresponding relation of journal file in different daily record datas and random access memory, search in described random access memory whether there is the journal file corresponding with told daily record data according to described corresponding relation.
Further, if when described random storage does not have the journal file corresponding with described daily record data to deposit, create the journal file corresponding with described daily record data, and the content of the data head of journal file described in initialization, write in RAM by data head and go, the content of data head comprises current document position (CurPos), the total quantity (TotalWrite) of daily record data write and the preservable total quantity of file (TotalCount).
In other embodiments, what writing unit 200 also can be daily record data is random, unordered is stored in described random access memory.
For unloading unit 300, can directly the daily record data in described random access memory being copied in described external storage, also by copying described journal file, the daily record data in described random access memory being copied to described external storage.
Preferably, described external storage is flash storage.
Further, can in advance according to the operation conditions of embedded system, setting copies period or the time interval of described daily record data.
In one embodiment, unloading unit 300 can be used for arranging poll time and mutex, copies in external storage, discharge described mutex according to the poll time arranged and mutex by described daily record data.
Wherein, arrange poll time, be used for regulation and control to write file in external storage every preset time period and goes from random access memory, according to the practical operation situation of embedded system, the described time period can be set to 30 minutes.
Preferably, when arranging poll time, a rational time period must be set, if the described time period is oversize, once system cut-off, will lose so also do not come copy to journal file in external storage, so journal file preservation that would not obtain.If the time is too short, owing to writing the overlong time of external storage, cause taking CPU in a large number, make CPU usage too low, other business cannot be completed faster, repeatedly refresh external storage simultaneously, more easily cause the problems such as CPU efficiency is too low, and the external storage life-span is short, loss is serious.
Further, newly can set up a task and be used for copying, namely not affect journal file copy RAM task, also do not affect other business and normally run.
In the present embodiment, if file is too much, repeatedly can repeat step mutex, replication log data being set and discharging mutex, if when daily record data being copied in external storage by replication log file, often copy a journal file and will re-establish mutex amount, can not make other tasks so always in wait.
The following stated is daily record storage system second embodiment of embedded system of the present invention.
The daily record storage system of the described embedded system of present embodiment and the difference of the first embodiment are: writing unit 200 also can be further used for:
The maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting.
If the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file.
If the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file.
Upgrade the quantity of the current document position recorded in the data head of described journal file and the daily record data write.
The daily record storage system of the embedded system described in present embodiment, by the assigned address by journal file corresponding for daily record data write, facilitates the reading of daily record data on conveniently carrying out while daily record write once.
Refer to Fig. 4, Fig. 4 is the schematic flow sheet of log read method first embodiment of embedded system of the present invention.
The log read method of the described embedded system of present embodiment comprises the following steps:
Step 401, detects log read instruction, and reads daily record data according to described reading command from random access memory.
Step 402, if when there is not described daily record data in described random access memory, read described daily record data from external storage, wherein, the described daily record data in described external storage copies from described random access memory.
The log read method of above-mentioned embedded system, from random access memory, daily record data can be read fast fast according to log read instruction, and when random access memory loses due to reasons such as power down the daily record data needing to read, described daily record data can be read further from external storage.
Wherein, for step 401 and step 402, when reading daily record data, preferentially reading from random access memory, the speed reading daily record data can be improved.Described log read instruction can set reading conditions (this condition refers in chronological order, ID content etc. read daily record data).If do not set reading conditions in described log read instruction, can directly the daily record data of out-of-order or journal file be read out.
In one embodiment, also can comprise the following steps from the step of described random access memory or described external storage reading daily record data:
If read according to time sequencing, according to the time interocclusal record in journal file, by the daily record of out-of-order according to time-sequencing, the journal file according to time sequencing is derived daily record.
If the ID according to daily record data reads, read and the correlation log file of a certain type i D needing to search, after reading, set up one piece of internal memory, by this journal file one by one according to the type ID by the data write memory that needs.
In the present embodiment, according to the content record of the data head of journal file, can the current record content of locating file fast, providing convenient for searching data content, saving the time.When reading journal file, different pieces of information information can be read according to different demand, better can investigate problem.
Refer to Fig. 5, Fig. 5 is the structural representation of log read system first embodiment of embedded system of the present invention.
The log read system of the described embedded system of present embodiment comprises the first reading unit 400 and the second reading unit 500, wherein:
First reading unit 400, for detecting log read instruction, and reads daily record data according to described reading command from random access memory.
Second reading unit 500, during for there is not described daily record data in described random access memory, reads described daily record data from external storage, and wherein, the described daily record data in described external storage copies from described random access memory.
The log read system of above-mentioned embedded system, from random access memory, daily record data can be read fast fast according to log read instruction, and when random access memory loses due to reasons such as power down the daily record data needing to read, described daily record data can be read further from external storage.
Wherein, for the first reading unit 400 and the second reading unit 500, when reading daily record data, preferentially reading from random access memory, the speed reading daily record data can be improved.Described log read instruction can set reading conditions (this condition refers in chronological order, ID content etc. read daily record data).If do not set reading conditions in described log read instruction, can directly the daily record data of out-of-order or journal file be read out.
In one embodiment, the first reading unit 400 or the second storage unit 500 also can be used for:
When reading daily record data according to time sequencing, according to the time interocclusal record in journal file, by the daily record of out-of-order according to time-sequencing, the journal file according to time sequencing is derived daily record.
When reading daily record data according to the ID of daily record data, reading and the correlation log file needing a certain type i D searched, after reading, setting up one piece of internal memory, by this journal file one by one according to the type ID by the data write memory that needs.
In the present embodiment, according to the content record of the data head of journal file, can the current record content of locating file fast, providing convenient for searching data content, saving the time.When reading journal file, different pieces of information information can be read according to different demand, better can investigate problem.
Refer to Fig. 6, Fig. 6 is the schematic flow sheet of log read method first embodiment of another embedded system of the present invention.
The log read method of the embedded system described in present embodiment, comprises the following steps:
Step 601, obtains the daily record data of embedded system.
Step 602, by described daily record data write random access memory.
Step 603, copies to the daily record data in the described random access memory of write in external storage.
Step 604, detects log read instruction, and reads described daily record data according to described reading command from described random access memory.
Step 605, if when there is not described daily record data in described random access memory, read described daily record data from external storage.
The log read method of the embedded system described in present embodiment, on embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.Both from random access memory, daily record data can be read fast fast simultaneously, the daily record data that random access memory is lost can be read again in time from external storage.
Wherein, step 601, step 601 and step 603 are equal to step 101, step 102 and step 103 in the log storing method of embedded system described in Fig. 1 respectively.Step 604 and step 605 are equal to the step 401 described in Fig. 4 and step 402 respectively.
Refer to Fig. 7, Fig. 7 is the structural representation of log read system first embodiment of another embedded system of the present invention.
The log read system of the embedded system described in present embodiment comprises acquiring unit 100, writing unit 200, unloading unit 300, first reading unit 400 and the second reading unit 500, wherein:
Acquiring unit 100, for obtaining the daily record data of embedded system.
Writing unit 200, for writing described daily record data in random access memory.
Unloading unit 300, for copying to the daily record data in the described random access memory of write in external storage.
First reading unit 400, for detecting log read instruction, and reads described daily record data according to described reading command from described random access memory.
Second reading unit 500, during for there is not described daily record data in described random access memory, reads described daily record data from external storage.
The log read system of the embedded system described in present embodiment, on embedded software system, the normal operation of all tasks can be ensured, with lower memory usage, daily record data can be preserved fast again, and the daily record data copying to external storage from random access memory when there is power down also can not be lost.Both from random access memory, daily record data can be read fast fast simultaneously, the daily record data that random access memory is lost can be read again in time from external storage.
Wherein, acquiring unit 100, writing unit 200, unloading unit 300, first reading unit 400 and the second reading unit 500 are equal to the corresponding unit described in Fig. 3 and Fig. 5 respectively.
The above embodiment only have expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (8)

1. a log storing method for embedded system, is characterized in that, comprises the following steps:
Obtain the daily record data of embedded system;
By in described daily record data write random access memory; Described step in described daily record data write random access memory to be comprised the following steps:
The maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting;
If the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file;
If the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file;
Upgrade the quantity of the current document position recorded in the data head of described journal file and the daily record data write;
Daily record data in the described random access memory of write is copied in external storage.
2. the log storing method of embedded system according to claim 1, is characterized in that, describedly the step that copies in external storage of daily record data in the described random access memory of write is comprised the following steps:
Poll time and mutex are set;
According to the poll time arranged and mutex, described daily record data is copied in external storage;
Discharge described mutex.
3. a daily record storage system for embedded system, is characterized in that, comprising:
Acquiring unit, for obtaining the daily record data of embedded system;
Writing unit, for writing in random access memory by described daily record data; Said write unit also for:
The maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting;
If the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file;
If the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file;
Upgrade the quantity of the current document position recorded in the data head of described journal file and the daily record data write;
Unloading unit, for copying to the daily record data in the described random access memory of write in external storage.
4. the daily record storage system of embedded system according to claim 3, it is characterized in that, described daily record data, also for arranging poll time and mutex, copying in external storage according to the poll time arranged and mutex, discharging described mutex by described unloading unit.
5. a log read method for embedded system, is characterized in that, comprise the following steps:
Detect log read instruction, and read daily record data according to described reading command from random access memory;
If when there is not described daily record data in described random access memory, read described daily record data from external storage, wherein, the described daily record data in described external storage copies from described random access memory;
The step reading daily record data from described random access memory or described external storage also can comprise the following steps:
Read and the correlation log file needing a certain type i D searched according to the ID of daily record data, after reading, set up one piece of internal memory, by this journal file one by one according to the type ID by the data write memory that needs.
6. a log read system for embedded system, is characterized in that, comprising:
First reading unit, for detecting log read instruction, and reads daily record data according to described reading command from random access memory;
Second reading unit, during for there is not described daily record data in described random access memory, reads described daily record data from external storage, and wherein, the described daily record data in described external storage copies from described random access memory;
Described first reading unit or the second storage unit also can be used for:
When reading daily record data according to the ID of daily record data, reading and the correlation log file needing a certain type i D searched, after reading, setting up one piece of internal memory, by this journal file one by one according to the type ID by the data write memory that needs.
7. a log read method for embedded system, is characterized in that, comprise the following steps:
Obtain the daily record data of embedded system;
By in described daily record data write random access memory; Described step in described daily record data write random access memory to be comprised the following steps:
The maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting;
If the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file;
If the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file;
Upgrade the quantity of the current document position recorded in the data head of described journal file and the daily record data write;
Daily record data in the described random access memory of write is copied in external storage;
Detect log read instruction, and read described daily record data according to described reading command from described random access memory;
If when there is not described daily record data in described random access memory, read described daily record data from external storage.
8. a log read system for embedded system, is characterized in that, comprising:
Acquiring unit, for obtaining the daily record data of embedded system;
Writing unit, for writing in random access memory by described daily record data; Said write unit also for:
The maximum writing position of the writing position of more described daily record data and the journal file of described random access memory, if the writing position of described daily record data is greater than described maximum writing position, then returns error reporting;
If the writing position of described daily record data is not more than described maximum writing position, the current document position then recorded in the writing position of more described daily record data and the file header of described journal file, if the writing position of described daily record data is not more than described current document position, then described daily record data is covered the data on position identical with the writing position of described daily record data in described journal file;
If the writing position of described daily record data is greater than described current document position, then in described journal file, the null value being used for identifying this position no data content will be write between the writing position of described daily record data and described current document position, and described daily record data is write position identical with the writing position of described daily record data in described journal file;
Upgrade the quantity of the current document position recorded in the data head of described journal file and the daily record data write;
Unloading unit, for copying in external storage by the daily record data in the described random access memory of write;
First reading unit, for detecting log read instruction, and reads described daily record data according to described reading command from described random access memory;
Second reading unit, during for there is not described daily record data in described random access memory, reads described daily record data from external storage.
CN201310496989.5A 2013-10-21 2013-10-21 The log storing method of embedded system, system and log read method and system Active CN103544097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310496989.5A CN103544097B (en) 2013-10-21 2013-10-21 The log storing method of embedded system, system and log read method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310496989.5A CN103544097B (en) 2013-10-21 2013-10-21 The log storing method of embedded system, system and log read method and system

Publications (2)

Publication Number Publication Date
CN103544097A CN103544097A (en) 2014-01-29
CN103544097B true CN103544097B (en) 2016-04-13

Family

ID=49967569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310496989.5A Active CN103544097B (en) 2013-10-21 2013-10-21 The log storing method of embedded system, system and log read method and system

Country Status (1)

Country Link
CN (1) CN103544097B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5982025B1 (en) * 2015-02-27 2016-08-31 京セラドキュメントソリューションズ株式会社 Information processing apparatus and memory management program
CN106033322B (en) * 2015-03-17 2019-11-01 北京元心科技有限公司 A kind of date storage method and device
CN105183626B (en) * 2015-09-30 2018-03-02 深圳怡化电脑股份有限公司 The log storing method and system of a kind of module for recognizing paper money
CN105224444B (en) * 2015-10-14 2019-02-01 深圳市金证科技股份有限公司 Log generation method and device
CN107562567A (en) * 2016-06-30 2018-01-09 华为技术有限公司 A kind of data processing method and data processing equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799783A (en) * 2009-01-19 2010-08-11 中国人民大学 Data storing and processing method, searching method and device thereof
CN102831034A (en) * 2012-08-14 2012-12-19 中国电力科学研究院 Multimode backup and quick recovery method based on embedded Linux device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7418635B2 (en) * 2005-01-25 2008-08-26 Tandberg Storage Asa Automatically triggered snapshot data dump for storage unit with embedded system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799783A (en) * 2009-01-19 2010-08-11 中国人民大学 Data storing and processing method, searching method and device thereof
CN102831034A (en) * 2012-08-14 2012-12-19 中国电力科学研究院 Multimode backup and quick recovery method based on embedded Linux device

Also Published As

Publication number Publication date
CN103544097A (en) 2014-01-29

Similar Documents

Publication Publication Date Title
WO2021238267A1 (en) Cluster file system-based data backup method and apparatus, and readable storage medium
CN103544097B (en) The log storing method of embedded system, system and log read method and system
CN103577121B (en) A kind of highly reliable linear file access method based on Nand Flash
CN104969168A (en) Persistent storage device with NVRAM for staging writes
CN101136825B (en) Asynchronous configuration information management method and system for client terminal/server structure
CN108319543A (en) A kind of asynchronous processing method and its medium, system of computer log data
CN103927251A (en) Log management method for embedded system
CN103049396B (en) The method of writing with a brush dipped in Chinese ink of data and device
CN103577574A (en) High-reliability linear file system based on nand flash
WO2017161795A1 (en) Method and system for processing chronological file
CN109558335A (en) A kind of file memory format of the embedded system based on Nor flash storage
CN108614876A (en) A kind of system and data processing method based on Redis databases
CN102622281A (en) Intelligent terminal and method of data backup and restore thereof
CN111324290A (en) Memory device
US9098396B2 (en) Enhancement of efficiency in power failure handling in flash memory
CN102025758B (en) Method, device and system for recovering data copy in distributed system
CN109753378A (en) A kind of partition method of memory failure, device, system and readable storage medium storing program for executing
US9507657B2 (en) Investigation program, information processing apparatus, and information processing method
CN101403972A (en) Memory card guiding method and device of embedded system
CN101135990A (en) System fault positioning method
CN108008908B (en) Method and device for controlling data on SD card
KR20090094594A (en) Information storage medium recording data according to journaling file system, method and apparatus of writing/recovering data using journaling file system
CN110262980A (en) High-speed memory system based on finite lifetime storage medium
CN115599575A (en) Novel method for solving concurrent activation and deactivation of cluster logical volume
CN108038035A (en) A kind of detection method and relevant apparatus of flash reading and writing state

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 510670 Guangdong Province, Guangzhou high tech Industrial Development Zone Kezhu Road No. 233

Patentee after: Wei Chong group Limited by Share Ltd

Address before: 510663 Guangzhou province high tech Industrial Development Zone, Guangdong, Cai road, No. 6, No.

Patentee before: Guangdong Weichuangshixun Science and Technology Co., Ltd.