[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN102541850A - Methods and devices and systems for obtaining and uploading log records - Google Patents

Methods and devices and systems for obtaining and uploading log records Download PDF

Info

Publication number
CN102541850A
CN102541850A CN2010105806798A CN201010580679A CN102541850A CN 102541850 A CN102541850 A CN 102541850A CN 2010105806798 A CN2010105806798 A CN 2010105806798A CN 201010580679 A CN201010580679 A CN 201010580679A CN 102541850 A CN102541850 A CN 102541850A
Authority
CN
China
Prior art keywords
record
log
daily record
request
log record
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
CN2010105806798A
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.)
Beijing North Microelectronics Co Ltd
Original Assignee
Beijing North Microelectronics 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 Beijing North Microelectronics Co Ltd filed Critical Beijing North Microelectronics Co Ltd
Priority to CN2010105806798A priority Critical patent/CN102541850A/en
Publication of CN102541850A publication Critical patent/CN102541850A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for obtaining log records, a method and a device for uploading the log records, and a system for obtaining the log records. The method for obtaining the log records comprises the steps of: sending a log start-stop time request to a lower computer; receiving the total quantity of the log records sent by the lower computer, wherein the total quantity of the log records is obtained by the lower computer according to the log record start-stop time request and locally-stored log files; obtaining the quantity of log data packets according to the total number of the log records and the number of preset monopack records; and sequentially sending a data request to the lower computer according to the number of the log data packets and obtaining log data packets generated by packaging the log records from the lower computer. According to the invention, the operation of a user is facilitated, and logs are avoided being checked and exported directly on the lower computer by the user, thus potential safety hazards caused to a system by directly operating the lower computer are eliminated.

Description

