CN102110167B - Method for implementing log information management in numerical control system - Google Patents

Method for implementing log information management in numerical control system Download PDF

Info

Publication number
CN102110167B
CN102110167B CN 201110049558 CN201110049558A CN102110167B CN 102110167 B CN102110167 B CN 102110167B CN 201110049558 CN201110049558 CN 201110049558 CN 201110049558 A CN201110049558 A CN 201110049558A CN 102110167 B CN102110167 B CN 102110167B
Authority
CN
China
Prior art keywords
log
journal
log information
control system
information management
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
CN 201110049558
Other languages
Chinese (zh)
Other versions
CN102110167A (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.)
Shanghai Naikai Technology Co ltd
SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO LTD
Original Assignee
Shanghai Weihong Electronic Technology 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 Shanghai Weihong Electronic Technology Ltd filed Critical Shanghai Weihong Electronic Technology Ltd
Priority to CN 201110049558 priority Critical patent/CN102110167B/en
Publication of CN102110167A publication Critical patent/CN102110167A/en
Application granted granted Critical
Publication of CN102110167B publication Critical patent/CN102110167B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method for implementing log information management in a numerical control system. The method comprises log storage operation and log reading operation, wherein in the log storage operation, log entry objects are generated according to the log information and stored in a log cache region, and the log entry objects in the log cache region are periodically written into a log file to implement storage; and in the log reading operation, a log display unit drives a file management unit to read the latest log entry object in the log file and write the latest log entry object into a log source, and then the log display unit reads the log entry objects in the log source. By using the method, lightweight storage and efficient application of a large amount of logs can be conveniently implemented, so that the efficient log information management method is provided for further development of the numerical control system.

Description

Realize the method for log information management in the digital control system
Technical field
The present invention relates to the industry control automatic field, particularly the management method field of digital control system specifically is meant the method that realizes log information management in a kind of digital control system.
Background technology
In recent years, the numerically-controlled machine industry had realized super-speed development, and meanwhile, the digital control system that is applied to numerically-controlled machine is also constantly improved raising.Log information management is a critical function in the digital control system, and outstanding log information management method can allow the function of digital control system more powerful, uses more conveniently, and whole digital control system is had significant values.But also owing to the continuous development and perfection of numerically-controlled machine, the operation of its software and hardware is more frequent, produce a large amount of log informations thus and need record, traditional log information management method, be difficult to handle so a large amount of daily record, the difficulty that can cause log store and application facet forms the bottleneck that digital control system develops.
Summary of the invention
The objective of the invention is to have overcome above-mentioned shortcoming of the prior art, provide a kind of and be convenient to log store and daily record and use, realize the management of the efficient and lightweight of daily record, the range of application method of realization log information management in the digital control system comparatively widely.
In order to realize above-mentioned purpose, realize in the digital control system of the present invention that the method for log information management comprises log store operation and daily record read operation, described log store operation may further comprise the steps:
(11) the log information management module in the digital control system obtains from the hardware module of digital control system and the log information of port module;
(12) described log information management module generates the journal entries object according to the log information that is obtained;
(13) described log information management module writes the log buffer district with described journal entries object;
(14) file management unit of described log information management module regularly reads the journal entries object in the described log buffer district;
(15) described file management unit writes journal file with the journal entries object that is read,
Described daily record read operation may further comprise the steps:
(21) the journal displaying unit of log information management module obtains a daily record and upgrades and to finish message, and drives described file management unit and read journal entries object up-to-date in the described journal file;
(22) described file management unit writes Log Source with the journal entries object that is read;
(23) described journal displaying unit reads the journal entries object in the described Log Source.
Realize in this digital control system that described journal entries object comprises daily record numbering, daily record time and daily record text message in the method for log information management.
Realize in this digital control system that each journal entries object is by daily record time order and function series arrangement in the described journal file in the method for log information management.
Realize in this digital control system that described method in step (23) afterwards, and is further comprising the steps of: other application module of (24) digital control system reads the journal entries object in the journal displaying unit in the method for log information management.
Realize in the method for log information management in this digital control system, described log information management module has the outside port unit, described step (11) specifically is meant: the log information management module obtains from the hardware module of digital control system and the log information of port module by described outside port unit, and described step (24) specifically is meant: other application module of digital control system reads journal entries object in the journal displaying unit by described outside port unit.
Realize in this digital control system in the method for log information management that described log information management module utilizes other module in case mechanism and the described digital control system to realize data transfer.Described step (15) afterwards, and is further comprising the steps of: (16) described file management unit is utilized case mechanism to send daily record renewal to described journal displaying unit and is finished message.
Realize in this digital control system that described log buffer district moves a thread synchronization signal in the method for log information management, described thread synchronization signal is only carried out single writing thread or read thread at one time in order to control described log buffer district.
Realize in this digital control system that described step (14) specifically may further comprise the steps in the method for log information management:
(14-1) event thread is waited in described file management unit operation one;
(14-2) when the waiting event thread finishes, whether described file management unit is inquired about described log buffer district change, if change is arranged, then enters step (14-3), if do not change, then returns step (14-1);
(14-3) described file management unit reads the journal entries object in the described log buffer district, and enters step (15).
Realize in this digital control system that described step (15) specifically may further comprise the steps in the method for log information management:
(15-1) whether the current journal file of described file management unit real-time judge reaches the size of systemic presupposition;
(15-2) if reach, then described file management unit backs up current journal file, creates new journal file, and the journal entries object that is read is write new journal file;
(15-3) if do not reach, then described file management unit writes current journal file with the journal entries object that is read.
Adopted the method that realizes log information management in the digital control system of this invention, it comprises log store operation and daily record read operation, the log store operation generates log information the journal entries object and deposits the log buffer district in, regularly the journal entries object in the log buffer district is write journal file and realizes storage; In the daily record read operation, journal displaying unit drives file management unit reads journal entries object up-to-date in the journal file and writes Log Source, and the journal displaying unit reads the journal entries object in the Log Source more then.Utilize this method can realize easily, thereby provide a kind of effective log information management method for further developing of digital control system for storage of the lightweight of a large amount of daily records and efficient application.
Description of drawings
Fig. 1 is a process flow diagram of realizing the method for log information management in the digital control system of the present invention.
Fig. 2 is a structured flowchart of realizing the applied log information management module of method of log information management in the digital control system of the present invention.
Embodiment
In order more to be expressly understood technology contents of the present invention, describe in detail especially exemplified by following examples.
See also shown in Figure 1ly, be to realize in the digital control system of the present invention the process flow diagram of the method for log information management.
In one embodiment, realize in the described digital control system that the method for log information management comprises log store operation and daily record read operation, described log store operation may further comprise the steps:
(11) the log information management module in the digital control system obtains from the hardware module of digital control system and the log information of port module;
(12) described log information management module generates the journal entries object according to the log information that is obtained;
(13) described log information management module writes the log buffer district with described journal entries object;
(14) file management unit of described log information management module regularly reads the journal entries object in the described log buffer district;
(15) described file management unit writes journal file with the journal entries object that is read,
Described daily record read operation may further comprise the steps:
(21) the journal displaying unit of log information management module obtains a daily record and upgrades and to finish message, and drives described file management unit and read journal entries object up-to-date in the described journal file;
(22) described file management unit writes Log Source with the journal entries object that is read;
(23) described journal displaying unit reads the journal entries object in the described Log Source.
In a kind of more preferably embodiment, described journal entries object comprises daily record numbering, daily record time and daily record text message.Each journal entries object is by daily record time order and function series arrangement in the described journal file.
More preferably in the embodiment, described method in step (23) afterwards, and is further comprising the steps of: other application module of (24) digital control system reads the journal entries object in the journal displaying unit at another kind.
In a kind of further preferred embodiment, described log information management module has the outside port unit, described step (11) specifically is meant: the log information management module obtains from the hardware module of digital control system and the log information of port module by described outside port unit, and described step (24) specifically is meant: other application module of digital control system reads journal entries object in the journal displaying unit by described outside port unit.
A kind of preferred embodiment in, described log information management module utilizes other module in case mechanism and the described digital control system to realize data transfer.
In preferred embodiment, described step (15) afterwards, and is further comprising the steps of: (16) described file management unit is utilized case mechanism to send daily record renewal to described journal displaying unit and is finished message.
In another preferred embodiment, described log buffer district moves a thread synchronization signal, and described thread synchronization signal is only carried out single writing thread or read thread at one time in order to control described log buffer district.
In a kind of preferred embodiment, described step (14) specifically may further comprise the steps:
(14-1) event thread is waited in described file management unit operation one;
(14-2) when the waiting event thread finishes, whether described file management unit is inquired about described log buffer district change, if change is arranged, then enters step (14-3), if do not change, then returns step (14-1);
(14-3) described file management unit reads the journal entries object in the described log buffer district, and enters step (15).
In the preferred embodiment of another kind, described step (15) specifically may further comprise the steps:
(15-1) whether the current journal file of described file management unit real-time judge reaches the size of systemic presupposition;
(15-2) if reach, then described file management unit backs up current journal file, creates new journal file, and the journal entries object that is read is write new journal file;
(15-3) if do not reach, then described file management unit writes current journal file with the journal entries object that is read.
In an application of the invention, the method for realization log information management generally includes following content in the digital control system of the present invention:
1, encapsulation journal entries object, journal entries is the object of the log information of encapsulation, comprises the numbering of daily record, the time of daily record, the information such as text that daily record need show.
2, the core operation to journalizing partly is encapsulated in the log information management module.As shown in Figure 2, mainly comprise Log Source in the log information management module, log buffer district, external interface, the incident of adding new daily record, thread synchronization signal, file operation thread and other correlation function.Reading and writing of files information, log information management methods such as additions and deletions journal entries information are carried out in each functional unit combination.Log Source and log buffer district are used to deposit the journal entries object, and external interface is an interface that provides at other called side.The incident of adding new daily record is to need notified module at other when new daily record produces.The thread synchronization signal is used to guarantee that the log buffer district has only a thread to operate on it at synchronization.
3, the daily record information management module at first reads the log information of fixedly journal entries object up-to-date in the local log file during program start, and it is kept at the journal displaying district.The program other parts can be by the log information of external interface usage log viewing area.
4, daily record called side, as hardware and port section because operation when occurring needing to preserve data message, it imports related data into to the daily record information management module by external interface, and the log information management module becomes the journal entries object with the data encapsulation that transmits and is kept in the log buffer district.Whether the file operation thread is used for detecting the log buffer district Data Update, when Data Update is arranged, just data is write in the journal file of local hard drive.
5, the incident of adding new daily record with triggering is imported in new daily record into, and event notice is subscribed to the module of this incident, so that upgrade the demonstration of daily record data.
6, use the circulation thread based on waiting event, the function of a similar timer detects the log buffer district every the set time, if data are arranged in the buffer area then data are write in the local hard drive journal file.If file has reached the size of setting, the current journal file of automated back-up then, and create a new new journal file.
Adopted the method that realizes log information management in the digital control system of this invention, it comprises log store operation and daily record read operation, the log store operation generates log information the journal entries object and deposits the log buffer district in, regularly the journal entries object in the log buffer district is write journal file and realizes storage; In the daily record read operation, journal displaying unit drives file management unit reads journal entries object up-to-date in the journal file and writes Log Source, and the journal displaying unit reads the journal entries object in the Log Source more then.Utilize this method can realize easily, thereby provide a kind of effective log information management method for further developing of digital control system for storage of the lightweight of a large amount of daily records and efficient application.
In this instructions, the present invention is described with reference to its certain embodiments.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, instructions and accompanying drawing are regarded in an illustrative, rather than a restrictive.

Claims (6)

1. realize the method for log information management in the digital control system, it is characterized in that described method comprises log store operation and daily record read operation, described log store is operated and be may further comprise the steps:
(11) the log information management module in the digital control system obtains from the hardware module of digital control system and the log information of port module;
(12) described log information management module generates the journal entries object according to the log information that is obtained, and described journal entries object comprises daily record numbering, daily record time and daily record text message;
(13) described log information management module writes the log buffer district with described journal entries object;
(14) file management unit of described log information management module regularly reads the journal entries object in the described log buffer district;
(15) described file management unit writes journal file with the journal entries object that is read,
Described daily record read operation may further comprise the steps:
(21) the journal displaying unit of log information management module obtains a daily record and upgrades and to finish message, and drives described file management unit and read journal entries object up-to-date in the described journal file;
(22) described file management unit writes Log Source with the journal entries object that is read;
(23) described journal displaying unit reads the journal entries object in the described Log Source;
(24) other application module of digital control system reads the journal entries object in the journal displaying unit;
Described log information management module utilizes other module in case mechanism and the described digital control system to realize data transfer;
Described log buffer district moves a thread synchronization signal, and described thread synchronization signal is only carried out single writing thread or read thread at one time in order to control described log buffer district.
2. realize the method for log information management in the digital control system according to claim 1, it is characterized in that each journal entries object is by daily record time order and function series arrangement in the described journal file.
3. realize the method for log information management in the digital control system according to claim 1, it is characterized in that described log information management module has the outside port unit, described step (11) specifically is meant:
The log information management module obtains from the hardware module of digital control system and the log information of port module by described outside port unit,
Described step (24) specifically is meant:
Other application module of digital control system reads journal entries object in the journal displaying unit by described outside port unit.
4. realize the method for log information management in the digital control system according to claim 1, it is characterized in that described step (15) is afterwards, and is further comprising the steps of:
(16) described file management unit is utilized case mechanism to send daily record renewal to described journal displaying unit and is finished message.
5. realize the method for log information management in the digital control system according to claim 1, it is characterized in that described step (14) specifically may further comprise the steps:
(14-1) event thread is waited in described file management unit operation one;
(14-2) when the waiting event thread finishes, whether described file management unit is inquired about described log buffer district change, if change is arranged, then enters step (14-3), if do not change, then returns step (14-1);
(14-3) described file management unit reads the journal entries object in the described log buffer district, and enters step (15).
6. realize the method for log information management in the digital control system according to claim 1, it is characterized in that described step (15) specifically may further comprise the steps:
(15-1) whether the current journal file of described file management unit real-time judge reaches the size of systemic presupposition;
(15-2) if reach, then described file management unit backs up current journal file, creates new journal file, and the journal entries object that is read is write new journal file;
(15-3) if do not reach, then described file management unit writes current journal file with the journal entries object that is read.
CN 201110049558 2011-03-01 2011-03-01 Method for implementing log information management in numerical control system Active CN102110167B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110049558 CN102110167B (en) 2011-03-01 2011-03-01 Method for implementing log information management in numerical control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110049558 CN102110167B (en) 2011-03-01 2011-03-01 Method for implementing log information management in numerical control system

Publications (2)

Publication Number Publication Date
CN102110167A CN102110167A (en) 2011-06-29
CN102110167B true CN102110167B (en) 2013-07-31

Family

ID=44174328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110049558 Active CN102110167B (en) 2011-03-01 2011-03-01 Method for implementing log information management in numerical control system

Country Status (1)

Country Link
CN (1) CN102110167B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5906721B2 (en) * 2011-12-26 2016-04-20 株式会社リコー External output device, log collection method for external output device, and program
CN103294570B (en) * 2012-02-23 2015-11-04 深圳市腾讯计算机系统有限公司 A kind of backup method of internal storage data and device
CN103064905B (en) * 2012-12-18 2016-04-20 武汉华中数控股份有限公司 A kind of blog management method of digital control system
CN103530255B (en) * 2013-10-12 2017-01-11 北京奇虎科技有限公司 Distributed asynchronous event processing method and system
CN105629862B (en) * 2014-11-05 2020-03-17 同方威视技术股份有限公司 Real-time log recording method of control equipment based on PLC
KR102040271B1 (en) * 2014-12-12 2019-11-04 삼성전자주식회사 Terminal apparatus and method for search contents
CN105701237A (en) * 2016-02-23 2016-06-22 无锡中科富农物联科技有限公司 Web access log processing method
CN105975376A (en) * 2016-04-28 2016-09-28 广州市锲致智能技术有限公司 Log processing based numerical control system security processing method
CN106681819B (en) * 2016-12-29 2020-11-06 杭州迪普科技股份有限公司 Thread processing method and device
CN106951488B (en) * 2017-03-14 2021-03-12 海尔优家智能科技(北京)有限公司 Log recording method and device
CN112783903B (en) * 2019-11-07 2024-04-05 北京沃东天骏信息技术有限公司 Method and device for generating update log

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932812A (en) * 2005-09-16 2007-03-21 腾讯科技(深圳)有限公司 Method and apparatus for holding journal
CN101646140A (en) * 2008-08-05 2010-02-10 中兴通讯股份有限公司 Message log processing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4295333B2 (en) * 2007-05-18 2009-07-15 株式会社日立製作所 Database control method and program
CN101907879B (en) * 2010-03-12 2012-07-04 大连理工大学 Industrial control network redundancy fault-tolerant system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1932812A (en) * 2005-09-16 2007-03-21 腾讯科技(深圳)有限公司 Method and apparatus for holding journal
CN101646140A (en) * 2008-08-05 2010-02-10 中兴通讯股份有限公司 Message log processing method and system

Also Published As

Publication number Publication date
CN102110167A (en) 2011-06-29

Similar Documents

Publication Publication Date Title
CN102110167B (en) Method for implementing log information management in numerical control system
CN106095620B (en) A kind of development approach of built-in Linux partition holding
CN101719149B (en) Data synchronization method and device
CN102508784B (en) Data storage method of flash memory card in video monitoring equipment, and system thereof
CN102567146B (en) Log backup method and device and smart card
CN101252640B (en) Method for writing sequence number to set top box
CN103780638A (en) Data synchronization method and system
CN103412803A (en) Data recovering method and device
CN103593333A (en) Electronic book document processing method, terminal and electronic equipment
CN102034287A (en) Data management device, data reading method and computer-readable medium
CN105320718B (en) Transaction completion in a synchronous replication environment
CN103856516A (en) Data storage and reading method and data storage and reading device
CN102314368A (en) Method and equipment for updating configuration data of server program
CN103544076B (en) A kind of data back up method and device
CN104216802A (en) Memory database recovery method and device
CN110162563B (en) Data warehousing method and system, electronic equipment and storage medium
CN103488695A (en) Data synchronizing device and data synchronizing method
CN101582015B (en) Control device, external storage device and their control methods
CN101187936B (en) A log data storage method and device
CN101527751A (en) Method for recording mobile phone information and mobile phone
CN103823634A (en) Data processing method and system supporting non-random write mode
CN104102552A (en) Message processing method and device
CN102722456A (en) Flash memory device and data writing method thereof
CN101866692B (en) Method for writing to and erasing a non-volatile memory
JP2016081301A (en) Programmable logic controller, system, control method, and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Free format text: FORMER OWNER: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

Effective date: 20120627

Owner name: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: SHANGHAI NAIKAI ELECTRONIC SCIENCE AND TECHNOLOGY CO., LTD.

Effective date: 20120627

Owner name: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: SHANGHAI WEIHONG TECHNOLOGYCO., LTD.

Effective date: 20120627

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20120627

Address after: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Applicant after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Applicant before: Shanghai Naikai Technology Co.,Ltd.

Co-applicant before: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Effective date of registration: 20120627

Address after: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Applicant after: Shanghai Naikai Technology Co.,Ltd.

Co-applicant after: SHANGHAI WEIHONG ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 201108, No. 2338, No. 29 Enterprise Park, headquarter, Shanghai Road, Minhang District

Applicant before: Shanghai Naikai Technology Co.,Ltd.

Co-applicant before: Shanghai Weihong Electronic Technology Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant