CN109656786A - Journal obtaining method and device - Google Patents
Journal obtaining method and device Download PDFInfo
- Publication number
- CN109656786A CN109656786A CN201811607426.8A CN201811607426A CN109656786A CN 109656786 A CN109656786 A CN 109656786A CN 201811607426 A CN201811607426 A CN 201811607426A CN 109656786 A CN109656786 A CN 109656786A
- Authority
- CN
- China
- Prior art keywords
- state value
- log
- electronic equipment
- grade
- log information
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3072—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Journal obtaining method and device provided by the present application are applied to electronic equipment, the default corresponding logging level of the log information that electronic equipment is generated.By obtaining the current multiple state values of the electronic equipment, it is filtered according to the log that the current state of electronic equipment generates equipment.Meanwhile for multiple functional modules in electronic equipment, when there is abnormal function unit, the transmission control information notifying abnormal function unit increases the acquisition type of log while so that the functional module improves the frequency acquisition of log.The technical solution that this Shen provides reduces electronic equipment and consumes in the case where resource anxiety to device resource, meanwhile, the log collection amount to abnormal function unit is targetedly improved, is analyzed convenient for the exception information preferably to abnormal function unit.
Description
Technical field
This application involves computer fields, in particular to a kind of journal obtaining method and device.
Background technique
At present in the Log Collect System of electronic equipment, which acquires each functional module of electronic equipment
Running log, and log information is disaggregatedly stored.And then facilitate the later period to the log information of analysis storage.Together
When, in current Log Collect System, for a large amount of log, some simple filterings can be done, are filtered some inessential
Log information.Since log storage will do it I/O operation, in the case where log amount is excessive, load and the function of system will affect
The indexs such as consumption.
Summary of the invention
In order to overcome above-mentioned deficiency in the prior art, the application's is designed to provide a kind of journal obtaining method, answers
For electronic equipment, the step of the method, includes:
The currently running multiple state values of the electronic equipment are obtained in real time, and the state value indicates the electronic equipment fortune
Operating status before the trade;
Obtain log information when electronic equipment operation, wherein the log information is preset with according to significance level
Different logging levels;
The log information of corresponding logging level is filtered out according to the multiple state value, and the log information after filter is carried out
Storage.
Optionally, described the step of filtering out corresponding log information according to the multiple state value, includes:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
The quantity for counting the exceeded state value obtains exceeded sum;
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value, according to the mesh
Mark amount threshold determines the corresponding target journaling grade of the destination number threshold value, wherein the multiple amount threshold is corresponding not
Same logging level;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the step of log information that corresponding logging level is filtered out according to the multiple state value also wraps
It includes:
When the quantity is more than default alarm threshold, stop obtaining journal file.
Optionally, the corresponding state of the state value is preset with different state grades according to state urgency level, described
The step of filtering out corresponding log information according to the multiple state value include:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
Highest state grade therein is obtained according to the exceeded state value, and determines that the highest state grade is corresponding
Target journaling grade, wherein different conditions grade is corresponding with different logging levels;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the electronic equipment includes multiple functional modules, and the log information further includes exception information;The side
Method further include:
When occurring abnormal function unit in the multiple functional module, the log information of the abnormal function unit is improved
Logging level.
Optionally, the method also includes:
Abnormal function unit described in transmission control information notifying so that the abnormal function unit increase log collection point and
Log collection frequency, wherein the log collection point indicates the type of log.
The another object of the application is to provide a kind of log acquisition device, applied to electronic equipment, the log acquisition
Device includes state acquisition module, log acquisition module, filtering module;
The state acquisition module for obtaining the currently running multiple state values of the electronic equipment, the state in real time
Value indicates that the electronic equipment runs current operating status;
The log acquisition module is used to obtain log information when electronic equipment operation, wherein the log letter
Breath is preset with different logging levels according to significance level;
The filtering module is used to filter out the log information of corresponding logging level according to the multiple state value, and to filter
Log information afterwards is stored.
Optionally, the filtering module is in the following manner filtered the log information:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
The quantity for counting the exceeded state value obtains exceeded sum;
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value, according to the mesh
Mark amount threshold determines the corresponding target journaling grade of the destination number threshold value, wherein the multiple amount threshold is corresponding not
Same logging level;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the filtering module is also in the following manner filtered the log information:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
Highest state grade therein is obtained according to the exceeded state value, and determines that the highest state grade is corresponding
Target journaling grade, wherein different conditions grade is corresponding with different logging levels;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the electronic equipment includes multiple functional modules, and the log information further includes exception information, the day
Will acquisition device further includes level adjustment module;
The level adjustment module is used for when occurring abnormal function unit in the multiple functional module, is improved described different
The logging level of the log information of normal functional unit.
In terms of existing technologies, the application has the advantages that
Journal obtaining method and device provided by the present application are applied to electronic equipment, and the log that electronic equipment is generated is believed
The default corresponding logging level of breath.By obtaining the current multiple state values of the electronic equipment, according to the current state of electronic equipment
The log generated to equipment is filtered.Meanwhile for multiple functional modules in electronic equipment, when there is abnormal function unit
When, the transmission control information notifying abnormal function unit while so that the functional module improves the frequency acquisition of log, increases
The acquisition type of log.The technical solution that this Shen provides reduces electronic equipment in the case where resource anxiety to device resource
Consumption, meanwhile, the log collection amount to abnormal function unit is improved, targetedly convenient for preferably different to abnormal function unit
Normal information is analyzed.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair
The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the hardware structure diagram of electronic equipment provided by the embodiments of the present application;
Fig. 2 is the step flow chart of journal obtaining method provided by the embodiments of the present application;
Fig. 3 is the sub-step flow chart of step S300 provided by the embodiments of the present application;
Fig. 4 is the structure chart of log acquisition apparatus provided by the embodiments of the present application.
Icon: 100- electronic equipment;130- processor;110- log acquisition device;120- memory;1101- state obtains
Modulus block;1102- log acquisition module;1103- filtering module;1104- level adjustment module.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is
Some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is implemented
The component of example can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiments herein provided in the accompanying drawings is not intended to limit below claimed
Scope of the present application, but be merely representative of the selected embodiment of the application.Based on the embodiment in the application, this field is common
Technical staff's every other embodiment obtained without creative efforts belongs to the model of the application protection
It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
In the description of the present application, it is also necessary to which explanation is unless specifically defined or limited otherwise, term " setting ",
" installation ", " connected ", " connection " shall be understood in a broad sense, for example, it may be fixedly connected, may be a detachable connection or one
Connect to body;It can be mechanical connection, be also possible to be electrically connected;It can be directly connected, it can also be indirect by intermediary
It is connected, can be the connection inside two elements.For the ordinary skill in the art, on being understood with concrete condition
State the concrete meaning of term in this application.
Please refer to the hardware structure diagram of electronic equipment 100 shown in FIG. 1.The electronic equipment 100 is filled including log acquisition
Set 110, memory 120 and processor 130.
The electronic equipment 100 may be, but not limited to, smart phone, PC (personal computer,
PC), tablet computer, personal digital assistant (personal digital assistant, PDA), mobile internet surfing equipment (mobile
Internet device, MID) etc..
The operating system of the electronic equipment 100 may be, but not limited to, Android (Android) system, IOS (iPhone
Operating system) system, Windows phone system, Windows system etc..
The memory 120 and each element of processor 130 are directly or indirectly electrically connected between each other, to realize data
Transmission or interaction.Electrically connect for example, these elements can be realized between each other by one or more communication bus or signal wire
It connects.
Wherein, the memory 120 may be, but not limited to, random access memory (Random Access
Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable
Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only
Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only
Memory, EEPROM) etc..Wherein, memory 120 is for storing program, the processor 130 after receiving and executing instruction,
Execute described program.
The processor 130 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor can
To be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network
Processor, NP) etc.;It can also be digital signal processor (DSP), specific integrated circuit (ASIC), field-programmable gate array
Arrange (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented
Or disclosed each method, step and logic diagram in execution the embodiment of the present application.General processor can be microprocessor
Or the processor is also possible to any conventional processor etc..
Since log storage operation is an I/O operation, need constantly to carry out the storage mediums such as disk or Flash
Read-write operation, it is bigger to the expense of system resource, especially to the consumption of electricity than more serious, in order in device resource anxiety
When, log storage operation is reduced to the occupancy of system resource, and the present embodiment provides a kind of journal obtaining methods.
The step flow chart of the journal obtaining method for being applied to electronic equipment 100 shown in Fig. 1 as shown in Figure 2 below will
To the method includes each steps to be described in detail.
Step S100, obtains the currently running multiple state values of the electronic equipment 100 in real time, and the state value indicates institute
It states electronic equipment 100 and runs current operating status.
Optionally, the electronic equipment 100 monitors in real time and obtains equipment current state, wherein the current shape of equipment
State includes CPU usage, disk utilization rate, memory usage, network resource utilization, battery capacity or device temperature.
Step S200 obtains the log information when electronic equipment 100 operation, wherein the log information is according to weight
Degree is wanted to be preset with different logging levels.
Optionally, the electronic equipment 100 includes multiple functional units.The functional unit is to operate in the electronics to set
Each software on standby 100, such as the single program on computer, APP or operating system nucleus in smart phone.The electricity
Sub- equipment 100 further includes log collection unit, and the log collection unit is used to pass through interprocess communication or inter-thread communication
Mode uniformly collect each functional unit on the electronic equipment 100 generation log information, wherein interprocess communication side
Method includes the modes such as message queue or shared drive.
Step S300 filters out the log information of corresponding logging level according to the multiple state value, and to the day after filter
Will information is stored.
Log information for the ease of generating to functional unit each in equipment is managed, in advance to different function lists
Different logging levels is preset in the log that member generates, wherein the logging level is drawn according to the significance level of log information
Point.
In a kind of specific embodiment provided in this embodiment, each state value of the electronic equipment 100 corresponds to phase
The threshold value answered.The sub-step flow chart of step S300 shown in Fig. 3 is please referred to, will include below each height to the step S300
Step is described in detail.
Step S3001 compares each state value preset threshold corresponding with the state value, will be more than that the correspondence is pre-
If the state value of threshold value is labeled as exceeded state value.
Step S3002, the quantity for counting the exceeded state value obtain exceeded sum.
Optionally, the state value for the equipment operation that the electronic equipment 100 will acquire is corresponding with the state value respectively
Preset threshold is compared, and will be more than to the default state value for answering threshold value labeled as exceeded state value.Then, the electronic equipment
The quantity of the 100 statistics exceeded state values obtains exceeded sum.
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value by step S3003,
The corresponding target journaling grade of the destination number threshold value is determined according to the destination number threshold value, wherein the multiple quantity
Threshold value corresponds to different logging levels.
Optionally, the electronic equipment 100 is preset with multiple amount thresholds, and different amount thresholds corresponds to different logs
Grade.The electronic equipment 100 is by the exceeded sum and sets preset amount threshold and is compared, and determines destination number threshold
Value, determines target journaling grade according to the destination number threshold value.The electronic equipment 100 is according to the target journaling grade mistake
Filter the log information lower than the target journaling grade.
Optionally, the corresponding alarm threshold of quantity that the electronic equipment 100 is preset with exceeded state value, when described exceeded
When the quantity of state value is more than the alarm threshold, stop obtaining journal file, so that the electronic equipment 100 further reduces
Consumption to device resource.
For example, the logging level of functional unit is divided into 1-6 by the electronic equipment 100 in a kind of possible example
A grade;The amount threshold of the electronic equipment 100 is 1-6;Wherein, numerical value is bigger, and higher grade, the amount threshold and institute
State logging level one-to-one correspondence.The electronic equipment 100 obtains CPU usage, disk utilization rate, memory usage, network money
The state value of source utilization rate, battery capacity and device temperature.The electronic equipment 100 is respectively by each state value and the device value
Corresponding threshold value comparison, as a result, it has been found that, wherein CPU usage, disk utilization rate and memory usage are more than its corresponding threshold values,
It is marked as exceeded state value.The quantity that the electronic equipment 100 counts exceeded state value is 3, and then determines target journaling
Grade is 3.The electronic equipment 100 filters out the log information that logging level is 1 and 2 according to the target journaling grade, and will
Filtered log information is disaggregatedly stored.
In another specific embodiment provided in this embodiment, the state value of the electronic equipment 100 is corresponding
State is preset with different state grades according to state urgency level.The electronic equipment 100 is by each state value and the state
It is worth corresponding preset threshold to compare, will is more than the state value of the corresponding preset threshold labeled as exceeded state value.The electricity
Sub- equipment 100 obtains the state value of wherein highest level, and the state value that will determine highest level according to the exceeded state value
Corresponding target journaling grade, wherein different conditions grade corresponds to different logging levels.The electronic equipment 100 is according to institute
Target journaling grade is stated, filters out the log information lower than the target journaling grade, and filtered log information is carried out
Disaggregatedly store.
For example, the logging level of functional unit is divided into 1-6 by the electronic equipment 100 in a kind of possible example
A grade.The state of the electronic equipment 100 includes CPU usage, disk utilization rate, memory usage, Internet usage
Rate, battery capacity and device temperature state value.The state value corresponding states of the electronic equipment 100 is drawn according to state urgency level
It is divided into 1-6 grade, wherein the numerical value of grade is bigger, and higher grade.The CPU usage, disk utilization rate, memory make
Grade 1-6 is respectively corresponded with rate, network resource utilization, device temperature and battery capacity.The electronic equipment 100 obtains equipment
The state value of current operating conditions, compared with state value preset threshold corresponding with the state value.It was found that wherein disk makes
It is greater than its corresponding preset threshold with rate, memory usage and battery capacity.Again because of the state grade highest of battery capacity, root
Determine that target journaling grade is 6 according to the state grade of battery capacity.The electronic equipment 100 is according to the target journaling grade mistake
Filter the log information that logging level is lower than 6.
It further include abnormal log information in the log information, when the electronic equipment 100 is in the log information got
In note abnormalities log information, show that the corresponding functional unit of the abnormal log information needs to carry out key monitoring.
Optionally, when occurring abnormal function unit in the multiple functional unit, the abnormal function unit is improved
The logging level of log information.Meanwhile in order to obtain the log information of more abnormal function units, convenient for technology people in the future
Member analyzes the reason of existing abnormal conditions.The electronic equipment 100 sends control information, notifies the abnormal function unit, so that
The abnormal function unit increases log collection point and log collection frequency, wherein the log collection point indicates the kind of log
Class.
In a kind of specific embodiment provided in this embodiment, the electronic equipment 100 passes through modification configuration file
Method notify abnormal function unit.The electronic equipment 100 once gets abnormal log information, modifies the abnormal log
The corresponding configuration file of information, so that the abnormal function unit increases log collection point and frequency acquisition.The abnormal function
Unit detects that configuration file is modified, and then reads the configuration information in configuration file.The abnormal function unit is according to repairing
Configuration information after changing, unlatching is more log information, while increasing log collection frequency.
The present embodiment also provides a kind of log acquisition apparatus, the structure chart of log acquisition apparatus as shown in Figure 4, the day
Will acquisition device 110 includes that at least one can be stored in the memory 120 in the form of software or firmware (firmware)
Or it is solidificated in the software function module in the operating system (operating system, OS) of the electronic equipment 100.The place
Reason device 130 is used to execute the executable module stored in the memory 120, such as included by the log acquisition device 110
Software function module and computer program etc..The log acquisition device 110 includes state acquisition module 1101, log acquisition
Module 1102, filtering module 1103.
The state acquisition module 1101 is used to obtain the currently running multiple state values of the electronic equipment 100 in real time,
The state value indicates that the electronic equipment 100 runs current operating status.
In the present embodiment, the state acquisition module 1101 is used to execute the step S100 in Fig. 2, about the state
The detailed description for obtaining module 1101 can refer to the detailed description of step S300.
The log acquisition module 1102 is used to obtain the log information when electronic equipment 100 operation, wherein described
Log information is preset with different logging levels according to significance level.
In the present embodiment, the log acquisition module 1102 is used to execute the step S200 in Fig. 2, about the log
The detailed description for obtaining module 1102 can refer to the detailed description of step S200.
The filtering module 1103 is used to filter out the log information of corresponding logging level according to the multiple state value, and
Log information after filter is stored.
In the present embodiment, the filtering module 1103 is used to execute the step S300 in Fig. 2, about the filtering module
1103 detailed description can refer to the detailed description of step S300.
Optionally, the filtering module 1103 is in the following manner filtered the log information:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
The quantity for counting the exceeded state value obtains exceeded sum;
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value, according to the mesh
Mark amount threshold determines the corresponding target journaling grade of the destination number threshold value, wherein the multiple amount threshold is corresponding not
Same logging level;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the filtering module 1103 is also in the following manner filtered the log information:
Each state value preset threshold corresponding with the state value is compared, will be more than the shape of the corresponding preset threshold
State value is labeled as exceeded state value;
Highest state grade therein is obtained according to the exceeded state value, and determines that the highest state grade is corresponding
Target journaling grade, wherein different conditions grade is corresponding with different logging levels;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
Optionally, the electronic equipment 100 includes multiple functional units, and the log information further includes exception information, institute
Stating log acquisition device 110 further includes level adjustment module 1104;
The level adjustment module 1104 is used for when occurring abnormal function unit in the multiple functional unit, improves institute
State the logging level of the log information of abnormal function unit.
Journal obtaining method and device provided by the present application are applied to electronic equipment 100, electronic equipment 100 are generated
The default corresponding logging level of log information.By obtaining the current multiple state values of the electronic equipment 100, according to electronic equipment
The log that 100 current states generate equipment is filtered.Meanwhile for multiple functional modules in electronic equipment 100, when
When there is abnormal function unit, transmission control information notifying abnormal function unit, so that the functional module improves adopting for log
While collecting frequency, increase the acquisition type of log.The technical solution that this Shen provides, it is tight in resource to reduce electronic equipment 100
Device resource is consumed in the case where, meanwhile, the log collection amount to abnormal function unit is improved, targetedly convenient for more
The exception information of abnormal function unit is analyzed well.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other
Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown
According to device, the architectural framework in the cards of method and computer program product, function of multiple embodiments of the application
And operation.In this regard, each box in flowchart or block diagram can represent one of a module, section or code
Point, a part of the module, section or code includes one or more for implementing the specified logical function executable
Instruction.It should also be noted that function marked in the box can also be attached to be different from some implementations as replacement
The sequence marked in figure occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes may be used
To execute in the opposite order, this depends on the function involved.It is also noted that each of block diagram and or flow chart
The combination of box in box and block diagram and or flow chart can be based on the defined function of execution or the dedicated of movement
The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the application can integrate one independent portion of formation together
Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module
It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any
Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain
Lid is within the scope of protection of this application.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.
Claims (10)
1. a kind of journal obtaining method, which is characterized in that be applied to electronic equipment, the step of the method includes:
The currently running multiple state values of the electronic equipment are obtained in real time, and the state value indicates that the electronic equipment operation is worked as
Preceding operating status;
Obtain log information when electronic equipment operation, wherein the log information is preset with difference according to significance level
Logging level;
The log information of corresponding logging level is filtered out according to the multiple state value, and the log information after filter is deposited
Storage.
2. journal obtaining method according to claim 1, which is characterized in that described to be filtered out according to the multiple state value
The step of corresponding log information includes:
Each state value preset threshold corresponding with the state value is compared, will be more than the state of the corresponding preset threshold
Value is labeled as exceeded state value;
The quantity for counting the exceeded state value obtains exceeded sum;
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value, according to the number of targets
Amount threshold value determines the corresponding target journaling grade of the destination number threshold value, wherein the multiple amount threshold corresponds to different
Logging level;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
3. journal obtaining method according to claim 2, which is characterized in that described to be filtered out according to the multiple state value
The step of log information of corresponding logging level further include:
When the quantity is more than default alarm threshold, stop obtaining journal file.
4. journal obtaining method according to claim 1, which is characterized in that the corresponding state of the state value is according to state
Urgency level is preset with different state grades, described to filter out corresponding log information according to the multiple state value
Step includes:
Each state value preset threshold corresponding with the state value is compared, will be more than the state value of the corresponding preset threshold
Labeled as exceeded state value;
Highest state grade therein is obtained according to the exceeded state value, and determines the corresponding target of the highest state grade
Logging level, wherein different conditions grade is corresponding with different logging levels;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
5. journal obtaining method according to claim 1, which is characterized in that the electronic equipment includes multiple function lists
Member, the log information further include exception information;The method also includes:
When occurring abnormal function unit in the multiple functional unit, the day of the log information of the abnormal function unit is improved
Will grade.
6. journal obtaining method according to claim 5, which is characterized in that the method also includes:
Abnormal function unit described in transmission control information notifying, so that the abnormal function unit increases log collection point and log
Frequency acquisition, wherein the log collection point indicates the type of log.
7. a kind of log acquisition device, which is characterized in that be applied to electronic equipment, the log acquisition device includes that state obtains
Module, log acquisition module, filtering module;
The state acquisition module for obtaining the currently running multiple state values of the electronic equipment, the state value table in real time
Show that the electronic equipment runs current operating status;
The log acquisition module is used to obtain log information when electronic equipment operation, wherein the log information root
Different logging levels is preset with according to significance level;
The filtering module is used to filter out the log information of corresponding logging level according to the multiple state value, and to filter after
Log information is stored.
8. log acquisition device according to claim 7, which is characterized in that the filtering module is in the following manner to institute
Log information is stated to be filtered:
Each state value preset threshold corresponding with the state value is compared, will be more than the state value of the corresponding preset threshold
Labeled as exceeded state value;
The quantity for counting the exceeded state value obtains exceeded sum;
The exceeded sum and preset multiple amount thresholds are compared determining destination number threshold value, according to the number of targets
Amount threshold value determines the corresponding target journaling grade of the destination number threshold value, wherein the multiple amount threshold corresponds to different
Logging level;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
9. log acquisition device according to claim 7, which is characterized in that the filtering module is also right in the following manner
The log information is filtered:
Each state value preset threshold corresponding with the state value is compared, will be more than the state value of the corresponding preset threshold
Labeled as exceeded state value;
Highest state grade therein is obtained according to the exceeded state value, and determines the corresponding target of the highest state grade
Logging level, wherein different conditions grade is corresponding with different logging levels;
According to the target journaling grade, the log information lower than the target journaling grade is filtered out.
10. log acquisition device according to claim 7, which is characterized in that the electronic equipment includes multiple function lists
Member, the log information include exception information, and the log acquisition device further includes level adjustment module;
The level adjustment module is used for when occurring abnormal function unit in the multiple functional unit, improves the abnormal function
The logging level of the log information of energy unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811607426.8A CN109656786B (en) | 2018-12-27 | 2018-12-27 | Log acquisition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811607426.8A CN109656786B (en) | 2018-12-27 | 2018-12-27 | Log acquisition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109656786A true CN109656786A (en) | 2019-04-19 |
CN109656786B CN109656786B (en) | 2022-06-03 |
Family
ID=66116880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811607426.8A Active CN109656786B (en) | 2018-12-27 | 2018-12-27 | Log acquisition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109656786B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124727A (en) * | 2019-12-12 | 2020-05-08 | 京信通信系统(中国)有限公司 | Log processing method, device, equipment and storage medium |
CN111176946A (en) * | 2019-12-29 | 2020-05-19 | 山东英信计算机技术有限公司 | SEL log recording method, device, equipment and storage medium |
CN112799922A (en) * | 2019-11-14 | 2021-05-14 | 合肥杰发科技有限公司 | Log management method, electronic equipment and storage device |
CN115391161A (en) * | 2022-10-28 | 2022-11-25 | 荣耀终端有限公司 | Log transmission method, device, system and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104375928A (en) * | 2013-08-12 | 2015-02-25 | 鸿富锦精密工业(深圳)有限公司 | Abnormal log management method and system |
CN108491310A (en) * | 2018-03-26 | 2018-09-04 | 北京九章云极科技有限公司 | A kind of daily record monitoring method and system |
CN108846070A (en) * | 2018-06-07 | 2018-11-20 | 北京京东尚科信息技术有限公司 | Log processing method, system, electronic equipment and the storage medium of distributed system |
US20180365083A1 (en) * | 2017-06-15 | 2018-12-20 | Simmonds Precision Products, Inc. | Event-based data collection for smart sensors on an arbitrating bus |
-
2018
- 2018-12-27 CN CN201811607426.8A patent/CN109656786B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104375928A (en) * | 2013-08-12 | 2015-02-25 | 鸿富锦精密工业(深圳)有限公司 | Abnormal log management method and system |
US20180365083A1 (en) * | 2017-06-15 | 2018-12-20 | Simmonds Precision Products, Inc. | Event-based data collection for smart sensors on an arbitrating bus |
CN108491310A (en) * | 2018-03-26 | 2018-09-04 | 北京九章云极科技有限公司 | A kind of daily record monitoring method and system |
CN108846070A (en) * | 2018-06-07 | 2018-11-20 | 北京京东尚科信息技术有限公司 | Log processing method, system, electronic equipment and the storage medium of distributed system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112799922A (en) * | 2019-11-14 | 2021-05-14 | 合肥杰发科技有限公司 | Log management method, electronic equipment and storage device |
CN111124727A (en) * | 2019-12-12 | 2020-05-08 | 京信通信系统(中国)有限公司 | Log processing method, device, equipment and storage medium |
CN111176946A (en) * | 2019-12-29 | 2020-05-19 | 山东英信计算机技术有限公司 | SEL log recording method, device, equipment and storage medium |
CN111176946B (en) * | 2019-12-29 | 2022-04-22 | 山东英信计算机技术有限公司 | SEL log recording method, device, equipment and storage medium |
CN115391161A (en) * | 2022-10-28 | 2022-11-25 | 荣耀终端有限公司 | Log transmission method, device, system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109656786B (en) | 2022-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109656786A (en) | Journal obtaining method and device | |
US9823954B2 (en) | Predicting anomalies and incidents in a computer application | |
US7702780B2 (en) | Monitoring method, system, and computer program based on severity and persistence of problems | |
CN108959034A (en) | A kind of monitoring alarm method, device, electronic equipment and storage medium | |
CN105429300B (en) | power monitoring method and system | |
CN105224439A (en) | Method and device for detecting CPU occupancy rate of terminal APP and terminal | |
US20150006440A1 (en) | Systems and methods for predictive analysis | |
CN112373306A (en) | Vehicle power battery fault remote monitoring and alarming system and method | |
CN107576930B (en) | power supply and relay status detection circuit and method | |
CN103885803A (en) | Method and device for managing procedures in mobile terminal and mobile terminal | |
US20070168310A1 (en) | Problem determination rules processing | |
CN106372820A (en) | Automatic payment reminding method and system | |
CN105871634A (en) | Method and application for detecting cluster anomalies and cluster managing system | |
CN110020769A (en) | A kind of business risk monitoring method, device and equipment | |
US20220138068A1 (en) | Computer readable program code change impact estimations | |
CN109040277A (en) | A kind of long-distance monitoring method and device of server | |
CN105739668A (en) | Power management method and power management system of notebook computers | |
CN110345100A (en) | Monitoring method, device, equipment and the readable storage medium storing program for executing of server fan rotating speed | |
CN112532435A (en) | Operation and maintenance method, operation and maintenance management platform, equipment and medium | |
CN106124835B (en) | A kind of method that power distribution voltage compares with predetermined voltage | |
CN110399405A (en) | Log alarming method, apparatus, system and storage medium | |
Chon et al. | Crowdsensing-based smartphone use guide for battery life extension | |
CN117608957A (en) | System security monitoring method, device and storage medium | |
CN113568494B (en) | Detection apparatus for hard disk supply voltage | |
CN104253722A (en) | Dataflow monitoring method and dataflow monitoring device for remote mobile phone management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |