CN102508765A - Method for monitoring software log in real time by inter-process communication - Google Patents

Method for monitoring software log in real time by inter-process communication Download PDF

Info

Publication number
CN102508765A
CN102508765A CN2011103656273A CN201110365627A CN102508765A CN 102508765 A CN102508765 A CN 102508765A CN 2011103656273 A CN2011103656273 A CN 2011103656273A CN 201110365627 A CN201110365627 A CN 201110365627A CN 102508765 A CN102508765 A CN 102508765A
Authority
CN
China
Prior art keywords
software
daily record
log
interprocess communication
real time
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
CN2011103656273A
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.)
Shenzhen ZTE Mobile Telecom Co Ltd
Original Assignee
Shenzhen ZTE Mobile Telecom Co 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 Shenzhen ZTE Mobile Telecom Co Ltd filed Critical Shenzhen ZTE Mobile Telecom Co Ltd
Priority to CN2011103656273A priority Critical patent/CN102508765A/en
Publication of CN102508765A publication Critical patent/CN102508765A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method for monitoring a software log in real time by inter-process communication. The method comprises the following steps of: starting log software, and establishing an inter-process communication channel between the log software and target software; generating the log by the target software; transmitting the log to the log software through the inter-process communication channel between the target software and the log software; and receiving the log by the log software in real time, and outputting the log to a user. According to the method, the step of generating the log can be eliminated automatically under the condition that the log software does not run by adopting a mode of independently generating and transmitting the log, so that the influence of a large number of logs on the running of the software is reduced; furthermore, by adopting the inter-process communication, the method is high in weak coupling performance and high in communication performance; and by adopting an independent log client, the method is powerful in capacity of monitoring the log in real time.

Description

A kind of method that realizes the real-time monitoring of software log through interprocess communication
Technical field
The present invention relates to communication technical field, relate in particular to a kind of method that realizes the real-time monitoring of software log through interprocess communication.
Background technology
For realizing tracking to target software running status, flow process etc., be convenient to find or orientation problem, need in target software, embed certain daily record data.Ruuning situation, positioning trip through analyzing daily record data grasp target software are unusual.
At present; Use traditional logs such as system journal, standard I/O output or file journalization record, the diary of above-mentioned record object software all has more defective; Can not well show and analyze daily record in real time; Daily record for running software when unusual can not be found very in time, the also difficult real-time follow-up of problem that produces for some softwares; Can not be like system journal than the comprehensive collection daily record; Standard I/O can only export text and difficulty is analyzed the daily record that produces; File journalization has bigger performance impact to software.
Summary of the invention
The object of the present invention is to provide a kind of method of monitoring in real time through interprocess communication realization software log, have the characteristics of real-time analysis and monitoring.
The objective of the invention is to realize through following technical scheme.
A kind of method of monitoring in real time through interprocess communication realization software log comprises:
Starting log software is set up daily record software and target software interprocess communication passage;
Target software generates daily record;
Interprocess communication passage through between target software and daily record software passes to daily record software with daily record;
Daily record software receives daily record in real time, and exports to the user.
Preferably, said interprocess communication comprises the message pipeline, message queue, and semaphore is shared storage or socket SOCKET.
Preferably, said shared storage comprises shared drive and shared file.
Preferably, when said interprocess communication is the shared drive mode, specifically comprise:
A: starting log software creation shared drive and the synchronizing signal amount that is used for shared drive;
B: start target software and open shared drive, obtain the synchronizing signal amount, the interprocess communication passage of foundation and daily record software;
C: target software generates daily record, and daily record is write shared drive, through the generation of signalization amount notice daily record data;
D: the daily record software detection is to the signal of semaphore, exports after from shared drive, reading daily record.
Preferably, target software uses the method for serializing to change into binary stream the daily record that generates among the step c, and binary stream is write shared drive.
Preferably, daily record software reads the binary stream in the shared drive in the steps d, is to export after the raw data with the binary stream unserializing.
Preferably, said target software comprises the system software and the application software that can generate daily record.
Preferably, daily record software adopts real-time interface display with the way of output of daily record in the steps d, perhaps specified file storage.
The present invention compared with prior art, the present invention adopts daily record to generate and transmits independent mode, not having to remove daily record generation step running log software under automatically, reduces the influence of a large amount of daily records to running software.Adopt interprocess communication, good weak coupling and communication performance are arranged.Adopt independently daily record client, have the real-time monitoring capacity of powerful daily record.
Description of drawings
Fig. 1 is the software log of the present invention method flow diagram of monitoring in real time.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
Before introducing the present invention, earlier this notion of interprocess communication is done one and introduce.
Interprocess communication is exactly the mechanism of between different processes, sharing with swap data, and interprocess communication mainly comprises the message pipeline, message queue, and semaphore is shared storage (shared drive and shared file), SOCKET etc.
Message pipeline (anonymous pipeline Anonymous Pipes), named pipes Named Pipes): be used to be provided with a persistent communication passage between application program, can read and write data as the flat file of application access of oneself through this passage.Anonymous pipeline: uniflux, and be merely able between each process on the same computer, flow.Named pipes: two-way flow, any process can be caught easily, and the data of putting pipeline into have set form, can only read this big or small multiple.
Message queue is exactly a chained list of message, and it allows one or more processes to write message to it, and one or more processes are therefrom read message.Message queue manager is acted as an intermediary when message being relayed to its target from its source.The fundamental purpose of formation provides route and guarantees the transmission of message; If the recipient is unavailable when sending message, message queue meeting reservation message is up to can successfully transmitting it.
Signal (Signals) amount is that operating system is come notification process through signal.Certain pre-specified incident (one group incident in one) has taken place in the system, and it also is communication and synchronous a kind of original mechanism between the consumer process.Arranged: generate and transmit two stages in the life cycle of a signal.When an incident takes place, need notify a process, at this moment generate a signal.When process identifies the arrival of signal, just take appropriate action to transmit or processing signals.Arrive and between process handled signal, signal was hung up on process at signal.
Shared drive is usually by a process creation, and all the other processes are read and write this piece memory field.For shared drive, system can't do synchronously it, needs program oneself to come the internal memory of sharing is made synchronous calculating, and thisly many times realizes with semaphore exactly synchronously.Shared file is the same with shared drive, just changes storage medium into file.
SOCKET (socket) can be regarded as the end points (endpoint) of interprocess communication, and the name of each socket all is unique, and other processes can be found, connect and communication with it.Communication domain is used for explaining the agreement of socket communication, and different communication domain has the address structure of different communication protocol and socket etc.
Be example below with the shared drive, realize that software log monitoring in real time comprises:
Starting log software, daily record software have at first been created shared drive and the synchronizing signal that is used for shared drive, and this shared drive representes that with the ID of an agreement other any process can be opened shared drive through this ID.
After starting target software, open shared drive with the ID trial of agreement, do not exist if return shared drive, just close all daily records outputs, the output of daily record just can not influence the performance of target software like this; After opening the shared drive success, obtain the synchronous semaphore of shared drive, the striding course communication port of target software and daily record software is just set up and is accomplished like this.
Target software generates daily record, uses the method for serializing to change into binary stream daily record data, and binary stream is write shared drive, then the generation of signalization amount notice daily record data.
The daily record software detection reads the binary stream of daily record to the signal of semaphore from shared drive, export after the unserializing.The mode of its output can perhaps be specified certain file storage for showing on the interface in real time, and the content of concrete output can be screened or do not carry out any screening according to user's requirement.
Wherein, target software comprises the system software and the application software that can generate daily record, and daily record software is the software that ability receiving target software generates daily record.
Below in conjunction with accompanying drawing and embodiment the present invention is done further detailed description:
See also Fig. 1, this figure realizes the real-time monitor procedure of software log through interprocess communication, may further comprise the steps:
Step 101 ~ 103: behind the starting log software; By good shared drive of daily record software creation and the synchronizing signal that is used for shared drive; Be used for interprocess communication, this shared drive is that unique ID representes with one in total system, and other any process can be communicated by letter with it through this ID.
Step 104 ~ 106: start target software, target software is attempted opening shared drive with the ID of agreement, does not exist if return shared drive, just closes all daily record outputs; After opening the shared drive success, obtain the synchronous semaphore of shared drive, the interprocess communication passage of foundation and daily record software.
Step 107 ~ 109: target software uses the method for serializing to change into binary stream the daily record that generates, and binary stream is write shared drive, then the generation of signalization amount notice daily record data.
Step 110 ~ 112: the daily record software detection finds to have daily record to generate to the signal of semaphore.Reading the binary stream in the shared drive, is to export after the raw data with the binary stream unserializing, and daily record software has been accomplished the process that from shared drive, reads and reduce daily record like this.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a method of monitoring in real time through interprocess communication realization software log is characterized in that, comprising:
Starting log software is set up daily record software and target software interprocess communication passage;
Target software generates daily record;
Interprocess communication passage through between target software and daily record software passes to daily record software with daily record;
Daily record software receives daily record in real time, and exports to the user.
2. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 1 is characterized in that said interprocess communication comprises the message pipeline, message queue, and semaphore is shared storage or socket SOCKET.
3. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 2 is characterized in that said shared storage comprises shared drive and shared file.
4. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 3 is characterized in that, when said interprocess communication is the shared drive mode, specifically comprises:
A: starting log software creation shared drive and the synchronizing signal amount that is used for shared drive;
B: start target software and open shared drive, obtain the synchronizing signal amount, the interprocess communication passage of foundation and daily record software;
C: target software generates daily record, and daily record is write shared drive, through the generation of signalization amount notice daily record data;
D: the daily record software detection is to the signal of semaphore, exports after from shared drive, reading daily record.
5. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 4 is characterized in that target software uses the method for serializing to change into binary stream the daily record that generates among the step c, and binary stream is write shared drive.
6. as claimed in claim 5ly realizing the software log method of monitoring in real time through interprocess communication, it is characterized in that daily record software reads the binary stream in the shared drive in the steps d, is to export after the raw data with the binary stream unserializing.
7. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 1 is characterized in that said target software comprises the system software and the application software that can generate daily record.
8. the method for monitoring in real time through interprocess communication realization software log as claimed in claim 4 is characterized in that daily record software adopts real-time interface display with the way of output of daily record in the steps d, perhaps specified file storage.
CN2011103656273A 2011-11-17 2011-11-17 Method for monitoring software log in real time by inter-process communication Pending CN102508765A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103656273A CN102508765A (en) 2011-11-17 2011-11-17 Method for monitoring software log in real time by inter-process communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103656273A CN102508765A (en) 2011-11-17 2011-11-17 Method for monitoring software log in real time by inter-process communication

Publications (1)

Publication Number Publication Date
CN102508765A true CN102508765A (en) 2012-06-20

Family

ID=46220857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103656273A Pending CN102508765A (en) 2011-11-17 2011-11-17 Method for monitoring software log in real time by inter-process communication

Country Status (1)

Country Link
CN (1) CN102508765A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164359A (en) * 2013-01-29 2013-06-19 北京雪迪龙科技股份有限公司 Method and device of pipeline communication
CN103345411A (en) * 2013-07-09 2013-10-09 北京奇虎科技有限公司 Method and device for uninstalling application program
CN103838624A (en) * 2013-12-16 2014-06-04 浪潮电子信息产业股份有限公司 Log processing method based on Linux message queue
CN103970593A (en) * 2013-01-30 2014-08-06 云联(北京)信息技术有限公司 Multi-process interaction method and system
CN104050074A (en) * 2013-03-12 2014-09-17 ***股份有限公司 Method and device for asynchronously recording log in system
CN104331358A (en) * 2014-10-30 2015-02-04 上海斐讯数据通信技术有限公司 Test management system and method
CN104410687A (en) * 2014-11-26 2015-03-11 上海爱数软件有限公司 Method for transmitting data among multiple groups of courses on basis of pipe
CN108255674A (en) * 2017-12-31 2018-07-06 广东欧珀移动通信有限公司 multi-process browser process log collecting method, device and mobile terminal
CN108540477A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 The method and relevant device of data communication
CN110704209A (en) * 2019-09-20 2020-01-17 江苏未来智慧信息科技有限公司 Data mining analysis platform based on PIPE communication
CN111078523A (en) * 2019-12-25 2020-04-28 惠州Tcl移动通信有限公司 Log obtaining method and device, storage medium and electronic equipment
CN112988029A (en) * 2019-12-17 2021-06-18 中标软件有限公司 Method for realizing starting soft keyboard of login interface

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0790559A1 (en) * 1996-02-14 1997-08-20 Hitachi, Ltd. Method of monitoring a computer system, featuring performance data distribution to plural monitoring processes
JPH11149383A (en) * 1997-11-17 1999-06-02 Toshiba Tec Corp Inter-process communication controller
CN1567248A (en) * 2003-07-01 2005-01-19 华为技术有限公司 Log recording method and system for application program
CN101707633A (en) * 2009-11-27 2010-05-12 山东中创软件商用中间件股份有限公司 Message-oriented middleware persistent message storing method based on file system
CN101963924A (en) * 2010-10-21 2011-02-02 深圳创维-Rgb电子有限公司 Process communication method, device and operating system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0790559A1 (en) * 1996-02-14 1997-08-20 Hitachi, Ltd. Method of monitoring a computer system, featuring performance data distribution to plural monitoring processes
JPH11149383A (en) * 1997-11-17 1999-06-02 Toshiba Tec Corp Inter-process communication controller
CN1567248A (en) * 2003-07-01 2005-01-19 华为技术有限公司 Log recording method and system for application program
CN101707633A (en) * 2009-11-27 2010-05-12 山东中创软件商用中间件股份有限公司 Message-oriented middleware persistent message storing method based on file system
CN101963924A (en) * 2010-10-21 2011-02-02 深圳创维-Rgb电子有限公司 Process communication method, device and operating system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164359A (en) * 2013-01-29 2013-06-19 北京雪迪龙科技股份有限公司 Method and device of pipeline communication
CN103970593A (en) * 2013-01-30 2014-08-06 云联(北京)信息技术有限公司 Multi-process interaction method and system
CN104050074A (en) * 2013-03-12 2014-09-17 ***股份有限公司 Method and device for asynchronously recording log in system
CN103345411A (en) * 2013-07-09 2013-10-09 北京奇虎科技有限公司 Method and device for uninstalling application program
CN103838624A (en) * 2013-12-16 2014-06-04 浪潮电子信息产业股份有限公司 Log processing method based on Linux message queue
CN104331358A (en) * 2014-10-30 2015-02-04 上海斐讯数据通信技术有限公司 Test management system and method
CN104410687A (en) * 2014-11-26 2015-03-11 上海爱数软件有限公司 Method for transmitting data among multiple groups of courses on basis of pipe
CN104410687B (en) * 2014-11-26 2018-01-19 上海爱数信息技术股份有限公司 A kind of multigroup inter-process data transmission method based on pipeline
CN108255674A (en) * 2017-12-31 2018-07-06 广东欧珀移动通信有限公司 multi-process browser process log collecting method, device and mobile terminal
CN108540477A (en) * 2018-04-13 2018-09-14 腾讯科技(成都)有限公司 The method and relevant device of data communication
CN110704209A (en) * 2019-09-20 2020-01-17 江苏未来智慧信息科技有限公司 Data mining analysis platform based on PIPE communication
CN112988029A (en) * 2019-12-17 2021-06-18 中标软件有限公司 Method for realizing starting soft keyboard of login interface
CN111078523A (en) * 2019-12-25 2020-04-28 惠州Tcl移动通信有限公司 Log obtaining method and device, storage medium and electronic equipment
CN111078523B (en) * 2019-12-25 2024-02-09 惠州Tcl移动通信有限公司 Log acquisition method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN102508765A (en) Method for monitoring software log in real time by inter-process communication
CN111787066B (en) Internet of things data platform based on big data and AI
Huang et al. Application traffic classification at the early stage by characterizing application rounds
CN107465690B (en) A kind of passive type abnormal real-time detection method and system based on flow analysis
CN101099345B (en) Interpreting an application message at a network element using sampling and heuristics
US20140189104A1 (en) System And Method For Continuous Low-Overhead Monitoring Of Distributed Applications Running On A Cluster Of Data Processing Nodes
CN107818120A (en) Data processing method and device based on big data
CN102394796A (en) Link time delay detection method, source terminal, destination terminal and system
CN101242408B (en) A construction method for open multi-source data packet capturing
CN111241049B (en) Distributed operation log realization system based on micro-service architecture
CN102497297A (en) System and method for realizing deep packet inspection technology based on multi-core and multi-thread
CN107357804A (en) The analysis system and method for internet finance massive logs
CN109542750A (en) Distributed information log system
WO2012022083A1 (en) Method for transmitting expression file and terminal equipment
CN108389131A (en) A kind of financial system micro services transaction monitoring implementation method
CN106412513A (en) Video processing system and processing method
CN108712306A (en) A kind of information system automation inspection platform and method for inspecting
CN116582365A (en) Network traffic safety control method and device and computer equipment
CN108769084B (en) Processor and firewall
Gorton et al. The medici integration framework: A platform for high performance data streaming applications
CN108156230B (en) Real-time data synchronization method, system and framework
CN115982234A (en) Method for tracking distributed architecture link based on micro-service
CN113688385B (en) Lightweight distributed intrusion detection method
CN102185705B (en) Intranet video file monitoring method based on information reduction
CN115391429A (en) Time sequence data processing method and device based on big data cloud computing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120620