CN101072124A - Log obtaining method - Google Patents

Log obtaining method Download PDF

Info

Publication number
CN101072124A
CN101072124A CN 200710075185 CN200710075185A CN101072124A CN 101072124 A CN101072124 A CN 101072124A CN 200710075185 CN200710075185 CN 200710075185 CN 200710075185 A CN200710075185 A CN 200710075185A CN 101072124 A CN101072124 A CN 101072124A
Authority
CN
China
Prior art keywords
log
data
task
daily record
threshold value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 200710075185
Other languages
Chinese (zh)
Inventor
黄锦通
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 200710075185 priority Critical patent/CN101072124A/en
Publication of CN101072124A publication Critical patent/CN101072124A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The method is applicable to multitask system of possessing authorization for accessing file system and obtaining files. The method includes steps: (1) setting up threshold value of log data in internal memory; (2) when a task needs to print log, the method stores data of log to internal memory; (3) determining capacity of data smaller than the said threshold, and returning back the multitask system, continuing processing each task; other executing step (4); (4) writing the said data to log file in use for storing log data. The invention solves issues of malposed, repeated and lost log. When fault occurs, analyzing log correctly can locate position of fault. Thus, the invention discloses method of solving fault for user effectively.

Description

A kind of method of obtaining daily record
Technical field
The present invention relates to the multitask embedded system, in particular, a kind of method of in the multitask embedded system, obtaining daily record.
Background technology
Obtaining log (daily record) in the multitask embedded system is meant in system's running, note in each task run process the path and the value of each each state of variable at that time of process, be in order when breaking down, to analyze according to log, judge system operation the path of process whether correct, and whether each variable is normal with each state value, thereby the place of orienting problem.
In the prior art, the method for obtaining 1og that adopts in the multitask embedded system as shown in Figure 1, the task that each priority is different, for example task I and task J are by data are sent in the print out task, and then output on the terminal by print out task.As shown in Figures 2 and 3, because the priority difference of each task that will print in the system, these tasks are different again with the priority of print out task, thereby cause the log that finally sees dislocation to occur from terminal, repeat, and the problem of losing, that is to say and can't correctly effectively write down the sequential that each task is carried out, when breaking down, also can't carry out correct analysis, also just can't correctly orient the problem place certainly log.
Therefore, there is defective in prior art, needs to improve.
Summary of the invention
The object of the present invention is to provide a kind of method of obtaining daily record, being applied to can the access file system and obtain in the multitask system of file, can correctly, effectively obtain the daily record of system.
Technical scheme of the present invention is as follows:
A kind of method of obtaining daily record is applied to have the access file System Privileges and obtains in the multitask system of file, and it comprises step: A1, the threshold value of data shared capacity in internal memory of daily record is set; A2, when a task needs print log, with the storage of described daily record to internal memory; The capacity of A3, the described data of judgement returns described multitask system less than described threshold value, continues to handle each task, otherwise execution in step A4; A4, described data are write the journal file that is used for storing daily record data.
Described method, wherein, described steps A 4 specifically comprises: create the journal file that is used for storing daily record data, described data are write described journal file.
Described method, wherein, also comprise steps A 5: the user calls described journal file.
Described method, wherein, described steps A 1 also comprises: adjust described threshold value according to memory size.
Described method, wherein, described steps A 1 also comprises: dynamically adjust described threshold value according to memory size.
Described method, wherein, described steps A 4 also comprises: return described multitask system, continue to handle each task.
Adopt such scheme, the invention solves log and dislocation occurs, repeat, and the problem of losing, when breaking down by log is carried out correct analysis, thereby can correctly orient the problem place, provide effective solution for the user fixes a breakdown.
Description of drawings
Fig. 1 is the method schematic diagram that obtains log of prior art;
Fig. 2 is the wrong log file schematic diagram of prior art;
Fig. 3 is the contrast schematic diagram of the correct log file of prior art;
Fig. 4 is the method schematic diagram that obtains log of the present invention;
Fig. 5 is the flow chart of the inventive method.
Embodiment
Below preferred embodiment of the present invention is described in detail.
As shown in Figure 5, the invention provides a kind of method of obtaining daily record, be applied to have the access file System Privileges and obtain in the multitask system of file, it comprises step:
A1, the threshold value of data shared capacity in internal memory of daily record is set; The user can be provided with described threshold value (threshold voluntarily, also claim threshold values), can also adjust the size of described threshold value according to memory size, also can be by system according to the automatic size of adjusting described threshold value of memory size, the present invention does not limit the application of these concrete modes.
A2, when a task needs print log, with the storage of described daily record to internal memory;
The capacity of A3, the described data of judgement returns described multitask system less than described threshold value, continues to handle each task, otherwise execution in step A4;
A4, described data are write the journal file that is used for storing daily record data.Described steps A 4 specifically comprises: create the journal file that is used for storing daily record data, described data are write described journal file.Log data stacks can be write in the same journal file, also can be during greater than described threshold value at the capacity of described data, a newly-built journal file writes described data in the new journal file.Described steps A 4 can also comprise: return described multitask system, continue to handle each task.
Method of the present invention can also comprise steps A 5: the user calls described journal file, analyzes detailed content wherein, thereby fixes a breakdown.
For example, particularly, as shown in Figure 4, this method is described below:
(1) certain task I or the task J in the executive system;
(2) when task I or task J will print log, earlier data directly are kept in the internal memory, judge that then whether the log size of preserving in the current internal memory surpasses threshold values (threshold also claims threshold value), if surpass, then forwards step (3) to; If do not surpass, then get back to step (1), so repeatedly;
(3) log in the internal memory is saved in the file system, gets back to step 1, so repeatedly;
Because when each task will be printed log, all be directly to be kept at data in the internal memory, do not relate to the switching of task, when reaching a certain size, data volume writes file, thereby guaranteed the sequential of log, can correctly effectively get access to our needed log, the dislocation of log can not occur, repeat, perhaps lose.
Because originally printed log also is a task, and a priority is also arranged, each task will relate to when printing and print out task between task switch, thereby cause the log of some tasks to repeat, the log of some tasks loses.And the inventive method does not just relate to the switching between each task and the print out task by writing direct internal memory, has guaranteed the sequential of log.
The present invention can determine the size of each log file by setting threshold values, the frequency of can be more rational definite access file system, and file system is read in can be not frequent write; When breaking down by analyzing the place that log that this kind method obtains can correct positioning goes wrong.
Should be understood that, for those of ordinary skills, can be improved according to the above description or conversion, and all these improvement and conversion all should belong to the protection range of claims of the present invention.

Claims (6)

1, a kind of method of obtaining daily record is applied to have the access file System Privileges and obtains in the multitask system of file, and it comprises step:
A1, the threshold value of data shared capacity in internal memory of daily record is set;
A2, when a task needs print log, with the storage of described daily record to internal memory;
The capacity of A3, the described data of judgement returns described multitask system less than described threshold value, continues to handle each task, otherwise execution in step A4;
A4, described data are write the journal file that is used for storing daily record data.
2, method according to claim 1 is characterized in that, described steps A 4 specifically comprises: create the journal file that is used for storing daily record data, described data are write described journal file.
3, method according to claim 1 is characterized in that, also comprises steps A 5: the user calls described journal file.
4, method according to claim 1 is characterized in that, described steps A 1 also comprises: adjust described threshold value according to memory size.
5, method according to claim 1 is characterized in that, described steps A 1 also comprises: dynamically adjust described threshold value according to memory size.
According to the arbitrary described method of claim 1 to 5, it is characterized in that 6, described steps A 4 also comprises: return described multitask system, continue to handle each task.
CN 200710075185 2007-06-22 2007-06-22 Log obtaining method Pending CN101072124A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200710075185 CN101072124A (en) 2007-06-22 2007-06-22 Log obtaining method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710075185 CN101072124A (en) 2007-06-22 2007-06-22 Log obtaining method

Publications (1)

Publication Number Publication Date
CN101072124A true CN101072124A (en) 2007-11-14

Family

ID=38899127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710075185 Pending CN101072124A (en) 2007-06-22 2007-06-22 Log obtaining method

Country Status (1)

Country Link
CN (1) CN101072124A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010099754A1 (en) * 2009-03-06 2010-09-10 成都市华为赛门铁克科技有限公司 Log information transmission method and apparatus
CN102209134A (en) * 2010-03-30 2011-10-05 深圳富泰宏精密工业有限公司 System and method for automatically retrieving log
CN102521070A (en) * 2011-11-18 2012-06-27 深圳中兴网信科技有限公司 Mirror image recovering method of journal information based on internal memory
CN102609484A (en) * 2012-01-19 2012-07-25 北京神州数码思特奇信息技术股份有限公司 General method for managing log of system
CN102769546A (en) * 2012-08-01 2012-11-07 北京经纬恒润科技有限公司 Method and system for message segmentation storage
CN103176888A (en) * 2011-12-22 2013-06-26 阿里巴巴集团控股有限公司 Log recording method and log recording system
CN103226340A (en) * 2013-04-16 2013-07-31 深圳市汇川控制技术有限公司 Programmable logic controller and realization method
CN107995234A (en) * 2016-10-26 2018-05-04 北京国双科技有限公司 Data transmission method and device
CN111063195A (en) * 2019-11-19 2020-04-24 珠海市德宇辉煌信息科技有限公司 License plate recognition device and system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010099754A1 (en) * 2009-03-06 2010-09-10 成都市华为赛门铁克科技有限公司 Log information transmission method and apparatus
CN102209134A (en) * 2010-03-30 2011-10-05 深圳富泰宏精密工业有限公司 System and method for automatically retrieving log
CN102521070A (en) * 2011-11-18 2012-06-27 深圳中兴网信科技有限公司 Mirror image recovering method of journal information based on internal memory
CN103176888A (en) * 2011-12-22 2013-06-26 阿里巴巴集团控股有限公司 Log recording method and log recording system
CN103176888B (en) * 2011-12-22 2018-01-23 阿里巴巴集团控股有限公司 A kind of method and system of log recording
CN102609484A (en) * 2012-01-19 2012-07-25 北京神州数码思特奇信息技术股份有限公司 General method for managing log of system
CN102769546A (en) * 2012-08-01 2012-11-07 北京经纬恒润科技有限公司 Method and system for message segmentation storage
CN103226340A (en) * 2013-04-16 2013-07-31 深圳市汇川控制技术有限公司 Programmable logic controller and realization method
CN107995234A (en) * 2016-10-26 2018-05-04 北京国双科技有限公司 Data transmission method and device
CN107995234B (en) * 2016-10-26 2021-08-10 北京国双科技有限公司 Data transmission method and device
CN111063195A (en) * 2019-11-19 2020-04-24 珠海市德宇辉煌信息科技有限公司 License plate recognition device and system

Similar Documents

Publication Publication Date Title
CN101072124A (en) Log obtaining method
CN103023984B (en) Terminal application server and application log filtering method thereof
US9946467B2 (en) Data storage method and electronic device
CN103150149B (en) Process database is reformed the method and apparatus of data
JP4641443B2 (en) Log information management apparatus, log information management method, and log information management program
CN103336736A (en) System log acquisition method and device
CN103186436B (en) A kind of Android system power-off protection method and device
EP1788577A3 (en) Data carrier system and data saving/restoring method thereof
CN101369969B (en) Method and devices for compressing Delta log using flash transactions
CN110704236B (en) On-line checking method for chip flash data and computer storage medium
CN103544097B (en) The log storing method of embedded system, system and log read method and system
MX2011000292A (en) Processing system with external memory access control.
CN1291322C (en) A two-channel synchronous recording and storing method and equipment for fault recording data
CN101394347A (en) Service data management method and system
CN107391312B (en) Data cloud backup method and system
CN106875977A (en) A kind of solid state hard disc adjustment method and device
CN116841458A (en) Memory read-write control method, system, terminal and storage medium
CN111339054A (en) Storage system hierarchical management method, device, equipment and storage medium
CN107193558B (en) Log file generation method and device
CN106484564B (en) Collected data storage method
CN101071633A (en) Method and system for reducing power consumption of storage unit
CN117632454A (en) Linux operating system resource monitoring method and device, storage medium and electronic equipment
CN103310848A (en) Method and apparatus using memory
CN112711503B (en) Memory test method based on Feiteng 2000+CPU
CN111078450B (en) Method for detecting file data non-synchronization in embedded system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication