Summary of the invention
The present invention provides a kind of log method for uploading and communication equipment, to solve communication equipment record day in the prior art
Be easy to cause when will file log content lose, journal file can not long-term preservation the technical issues of.
A kind of log method for uploading provided in an embodiment of the present invention, comprising:
If it is determined that current time met for the first setting period, then the journal file stored in the communication equipment is uploaded to
Log server;
If it is determined that current time is unsatisfactory for the first setting period, but met for the second setting period, then detects communication and set
The journal file of standby middle storage will meet the journal file to impose a condition and be uploaded to the log server, and will
The successful journal file of the upload stored in the communication equipment is deleted;The first setting period is greater than second setting
Period;
Optionally, the journal file to impose a condition that will meet is uploaded to log server, comprising:
The journal file that file size is more than or equal to given threshold is uploaded to the log server;And/or it will
The journal file that setting module generates is uploaded to the log server.
Optionally, described if it is determined that current time meet first setting the period, then in the log that will be stored in communication equipment
File is uploaded to after log server, further includes:
The successful journal file of the upload stored in the communication equipment is deleted.
It is optionally, described that the journal file is uploaded to the log server, comprising:
The journal file to be uploaded is extracted into characteristic item, and is uploaded to the log server after compressing.
Based on same inventive concept, the present invention also provides a kind of communication equipments, comprising:
Determining module, for determining whether current time met for the first setting period, if met for the second setting period,
Described in first setting the period be greater than it is described second setting the period;
Detection module for determining that current time is unsatisfactory for the first setting period in the determining module, but meets
When the second setting period, the journal file of storage is detected;
Uploading module, if determining that current time meets the first setting period for the determining module, by storage
Journal file is uploaded to log server;And if the determining module determines that current time is unsatisfactory for the first setting week
Phase, but meet the second setting period, on the journal file that the satisfaction that the detection module is detected imposes a condition
Reach the log server;
Removing module for determining that current time is unsatisfactory for the first setting period in the determining module, but meets
When the second setting period, by the upload of storage, successfully the journal file is deleted.
Optionally, the uploading module is specifically used for:
The journal file that file size is more than or equal to given threshold is uploaded to the log server;And/or it will
The journal file that setting module generates is uploaded to the log server.
Optionally, the removing module is also used to:
In the determining module when meeting the first setting period at current time, by the successful institute of the upload of storage
State journal file deletion.
Optionally, the uploading module is specifically used for:
The journal file to be uploaded is extracted into characteristic item, and is uploaded to the log server after compressing.
Another embodiment of the present invention provides a kind of communication equipments comprising memory, processor, wherein the storage
Device is for storing program instruction, and the processor is for calling the program instruction stored in the memory, according to the journey of acquisition
Sequence executes any of the above-described kind of method.
Another embodiment of the present invention provides a kind of computer storage medium, the computer-readable recording medium storage has
Computer executable instructions, the computer executable instructions are for making the computer execute any of the above-described kind of method.
In the embodiment of the present invention, when determining that current time met for the first setting period, day for will being stored in communication equipment
Will file is uploaded to log server, when determining that current time was unsatisfactory for for the first setting period, but meeting for the second setting period,
The journal file stored in detection communication equipment will meet the journal file to impose a condition and be uploaded to log server, and will lead to
The log uploaded that succeeded stored in letter equipment is deleted.
As can be seen that the embodiment of the present invention sets the period for journal file week by the first setting period of setting and second
Phase property is uploaded to log server, can effectively ensure that the integrality of journal file, facilitates plant maintenance personnel in log server
In check the journal file of equipment, improve research and development and operation maintenance personnel positioning and the efficiency that solves the problems, such as.Further, since the second setting
Period less than the first setting period, uploads journal file according to the second setting period in the embodiment of the present invention, satisfaction may make to set
The journal file of fixed condition quickly uploads to log server, so that transfer efficiency in log can be improved, saves journal file
Uploading bandwidth uploads journal file according to the first setting period, and can further avoid the day not uploaded in the second setting period
The problem of will file data is lost.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into
One step it is described in detail, it is clear that described embodiment, only a part of the embodiment of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
All other embodiment, shall fall within the protection scope of the present invention.
In the embodiment of the present invention, the log method for uploading can be applied to a plurality of types of communication equipments, especially be embedded in
Formula communication equipment, such as base station, WLAN (Wireless Local Area Networks, WLAN) equipment.
The embodiment of the present invention is described in further detail with reference to the accompanying drawings of the specification.
Fig. 1 shows flow diagram, such as Fig. 1 corresponding to a kind of log method for uploading provided in the embodiment of the present invention
It is shown, which comprises
Step S101: if it is determined that current time meets the first setting period, the then log that will be stored in the communication equipment
File is uploaded to log server;
Step S102: if it is determined that current time is unsatisfactory for the first setting period, but met for the second setting period, then examine
The journal file stored in communication equipment is surveyed, the journal file to impose a condition will be met and be uploaded to the log services
Device, and the successful journal file of the upload stored in the communication equipment is deleted.
As can be seen that the embodiment of the present invention sets the period for journal file week by the first setting period of setting and second
Phase property is uploaded to log server, can effectively ensure that the integrality of journal file, facilitates plant maintenance personnel in log server
In check the journal file of equipment, improve research and development and operation maintenance personnel positioning and the efficiency that solves the problems, such as.Further, since the second setting
Period less than the first setting period, uploads journal file according to the second setting period in the embodiment of the present invention, satisfaction may make to set
The journal file of fixed condition quickly uploads to log server, so that transfer efficiency in log can be improved, saves journal file
Uploading bandwidth uploads journal file according to the first setting period, and can further avoid the day not uploaded in the second setting period
The problem of will file data is lost.
Specifically, in the specific implementation of step S101, communication equipment can real-time watch device runing time, however, it is determined that
Current time met for the first setting period, then the journal file stored in communication equipment was uploaded to the log server.It can
The whole journal files stored in communication equipment can be uploaded to log when meeting for the first setting period at current time by selection of land
Server, and the successful journal file of the upload stored in communication equipment is deleted.
In the specific implementation of step S102, communication equipment if it is determined that current time be unsatisfactory for for the first setting period, but it is full
Foot second sets the period, then can detect each journal file of its storage, such as determine the data volume of each journal file, the source of file
Etc., the journal file to impose a condition will be met and be uploaded to log server.
In the embodiment of the present invention, the time span in the first setting period and the second setting period can be by ability
Self-setting, the present invention are not particularly limited this to field technique personnel according to actual needs.For example, the period can be set by first
Equipment is 1 hour, sets for the second setting period to 20 minutes.
Described impose a condition can be used for limiting the size (i.e. journal file include data volume) and/or log of journal file
Whether whether the source of file, such as the size of journal file are greater than given threshold, journal file by the setting in communication equipment
(whether the size for the journal file that the setting module i.e. in communication equipment generates, which is greater than, sets for module generation or the combination of the two
Determine threshold value) etc..The setting module can be one or more comprising modules on hardware, be also possible to a certain of software realization
A or a kind of function, the present invention are not particularly limited this.
In addition, the setting module is used to identify the journal file of certain particular sources, by setting in the embodiment of the present invention
The journal file that module generates need to be uploaded to server, and the journal file in other sources is then not limited.The present invention is implemented
Example in, the setting module can voluntarily be configured according to actual needs by those skilled in the art, i.e., by those skilled in the art Lai
The journal file for needing to upload in unrestricted choice current communication devices only selects certain specific journal files to upload to reach
Purpose.For example, may be selected to run this part into more stable module when the operation of the certain module of communication equipment is relatively stable
The journal file of generation is not uploaded to log server, to save uploading bandwidth and alleviate the storage pressure of log server.
Since the second setting period is less than the first setting period, according to the second setting period upload unit in the embodiment of the present invention
Divide the journal file for meeting and imposing a condition, this partial log file is aloowed quickly to upload to log server, thus
Transfer efficiency in log can be improved, save the uploading bandwidth of journal file, facilitate plant maintenance personnel that can check log text in time
Part.
In the embodiment of the present invention, after journal file uploads successfully, upload that communication equipment can also be stored at
The journal file of function is deleted, and so as to enable this part memory space to be used to record new journal file, avoids communication equipment
Memory space when being occupied full, newly generated journal file covers the data of original journal file, causes log file data
The problem of loss.
As can be seen that communication equipment can will be stored when determining that current time met for the first setting period in communication equipment
Whole journal files be uploaded to log server, and after uploading successfully, this partial log file uploaded that will succeed is deleted
It removes.If communication equipment defines the size of journal file in setting condition, communication equipment can also be unsatisfactory for the first setting week
Phase, but when the second setting period of satisfaction, the journal file that the data volume of storage is greater than given threshold is uploaded.In this way, communication is set
It is standby to upload whole journal files when satisfaction first sets the period, it can also be achieved and journal file timing is uploaded into log services
The purpose of device avoids in some cases, since the data volume of the journal file of the generation of communication equipment is smaller, is meeting the
When two setting periods, the data volume of journal file does not reach given threshold and could not upload to log server always, in case of
To abnormal conditions such as power-off, the problem of leading to the loss of data of journal file.
In the embodiment of the present invention, the first setting period is greater than the second setting period.Fig. 2 a to Fig. 2 c is exemplary
Show the first setting period and the second setting period in the embodiment of the present invention.As shown in Figure 2 a, the first setting period can be with
For the integral multiple in the second setting period, and communication equipment synchronizes timing to two periods, in this way, when a certain moment meets the
When one setting period, then it must also meet for the second setting period.In fig. 2 a, as an example, first the period is set as
4 times of two setting periods, circle not only met for the first setting period at the time of mark, but also met for the second setting period, therefore, at this
When at the time of one type, the whole journal files being locally stored directly all can be uploaded to log server by communication equipment, and
After uploading successfully, memory headroom shared by local log file is emptied.Box only met for the second setting period at the time of mark, no
Met for the first setting period, therefore, when at the time of this type, the detectable each journal file being locally stored of communication equipment
Size and/or file source, file size is greater than the journal file that given threshold and/or file result from particular module
It is uploaded to log server, and deletes memory headroom shared by this partial log file after uploading successfully.
As shown in Figure 2 b, the first setting period can be the integral multiple in the second setting period, but communication equipment is to two weeks
The timing of phase, which can be staggered, certain time interval, in this way, then the moment will not when meeting for the first setting period at a certain moment
Met for the second setting period again, similarly, when meeting for the second setting period at a certain moment, which will not meet first again and set
Fixed cycle.In figure 2b, as an example, first the period is set as the second 2 times for setting the period, at the time of circle identifies only
Met for the first setting period, box only met for the second setting period at the time of mark.When arriving at the time of circle mark, communication
The whole journal files being locally stored directly all can be uploaded to log server by equipment, and local day is emptied after uploading successfully
Memory headroom shared by will file, when arriving at the time of box mark, the detectable each log being locally stored of communication equipment
File size is greater than given threshold and/or file results from the log of particular module by the size of file and/or the source of file
File is uploaded to log server, and memory headroom shared by this partial log file is deleted after uploading successfully.
As shown in Figure 2 c, the first setting period can be greater than for the second setting period, but not be the integral multiple in the second setting period.
In this way, then the moment both meets first when being exactly the common multiple in the first setting period and the second setting period at a certain moment
The period is set, and met for the second setting period, and at other moment, if meeting for the first setting period, second will not be met again
The period is set, vice versa.In figure 2 c, second setting period of the first setting period equal to 4/3 times, before shown in the figure
At the time of 3 circle marks, they only met for the first setting period, thus, the whole that communication equipment will can directly be locally stored
Journal file is all uploaded to log server, and memory headroom shared by local log file is emptied after uploading successfully.Scheming
Shown in preceding 3 boxes mark at the time of, the size and/or text of the detectable each journal file being locally stored of communication equipment
File size is uploaded to log clothes greater than the journal file that given threshold and/or file result from particular module by the source of part
Business device, and memory headroom shared by this partial log file is deleted after uploading successfully.The last one circle shown in the figure
At the time of with box mark, due to the least common multiple that the moment is the first setting period and the second setting period, thus both completely
Foot first set the period, and meet second setting the period, in this case, communication equipment can directly upload be locally stored it is complete
Portion's journal file, and after uploading successfully, memory headroom shared by Clear Log file.
In the embodiment of the present invention, the data volume of the journal file stored in communication equipment may be more, different log texts
It may include may only have partial content needs in duplicate part or a journal file to upload in part, therefore, lead to
Equipment is believed when uploading journal file, and characteristic item can be extracted for journal file to be uploaded and is uploaded to again after being compressed
Log server.Wherein, the characteristic item can produce for the specific content in journal file, such as communication equipment in special time period
Raw log content, or the log content generated by the particular module in communication equipment.
In this way, the transmission bandwidth of journal file can be saved effectively, journal file the space occupied is reduced, mitigates log services
The storage pressure of device, while uploading speed and efficiency can also be effectively improved, guarantee that communication equipment also can when heavy traffic
Journal file is rapidly uploaded to log server.
Fig. 3 is the flow diagram of another log method for uploading provided in an embodiment of the present invention.In the example of fig. 3,
First sets the period should when the runing time of communication equipment met for the second setting period as the integral multiple in the second setting period
Moment must be the timing node in the first setting period of satisfaction.
As shown in figure 3, unlatching is periodically detected thread, if current time reaches the second setting after communicating upper electricity operation
Period then judges whether current time reached for the first setting period simultaneously, if reaching for the first setting period, present communications is set
Standby one compressed package of whole journal file boil down tos to some catalogue and uploads to log server, while in communication equipment
The journal file of storage empties.If in the not up to first setting period, detect in the journal file stored in communication equipment which
The data volume of journal file is more than or equal to given threshold, and data volume is more than or equal to those of given threshold journal file and is compressed
For a compressed package, it is uploaded to log server, and the memory space that these journal files occupy is emptied.And those data volumes
Other journal files for not reaching given threshold, then reprocessing when next second setting period being waited to arrive.If when current
Not up to the second setting period is carved, then is continued waiting for, executes above-mentioned processing after meeting for the second setting period.
Based on same inventive concept, the embodiment of the present invention also provides a kind of communication equipment, and Fig. 4 is in the embodiment of the present invention
The structural schematic diagram of a kind of communication equipment provided, as shown in figure 4, the communication equipment 400 includes:
Determining module 401, for determining whether current time met for the first setting period, if met for the second setting week
Phase, wherein the first setting period is greater than the second setting period;
Detection module 402, for determining that current time is unsatisfactory for the first setting period in the determining module, but it is full
When foot described second sets the period, the journal file of storage is detected;
Uploading module 403 will store if determining that current time meets the first setting period for the determining module
Journal file be uploaded to log server;And if the determining module determines that current time is unsatisfactory for first setting
Period, but meet the second setting period, the journal file that the satisfaction that the detection module is detected imposes a condition
It is uploaded to the log server;
Removing module 404, for determining that current time is unsatisfactory for the first setting period in the determining module, but it is full
When foot described second sets the period, by the upload of storage, successfully the journal file is deleted.
Optionally, the uploading module 403 is specifically used for:
The journal file that file size is more than or equal to given threshold is uploaded to the log server;And/or it will
The journal file that setting module generates is uploaded to the log server.
Optionally, the removing module 404 is also used to:
In the determining module when meeting the first setting period at current time, by the successful institute of the upload of storage
State journal file deletion.
Optionally, the uploading module 403 is specifically used for:
The journal file to be uploaded is extracted into characteristic item, and is uploaded to the log server after compressing.
Another embodiment of the present invention provides a kind of communication equipments comprising memory and processor, wherein the storage
Device is for storing program instruction, and the processor is for calling the program instruction stored in the memory, according to the journey of acquisition
Sequence executes any of the above-described kind of method.
Another embodiment of the present invention provides a kind of computer storage medium, the computer-readable recording medium storage has
Computer executable instructions, the computer executable instructions are for making the computer execute any of the above-described kind of method.
Based on same inventive concept, the embodiment of the present invention also provides another communication equipment, which specifically may be used
Think desktop computer, portable computer, smart phone, tablet computer, personal digital assistant (Personal Digital
Assistant, PDA) etc..As shown in figure 5, the communication equipment 500 may include central processing unit (Center Processing
Unit, CPU) 501, memory 502, input-output apparatus 503 and bus system 504 etc..Wherein, input equipment may include
Keyboard, mouse, touch screen etc., output equipment may include display equipment, such as liquid crystal display (Liquid Crystal
Display, LCD), cathode-ray tube (Cathode Ray Tube, CRT) etc..
Memory may include read-only memory (ROM) and random access memory (RAM), and provide storage to processor
The program instruction and data stored in device.In embodiments of the present invention, memory can be used for storing the program of the above method.
Processor is by the program instruction for calling memory to store, and processor according to the program instruction of acquisition for executing
State method.
Based on same inventive concept, the embodiment of the invention provides a kind of computer storage mediums, for being stored as
Computer program instructions used in communication equipment are stated, it includes the programs for executing above-mentioned parallax correction method.
The computer storage medium can be any usable medium or data storage device that computer can access, packet
Include but be not limited to magnetic storage (such as floppy disk, hard disk, tape, magneto-optic disk (MO) etc.), optical memory (such as CD, DVD,
BD, HVD etc.) and semiconductor memory (such as it is ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid
State hard disk (SSD)) etc..
By above content it can be seen that
In the embodiment of the present invention, when determining that current time met for the first setting period, day for will being stored in communication equipment
Will file is uploaded to log server, when determining that current time was unsatisfactory for for the first setting period, but meeting for the second setting period,
The journal file stored in detection communication equipment will meet the journal file to impose a condition and be uploaded to log server, and will lead to
The log uploaded that succeeded stored in letter equipment is deleted.
As can be seen that the embodiment of the present invention sets the period for journal file week by the first setting period of setting and second
Phase property is uploaded to log server, can effectively ensure that the integrality of journal file, facilitates plant maintenance personnel in log server
In check the journal file of equipment, improve research and development and operation maintenance personnel positioning and the efficiency that solves the problems, such as.Further, since the second setting
Period less than the first setting period, uploads journal file according to the second setting period in the embodiment of the present invention, satisfaction may make to set
The journal file of fixed condition quickly uploads to log server, so that transfer efficiency in log can be improved, saves journal file
Uploading bandwidth uploads journal file according to the first setting period, and can further avoid the day not uploaded in the second setting period
The problem of will file data is lost.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the meter of computer usable program code that the present invention, which can be used at one or more,
The computer journey implemented in calculation machine usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of sequence product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The function of being specified in present one process of flow chart or more than two one box of process and/or block diagram or more than two boxes
Device.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
The manufacture of device is enabled, which realizes in one side of one process of flow chart or more than two processes and/or block diagram
The function of being specified in frame or more than two boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one process of flow chart or more than two processes and/or box
The step of function of being specified in one box of figure or more than two boxes.
Although alternative embodiment of the invention has been described, created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So the following claims are intended to be interpreted as include can
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.