The obtaining of log record, method for uploading and device and system
Technical field
The present invention relates to the process monitoring technical field, particularly relate to the obtaining of log record, method for uploading and device and system.
Background technology
In the semiconductor production field, the software architecture of technology controlling and process comprises slave computer Control Software and PC control software two parts.The slave computer Control Software is directly in the face of process equipment, and it operates serial equipment and Devicenet equipment through industrial computer, and is directly mutual with equipment, responsible to process treatment process control, data parameters in the recording process process.PC control software is mutual with the slave computer Control Software, through automatic production to slave computer Control Software sending controling instruction opertaing device, and realize data acquisition, the functions such as processing, plant maintenance operation of reporting to the police, and the integrated function of data monitoring.
The PC control running software is on a common PC, and running environment is in the windows system; The slave computer Control Software operates on the industrial computer, and running environment is the linux system.Connect through Ethernet between the two, also can connect, and adopt the mode of network communication engine (ICE, Internet Communications Engine) to realize communication through data line.
In many functions of slave computer Control Software, log record is a kind of crucial function.The slave computer Control Software is responsible for the generation of log record, and the form of journal file with text existed on the slave computer.Log record controlled plant in the various information in when operation, these information are main foundations of tracking equipment operational process and emergency review.Journal file mostly comes preservation information according to set form, and every log record generally will comprise: writing time, write down title, class information and the log content etc. of the module (or subsystem) of this daily record.
Write down the action in each step of equipment in the journal file, operating personnel can come the investigation problem and safeguard board through checking journal file, also can issue equipment vendors to journal file, come investigation problem and problem analysis reason by manufacturer.So the preservation of log record, to check and derive be very necessary.
In the prior art, journal file is kept on the slave computer, because slave computer is the linux system, checks that daily record and derivation daily record are all very inconvenient.And lower computer system is the core place of software systems, and misoperation can cause irreversible loss to system, and security causes anxiety.Common, check that journal file must provide the login username and the password of slave computer to producers, makes troubles to the user.
In a word, need the urgent technical matters that solves of those skilled in the art to be exactly: how the obtaining of a kind of log information, method for uploading can be provided, can make things convenient for the user to check log record, ensure the security of slave computer simultaneously.
Summary of the invention
Technical matters to be solved by this invention provides the obtaining of a kind of log record, method for uploading and device and system, to solve the problem of checking and deriving the daily record inconvenience in the prior art and bring potential safety hazard to slave computer.
In order to address the above problem, the invention discloses a kind of acquisition methods of log record, comprising:
The request of daily record beginning and ending time is sent to slave computer;
Receive the log record total number that slave computer sends, said log record total number is obtained according to request of said daily record beginning and ending time and local stored log file by slave computer;
According to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Number according to the daily record data bag is sent request of data to slave computer successively, and obtains each daily record data bag that is generated by the log record packing from slave computer.
Preferably, according to said log record total number with preset the number that single bag record strip number obtains the daily record data bag, be specially: said log record total number is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of daily record data bag.
Preferably, send request of data to slave computer successively according to the number of daily record data bag, and obtain each daily record data bag, be specially from slave computer:
The request of data of sending the daily record data bag to slave computer, and request number of times added up one; Receive the daily record data bag of slave computer according to the request of data foldback; Wherein, circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, receives last daily record data bag this moment.
Preferably, said after slave computer obtains each daily record data bag that is generated by the log record packing, also comprise: each daily record data bag that will get access to resolves to each bar log record, and through the paging control log record is carried out Pagination Display.
Preferably, said after slave computer obtains each daily record data bag that is generated by the log record packing, also comprise: each daily record data bag that will get access to is directed in the local storage unit of host computer.
In addition, the invention also discloses a kind of method for uploading of log record, comprising:
Receive the daily record beginning and ending time request that host computer sends;
Request of daily record beginning and ending time and local stored log file according to receiving obtain log record and log record total number;
Send said log record total number to host computer;
According to the request of data that host computer sends, upload each daily record data bag that generates by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
Preferably, request of daily record beginning and ending time and local stored log file that said foundation receives obtain log record and log record total number, comprising:
Slave computer obtains to ask the log record in the corresponding journal file with the said beginning and ending time according to the name of journal file; Wherein, said journal file was named according to the date;
The number addition of log record in resulting each journal file is obtained the log record total number.
Preferably, slave computer obtains also to comprise after the log record total number: according to presetting single bag record strip number, each the bar log record packing in the journal file that obtains is generated each daily record data bag.
Accordingly, the invention also discloses a kind of deriving means of log record, comprising:
The time request transmitting unit is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element, is used to receive the log record total number that slave computer sends, and said log record total number is obtained according to request of said daily record beginning and ending time and local stored log file by slave computer;
The number of data packets acquiring unit is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer.
Preferably; Said number of data packets acquiring unit is according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag; Be specially: said log record total number is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of daily record data bag.
Preferably, said daily record data bag acquiring unit comprises:
Packet request subelement is used for the request of data to slave computer transmission daily record data bag, and request number of times is added up one;
Packet receives subelement, is used to receive the daily record data bag of slave computer according to the request of data foldback;
Wherein, packet request subelement circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, and packet received subelement and received last daily record data bag this moment.
Preferably, said deriving means also comprises:
The log record display unit; Be used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing; Each daily record data bag that gets access to is resolved to each bar log record, and log record is carried out Pagination Display through the paging control.
Preferably, said deriving means also comprises:
The log record lead-out unit is used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing, and each daily record data bag that gets access to is directed in the local storage unit of host computer.
Accordingly, the invention also discloses a kind of device of uploading of log record, comprising:
Time request receiving element is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
Preferably, said daily record bar is counted acquiring unit and is comprised:
Log record obtains subelement, is used for obtaining to ask with the said beginning and ending time according to the name of journal file the log record of corresponding journal file; Wherein, said journal file was named according to the date;
The record strip number obtains subelement, and the number addition of each journal file log record that is used for the log record acquiring unit is obtained obtains the log record total number.
Preferably, said daily record data is wrapped leaflet unit and is comprised:
Log record packing subelement is used for the daily record bar and counts after the acquiring unit acquisition log record total number, and according to presetting single bag record strip number, each the bar log record in the journal file that obtains is packed generates each daily record data bag.
Accordingly, the invention also discloses a kind of system that obtains of log record, comprise slave computer and host computer;
Said host computer comprises the deriving means of log record, and said deriving means comprises:
The time request transmitting unit is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element, is used to receive the log record total number that slave computer sends;
The number of data packets acquiring unit is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer;
Said host computer comprises the device of uploading of log record, and the said device of uploading comprises:
Time request receiving element is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively.
Compared with prior art, the present invention has the following advantages:
The acquisition methods of a kind of log record that the present invention proposes; Host computer obtains the number of daily record data bag according to the log record total number of slave computer foldback; And send request of data to slave computer successively according to the number of daily record data bag, obtain each daily record data bag that generates by the log record packing from slave computer.Through the present invention; Increased the function of host computer; The user through host computer just can be long-range obtain the log record on the slave computer, need not make things convenient for user's operation through the linux operating system of username and password login slave computer; Avoid the user directly on slave computer, to check daily record and derived daily record, eliminated the direct control slave computer and potential safety hazard that system is brought.
Further; The present invention can resolve to each bar log record with each daily record data bag that gets access to, and through the paging control log record is carried out Pagination Display, makes things convenient for the user to check log record; And; When checking daily record, need not to leave the content of daily record in host computer local storage space, without the size of maintenance log.In addition; Each daily record data bag through getting access to imports in the local storage unit of host computer, and the user can derive log record easily, on host computer, carries out this locality and preserves; Then on host computer and slave computer, preserve simultaneously, realized the dual backup of journal file.
Description of drawings
Fig. 1 is the process flow diagram of the acquisition methods embodiment one of a kind of log record of the present invention;
Fig. 2 is the process flow diagram of the method for uploading embodiment of a kind of log record of the present invention;
Fig. 3 is the process flow diagram of the acquisition methods embodiment two of a kind of log record of the present invention;
Fig. 4 is the structural drawing of the deriving means embodiment of a kind of log record of the present invention;
Fig. 5 is the structural drawing of uploading device embodiment of a kind of log record of the present invention;
Fig. 6 is the structural drawing that obtains system embodiment of a kind of log record of the present invention.
Embodiment
For make above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, below in conjunction with accompanying drawing and embodiment the present invention done further detailed explanation.
At first, the log record process of slave computer is specifically introduced.Control program on the slave computer is responsible for carrying out log record, and when operating personnel operated board at every turn, the control program of slave computer and equipment carried out communication.When slave computer and single part equipment normal communication, after single part equipment was carried out corresponding actions according to the control command of slave computer, the control program of slave computer just write down a log content.Afterwards log record is written to a journal file the inside under the slave computer fixed storage address.
In an embodiment of the present invention; The stored log file was named according to the date on the slave computer; Also promptly, it was the file the inside of name with the time on the same day that one day log information is written to one, and the name form of journal file is the mode on " date "; For example, 20101010.txt is exactly whole action messages that write down corresponding board on October 10th, 2010.If this board does not carry out any action in some day, then should the date corresponding file.And; Program limit on the host computer size of individual log file; When the size of daily record file reaches preset value, just can distinguish through the mode of adding suffix, divide a plurality of journal file log contents with the mode of " date+suffix "; For example, the recorded logs content on November 29th, 2010 is stored in respectively in " 20101129-1.txt " and " 20101129-2.tx " these two journal files.
Each journal file comprises many log records, and every log record generally will comprise: writing time, write down title, class information and the log content etc. of the module (or subsystem) of this daily record.Common, corresponding from low to high five ranks of log content: details (Verbose), incident (Event), problem (Problem), mistake (Error), fatal error (Fatal).Showed the daily record of a typical device control software below:
2010-07-2209:18:46.334CONTROL?EVENT?PhyValvel?is?opean。
This log record control module CONTROL on February 22nd, 2010 09:18:46.334 produced an incident: the physics valve open.
Below, the acquisition methods of a kind of log record that the present invention is proposed is elaborated.
With reference to Fig. 1, show the process flow diagram of the acquisition methods embodiment one of a kind of log record of the present invention, comprising:
Step 101 is sent to slave computer with the request of daily record beginning and ending time;
When the user need check log record; Two time points of input on host computer, one is the daily record start time, one is the daily record concluding time; The daily record start time need be early than the daily record concluding time, and perhaps the daily record start time also can be identical with the daily record concluding time.Host computer generates the request of daily record beginning and ending time through above-mentioned two time points, and it has specified the time range of obtaining journal file.Further, can come to send the request of daily record beginning and ending time, obtain the journal file in the fixed time scope through network communication engine (ICE) to slave computer.
Step 102 receives the log record total number that slave computer sends, and said log record total number is obtained according to request of daily record beginning and ending time and local stored log file by slave computer;
After slave computer obtains the daily record beginning and ending time request of host computer transmission, in the local storage unit of slave computer, obtain the listed files in the fixed time scope, read relevant journal file then, calculate the log record total number.Afterwards, slave computer feeds back to host computer with the log record total number that calculates, and is corresponding, and host computer receives the log record total number that slave computer sends.
Step 103 is according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Saidly preset the maximum number that single bag record strip number is the packet log record that can hold; It is a kind of configuration information pre-set in the program; And, all need be configured in host computer and the slave computer presetting single bag record strip number, the single bag record strip number that presets in the upper and lower machine is consistent; Host computer is according to presetting the number that single bag record strip number calculates packet, and slave computer carries out packing data according to presetting single bag record strip number.
On host computer, the log record total number that receives is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of packet.For example, slave computer obtains four journal files of daily record beginning and ending time request appointment, and the daily record bar number that it comprises respectively is N1, N2, N3, N4; Accordingly; The log record total number that host computer receives the slave computer transmission is N1+N2+N3+N4, and supposing to preset single bag record strip number is N, then according to above-mentioned data; The number that host computer obtains the daily record data bag is INT [(N1+N2+N3+N4)/N+1], and wherein INT is for rounding calculating.
Step 104 is sent request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer.
Said step 104 is specially:
A1, the request of data of sending the daily record data bag to slave computer, and request number of times added up one;
A2 receives the daily record data bag of slave computer according to the request of data foldback;
Wherein, circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, receives last daily record data bag this moment.
That is to say; Host computer is according to the number that obtains the daily record data bag; Send request of data to slave computer successively, that is, transmission INT [(N1+N2+N3+N4)/and N+1] secondary data request; And foundation request of data each time, obtain each daily record data bag that generates by the log record packing from slave computer in batches.
The acquisition methods embodiment one of a kind of log record that the present invention proposes; Increased the function of host computer; The user through host computer just can be long-range obtain the log record on the slave computer, need not login slave computer linux operating system through username and password and obtain log record, made things convenient for user's operation; Avoid the user directly on slave computer, to check daily record and derived daily record, eliminated the direct control slave computer and potential safety hazard that system is brought.
With reference to Fig. 2, show the process flow diagram of the method for uploading embodiment one of a kind of log record of the present invention, comprising:
Step 201 receives the daily record beginning and ending time request that host computer sends;
The time range of obtaining journal file has been specified in said daily record beginning and ending time request.
Step 202 obtains log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
After slave computer receives the daily record beginning and ending time request of host computer transmission, in the local storage unit of slave computer, obtain the listed files in the fixed time scope, read relevant journal file then, calculate the log record total number.Concrete, said step 202 comprises:
B1, slave computer obtains to ask the log record in the corresponding journal file with the said beginning and ending time according to the name of journal file; Wherein, said journal file was named according to the date;
B2 is with the number addition acquisition log record total number of log record in resulting each journal file.
For example, slave computer this locality stores following several journal file:
20101128-1.txt、20101128-2.txt、20101129-1.txt、20101129-2.txt、
20101130-1.txt、20101130-2.txt、20101201-1.txt、20101201-2.txt、
The information that the daily record beginning and ending time request that host computer sends comprises is " 20101129-20101130 "; The daily record start time of i.e. appointment is: on November 29th, 2010; The daily record concluding time is on November 30th, 2010, and then slave computer asks corresponding journal file to be according to what the name of journal file obtained with the said beginning and ending time: 20101129-1.txt, 20101129-2.txt, 20101130-1.txt, these four files of 20101130-2.txt.
Each journal file all can comprise many (several are to thousands of) log records, and slave computer obtains the log record total number with the number addition of log record in resulting each journal file.For example; The daily record bar number that journal file 20101129-1.txt shown in the above-mentioned instance, 20101129-2.txt, 20101130-1.txt, 20101130-2.txt comprise respectively is N1, N2, N3, N4, and the log record total number that calculates so is exactly N1+N2+N3+N4.
Need to prove, because the journal file that obtains maybe be very big, such as comprising up to ten thousand log records, if the disposable host computer that is sent to can cause the transmission time long.In a preferred embodiment of the invention, slave computer obtains also to comprise step after the log record total number: according to presetting single bag record strip number, each the bar log record packing in the journal file that obtains is generated each daily record data bag.
For example; The daily record bar number that four journal file 20101129-1.txt, 20101129-2.txt, 20101130-1.txt, the 20101130-2.txt that slave computer obtains comprise respectively is 50,60,40,60; Presetting single bag record strip number is 100, and then slave computer is packaged as first daily record data bag with 50 log records among the 20101129-1.txt and preceding 50 log records among the 20101129-2.txt; 40 log records among remaining back 10 journal records, the 20101130-1.txt among the 20101129-2.txt, preceding 50 log records among the 20101130-2.txt are packaged as second daily record data bag, remaining back 10 log records among the 20101130-2.txt are packaged as the 3rd daily record data bag.
Step 203 is sent said log record total number to host computer;
Step 204 according to the request of data that host computer sends, is uploaded each daily record data bag that is generated by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
As above instance is said, and the number that host computer obtains the daily record data bag is: INT [(50+60+40+60)/100+1]=INT [210/100+1]=INT [3.1]=3.Host computer is according to the number that obtains the daily record data bag; Send three secondary data request; Slave computer foundation request of data each time; Upload each daily record data bag that the log record packing generates in batches, that is, first daily record data bag, second daily record data bag and the 3rd daily record data bag are divided to be uploaded to host computer three times successively.
Below, the acquisition methods embodiment two to a kind of log record of the present invention is elaborated in conjunction with host computer and slave computer, and with reference to Fig. 3, said method comprises:
Step 301, host computer is sent to slave computer with the request of daily record beginning and ending time;
Step 302, slave computer obtain to ask with the said beginning and ending time log record of corresponding journal file according to the name of journal file;
Step 303, slave computer obtains the log record total number, and the log record packing is generated each daily record data bag;
Concrete, with the number addition acquisition log record total number of log record in resulting each journal file.Further, slave computer generates each daily record data bag according to presetting single bag record strip number with each the bar log record packing in the journal file that obtains.It is understandable that the daily record data bag after the packing is converted into the binary code (being document flow) that can carry out Network Transmission accordingly.
Step 304 receives the log record total number that slave computer sends;
Step 305 is according to log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Step 306, the request of data of sending first daily record data bag to slave computer;
Step 307 receives slave computer first daily record data bag according to the request of data foldback, and this daily record data bag is inserted among the ArrayList;
Step 308, circulation is sent request of data to slave computer, is added to identical with the number of daily record data bag up to request number of times;
Step 309 receives last daily record data bag of slave computer foldback, and this daily record data bag is inserted among the ArrayList;
Wherein, ArrayList is a kind of Dynamic Array, through ArrayList, can increase and reduce data element dynamically, and the size of array is set flexibly.In embodiments of the present invention, whenever obtain a daily record data bag, just insert among the ArrayList successively, its objective is to make things convenient for program to read log record.
Step 310 resolves to each bar log record with each daily record data bag that gets access to, and through the paging control log record is carried out Pagination Display.
General, can pass through ListView control, all log records that Pagination Display gets access to.
Through the embodiment of the invention two, the user can check log record easily; When checking daily record, need not to leave the content of daily record in host computer local storage space, without the size of maintenance log.
In another preferred embodiment of the present invention, after slave computer obtained each daily record data bag that is generated by the log record packing, said method also comprised: each daily record data bag that will get access to imports in the local storage unit of host computer.Through this method, the user can derive log record easily, and log content is written in the file that is easy to open, and on host computer, carries out this locality and preserves, and then on host computer and slave computer, preserves simultaneously, has realized the dual backup of journal file.
With reference to Fig. 4, show the structural drawing of the deriving means embodiment of a kind of log record of the present invention, comprising:
Time request transmitting unit 401 is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element 402, is used to receive the log record total number that slave computer sends, and said log record total number is obtained according to request of said daily record beginning and ending time and local stored log file by slave computer;
Number of data packets acquiring unit 403 is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit 404 is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer.
Further; The number of data packets acquiring unit is according to said log record total number and the number that presets single bag record strip number acquisition packet; Be specially: said log record total number is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of packet.For example, presetting single bag record strip number is N, and the log record total number is M, and then the number of host computer acquisition daily record data bag is: INT [M/N+1].
In a preferred embodiment of the invention, said daily record data bag acquiring unit 404 comprises:
Packet request subelement is used for the request of data to slave computer transmission daily record data bag, and request number of times is added up one; Packet receives subelement, is used to receive the daily record data bag of slave computer according to the request of data foldback that receives;
Wherein, packet request subelement circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, and packet received subelement and received last daily record data bag this moment.
In a preferred embodiment of the invention, said device also comprises:
The log record display unit; Be used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing; Each daily record data bag that gets access to is resolved to each bar log record, and log record is carried out Pagination Display through the paging control.
In a preferred embodiment of the invention, said device also comprises:
The log record lead-out unit is used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing, and each daily record data bag that gets access to is directed in the local storage unit of host computer.
With reference to Fig. 5, show the structural drawing of uploading device embodiment of a kind of log record of the present invention, comprising:
Time request receiving element 501 is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit 502, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element 503, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit 504, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
In a preferred embodiment of the invention, said daily record bar is counted acquiring unit 502 and is comprised:
Log record obtains subelement 5021, is used for obtaining to ask with the said beginning and ending time according to the name of journal file the log record of corresponding journal file; Wherein, said journal file was named according to the date;
The record strip number obtains subelement 5022, and the number addition of each journal file log record that is used for the log record acquiring unit is obtained obtains the log record total number.For example; Slave computer is asked corresponding four file journalization files according to what the name of journal file obtained with the said beginning and ending time; The daily record bar number that each journal file comprises respectively is N1, N2, N3, N4, and the log record total number that calculates so is exactly N1+N2+N3+N4.
In another preferred embodiment of the present invention, said daily record data is wrapped leaflet unit and is comprised:
Log record packing subelement is used for the daily record bar and counts after the acquiring unit acquisition log record total number, and according to presetting single bag record strip number, each the bar log record in the journal file that obtains is packed generates each daily record data bag.
With reference to Fig. 6, show the structural drawing that obtains system embodiment of a kind of log record of the present invention, comprise slave computer 61 and host computer 62;
Said host computer 61 comprises the deriving means 61a of log record, and said deriving means 61a comprises:
Time request transmitting unit 611 is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element 612, is used to receive the log record total number that slave computer sends;
Number of data packets acquiring unit 613 is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit 614 is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer;
What said slave computer 62 comprised log record uploads device 62a, and the said device 62a that uploads comprises:
Time request receiving element 621 is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit 622, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element 623, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit 624, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively.
The function and the running status of correlation unit repeat no more here, please refer to the related content of the foregoing description.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device and system embodiment, because it is similar basically with method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than to acquisition methods and device, a kind of method for uploading of log record and the system that obtains of device and a kind of log record thereof of a kind of log record provided by the present invention; Carried out detailed introduction; Used concrete example among this paper principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (19)

1. the acquisition methods of a log record is characterized in that, comprising:
The request of daily record beginning and ending time is sent to slave computer;
Receive the log record total number that slave computer sends, said log record total number is obtained according to request of said daily record beginning and ending time and local stored log file by slave computer;
According to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Number according to the daily record data bag is sent request of data to slave computer successively, and obtains each daily record data bag that is generated by the log record packing from slave computer.
2. the method for claim 1 is characterized in that, according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag, is specially:
Said log record total number is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of daily record data bag.
3. according to claim 1 or claim 2 method is characterized in that, sends request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag from slave computer, is specially:
The request of data of sending the daily record data bag to slave computer, and request number of times added up one;
Receive the daily record data bag of slave computer according to the request of data foldback;
Wherein, circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, receives last daily record data bag this moment.
4. the method for claim 1 is characterized in that, and is said after slave computer obtains each daily record data bag that is generated by the log record packing, also comprises:
Each daily record data bag that gets access to is resolved to each bar log record, and log record is carried out Pagination Display through the paging control.
5. the method for claim 1 is characterized in that, and is said after slave computer obtains each daily record data bag that is generated by the log record packing, also comprises:
Each daily record data bag that gets access to is directed in the local storage unit of host computer.
6. the method for uploading of a log record is characterized in that, comprising:
Receive the daily record beginning and ending time request that host computer sends;
Request of daily record beginning and ending time and local stored log file according to receiving obtain log record and log record total number;
Send said log record total number to host computer;
According to the request of data that host computer sends, upload each daily record data bag that generates by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
7. method as claimed in claim 6 is characterized in that, request of daily record beginning and ending time and local stored log file that said foundation receives obtain log record and log record total number, comprising:
Slave computer obtains to ask the log record in the corresponding journal file with the said beginning and ending time according to the name of journal file; Wherein, said journal file was named according to the date;
The number addition of log record in resulting each journal file is obtained the log record total number.
8. method as claimed in claim 6 is characterized in that, slave computer obtains also to comprise after the log record total number:
According to presetting single bag record strip number, each the bar log record packing in the journal file that obtains is generated each daily record data bag.
9. the deriving means of a log record is characterized in that, comprising:
The time request transmitting unit is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element, is used to receive the log record total number that slave computer sends, and said log record total number is obtained according to request of said daily record beginning and ending time and local stored log file by slave computer;
The number of data packets acquiring unit is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer.
10. device as claimed in claim 9 is characterized in that, the number of data packets acquiring unit is specially according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag:
Said log record total number is added one and rounds divided by presetting remainder that single bag record strip number obtains, obtain the number of daily record data bag.
11. device as claimed in claim 10 is characterized in that, said daily record data bag acquiring unit comprises:
Packet request subelement is used for the request of data to slave computer transmission daily record data bag, and request number of times is added up one;
Packet receives subelement, is used to receive the daily record data bag of slave computer according to the request of data foldback;
Wherein, packet request subelement circulation is sent request of data to slave computer, is added to identically with the number of daily record data bag up to request number of times, and packet received subelement and received last daily record data bag this moment.
12. device as claimed in claim 9 is characterized in that, also comprises:
The log record display unit; Be used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing; Each daily record data bag that gets access to is resolved to each bar log record, and log record is carried out Pagination Display through the paging control.
13. device as claimed in claim 9 is characterized in that, also comprises:
The log record lead-out unit is used for the daily record data acquiring unit after slave computer obtains each daily record data bag that is generated by the log record packing, and each daily record data bag that gets access to is directed in the local storage unit of host computer.
14. a log record upload device, it is characterized in that, comprising:
Time request receiving element is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively; Wherein, the number of times of the request of data of host computer transmission obtains according to said log record total number.
15. device as claimed in claim 14 is characterized in that, said daily record bar is counted acquiring unit and is comprised:
Log record obtains subelement, is used for obtaining to ask with the said beginning and ending time according to the name of journal file the log record of corresponding journal file; Wherein, said journal file was named according to the date;
The record strip number obtains subelement, and the number addition of each journal file log record that is used for the log record acquiring unit is obtained obtains the log record total number.
16. device as claimed in claim 14 is characterized in that, said daily record data is wrapped leaflet unit and is comprised:
Log record packing subelement is used for the daily record bar and counts after the acquiring unit acquisition log record total number, and according to presetting single bag record strip number, each the bar log record in the journal file that obtains is packed generates each daily record data bag.
17. the system that obtains of a log record is characterized in that, comprises slave computer and host computer;
Said host computer comprises the deriving means of log record, and said deriving means comprises:
The time request transmitting unit is used for the request of daily record beginning and ending time is sent to slave computer;
The daily record bar is counted receiving element, is used to receive the log record total number that slave computer sends;
The number of data packets acquiring unit is used for according to said log record total number and the number that presets single bag record strip number acquisition daily record data bag;
Daily record data bag acquiring unit is used for sending request of data to slave computer successively according to the number of daily record data bag, and obtains each daily record data bag that is generated by the log record packing from slave computer;
Said host computer comprises the device of uploading of log record, and the said device of uploading comprises:
Time request receiving element is used to receive the daily record beginning and ending time request that host computer sends;
The daily record bar is counted acquiring unit, is used for obtaining log record and log record total number according to the request of daily record beginning and ending time and the local stored log file that receive;
The daily record bar is counted transmitting element, is used for sending said log record total number to host computer;
Daily record data is wrapped leaflet unit, is used for the request of data according to the host computer transmission, uploads each daily record data bag that is generated by the log record packing to host computer successively.
18. system according to claim 17 is characterized in that, said host computer comprises the deriving means of each described log record of claim 10-13.
19. system according to claim 17 is characterized in that, said slave computer comprises the device of uploading of each described log record of claim 15-16.
CN2010105806798A 2010-12-09 2010-12-09 Methods and devices and systems for obtaining and uploading log records Pending CN102541850A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105806798A CN102541850A (en) 2010-12-09 2010-12-09 Methods and devices and systems for obtaining and uploading log records

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105806798A CN102541850A (en) 2010-12-09 2010-12-09 Methods and devices and systems for obtaining and uploading log records

Publications (1)

Publication Number Publication Date
CN102541850A true CN102541850A (en) 2012-07-04

Family

ID=46348774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105806798A Pending CN102541850A (en) 2010-12-09 2010-12-09 Methods and devices and systems for obtaining and uploading log records

Country Status (1)

Country Link
CN (1) CN102541850A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104506390A (en) * 2014-12-31 2015-04-08 上海大唐移动通信设备有限公司 Log storage method and device of road test system
CN105630914A (en) * 2015-12-21 2016-06-01 山东中创软件商用中间件股份有限公司 Log data query method and device
CN107360242A (en) * 2017-07-27 2017-11-17 郑州云海信息技术有限公司 The method for down loading and system of a kind of journal file

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043375A (en) * 2007-03-15 2007-09-26 华为技术有限公司 Distributed system journal collecting method and system
CN101453378A (en) * 2008-12-30 2009-06-10 杭州华三通信技术有限公司 Method and system for log damp and audit
US20100082531A1 (en) * 2008-09-22 2010-04-01 Yuu Sakamoto Log managing apparatus, log managing system, log managing method and log managing program
CN101907879A (en) * 2010-03-12 2010-12-08 大连理工大学 Industrial control network redundancy fault-tolerant system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043375A (en) * 2007-03-15 2007-09-26 华为技术有限公司 Distributed system journal collecting method and system
US20100082531A1 (en) * 2008-09-22 2010-04-01 Yuu Sakamoto Log managing apparatus, log managing system, log managing method and log managing program
CN101453378A (en) * 2008-12-30 2009-06-10 杭州华三通信技术有限公司 Method and system for log damp and audit
CN101907879A (en) * 2010-03-12 2010-12-08 大连理工大学 Industrial control network redundancy fault-tolerant system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104506390A (en) * 2014-12-31 2015-04-08 上海大唐移动通信设备有限公司 Log storage method and device of road test system
CN105630914A (en) * 2015-12-21 2016-06-01 山东中创软件商用中间件股份有限公司 Log data query method and device
CN107360242A (en) * 2017-07-27 2017-11-17 郑州云海信息技术有限公司 The method for down loading and system of a kind of journal file

Similar Documents

Publication Publication Date Title
CN106777371A (en) Result collection system and method
WO2016183967A1 (en) Failure alarm method and apparatus for key component, and big data management system
CN110554930A (en) Data storage method and related equipment
CN103441861A (en) Method and device for generating data records
CN102541850A (en) Methods and devices and systems for obtaining and uploading log records
CN100520649C (en) Program creating device for programmable controller, program creating method for programmable controller, and recording medium
US7178103B2 (en) Systems and methods for storing configuration data in process control systems
US10754748B2 (en) System and method for constructing extensible event log with javascript object notation (JSON) encoded payload data
CN114416868B (en) Data synchronization method, device, equipment and storage medium
AU2017305172A1 (en) Systems and methods for discovering configurations of legacy control systems
CN112202862B (en) Method and device for synchronizing cluster data and files based on kafka
CN112527192B (en) Data acquisition method and device and service equipment
US11039225B2 (en) Declarative IoT data control
CN104734881A (en) Log and abnormity probe implementation method
WO2023200395A1 (en) Method and apparatus for transmitting data, device and storage medium
CN112015600B (en) Log information processing system, log information processing method and device and switch
CN118113781A (en) Redis synchronization method, redis synchronization device, storage medium and processor
CN102868559A (en) Method and system for generating weblog data
US20130179569A1 (en) Systems and methods for gateway status information handling
CN102752138A (en) Asynchronous configuration management method and network device
CN111241044A (en) Method, device and equipment for building heterogeneous database and readable storage medium
CN103647812A (en) A method and an apparatus for displaying a picture on different terminal devices
CN1971599A (en) Error monitoring method and system of software application
CN112486542A (en) Configuration file generation and updating method and system based on dynamic link library
CN114268844B (en) Internet television service emergency guarantee system and method thereof

Legal Events

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

Application publication date: 20120704