CN111177078A - Log processing method and device and electronic equipment - Google Patents

Log processing method and device and electronic equipment Download PDF

Info

Publication number
CN111177078A
CN111177078A CN201911312500.8A CN201911312500A CN111177078A CN 111177078 A CN111177078 A CN 111177078A CN 201911312500 A CN201911312500 A CN 201911312500A CN 111177078 A CN111177078 A CN 111177078A
Authority
CN
China
Prior art keywords
log
processing
interface
logs
interfaces
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911312500.8A
Other languages
Chinese (zh)
Inventor
林永保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201911312500.8A priority Critical patent/CN111177078A/en
Publication of CN111177078A publication Critical patent/CN111177078A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a log processing method and device, electronic equipment and a storage medium. The method comprises the following steps: and calling a log processing object in the log component system, and then instructing the log processing object to call at least one log processing interface in a plurality of log processing interfaces of the log component system to process the log according to a target processing mode. According to the method and the device, the log processing object configured in the log component system is called, and then the log processing object is indicated to call at least one log processing interface in a plurality of log processing interfaces of the log component system to correspondingly process the log according to the target processing mode, so that different processing on the log in the corresponding processing mode can be realized through different interfaces of the log component system, a log tool does not need to be downloaded independently, and the convenience of log processing is improved. The log is processed differently through the interfaces integrated with different processing functions, so that the reliability and accuracy of quick log fault repair can be improved.

Description

Log processing method and device and electronic equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a log processing method and apparatus, an electronic device, and a storage medium.
Background
The user behavior log includes all behavior data (visit, browse, search, click, etc.) when the user visits the website, and may also be called a behavior trace or a traffic log. Along with the development of big data technology, more and more internet enterprises intervene in the big data analysis field, thereby obtaining more intelligent and accurate analysis results. The engineer can simultaneously collect user behavior logs of different services on a PC side, a wireless side, an H5 side and the like, and a TB or even PB level data warehouse is formed after transmission, conversion and storage. The data warehouse is the basis of all data analysis and mining, and the data accuracy of the data warehouse is particularly important. However, because factors such as network instability easily cause the user behavior log to have a fault and be difficult to repair, and further affect the accuracy of data, how to quickly repair the fault of the user behavior log becomes a problem that cannot be ignored.
Disclosure of Invention
In view of the foregoing problems, the present application provides a log processing method, an apparatus, an electronic device, and a storage medium to improve the foregoing problems.
In a first aspect, an embodiment of the present application provides a log processing method, which is applied to a log component system, where the log component system includes multiple log processing interfaces with different processing functions, and the method includes: calling a log processing object configured in the log component system; and indicating the log processing object to call at least one log processing interface in the plurality of log processing interfaces to process the log according to a target processing mode, wherein the target processing mode is the log processing mode corresponding to the called interface.
In a second aspect, an embodiment of the present application provides a log processing apparatus, which runs on a log component system, where the log component system includes multiple log processing interfaces with different processing functions, and the apparatus includes: the calling module is used for calling the log processing object configured in the log component system; and the processing module is used for indicating the log processing object to call at least one log processing interface in the plurality of log processing interfaces to process the log according to a target processing mode, wherein the target processing mode is a log processing mode corresponding to the called interface.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and one or more processors; one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of the first aspect described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having program code stored therein, where the program code, when executed by a processor, performs the method of the first aspect.
The embodiment of the application provides a log processing method and device, electronic equipment and a storage medium. The method comprises the steps of calling a log processing object in a log component system, and then indicating the log processing object to call at least one log processing interface in a plurality of log processing interfaces of the log component system to process a log according to a target processing mode. According to the method and the device, the log processing object configured in the log component system is called, and then the log processing object is indicated to call at least one log processing interface in a plurality of log processing interfaces of the log component system to correspondingly process the log according to the target processing mode, so that different processing on the log in the corresponding processing mode can be realized through different interfaces of the log component system, a log tool does not need to be downloaded independently, and the convenience of log processing is improved. The log is processed differently through the interfaces integrated with different processing functions, so that the reliability and accuracy of quick log fault repair can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a block diagram of a log component system provided in an embodiment of the present application.
Fig. 2 shows a flowchart of a method of processing a log according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a method of processing a log according to another embodiment of the present application.
Fig. 4 is a flowchart illustrating a method of processing a log according to another embodiment of the present application.
Fig. 5 is a flowchart illustrating a method of processing a log according to yet another embodiment of the present application.
Fig. 6 is a flowchart illustrating a method of processing a log according to yet another embodiment of the present application.
Fig. 7 is a flowchart illustrating a method of processing a log according to yet another embodiment of the present application.
Fig. 8 shows a block diagram of a log processing apparatus according to an embodiment of the present application.
Fig. 9 shows a block diagram of an electronic device according to an embodiment of the present application.
Fig. 10 illustrates a storage unit for storing or carrying program codes for implementing a log processing method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, 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.
The user behavior log includes all behavior data (visit, browse, search, click, etc.) when the user visits the website, and may also be called a behavior trace or a traffic log. Along with the development of big data technology, more and more internet enterprises intervene in the big data analysis field, thereby obtaining more intelligent and accurate analysis results. The engineer can simultaneously collect user behavior logs of different services on a PC side, a wireless side, an H5 side and the like, and a TB or even PB level data warehouse is formed after transmission, conversion and storage. The data warehouse is the basis of all data analysis and mining, and the data accuracy of the data warehouse is particularly important. However, because factors such as network instability easily cause the user behavior log to have a fault and be difficult to repair, and further affect the accuracy of data, how to quickly repair the fault of the user behavior log becomes a problem that cannot be ignored.
In view of the above problems, the inventors have found through long-term research that a log can be processed in a target processing manner by calling a log processing object in a log component system and then instructing the log processing object to call at least one of a plurality of log processing interfaces of the log component system. Therefore, different processing on the log is realized through different interfaces of the log component system in corresponding processing modes, a log tool does not need to be downloaded independently, and the convenience of log processing is improved. The log is processed differently through the interfaces integrated with different processing functions, so that the reliability and accuracy of quick log fault repair can be improved. Therefore, a log processing method, a log processing device, an electronic device and a storage medium provided by the embodiments of the present application are provided.
The journal component system provided by the embodiment of the present application is described below with reference to the accompanying drawings:
referring to fig. 1, a block diagram of a log component system according to an embodiment of the present disclosure is shown. As shown in fig. 1, the log component system 10 includes a log processing object 11, a log category sorting interface 12, a log uploading interface 13, a log format setting interface 14, a log searching interface 15, and a log exporting interface 16. The log processing object 11 is pre-packaged with a static processing method corresponding to a log processing mode of a different interface, and the log processing object 11 can call the different interface to execute a corresponding log processing function. The log category ordering interface 12 may be used to collect logs and order the collected logs by log category, or in other manners.
Optionally, the log uploading interface 13 may be configured to collect logs and upload logs while collecting logs. Alternatively, the log uploaded by the log uploading interface 13 may be a log collected by another interface. The log format setting interface 14 may collect logs and format the collected logs. Alternatively, the log format setting interface 14 may set the log format of the log collected by the other interface. The log search interface 15 may be configured to collect logs and search the collected logs for a log corresponding to a user's requirement. Optionally, the log search interface 15 may also search logs collected by other interfaces for a log corresponding to the search requirement of the user. The log export interface 16 in this embodiment may export logs of the other interfaces, and the log export interface 16 does not collect log information.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a flowchart of a log processing method according to an embodiment of the present application is shown, where the log processing method is applicable to a log component system, and the log component system may include a plurality of log processing interfaces with different processing functions, and the method includes:
step S110: and calling a log processing object configured in the log component system.
Optionally, when a fault occurs in the process of using the website by the user, if the local log needs to be checked by using third-party auxiliary software, a tester may not be able to quickly find the fault, so that the website repair process is abnormally slowed down, and the user experience is reduced.
As a way to improve the above problem, a log processing object configured in the log component system may be called, so as to call each interface of the log component system through the log processing object to perform corresponding processing on the log.
In the present embodiment, a log processing object is packaged with a static processing method corresponding to a log processing mode of different interfaces, and the functions of the different interfaces and each interface are as shown in table 1 below:
TABLE 1
Figure BDA0002324919100000051
Wherein, the interface regiostuploadhttp is a registration uploading interface. The interface debug is a log category sorting interface, and the interface can collect log information, dynamically add categories to the collected logs, and sort the collected logs according to the categories. The format (including bold, italic, color, size, etc.) of the log collected by the interface may be set by the log format setting interface.
The interface debug ByUpload and the interface debug ByDelayUpload are log uploading interfaces, and the two interfaces can upload the acquired logs according to corresponding uploading modes. Similarly, the format (including bold, italic, color, size, etc.) of the logs collected by the two interfaces may be set by the log format setting interface.
The interface search is a log search interface, and the interface can be used for searching logs corresponding to user requirements according to keywords, positioning tab and highlighting search results.
The interface export is a log export interface, and the interface can be used for exporting logs needing to be exported in logs collected by other interfaces according to log levels or log categories.
The interface watchkeybordconten may be used to open the snoop combination key "ctrl + d + o" of the log component system. The CALL interface watchkeybordcon can open a monitoring combination key 'ctrl + d + o', at this time, the system can initiate a DQ request, process the request for pressing the combination key at the same time as DQ, the diary component system triggers a keyboard event callback function CALL (NAME), and determines whether the NAME is equal to 'ctrl + d + o', optionally, if so, the system can perform processing of central display of the log panel, which is denoted as SHOW. Otherwise, no processing is performed, and the result can be summarized as: CALL (NAME) ═ YYH5Debug (DQ), SHOW ═ CALL (NAME) & (NAME & "ctrl + d + o").
For example, in a specific application scenario, a global object G may be established in the log component system, the processing mode of each interface of the log component system is encapsulated into the object G as a static method, and the object G encapsulated with the processing mode of each interface of the log component system is renamed to YYH5Debug, so as to obtain the encapsulated global object YYH5 Debug. As one way, the interface of the global object YYH5Debug package may be represented as "YYH 5Debug ═ (INTER1, INTER2, INTER3 … …)". Further, a JS library file can be introduced, and a YYH5Debug is referred to by a variable, so that the YYH5Debug can automatically mount a Global object, namely a window object, and can initialize data, namely upload queues Q and a, export objects Q1 and Q2, define a data cache array P, and define a search data object S.
The YYH5Debug is a log processing object, and the YYH5Debug can receive an interface call request and call each interface of the log component system. Alternatively, the log processing object YYH5Debug may be called by a function O window (YYH5Debug), where O is a global object. Suppose the calling interface is INTER, the parameter is PA, the return RESULT is RESULT, RESULT equals 0 is success, otherwise it fails. The calling procedure can be summarized as: RESULT ═ O (INTER (PA)).
Step S120: and instructing the log processing object to call at least one log processing interface in the plurality of log processing interfaces to process the log according to a target processing mode.
The target processing mode is a log processing mode corresponding to the called interface, and the log processing modes corresponding to different interfaces can be different. As a mode, the log processing object may be instructed to call at least one log processing interface of the plurality of log processing interfaces to process the log according to a target processing mode, and the log may be processed by calling at least one log processing interface, so that the possibility of finding a fault at a fixed time may be improved, and the efficiency of repairing the problem may be improved.
In the log processing method provided by this embodiment, a log processing object in a log component system is called, and then the log processing object is instructed to call at least one log processing interface in a plurality of log processing interfaces of the log component system to process a log according to a target processing mode. According to the method and the device, the log processing object configured in the log component system is called, and then the log processing object is indicated to call at least one log processing interface in a plurality of log processing interfaces of the log component system to correspondingly process the log according to the target processing mode, so that different processing on the log in the corresponding processing mode can be realized through different interfaces of the log component system, a log tool does not need to be downloaded independently, and the convenience of log processing is improved. The log is processed differently through the interfaces integrated with different processing functions, so that the reliability and accuracy of quick log fault repair can be improved.
Referring to fig. 3, a flowchart of a log processing method according to another embodiment of the present application is shown, where the log processing method is applicable to a log component system, and the log component system may include a plurality of log processing interfaces with different processing functions, and the method includes:
step S210: and calling a log processing object configured in the log component system.
Step S220: and indicating the log processing object to call the log category sorting interface to acquire the categories corresponding to the logs.
As described above, the plurality of log processing interfaces in the present embodiment may include at least a log category sorting interface, and the log may include a plurality of logs. The log category sorting interface can collect logs of the website. And along with the operation of the system, the number of the logs is increased sharply, if the collected logs are displayed according to the collection sequence, important logs can be collected later and displayed later, so that the important logs are inconvenient for a tester to check, and in order to facilitate finding the position of a fault in a plurality of logs quickly, the log classification ordering interface can order the logs.
In one embodiment, the log processing object may be instructed to call the log category sorting interface to obtain the category to which the plurality of logs belong. Optionally, the log category sorting interface may acquire the categories of the multiple acquired logs while acquiring the logs, and may also acquire the categories of the multiple logs acquired by other interfaces.
Optionally, the category labels may be predefined for logs of different categories, so that when the log category sorting interface receives a call request of the log processing object, the category to which the log corresponds may be identified according to the predefined category labels.
Step S230: and acquiring weights respectively corresponding to the plurality of logs based on the belonged categories, and taking the weights as display priorities corresponding to the logs.
Wherein the weight may characterize the importance of the log in the plurality of logs. Optionally, the corresponding acquisition levels may be defined for different types of logs, and the acquisition levels corresponding to the different types of logs are different. The number of times that the log processing object calls the log category sorting interface within a specified duration can be obtained as a secondary weight corresponding to the log, and the collection level corresponding to the log is used as a primary weight corresponding to the log.
It should be noted that, when the number of times that the log processing object calls the log category sorting interface within the specified time duration is obtained, the logs acquired by calling the interface within the specified time duration are logs of the same category, and a specific numerical value of the specified time duration may not be limited, for example, the specified time duration may be 5 seconds, 10 seconds, or 20 seconds. Optionally, the weight may be used as a presentation priority corresponding to the log.
Step S240: displaying the plurality of logs based on the display priority.
As one approach, the collected multiple logs may be presented based on the obtained presentation priority. Through the display priority sequencing of the collected logs, the important logs can be displayed in front, so that testers can see the important logs preferentially.
The present embodiment is described below with a specific example:
assuming that the log collected by the log category sorting interface is C, the category of the log C is T, and the maximum value of the level range corresponding to the log category may be set to LM, then the level range corresponding to the category of the log collected by the log category sorting interface may be represented as L ([0-LM ]), and the processing procedure of the log category sorting interface on the collected log C includes:
and calculating the number of times of calling the interface per second as TC, recording the current index N, acquiring a log storage array P, putting the acquired logs into the array P after each log acquisition, and sequencing the logs currently included in the array P so that important logs can be displayed in front. Optionally, the level L corresponding to the category T of the current log C may be used as the primary priority of the log C, and the number of times TC of calling the interface per second may be used as the secondary priority, and optionally, the larger the primary priority L or the larger the secondary priority TC is, the more front the log corresponding to the category is displayed in the array P. The weight of the log C may be represented as TCL ═ (TC + L), TCL, C, and T may be combined into an object M, and the object M may be represented as O ═ C, and added to the array P. Then, after each time the collected log is inserted into the array P, the logs may be sorted according to the weight corresponding to the log, and if the queue Q indicates the order of the sorted logs, Q may be represented as Q (TCL). Optionally, the log result after the collected logs are sorted may be represented as N, Q [ N ].
In the log processing method provided by this embodiment, a log processing object in a log component system is called, and then the log processing object is instructed to call a log category sorting interface to obtain a category to which a plurality of logs correspond, weights respectively corresponding to the plurality of logs are obtained based on the category to which the log processing object belongs, the weights are used as display priorities corresponding to the logs, and then the plurality of logs are displayed based on the display priorities. The method and the device realize the importance sorting of the plurality of logs by calling the log category sorting interface, so that the important logs can be seen preferentially, the fault positioning speed is increased, and the fault repairing efficiency is improved.
Referring to fig. 4, a flowchart of a log processing method according to another embodiment of the present application is shown, where the log processing method is applicable to a log component system, and the log component system may include a plurality of log processing interfaces with different processing functions, and the method includes:
step S310: and calling a log processing object configured in the log component system.
Step S320: and indicating the log processing object to call the log uploading interface to acquire an uploading queue task.
The plurality of log processing interfaces in this embodiment may further include a log uploading interface. It can be understood that if the collected log information is copied to the developer for fault detection after the log collection is completed, a lot of time will be consumed, and the fault repairing efficiency is reduced. As a way to improve the above problem, the log processing object may be instructed to call the log uploading interface to obtain the uploading queue task, so that whether to upload the collected log immediately may be determined according to the current state of the uploading queue task.
Step S330: and judging whether the uploading queue task meets a target condition or not.
The target condition may be that the upload queue does not currently have a task being uploaded. Optionally, whether the upload queue task meets the target condition may be determined, and the specific implementation process of the determination may refer to the prior art. Optionally, if the upload queue does not have a task being uploaded, it may be determined that the upload queue task meets the target condition; if the uploading queue does not have the task being uploaded, the task of the uploading queue can be judged not to meet the target condition.
Step S331: the plurality of logs are uploaded at once.
As a mode, if the uploading queue task meets the target condition, the acquired multiple logs can be uploaded immediately, so that fault repair can be completed quickly.
Step S332: and acquiring uploading priorities respectively corresponding to the logs based on the belonged categories, and uploading the logs according to the uploading priorities.
As another mode, if the upload queue task does not satisfy the target condition, the upload priorities corresponding to the multiple logs may be obtained based on the categories to which the multiple logs belong, and the multiple logs are uploaded according to the upload priorities. The uploading priorities corresponding to different belonging categories may be different. In the foregoing embodiment, the uploading priorities corresponding to the multiple logs respectively may be obtained according to the weights corresponding to the collected log categories.
As an implementation manner, the present embodiment may further instruct the log processing object to call the log uploading interface to obtain log lengths corresponding to the multiple logs respectively; if the log length is larger than the preset threshold value, the log corresponding to the log length can be uploaded.
The present embodiment is described below with a specific example:
assuming that the log collected by the log uploading interface is C, and the maximum value of the level range corresponding to the log category may be set to LM, then the level range corresponding to the category to which the log collected by the log category sorting interface belongs may be represented as L ([0-LM ]), and the processing procedure of the log uploading interface on the collected log C includes:
if the uploading queue Q has no uploading task, the log can be immediately uploaded; or if the length of the log in the log storage array A is larger than a preset threshold value N, the log can be uploaded immediately. If the task currently being uploaded exists in the uploading queue Q, the uploading sequence of the log C can be sorted according to the level range corresponding to the category to which the log C belongs, and then the uploading sequence corresponding to the log C is uploaded. Alternatively, the log C may include a plurality of logs C. Optionally, if the length of the log in the log storage array a is not greater than the preset threshold N, the log C may be delayed from being uploaded. Optionally, the log that has been uploaded may be removed from the upload queue task, that is, Q — 1, which may save system memory.
According to the log processing method provided by the embodiment, the log processing object in the log component system is called, then the log processing object is indicated to call the log uploading interface to obtain the uploading queue task, whether the uploading queue task meets the target condition is judged, and the log is uploaded in a corresponding mode according to the judgment result, so that the log is uploaded in the log collecting process, log files do not need to be copied to developers, the log uploading efficiency is improved, and the fault repairing efficiency is further improved.
Referring to fig. 5, a flowchart of a log processing method according to still another embodiment of the present application is shown, where the log processing method is applicable to a log component system, and the log component system may include a plurality of log processing interfaces with different processing functions, and the method includes:
step S410: and calling a log processing object configured in the log component system.
Step S420: and indicating the log processing object to call the log format setting interface to judge whether the styles of the logs conform to a preset rule or not.
The plurality of log processing interfaces in this embodiment may further include a log format setting interface. The log pattern meeting the preset rule can be replaced, that is, the log pattern meeting the preset rule can be reset, so that the pattern of the important log can be displayed in a specific pattern, for example, the pattern of the important log is displayed in bold and red, and the consulting effect of the log is improved.
It can be understood that, in the process of collecting the log, the header color, the thickness and the like of the log content may change, so that the collected log format needs to meet the CSS style standard of the browser. For example, the font-size included in the data is a legal log format, otherwise the data is not a legal log format.
As a mode, the log processing object may be instructed to call the log format setting interface to determine whether the style of the collected multiple logs meets a preset rule, so that the display style of the important logs may be adjusted according to the determination result.
Step S421: and adjusting the display style corresponding to the log.
As one way, if the styles of the logs conform to the preset rule, the display style corresponding to the log may be adjusted (e.g., the display style corresponding to the log is subjected to result thickening and reflection processing, etc.), that is, the display style corresponding to the log conforming to the preset rule is adjusted.
For example, assume that the search result of the log is "12345667789901231231", where "01231" is the adjusted display style.
Step S422: and not adjusting the display style corresponding to the log.
As another way, if the patterns of the logs do not meet the preset rule, the display pattern corresponding to the log may not be adjusted.
As an embodiment, assuming that the collected log is C, the STYLE of the log C is sty, and the output content after the display STYLE corresponding to the log is finally adjusted can be set to NEW, the processing procedure of the log format setting interface on the collected log is as follows:
if STYLE is legal data, secondary data processing can be carried out on the collected log: that is, a preset template may be designed to be TL, and assuming that each style is S, the number of legal styles is equal to [ S1, S2, S3, S4 … ], and TL is equal to Sn; and designing an alternative placeholder marker Rn for each legal style, then TL ═ S1: R1, S2: R2, S3: R3. ], we can get TL ═ Sn: rn ]. Optionally, assuming that the style name to be replaced is M, according to the matching rule, if N and the like are M, M may be replaced by N.
Wherein, if N ═ M, the INDEX of M in TL can be found to be INDEX, the replacement process can be expressed as: finding a position of a style needing replacement in a preset template, and assigning the style for replacement to the position; alternatively, if N! M, then no processing may be performed.
According to the log processing method provided by the embodiment, the log processing object in the log component system is called, then the log processing object is indicated to call the log format setting interface to judge whether the styles of the multiple logs meet the preset rule or not, the display styles corresponding to the logs meeting the preset rule are adjusted, the display styles of the key logs are set in a self-defined mode, and the searching effect of the key logs is improved.
Referring to fig. 6, a flowchart of a log processing method according to still another embodiment of the present application is shown, where the log processing method is applicable to a log component system, and the log component system may include a plurality of log processing interfaces with different processing functions, and the method includes:
step S510: and calling a log processing object configured in the log component system.
Step S520: and indicating the log processing object to call the log search interface to acquire a keyword corresponding to the log search requirement.
Optionally, the plurality of log processing interfaces in this embodiment may further include a log search interface. It can be understood that as the content of the log increases, if the required log information is looked up in a huge log, unnecessary time consumption may be caused, and the user experience is reduced.
As a way for improving the above problem, the log processing object may be instructed to call the log search interface to obtain a keyword corresponding to the log search requirement, so as to quickly view the log through the keyword, thereby improving the positioning speed of log lookup.
Step S530: and calling the log search interface to search the log corresponding to the keyword.
After the keyword corresponding to the log search requirement is acquired, a log search interface can be called to search for the log corresponding to the keyword.
In one embodiment, it is assumed that the collected log is Q, the category to which the log Q belongs is T, the keyword corresponding to the log search requirement is KEY, the search result of the category to which the log belongs may be denoted as S _ T, and the search result of the log keyword content may be denoted as S _ T _ Q. When the log search interface acquires the log Q, the log Q may be cached in an array S, which may be represented as S [ T ] ═ S [ T ] + Q, and stores the content of the category T to which the array S belongs. In an implementation, the category T of the array S may be traversed, and the keyword KEY and the category T may be subjected to fuzzy matching, and optionally, if T > ═ KEY, it may be determined that matching is successful, and in this manner, S _ T ═ T may be obtained.
In another implementation manner, if the fuzzy matching is not successful when the keyword KEY is matched with the category T to which the keyword KEY belongs, the content of the category T may be taken from the array S through S _ T, and whether the keyword KEY is in the content is determined, optionally, if the content is greater than or equal to the content corresponding to the keyword, the matching may be determined to be successful, and S _ T _ C is obtained as KEY.
Alternatively, if the log corresponding to the keyword is not searched, the content C of the array S itself may be traversed to S (T). Alternatively, if C > ═ KEY, the current T may be recorded, S _ T ═ T, and S _ T _ C ═ S (T).
Optionally, if the log corresponding to the keyword is not searched yet, the search may be ended.
According to the log processing method provided by the embodiment, the log processing object in the log component system is called, then the log processing object is indicated to call the log searching interface to obtain the keyword corresponding to the log searching requirement, then the log searching interface is called to search the log corresponding to the keyword, the log is quickly searched through the keyword corresponding to the searching requirement, the log positioning speed is improved, and the speed of looking up the key log is further improved.
Referring to fig. 7, a flowchart of a log processing method according to still another embodiment of the present application is shown, where the log processing method is applicable to a log component system, where the log component system may include multiple log processing interfaces with different processing functions, and the method includes:
step S610: and calling a log processing object configured in the log component system.
Step S620: and instructing the log processing object to call the log export interface to acquire a log export request.
The plurality of log processing interfaces in this embodiment may further include a log export interface. As one mode, the log processing object can be instructed to call the log export interface to obtain the log export request so as to export the logs required by the tester in a targeted mode.
Step S630: and calling the log export interface to search a target log matched with the log export request based on the belonged category.
Optionally, after the log export request is obtained, the log export interface may search for a target log matching the log export request based on the category to which the log belongs. For example, assume that the collected log is C, the level of the log is L, and there are two logs cached as a cache Q1[ L ] ═ C and a cache Q2[ T ] ═ C, respectively (where "+" indicates that there is additional log content). Assuming that the log-export requests are a and B, the target log matching log-export request a may be Q1[ L ] ═ C, and the target log matching log-export request B may be Q2[ T ] ═ C.
Step S640: and exporting the target log.
It should be noted that the log derived by the log deriving interface in the present embodiment may be derived from the log collected by at least one of the four interfaces.
According to the log processing method provided by the embodiment, the log processing object in the log component system is called, then the log processing object is indicated to call the log export interface to obtain the log export request, then the log export interface is called to search the target log matched with the log export request based on the belonged category, and then the target log is exported, so that the logs required by developers are exported according to the category of the logs, and the log lookup effect is improved.
Referring to fig. 8, a block diagram of a log processing apparatus according to an embodiment of the present disclosure is shown, in which the log processing apparatus 700 is operated in a log component system, the log component system includes a plurality of log processing interfaces with different processing functions, and the apparatus 700 includes: calling module 710 and processing module 720:
and the calling module 710 is used for calling the log processing object configured in the log component system.
The processing module 720 is configured to instruct the log processing object to call at least one log processing interface of the plurality of log processing interfaces to process the log according to a target processing manner, where the target processing manner is a log processing manner corresponding to the called interface.
Optionally, the plurality of log processing interfaces may include at least a log category sorting interface, and the log may include a plurality of logs. In this manner, the processing module 720 may be specifically configured to instruct the log processing object to call the log category sorting interface to obtain the categories to which the multiple logs belong; acquiring weights respectively corresponding to the plurality of logs based on the belonged categories, and taking the weights as display priorities corresponding to the logs; displaying the plurality of logs based on the display priority.
Optionally, the plurality of log processing interfaces may further include a log uploading interface. In this manner, the processing module 720 may be specifically configured to instruct the log processing object to call the log uploading interface to obtain an uploading queue task; if the uploading queue task meets the target condition, the plurality of logs are uploaded immediately; and if the uploading queue task does not meet the target condition, acquiring uploading priorities respectively corresponding to the logs based on the categories, and uploading the logs according to the uploading priorities. Optionally, the processing module 720 may be further specifically configured to instruct the log processing object to call the log uploading interface to obtain log lengths corresponding to the multiple logs respectively; and if the log length is larger than a preset threshold value, uploading the log corresponding to the log length.
Optionally, the plurality of log processing interfaces may further include a log format setting interface, and in this manner, the processing module 720 may be specifically configured to instruct the log processing object to call the log format setting interface to determine whether the styles of the plurality of logs conform to a preset rule; and adjusting the display style corresponding to the log which accords with the preset rule.
Optionally, the plurality of log processing interfaces may further include a log search interface, and in this manner, the processing module 720 may be specifically configured to instruct the log processing object to call the log search interface to obtain a keyword corresponding to a log search requirement; and calling the log search interface to search the log corresponding to the keyword.
Optionally, the multiple log processing interfaces may further include a log export interface, and in this manner, the processing module 720 may be specifically configured to instruct the log processing object to call the log export interface to obtain a log export request; calling the log export interface to search a target log matched with the log export request based on the belonged category; and exporting the target log.
It should be noted that the log derived by the log deriving interface in the present embodiment may be derived from the log collected by at least one of the four interfaces.
In the log processing apparatus provided in this embodiment, a log processing object in a log component system is called, and then the log processing object is instructed to call at least one log processing interface of a plurality of log processing interfaces of the log component system to process a log according to a target processing manner. According to the method and the device, the log processing object configured in the log component system is called, and then the log processing object is indicated to call at least one log processing interface in a plurality of log processing interfaces of the log component system to correspondingly process the log according to the target processing mode, so that different processing on the log in the corresponding processing mode can be realized through different interfaces of the log component system, a log tool does not need to be downloaded independently, and the convenience of log processing is improved. The log is processed differently through the interfaces integrated with different processing functions, so that the reliability and accuracy of quick log fault repair can be improved.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 9, based on the log processing method and apparatus, an embodiment of the present application further provides an electronic device 100 capable of executing the log processing method. The electronic device 100 includes a memory 102 and one or more processors 104 (only one shown) coupled to each other, the memory 102 and the processors 104 being communicatively coupled to each other. The memory 102 stores therein a program that can execute the contents of the foregoing embodiments, and the processor 104 can execute the program stored in the memory 102.
The processor 104 may include one or more processing cores, among other things. The processor 104 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 102 and invoking data stored in the memory 102. Alternatively, the processor 104 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 104 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 104, but may be implemented by a communication chip.
The Memory 102 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 102 may be used to store instructions, programs, code sets, or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the foregoing embodiments, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
Referring to fig. 10, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 800 has stored therein program code that can be called by a processor to execute the methods described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A log processing method applied to a log component system including a plurality of log processing interfaces having different processing functions, the method comprising:
calling a log processing object configured in the log component system;
and indicating the log processing object to call at least one log processing interface in the plurality of log processing interfaces to process the log according to a target processing mode, wherein the target processing mode is the log processing mode corresponding to the called interface.
2. The method of claim 1, wherein the plurality of log processing interfaces at least comprise a log category ordering interface, wherein the log comprises a plurality of logs, and wherein the instructing the log processing object to invoke at least one of the plurality of log processing interfaces to process the log in a target processing manner comprises:
indicating the log processing object to call the log category sorting interface to acquire the categories corresponding to the logs;
acquiring weights respectively corresponding to the plurality of logs based on the belonged categories, and taking the weights as display priorities corresponding to the logs;
displaying the plurality of logs based on the display priority.
3. The method of claim 2, wherein the plurality of log processing interfaces further comprise a log uploading interface, and the instructing the log processing object to call at least one of the plurality of log processing interfaces to process the log in a target processing manner comprises:
the log processing object is instructed to call the log uploading interface to obtain an uploading queue task;
if the uploading queue task meets the target condition, the plurality of logs are uploaded immediately;
and if the uploading queue task does not meet the target condition, acquiring uploading priorities respectively corresponding to the logs based on the categories, and uploading the logs according to the uploading priorities.
4. The method of claim 3, further comprising:
the log processing object is instructed to call the log uploading interface to obtain log lengths corresponding to the logs respectively;
and if the log length is larger than a preset threshold value, uploading the log corresponding to the log length.
5. The method of claim 4, wherein the plurality of log processing interfaces further comprise a log format setting interface, and wherein the instructing the log processing object to call at least one of the plurality of log processing interfaces to process the log in a target processing manner comprises:
the log processing object is instructed to call the log format setting interface to judge whether the styles of the logs conform to a preset rule or not;
and adjusting the display style corresponding to the log which accords with the preset rule.
6. The method of claim 5, wherein the plurality of log processing interfaces further comprises a log search interface, and wherein the instructing the log processing object to call at least one of the plurality of log processing interfaces to process the log in a target processing manner comprises:
the log processing object is instructed to call the log searching interface to obtain a keyword corresponding to the log searching requirement;
and calling the log search interface to search the log corresponding to the keyword.
7. The method of claim 6, wherein the plurality of log processing interfaces further comprises a log export interface, and wherein the instructing the log processing object to call at least one of the plurality of log processing interfaces to process the log in a target processing manner comprises:
the log processing object is instructed to call the log export interface to obtain a log export request;
calling the log export interface to search a target log matched with the log export request based on the belonged category;
and exporting the target log.
8. A log processing apparatus that operates in a log component system including a plurality of log processing interfaces having different processing functions, the apparatus comprising:
the calling module is used for calling the log processing object configured in the log component system;
and the processing module is used for indicating the log processing object to call at least one log processing interface in the plurality of log processing interfaces to process the log according to a target processing mode, wherein the target processing mode is a log processing mode corresponding to the called interface.
9. An electronic device, comprising a memory;
one or more processors;
one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
10. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-7.
CN201911312500.8A 2019-12-18 2019-12-18 Log processing method and device and electronic equipment Pending CN111177078A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911312500.8A CN111177078A (en) 2019-12-18 2019-12-18 Log processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911312500.8A CN111177078A (en) 2019-12-18 2019-12-18 Log processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111177078A true CN111177078A (en) 2020-05-19

Family

ID=70622490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911312500.8A Pending CN111177078A (en) 2019-12-18 2019-12-18 Log processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111177078A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110887A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 Information processing method and device, electronic equipment and storage medium
CN115410290A (en) * 2021-09-30 2022-11-29 北京罗克维尔斯科技有限公司 Log transmission method and device and computing equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6122675A (en) * 1995-05-05 2000-09-19 Apple Computer, Inc. Replaceable and extensible log component of a network component system
US20090248475A1 (en) * 2005-11-03 2009-10-01 Ktfreetel Co., Ltd. Open mobile business supporting system and method
CN102915269A (en) * 2012-09-20 2013-02-06 山东浪潮齐鲁软件产业股份有限公司 Method for analyzing common logs of B/S (browser/server) software system
US20140366118A1 (en) * 2013-06-05 2014-12-11 Fortinet, Inc. Cloud based logging service
CN105260315A (en) * 2015-11-13 2016-01-20 上海斐讯数据通信技术有限公司 Method for debugging log in embedded system process
CN105975376A (en) * 2016-04-28 2016-09-28 广州市锲致智能技术有限公司 Log processing based numerical control system security processing method
CN106201837A (en) * 2016-07-19 2016-12-07 电信科学技术第五研究所 A kind of daily record parsing method and system of integrated hardware platform
CN106980627A (en) * 2016-01-18 2017-07-25 中兴通讯股份有限公司 The display methods and device of log content
CN107273280A (en) * 2017-06-30 2017-10-20 百度在线网络技术(北京)有限公司 A kind of log processing method, device, electronic equipment and storage medium
CN107924333A (en) * 2015-07-31 2018-04-17 微软技术许可有限责任公司 Update log in multi-tenant cloud service is changed and associated
CN109032881A (en) * 2017-06-09 2018-12-18 武汉斗鱼网络科技有限公司 A kind of log level dynamic method of adjustment and device
CN109522177A (en) * 2017-09-20 2019-03-26 阿里巴巴集团控股有限公司 A kind of task daily record processing system, method and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6122675A (en) * 1995-05-05 2000-09-19 Apple Computer, Inc. Replaceable and extensible log component of a network component system
US20090248475A1 (en) * 2005-11-03 2009-10-01 Ktfreetel Co., Ltd. Open mobile business supporting system and method
CN102915269A (en) * 2012-09-20 2013-02-06 山东浪潮齐鲁软件产业股份有限公司 Method for analyzing common logs of B/S (browser/server) software system
US20140366118A1 (en) * 2013-06-05 2014-12-11 Fortinet, Inc. Cloud based logging service
CN107924333A (en) * 2015-07-31 2018-04-17 微软技术许可有限责任公司 Update log in multi-tenant cloud service is changed and associated
CN105260315A (en) * 2015-11-13 2016-01-20 上海斐讯数据通信技术有限公司 Method for debugging log in embedded system process
CN106980627A (en) * 2016-01-18 2017-07-25 中兴通讯股份有限公司 The display methods and device of log content
WO2017124704A1 (en) * 2016-01-18 2017-07-27 中兴通讯股份有限公司 Method and apparatus for displaying log content
CN105975376A (en) * 2016-04-28 2016-09-28 广州市锲致智能技术有限公司 Log processing based numerical control system security processing method
CN106201837A (en) * 2016-07-19 2016-12-07 电信科学技术第五研究所 A kind of daily record parsing method and system of integrated hardware platform
CN109032881A (en) * 2017-06-09 2018-12-18 武汉斗鱼网络科技有限公司 A kind of log level dynamic method of adjustment and device
CN107273280A (en) * 2017-06-30 2017-10-20 百度在线网络技术(北京)有限公司 A kind of log processing method, device, electronic equipment and storage medium
CN109522177A (en) * 2017-09-20 2019-03-26 阿里巴巴集团控股有限公司 A kind of task daily record processing system, method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
迟初等: "通用SOA中间件平台日志消息检索技术与实现", 《信息系统工程》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110887A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 Information processing method and device, electronic equipment and storage medium
CN113110887B (en) * 2021-03-31 2023-07-21 联想(北京)有限公司 Information processing method, device, electronic equipment and storage medium
CN115410290A (en) * 2021-09-30 2022-11-29 北京罗克维尔斯科技有限公司 Log transmission method and device and computing equipment

Similar Documents

Publication Publication Date Title
CN108345543B (en) Data processing method, device, equipment and storage medium
US8468145B2 (en) Indexing of URLs with fragments
CN108363792A (en) Link generation method, device, storage medium and the electronic equipment of five application page
CN108334608A (en) Link generation method, device, storage medium and the electronic equipment of five application page
US11240290B2 (en) Application download method and apparatus, application sending method and apparatus, and system
CN110955428A (en) Page display method and device, electronic equipment and medium
CN109857477A (en) Transition optimization method, device and equipment are applied in mixing
CN108345478B (en) Application processing method and device, storage medium and electronic equipment
CN106528659A (en) A control method and device for jumping from a browser to an application program
CN111475694A (en) Data processing method, device, terminal and storage medium
CN112930669A (en) Content recommendation method and device, mobile terminal and server
CN111177078A (en) Log processing method and device and electronic equipment
CN111737443B (en) Answer text processing method and device and key text determining method
CN111078986A (en) Data retrieval method, device and computer readable storage medium
CN110955438A (en) Method, device and equipment for monitoring performance of small program and storage medium
CN111666220A (en) Method and device for generating Web page object test file
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN110442803A (en) Data processing method, device, medium and the calculating equipment executed by calculating equipment
CN112269666A (en) Applet dead link detection method and device, computing device and medium
CN111428117A (en) Data acquisition method and device for application program
CN114519153B (en) Webpage history record display method, device, equipment and storage medium
CN106817383B (en) Access cycle management method and device based on data statistics reporting
CN113467867B (en) Information processing method, information processing device, electronic equipment and storage medium
CN112817782B (en) Data acquisition reporting method and device, electronic equipment and storage medium
CN115481025A (en) Script recording method and device for automatic test, computer equipment and medium

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
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200519

Assignee: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Contract record no.: X2021440000031

Denomination of invention: Log processing method, device and electronic equipment

License type: Common License

Record date: 20210125

EE01 Entry into force of recordation of patent licensing contract
RJ01 Rejection of invention patent application after publication

Application publication date: 20200519

RJ01 Rejection of invention patent application after publication