CN109656786B - Log acquisition method and device - Google Patents

Log acquisition method and device Download PDF

Info

Publication number
CN109656786B
CN109656786B CN201811607426.8A CN201811607426A CN109656786B CN 109656786 B CN109656786 B CN 109656786B CN 201811607426 A CN201811607426 A CN 201811607426A CN 109656786 B CN109656786 B CN 109656786B
Authority
CN
China
Prior art keywords
log
state
target
information
electronic equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811607426.8A
Other languages
Chinese (zh)
Other versions
CN109656786A (en
Inventor
于波
邵亚娟
李鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianhong Asset Management Co ltd
Original Assignee
Tianhong Asset Management 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 Tianhong Asset Management Co ltd filed Critical Tianhong Asset Management Co ltd
Priority to CN201811607426.8A priority Critical patent/CN109656786B/en
Publication of CN109656786A publication Critical patent/CN109656786A/en
Application granted granted Critical
Publication of CN109656786B publication Critical patent/CN109656786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring 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
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy 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

The log obtaining method and device are applied to electronic equipment, and log information generated by the electronic equipment is preset with a corresponding log grade. And filtering the log generated by the equipment according to the current state of the electronic equipment by acquiring a plurality of current state values of the electronic equipment. Meanwhile, for a plurality of functional modules in the electronic equipment, when an abnormal functional unit occurs, control information is sent to inform the abnormal functional unit, so that the functional modules increase the collection frequency of the logs and increase the collection types of the logs. The technical scheme provided by the application reduces the consumption of the electronic equipment on the equipment resources under the condition of resource shortage, and meanwhile, the log collection amount of the abnormal functional unit is improved in a targeted manner, so that the abnormal information of the abnormal functional unit can be better analyzed.

Description

Log obtaining method and device
Technical Field
The application relates to the field of computers, in particular to a log obtaining method and device.
Background
In a log collection system of an electronic device at present, the log collection system collects operation logs of each functional module of the electronic device and stores log information in different categories. And then the later analysis and storage of the log information is facilitated. Meanwhile, in the current log collection system, some simple filtering can be performed aiming at a large amount of logs, and some irrelevant log information can be filtered. Because log storage can perform I/O operation, when the amount of logs is too large, indexes such as load and power consumption of a system can be influenced.
Disclosure of Invention
In order to overcome the above disadvantages in the prior art, an object of the present application is to provide a log obtaining method applied to an electronic device, where the method includes:
acquiring a plurality of state values of the current operation of the electronic equipment in real time, wherein the state values represent the current operation state of the electronic equipment;
acquiring log information of the electronic equipment during operation, wherein the log information is preset with different log grades according to the importance degree;
and filtering the log information of the corresponding log grade according to the plurality of state values, and storing the filtered log information.
Optionally, the step of filtering out log information of corresponding levels according to the plurality of state values includes:
comparing each state value with a preset threshold corresponding to the state value, and marking the state value exceeding the corresponding preset threshold as an overproof state value;
counting the number of the overproof state values to obtain an overproof total number;
comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, and determining a target log grade corresponding to the target number threshold according to the target number threshold, wherein the plurality of number thresholds correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the step of filtering out log information of corresponding log levels according to the plurality of state values further includes:
and when the number exceeds a preset warning threshold value, stopping acquiring the log file.
Optionally, different status levels are preset for the status corresponding to the status value according to the status urgency, and the step of filtering out log information of corresponding levels according to the plurality of status values includes:
comparing each state value with a preset threshold corresponding to the state value, and marking the state value exceeding the corresponding preset threshold as an overproof state value;
acquiring the highest state grade according to the standard exceeding state value, and determining a target log grade corresponding to the highest state grade, wherein different state grades correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the electronic device includes a plurality of functional modules, and the log information further includes exception information; the method further comprises the following steps:
and when an abnormal functional unit appears in the plurality of functional modules, improving the log level of the log information of the abnormal functional unit.
Optionally, the method further comprises:
and sending control information to inform the abnormal function unit so that the abnormal function unit increases a log collection point and a log collection frequency, wherein the log collection point represents the type of a log.
Another objective of the present application is to provide a log obtaining apparatus, which is applied to an electronic device, and the log obtaining apparatus includes a state obtaining module, a log obtaining module, and a filtering module;
the state acquisition module is used for acquiring a plurality of state values of the current operation of the electronic equipment in real time, wherein the state values represent the current operation state of the electronic equipment;
the log obtaining module is used for obtaining log information when the electronic equipment runs, wherein the log information is preset with different log grades according to the importance degree;
and the filtering module is used for filtering the log information of the corresponding log grade according to the plurality of state values and storing the filtered log information.
Optionally, the filtering module filters the log information by:
comparing each state value with a preset threshold value corresponding to the state value, and marking the state value exceeding the corresponding preset threshold value as an overproof state value;
counting the number of the overproof state values to obtain an overproof total number;
comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, and determining a target log grade corresponding to the target number threshold according to the target number threshold, wherein the plurality of number thresholds correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the filtering module further filters the log information by:
comparing each state value with a preset threshold corresponding to the state value, and marking the state value exceeding the corresponding preset threshold as an overproof state value;
acquiring the highest state grade according to the standard exceeding state value, and determining a target log grade corresponding to the highest state grade, wherein different state grades correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the electronic device includes a plurality of functional modules, the log information further includes abnormal information, and the log obtaining apparatus further includes a level adjustment module;
the level adjusting module is used for improving the log level of the log information of the abnormal functional unit when the abnormal functional unit appears in the plurality of functional modules.
Compared with the prior art, the method has the following beneficial effects:
the log obtaining method and device are applied to electronic equipment, and log information generated by the electronic equipment is preset with a corresponding log grade. And filtering the log generated by the equipment according to the current state of the electronic equipment by acquiring a plurality of current state values of the electronic equipment. Meanwhile, for a plurality of functional modules in the electronic equipment, when an abnormal functional unit occurs, control information is sent to inform the abnormal functional unit, so that the functional modules increase the collection frequency of the logs and increase the collection types of the logs. The technical scheme provided by the application reduces the consumption of the electronic equipment on the equipment resources under the condition of resource shortage, and meanwhile, the log collection amount of the abnormal functional unit is improved in a targeted manner, so that the abnormal information of the abnormal functional unit can be better analyzed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating steps of a log obtaining method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating sub-steps of step S300 according to an embodiment of the present disclosure;
fig. 4 is a structural diagram of a log collection device according to an embodiment of the present application.
Icon: 100-an electronic device; 130-a processor; 110-log obtaining means; 120-a memory; 1101-a state acquisition module; 1102-a log obtaining module; 1103-a filter module; 1104-level adjustment module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures.
In the description of the present application, it is further noted that, unless expressly stated or limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Please refer to fig. 1 for a hardware structure of an electronic device 100. The electronic device 100 includes a log obtaining apparatus 110, a memory 120, and a processor 130.
The electronic device 100 may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like.
The operating system of the electronic device 100 may be, but is not limited to, an Android system, an ios (Android system), a Windows phone system, a Windows system, and the like.
The elements of the memory 120 and the processor 130 are electrically connected to each other, directly or indirectly, to enable data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The Memory 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like. The memory 120 is used for storing a program, and the processor 130 executes the program after receiving the execution instruction.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Because the log storage operation is an I/O operation, it is necessary to continuously perform read-write operations on storage media such as a disk or a Flash, the overhead on system resources is relatively high, especially the consumption of electric quantity is relatively serious, and in order to reduce the occupation of the system resources by the log storage operation when the device resources are in short supply, the embodiment provides a log acquisition method.
As shown in fig. 2, the method for obtaining a log applied to the electronic device 100 shown in fig. 1 includes various steps, which will be described in detail below.
Step S100, obtaining a plurality of current operating status values of the electronic device 100 in real time, where the status values represent the current operating status of the electronic device 100.
Optionally, the electronic device 100 monitors and acquires a current state of the device in real time, where the current state of the device includes a CPU usage rate, a disk usage rate, a memory usage rate, a network resource usage rate, a battery level, or a device temperature.
Step S200, obtaining log information of the electronic device 100 during operation, wherein the log information has different log levels preset according to the importance level.
Optionally, the electronic device 100 includes a plurality of functional units. The functional units are software running on the electronic device 100, such as a single program on a computer, an APP in a smart phone, or an operating system kernel. The electronic device 100 further includes a log collection unit, which is configured to collect log information generated by each functional unit on the electronic device 100 in a unified manner through inter-process communication or inter-thread communication, where the inter-process communication method includes a message queue or a shared memory.
And step S300, filtering the log information of the corresponding log grade according to the plurality of state values, and storing the filtered log information.
In order to facilitate management of log information generated by each functional unit in the device, different log grades are preset for logs generated by different functional units in advance, wherein the log grades are divided according to the importance degree of the log information.
In a specific implementation manner provided in this embodiment, each state value of the electronic device 100 corresponds to a corresponding threshold. Referring to the flowchart of the sub-steps of step S300 shown in fig. 3, the sub-steps of step S300 will be described in detail.
Step S3001, compare each state value with a preset threshold corresponding to the state value, and mark the state value exceeding the corresponding preset threshold as an overproof state value.
And step S3002, counting the number of the overproof state values to obtain the overproof total number.
Optionally, the electronic device 100 compares the obtained device operation state values with preset thresholds corresponding to the state values, and marks the state values exceeding the preset thresholds as superstandard state values. Then, the electronic apparatus 100 counts the number of the superscalar state values to obtain a superscalar total.
Step S3003, comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, and determining a target log level corresponding to the target number threshold according to the target number threshold, wherein the plurality of number thresholds correspond to different log levels.
Optionally, a plurality of quantity thresholds are preset in the electronic device 100, and different quantity thresholds correspond to different log levels. The electronic device 100 compares the standard exceeding total number with a preset number threshold, determines a target number threshold, and determines a target log grade according to the target number threshold. The electronic device 100 filters out log information lower than the target log level according to the target log level.
Optionally, the electronic device 100 presets a warning threshold corresponding to the number of the superstandard state values, and when the number of the superstandard state values exceeds the warning threshold, the log file is stopped from being acquired, so that the electronic device 100 further reduces consumption of device resources.
For example, in one possible example, the electronic device 100 divides the log level of the functional unit into 1-6 levels; the number threshold of the electronic devices 100 is 1-6; wherein, the larger the numerical value is, the higher the grade is, and the number threshold corresponds to the log grade one by one. The electronic device 100 obtains the state values of the CPU usage rate, the disk usage rate, the memory usage rate, the network resource usage rate, the battery level, and the device temperature. The electronic device 100 compares each state value with the threshold corresponding to the device value, and as a result, it finds that the CPU utilization, the disk utilization, and the memory utilization exceed their corresponding thresholds, and marks them as an excessive state value. The electronic device 100 counts the number of the superscalar status values to be 3, and determines that the target log level is 3. The electronic device 100 filters out log information with log levels of 1 and 2 according to the target log level, and stores the filtered log information in different categories.
In another specific implementation manner provided by this embodiment, the states corresponding to the state values of the electronic device 100 have different state levels according to the state emergency degree. The electronic device 100 compares each state value with a preset threshold corresponding to the state value, and marks the state value exceeding the corresponding preset threshold as an overproof state value. The electronic device 100 obtains the state value of the highest level according to the superstandard state value, and determines a target log level corresponding to the state value of the highest level, wherein different state levels correspond to different log levels. The electronic device 100 filters log information lower than the target log level according to the target log level, and stores the filtered log information in categories.
For example, in one possible example, the electronic device 100 divides the log level of the functional unit into 1-6 levels. The state of the electronic device 100 includes a CPU utilization rate, a disk utilization rate, a memory utilization rate, a network resource utilization rate, a battery level, and a device temperature state value. The corresponding state of the state value of the electronic device 100 is divided into 1-6 levels according to the state emergency degree, wherein the higher the value of the level is, the higher the level is. The CPU utilization rate, the disk utilization rate, the memory utilization rate, the network resource utilization rate, the equipment temperature and the battery power respectively correspond to grades 1-6. The electronic device 100 obtains a state value of a current operating state of the device, and compares the state value with a preset threshold corresponding to the state value. And finding that the utilization rate of the disk, the utilization rate of the memory and the electric quantity of the battery are greater than the corresponding preset threshold values. And because the state grade of the battery electric quantity is highest, the target log grade is determined to be 6 according to the state grade of the battery electric quantity. And the electronic equipment 100 filters out log information with a log level lower than 6 according to the target log level.
The log information further includes abnormal log information, and when the electronic device 100 finds the abnormal log information in the acquired log information, it indicates that the functional unit corresponding to the abnormal log information needs to perform key monitoring.
Optionally, when an abnormal functional unit occurs in the plurality of functional units, the log level of the log information of the abnormal functional unit is increased. Meanwhile, in order to acquire more log information of the abnormal functional unit, technicians can analyze the reason of the abnormal condition in the future conveniently. The electronic device 100 sends control information to notify the abnormal functional unit, so that the abnormal functional unit increases a log collection point and a log collection frequency, wherein the log collection point represents a log type.
In a specific implementation manner provided by this embodiment, the electronic device 100 notifies the abnormal functional unit by a method of modifying the configuration file. Once the electronic device 100 acquires the abnormal log information, the configuration file corresponding to the abnormal log information is modified, so that the abnormal functional unit increases the log acquisition point and the log acquisition frequency. And the abnormal function unit detects that the configuration file is modified, and then reads the configuration information in the configuration file. And the abnormal function unit starts more log information according to the modified configuration information and increases the log acquisition frequency.
In this embodiment, a structure diagram of the log collecting apparatus shown in fig. 4 is further provided, where the log obtaining apparatus 110 includes at least one software functional module that can be stored in the memory 120 in a form of software or firmware (firmware) or solidified in an Operating System (OS) of the electronic device 100. The processor 130 is used for executing executable modules stored in the memory 120, such as software functional modules and computer programs included in the log obtaining device 110. The log obtaining device 110 includes a state obtaining module 1101, a log obtaining module 1102, and a filtering module 1103.
The state acquiring module 1101 is configured to acquire a plurality of state values of the current operation of the electronic device 100 in real time, where the state values represent the current operation state of the electronic device 100.
In the present embodiment, the status acquiring module 1101 is configured to execute step S100 in fig. 2, and reference may be made to the detailed description of step S300 for a detailed description of the status acquiring module 1101.
The log obtaining module 1102 is configured to obtain log information of the electronic device 100 during operation, where the log information has different log levels preset according to importance levels.
In this embodiment, the log obtaining module 1102 is configured to execute step S200 in fig. 2, and reference may be made to the detailed description of step S200 for a detailed description of the log obtaining module 1102.
The filtering module 1103 is configured to filter log information of corresponding log levels according to the plurality of state values, and store the filtered log information.
In this embodiment, the filtering module 1103 is configured to perform step S300 in fig. 2, and reference may be made to the detailed description of step S300 for a detailed description of the filtering module 1103.
Optionally, the filtering module 1103 filters the log information by:
comparing each state value with a preset threshold value corresponding to the state value, and marking the state value exceeding the corresponding preset threshold value as an overproof state value;
counting the number of the overproof state values to obtain an overproof total number;
comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, and determining a target log grade corresponding to the target number threshold according to the target number threshold, wherein the plurality of number thresholds correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the filtering module 1103 further filters the log information by:
comparing each state value with a preset threshold corresponding to the state value, and marking the state value exceeding the corresponding preset threshold as an overproof state value;
acquiring the highest state grade according to the standard exceeding state value, and determining a target log grade corresponding to the highest state grade, wherein different state grades correspond to different log grades;
and filtering out log information lower than the target log grade according to the target log grade.
Optionally, the electronic device 100 includes a plurality of functional units, the log information further includes abnormal information, and the log obtaining apparatus 110 further includes a level adjustment module 1104;
the level adjustment module 1104 is configured to, when an abnormal functional unit occurs in the plurality of functional units, increase a log level of log information of the abnormal functional unit.
The log obtaining method and device provided by the application are applied to the electronic equipment 100, and the log information generated by the electronic equipment 100 is preset into the corresponding log grade. By acquiring a plurality of current state values of the electronic device 100, the log generated by the device is filtered according to the current state of the electronic device 100. Meanwhile, for a plurality of functional modules in the electronic device 100, when an abnormal functional unit occurs, control information is sent to notify the abnormal functional unit, so that the functional module increases the collection frequency of the log and increases the collection types of the log. According to the technical scheme, the consumption of the electronic equipment 100 on the equipment resources under the condition of resource shortage is reduced, meanwhile, the log collection amount of the abnormal functional unit is improved in a targeted mode, and the abnormal information of the abnormal functional unit is conveniently analyzed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. A log obtaining method is applied to an electronic device, and the method comprises the following steps:
acquiring a plurality of state values of the current operation of the electronic equipment in real time, wherein the state values represent the current operation state of the electronic equipment;
acquiring log information of the electronic equipment during operation, wherein the log information is preset with different log grades according to the importance degree;
comparing each state value with a preset threshold corresponding to the state value respectively, and marking the state value exceeding the preset threshold as an overproof state value;
counting the number of the overproof state values to obtain an overproof total number;
comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, wherein the number thresholds correspond to different log grades respectively, and the larger the number threshold is, the higher the log grade is;
determining a target log grade corresponding to the target quantity threshold according to the target quantity threshold;
and filtering the log information lower than the target log grade according to the target log grade, and storing the filtered log information.
2. The log retrieving method as claimed in claim 1, wherein the method further comprises:
and when the number exceeds a preset warning threshold value, stopping acquiring the log file.
3. The log obtaining method according to claim 1, wherein the electronic device includes a plurality of functional units, the log information further includes abnormality information; the method further comprises the following steps:
and when an abnormal functional unit appears in the plurality of functional units, improving the log level of the log information of the abnormal functional unit.
4. The log obtaining method according to claim 3, wherein the method further comprises:
and sending control information to inform the abnormal function unit so that the abnormal function unit increases a log collection point and a log collection frequency, wherein the log collection point represents the type of a log.
5. The log obtaining device is applied to electronic equipment and comprises a state obtaining module, a log obtaining module and a filtering module;
the state acquisition module is used for acquiring a plurality of state values of the current operation of the electronic equipment in real time, wherein the state values represent the current operation state of the electronic equipment;
the log obtaining module is used for obtaining log information when the electronic equipment runs, wherein the log information is preset with different log grades according to the importance degree;
the filtering module is used for respectively comparing each state value with a preset threshold corresponding to the state value and marking the state value exceeding the preset threshold as an overproof state value;
counting the number of the overproof state values to obtain an overproof total number;
comparing the standard exceeding total number with a plurality of preset number thresholds to determine a target number threshold, wherein the number thresholds correspond to different log grades respectively, and the larger the number threshold is, the higher the log grade is;
determining a target log grade corresponding to the target quantity threshold according to the target quantity threshold;
and filtering the log information lower than the target log grade according to the target log grade, and storing the filtered log information.
6. The apparatus according to claim 5, wherein the electronic device includes a plurality of functional units, the log information includes abnormality information, and the apparatus further includes a level adjustment module;
the level adjustment module is used for improving the log level of the log information of the abnormal functional unit when the abnormal functional unit appears in the plurality of functional units.
CN201811607426.8A 2018-12-27 2018-12-27 Log acquisition method and device Active CN109656786B (en)

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 CN109656786A (en) 2019-04-19
CN109656786B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
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
CN111176946B (en) * 2019-12-29 2022-04-22 山东英信计算机技术有限公司 SEL log recording method, device, equipment and storage medium
CN115391161B (en) * 2022-10-28 2023-04-07 荣耀终端有限公司 Log transmission method, device, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10402236B2 (en) * 2017-06-15 2019-09-03 Simmonds Precision Products, Inc. Event-based data collection for smart sensors on an arbitrating bus

Patent Citations (3)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN109656786A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN109656786B (en) Log acquisition method and device
CN110661659B (en) Alarm method, device and system and electronic equipment
CN113176978B (en) Monitoring method, system, equipment and readable storage medium based on log file
CN105471932B (en) Monitoring method, device and system for front-end application
CN110955586A (en) System fault prediction method, device and equipment based on log
CN101976209A (en) Adapting configuration for incompatible application programs
CN110069925B (en) Software monitoring method, system and computer readable storage medium
CN111694718A (en) Method and device for identifying abnormal behavior of intranet user, computer equipment and readable storage medium
CN115080356B (en) Abnormity warning method and device
CN111782462A (en) Alarm method and device and electronic equipment
CN105512788A (en) Intelligent operation and maintenance management method and system
CN112306802A (en) Data acquisition method, device, medium and electronic equipment of system
CN111222710A (en) Data abnormity warning method, device, equipment and storage medium
CN115038088A (en) Intelligent network security detection early warning system and method
CN111159009B (en) Pressure testing method and device for log service system
CN113992602A (en) Cable monitoring data uploading method, device, equipment and storage medium
CN111949421B (en) SDK calling method, device, electronic equipment and computer readable storage medium
CN106899977B (en) Abnormal flow detection method and device
US20160218913A1 (en) Method and apparatus of establishing computer network monitoring criteria
CN110677271A (en) Big data alarm method, device, equipment and storage medium based on ELK
CN112311599B (en) Cloud resource allowance alarm method and device and server
CN106855824B (en) Task stopping method and device and electronic equipment
CN111897701B (en) Alarm processing method, device, computer system and medium for application
CN111447086B (en) Service processing method and device and electronic equipment
CN110995500A (en) Node log management and control method, system and related components

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