Log grading method and device, equipment and storage medium

By calculating the generation density of logs and access to high-frequency words, the log level is automatically determined, which solves the problem of inflexible log level adjustment in the existing technology, reduces labor costs and improves log search efficiency.

CN119645710APending Publication Date: 2025-03-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411808051.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, the log level cannot be flexibly adjusted, resulting in a lot of manpower required to classify and modify when there is a need for subsequent log level adjustment.

Method used

By obtaining all the logs of the target application in the set period, calculating the average generation density and peak generation density to determine the number of logs per layer, and sorting them according to the number of accesses and durations of high-frequency words in the log, and finally automatically determine the level to which each log belongs.

Benefits of technology

It realizes the automatic determination of the log level regularly, reduces the cost of updating the log level, and improves the efficiency of log search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645710A_ABST
    Figure CN119645710A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a log grading method and device, equipment and a storage medium, and relates to the field of financial science and technology, and the method comprises the steps: obtaining all logs of a target application in a set period, and determining the number of logs of each layer according to the average generation density and the peak generation density of all logs; determining high-frequency words in each log according to the accessed times of each keyword in the log and a high-frequency word list; sorting all the high-frequency words in the same log according to the visited times and visited duration of each high-frequency word in the same log, and obtaining a set number of target high-frequency words according to a high-frequency word sorting result; according to the visited times and visited duration of each target high-frequency word, determining the total visited times and total visited duration of logs where the target high-frequency words are located, and sorting the logs according to the total visited times and total visited duration of the logs; and according to the log sorting result and the log number of each layer, the hierarchy to which each log belongs is determined, so that the cost of updating the hierarchy to which the log belongs is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a log classification method, device, equipment and storage medium. Background Art

[0002] At present, logs are an important information resource that records detailed information during the operation of applications, such as error information, debugging information, warning information, and important time, so that the operation of applications can be understood in a timely manner and problems can be quickly located and solved. However, due to the huge amount of application logs, it takes a lot of manpower to find useful logs from the massive logs when troubleshooting problems based on logs.

[0003] In the prior art, developers are usually required to mark the log level during the development process, wherein the log level marked by the developer is usually error (also known as error), debug (also known as debug) and normal (also known as info).

[0004] However, since the log levels marked by developers cannot be flexibly adjusted, when there is a need to adjust the log levels in the future, a lot of additional manpower is required to classify and modify them. Summary of the invention

[0005] The present invention provides a log grading method, device, equipment and storage medium, which can realize regular and automatic determination of the level to which a log belongs, thereby reducing the cost of updating the level to which the log belongs.

[0006] In a first aspect, an embodiment of the present invention provides a log classification method, including:

[0007] Obtain all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all logs, and determine the number of logs per layer based on the average generation density and peak generation density;

[0008] According to the number of visits of each keyword in each log and the pre-stored high-frequency word list, the high-frequency words in each log are determined;

[0009] According to the number of visits and the duration of visits of each high-frequency word in the same log, all high-frequency words in the same log are sorted, and a set number of target high-frequency words are obtained according to the high-frequency word sorting results;

[0010] According to the number of visits and the visit duration corresponding to each target high-frequency word, the total number of visits and the total visit duration of the log where the target high-frequency word is located are determined, and each log is sorted according to the total number of visits and the total visit duration corresponding to each log;

[0011] The level to which each log belongs is determined based on the sorting result of each log and the number of logs in each level.

[0012] Optionally, all high-frequency words under the same log are sorted according to the number of times each high-frequency word is visited and the length of time it is visited, including: preliminarily sorting all high-frequency words under the same log according to the number of times each high-frequency word is visited to obtain an initial sorting result; judging whether there are high-frequency words to be rearranged with the same sorting order in the initial sorting result; if so, re-sorting each high-frequency word to be rearranged that belongs to the same sorting order according to the length of time each high-frequency word to be rearranged is visited, and updating the initial sorting result according to the re-sorting result of the high-frequency words to be rearranged to obtain a high-frequency word sorting result; if not, taking the initial sorting result as the high-frequency word sorting result.

[0013] Optionally, the total number of visits and the total visit duration of the log where the target high-frequency word is located are determined based on the number of visits and the visit duration corresponding to each target high-frequency word, including: determining the total number of visits to the log where the target high-frequency word is located based on the sum of the number of visits corresponding to each target high-frequency word; determining the total visit duration of the log where the target high-frequency word is located based on the sum of the visit duration corresponding to each target high-frequency word.

[0014] Optionally, before sorting each log according to the total number of visits and total visit time corresponding to each log, it also includes: obtaining the current search conditions for all logs, and determining whether the current search conditions are the final search conditions; if so, obtaining each answer display page corresponding to the current search conditions, and obtaining the target answer display page according to the display order of each answer display page; obtaining each answer log on the target answer display page, and determining the first multiplier value corresponding to each answer log; if not, obtaining each search display page corresponding to the current search conditions, and obtaining the target display page according to the display order of each search display page; obtaining each search log on the target display page, and determining the second multiplier value corresponding to each search log.

[0015] Optionally, each log is sorted according to the total number of accesses and the total access time corresponding to each log, including: after preliminarily updating the total number of accesses and the total access time of each log according to the number of times each log is copied, taking each log as the current log in turn, and judging whether the current log is a search log and / or an answer log; if the current log is both a search log and an answer log, updating the total number of accesses and the total access time of the current log according to a first multiplier value and a second multiplier value; if the current log is only an answer log, updating the total number of accesses and the total access time of the current log according to the first multiplier value; if the current log is only a search log, updating the total number of accesses and the total access time of the current log according to the second multiplier value; sorting each log according to the updated total number of accesses and the updated total access time corresponding to each log.

[0016] Optionally, after determining the level to which each log belongs based on the sorting result of each log and the number of logs in each layer, the method further includes: obtaining a target hierarchical log having the smallest total access count and total access time among the hierarchical logs belonging to the same level; the method further includes: after receiving a new log corresponding to a target application, if the total access count of the new log is greater than or equal to the total access count of the target hierarchical log, and the total access time of the new log is greater than or equal to the total access time of the target hierarchical log, then determining that the level to which the new log belongs is the level to which the target hierarchical log belongs.

[0017] Optionally, determining the number of logs in each layer according to the average generation density and the peak generation density includes: determining the number of logs in each layer according to an intermediate value of the average generation density and the peak generation density.

[0018] In a second aspect, an embodiment of the present invention further provides a log grading device, including:

[0019] A module for determining the number of logs per layer is used to obtain all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all logs, and determine the number of logs per layer according to the average generation density and peak generation density;

[0020] A high-frequency word determination module is used to determine the high-frequency words in each log according to the number of times each keyword in each log is accessed and a pre-stored high-frequency word list;

[0021] The high-frequency word screening module is used to sort all high-frequency words in the same log according to the number of visits and the duration of visits of each high-frequency word in the same log, and obtain a set number of target high-frequency words according to the high-frequency word sorting results;

[0022] The log sorting module is used to determine the total number of accesses and the total access duration of the log where the target high-frequency word is located according to the number of accesses and the access duration corresponding to each target high-frequency word, and sort each log according to the total number of accesses and the total access duration corresponding to each log;

[0023] The log level determination module is used to determine the level to which each log belongs based on the sorting result of each log and the number of logs in each level.

[0024] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0025] at least one processor; and

[0026] a memory communicatively connected to at least one processor; wherein,

[0027] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the log grading method provided by any embodiment of the present invention.

[0028] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the log grading method provided by any embodiment of the present invention when executed.

[0029] The technical solution of the embodiment of the present invention sorts each log according to the total number of accesses and the total access duration corresponding to each log, and determines the level to which each log belongs according to the sorting result of each log and the number of logs in each layer. This can realize regular and automatic determination of the level to which each log belongs, avoiding the situation where the log level marked by the developer cannot be flexibly adjusted, resulting in the need for additional investment of a large amount of manpower for adjustment when there is a need to adjust the log level in the future, and reducing the cost of updating the level to which the log belongs. Secondly, by determining the level to which each log belongs, it can support developers to search for logs according to the level to which the log belongs, improving the efficiency of log search and reducing the cost of log search.

[0030] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 is a flow chart of a log classification method provided according to the first embodiment of the present invention;

[0033] Figure 2 is a flow chart of another log classification method provided according to the second embodiment of the present invention;

[0034] Figure 3 is a structural schematic diagram of a log grading device provided according to Embodiment 3 of the present invention;

[0035] Figure 4 It is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] Embodiment 1

[0039] Figure 1This is a flowchart of a log grading method provided according to Example 1 of the present invention. This embodiment is applicable to the situation of grading logs. The method can be executed by a log grading device. The log grading device can be implemented in the form of hardware and / or software. The log grading device can be configured in an electronic device such as a computer.

[0040] like Figure 1 As shown, a log classification method disclosed in this embodiment includes:

[0041] S110 , obtaining all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all the logs, and determining the number of logs in each layer according to the average generation density and the peak generation density.

[0042] In this embodiment, the average generation density can be used to reflect the average number of logs generated by the target application per unit time. The peak generation density can be used to reflect the maximum number of logs generated by the target application per unit time. The unit time can be set according to user needs. For example, the average time consumption of all services provided by the target application can be used as the unit time, or 1 time unit can be used as the unit time, which is not limited in this embodiment.

[0043] In this step, specifically, the number of logs per layer may be determined according to the middle value or average value of the average generation density and the peak generation density.

[0044] S120 , determining high-frequency words in each log according to the number of times each keyword in each log is accessed and a pre-stored high-frequency word list.

[0045] In this step, specifically, the high-frequency words in each log can be determined based on the number of times each keyword in each log is accessed, a preset threshold of the number of times accessed, and a pre-stored high-frequency word list. In a specific implementation, keywords whose number of times accessed are greater than or equal to the threshold of the number of times accessed, and keywords that are the same as any high-frequency word recorded in the high-frequency word list can be regarded as high-frequency words. The size relationship between the number of times accessed of the high-frequency words determined by the high-frequency word list and the threshold of the number of times accessed can be greater than, less than, or equal to.

[0046] Exemplarily, assuming that the high-frequency word "nullexception" is recorded in the high-frequency word list, even if the number of accesses to "nullexception" is less than a preset access threshold, "nullexception" can be determined as a high-frequency word.

[0047] S130 , sorting all high-frequency words in the same log according to the number of visits and the duration of visits of each high-frequency word in the same log, and obtaining a set number of target high-frequency words according to the high-frequency word sorting result.

[0048] In this step, specifically, all high-frequency words under the same log can be sorted according to the sum of the number of visits and the length of time each high-frequency word is visited under the same log, to obtain a high-frequency word sorting result. Alternatively, after a preliminary sorting is performed according to the number of visits of each high-frequency word under the same log, the initial sorting result can be updated according to the length of time each high-frequency word is visited under the same log to obtain a high-frequency word sorting result. Then, the sorting method of the high-frequency word sorting result can be obtained. If the high-frequency word sorting result is to arrange the high-frequency words in descending order from large to small, the first set number of high-frequency words in the high-frequency word sorting result can be used as the target high-frequency words. If the high-frequency word sorting result is to arrange the high-frequency words in ascending order from small to large, the last set number of high-frequency words in the high-frequency word sorting result can be used as the target high-frequency words. Among them, the set number can be determined based on historical experience, such as 3.

[0049] S140, determining the total number of accesses and the total access duration of the log where the target high-frequency word is located according to the number of accesses and the access duration corresponding to each target high-frequency word, and sorting each log according to the total number of accesses and the total access duration corresponding to each log.

[0050] In this step, specifically, the total number of accesses to the log containing the target high-frequency word can be determined based on the sum of the number of accesses corresponding to each target high-frequency word, or the average number of accesses corresponding to each target high-frequency word. The total access duration of the log containing the target high-frequency word can be determined based on the sum of the access durations corresponding to each target high-frequency word, or the average number of access durations corresponding to each target high-frequency word.

[0051] Then, the logs can be sorted according to the sum of the total number of accesses and the total access duration of each log. Alternatively, after the logs are preliminarily sorted according to the total number of accesses of each log, the preliminary sorting result of the logs can be updated according to the total access duration of each log to obtain the sorting result of the logs.

[0052] S150: Determine the level to which each log belongs according to the sorting result of each log and the number of logs in each level.

[0053] The technical solution of this embodiment is to obtain all logs of the target application within a set period, and the average generation density and peak generation density corresponding to all logs, and determine the number of logs in each layer according to the average generation density and peak generation density; determine the high-frequency words in each log according to the number of visits of each keyword in each log and the pre-stored high-frequency word list; sort all high-frequency words in the same log according to the number of visits and the access duration of each high-frequency word in the same log, and obtain a set number of target high-frequency words according to the high-frequency word sorting result; and sort the target high-frequency words according to the number of visits and the access duration of each high-frequency word in the same log; The number of visits and the duration of visits are used to determine the total number of visits and the total duration of visits to the log where the target high-frequency word is located, and each log is sorted according to the total number of visits and the total duration of visits corresponding to each log; the technical means of determining the level to which each log belongs based on the sorting result of each log and the number of logs in each layer solves the problem that the log level marked by the developer cannot be flexibly adjusted, resulting in the need for a large amount of additional manpower to adjust the log level in the future. It can realize regular and automatic determination of the level to which each log belongs, reducing the cost of updating the level to which the log belongs.

[0054] Embodiment 2

[0055] Figure 2 It is a flowchart of another log classification method provided according to the second embodiment of the present invention. This embodiment is a further optimization and expansion based on the above embodiments, and can be combined with various optional technical solutions in the above implementation methods.

[0056] like Figure 2 As shown, a log classification method disclosed in this embodiment includes:

[0057] S210: Obtain all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all logs, and determine the number of logs in each layer according to the average generation density and the peak generation density.

[0058] Optionally, determining the number of logs in each layer according to the average generation density and the peak generation density includes: determining the number of logs in each layer according to an intermediate value of the average generation density and the peak generation density.

[0059] Specifically, when the middle value of the average generation density and the peak generation density is 1, the middle value of the average generation density and the peak generation density can be directly used as the number of logs per layer. When the middle value of the average generation density and the peak generation density is 2, the maximum value of the two values ​​can be used as the number of logs per layer.

[0060] The advantage of this setting is that the number of logs in each layer is determined by the middle value of the average generation density and the peak generation density, so that the number of logs in each layer is between the average generation density and the peak generation density. While avoiding too many levels, it provides a basis for quickly finding logs according to the level to which the logs belong.

[0061] S220, according to the number of visits of each keyword in each log and the pre-stored high-frequency word list, determine the high-frequency words in each log, and according to the number of visits of each high-frequency word in the same log, preliminarily sort all the high-frequency words in the same log to obtain an initial sorting result.

[0062] Exemplarily, all high-frequency words under the same log may be sorted in descending order according to the number of accesses, to obtain an initial sorting result.

[0063] S230 , determining whether there are high-frequency words to be rearranged with the same sorting order in the initial sorting result, if so, executing S240 , if not, executing S250 .

[0064] S240, reorder each high-frequency word to be rearranged that belongs to the same sorting order according to the access time of each high-frequency word to be rearranged, and update the initial sorting result according to the reordering result of the high-frequency word to be rearranged to obtain the high-frequency word sorting result.

[0065] Continuing with the previous example, if there are high-frequency words to be rearranged with the same sorting order in the initial sorting results, the high-frequency words to be rearranged with the same sorting order can be sorted in descending order according to the access time from large to small, and the initial sorting results can be updated according to the descending sorting results of the high-frequency words to be rearranged to obtain the high-frequency word sorting results.

[0066] The advantage of this setting is that when there are high-frequency words to be rearranged with the same sorting order in the initial sorting results, each high-frequency word to be rearranged belonging to the same sorting order is re-sorted according to the access time of each high-frequency word to be rearranged, and the initial sorting results are updated according to the descending sorting results of the high-frequency words to be rearranged, so as to obtain the high-frequency word sorting results, thereby improving the accuracy of the high-frequency word sorting results and providing a basis for the subsequent accurate selection of target high-frequency words.

[0067] S250: Use the initial sorting result as the high-frequency word sorting result.

[0068] Continuing with the above example, if there are no high-frequency words to be rearranged with the same sorting order in the initial sorting result, the initial sorting result can be used as the high-frequency word sorting result.

[0069] S260. Obtain a set number of target high-frequency words according to the high-frequency word sorting results.

[0070] The number of visits to the target high-frequency word is greater than or equal to the number of visits to other high-frequency words in the high-frequency word ranking result.

[0071] S270. Determine the total number of visits to the log containing the target high-frequency word based on the sum of the number of visits corresponding to each target high-frequency word; determine the total visit duration of the log containing the target high-frequency word based on the sum of the visit duration corresponding to each target high-frequency word.

[0072] S280 , sorting each log according to the total number of accesses and the total access duration corresponding to each log.

[0073] In this step, specifically, the total number of accesses and the total access duration of each log can be updated according to the number of times each log is copied and whether each log is a search log and / or an answer log, and the updated total number of accesses and the updated total access duration corresponding to each log can be obtained. Then, the logs can be preliminarily sorted according to the updated total number of accesses of each log to obtain the log preliminary sorting results. Finally, it can be determined whether there are logs to be rearranged with the same sorting order in the log preliminary sorting results. If so, each log to be rearranged belonging to the same sorting order is re-sorted according to the total access duration of each log, and the log preliminary sorting results are updated according to the re-sorting results of the logs to be rearranged to obtain the log sorting results.

[0074] Furthermore, according to the number of times each log is copied and whether each log is a search log and / or an answer log, the total number of accesses and the total access time of each log are updated to obtain the updated total number of accesses and the updated total access time corresponding to each log, including: after preliminarily updating the total number of accesses and the total access time of each log according to the number of times each log is copied, taking each log as the current log in turn, and judging whether the current log is a search log and / or an answer log; if the current log is both a search log and an answer log, updating the total number of accesses and the total access time of the current log according to a first multiplier value and a second multiplier value; if the current log is only an answer log, updating the total number of accesses and the total access time of the current log according to the first multiplier value to obtain the updated total number of accesses and the updated total access time corresponding to the current log; if the current log is only a search log, updating the total number of accesses and the total access time of the current log according to the second multiplier value to obtain the updated total number of accesses and the updated total access time corresponding to the current log.

[0075] Specifically, when the number of times it is copied is less than 1, the total number of accesses to each log can be directly used as the total number of accesses to be updated, and the total access duration of each log can be used as the total access duration to be updated. When the number of times it is copied is greater than or equal to 1, the total number of accesses to be updated can be obtained by multiplying the number of copies times the basic value with the total number of accesses to each log, and the total access duration to be updated can be obtained by multiplying the number of copies times the basic value with the total access duration of each log. Preferably, the basic value can be 2. Exemplarily, when receiving a selection or copy operation performed by a developer on a log, double the total number of accesses can be used as the total number of accesses to be updated, and double the total access duration can be used as the total access duration to be updated. When receiving a selection and copy operation performed by a developer on a log, quadruple the total number of accesses can be used as the total number of accesses to be updated, and quadruple the total access duration can be used as the total access duration to be updated.

[0076] After obtaining the total number of accesses to be updated and the total access duration to be updated corresponding to each log, if the current log is both a search log and an answer log, the total number of accesses to be updated, the first multiplier value, and the second multiplier value of the current log can be multiplied as the total number of accesses to be updated for the current log, and the total time to be updated for the current log, the first multiplier value, and the second multiplier value can be multiplied as the total time to be updated for the current log. If the current log is only an answer log, the total number of accesses to the current log and the first multiplier value can be multiplied as the total number of accesses to be updated for the current log, and the total time to be updated for the current log can be multiplied as the total time to be updated for the current log. If the current log is only a search log, the total number of accesses to the current log and the second multiplier value can be multiplied as the total number of accesses to be updated for the current log, and the total time to be updated for the current log can be multiplied as the total time to be updated for the current log.

[0077] The advantage of this setting is that by updating the total number of accesses and total access time of each log through the number of times each log is copied and whether each log is a search log and / or an answer log, the total number of accesses and total access time of each log can be determined more accurately, thereby improving the accuracy of the log classification results.

[0078] Optionally, before sorting each log according to the total number of visits and total visit time corresponding to each log, it also includes: obtaining the current search conditions for all logs, and determining whether the current search conditions are the final search conditions; if so, obtaining each answer display page corresponding to the current search conditions, and obtaining the target answer display page according to the display order of each answer display page; obtaining each answer log on the target answer display page, and determining the first multiplier value corresponding to each answer log; if not, obtaining each search display page corresponding to the current search conditions, and obtaining the target display page according to the display order of each search display page; obtaining each search log on the target display page, and determining the second multiplier value corresponding to each search log.

[0079] Specifically, since the importance of the answer display page obtained under the final search condition is higher than the importance of the search display page obtained under the non-final search condition, the first multiplier value can be set to be greater than or equal to the second multiplier value. The first multiplier value and the second multiplier value can be set based on historical experience, for example, the first multiplier value is set to 50 and the second multiplier value is set to 10. Furthermore, since the later the page display order is, the higher the importance of the log on the page is, the last answer display page corresponding to the final search condition can be used as the target answer display page, and the last search display page corresponding to the non-final search condition can be used as the target display page.

[0080] The advantage of this setting is that after determining the target answer display page corresponding to the final search conditions, the first multiplier value corresponding to each answer log on the target answer display page is determined, and after determining the target display page corresponding to the non-final search conditions, the second multiplier value corresponding to each search log on the target display page is determined. This fully considers the impact of the search conditions triggered by the user and the log display order on the log grading results, thereby improving the user's satisfaction with the log grading results.

[0081] S290: Determine the level to which each log belongs according to the sorting result of each log and the number of logs in each level.

[0082] Optionally, after determining the level to which each log belongs according to the sorting result of each log and the number of logs in each level, the method further includes: obtaining a target level log having the smallest total number of accesses and total access duration among the level logs belonging to the same level.

[0083] Furthermore, after receiving a new log corresponding to the target application, if the total number of accesses to the new log is greater than or equal to the total number of accesses to the target graded log, and the total access duration of the new log is greater than or equal to the total access duration of the target graded log, then it is determined that the level to which the new log belongs is the level to which the target graded log belongs.

[0084] The advantage of this setting is that by comparing the total number of accesses and total access duration of the newly added logs with the total number of accesses and total access duration of the target graded logs, the grade to which the newly added logs belong can be automatically determined, thereby improving the grade efficiency of the newly added logs.

[0085] The technical solution of this embodiment is to preliminarily sort all high-frequency words under the same log by the number of times each high-frequency word is accessed under the same log to obtain an initial sorting result; determine whether there are high-frequency words to be rearranged with the same sorting order in the initial sorting result; if so, re-sort each high-frequency word to be rearranged belonging to the same sorting order according to the access time of each high-frequency word to be rearranged, and update the initial sorting result according to the re-sorting result of the high-frequency words to be rearranged to obtain a high-frequency word sorting result; if not, use the initial sorting result as the high-frequency word sorting result; obtain the high-frequency word sorting result according to the high-frequency word sorting result Take a set number of target high-frequency words; determine the total number of visits to the log where the target high-frequency words are located based on the sum of the number of visits corresponding to each target high-frequency word; determine the total access time of the log where the target high-frequency words are located based on the sum of the access time corresponding to each target high-frequency word; sort each log according to the total number of visits and total access time corresponding to each log; determine the level to which each log belongs based on the sorting result of each log and the number of logs in each layer, which can achieve more accurate determination of the total number of visits and total access time of the log, thereby improving the accuracy of the log classification results. Secondly, by classifying the logs, it is convenient for developers to quickly filter out a large number of unnecessary logs when searching for logs, improving the efficiency of troubleshooting and reducing the cost of log search.

[0086] Embodiment 3

[0087] Figure 3 1 is a schematic diagram of the structure of a log grading device provided according to Embodiment 3 of the present invention. This embodiment is applicable to the situation of grading logs. The log grading device can be implemented in the form of hardware and / or software and can be configured in an electronic device such as a computer.

[0088] like Figure 3 As shown, the log grading device disclosed in this embodiment includes: a log number determination module 31 for each layer, a high-frequency word determination module 32, a high-frequency word screening module 33, a log sorting module 34 and a log level determination module 35, wherein:

[0089] The log number determination module 31 of each layer is used to obtain all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all logs, and determine the log number of each layer according to the average generation density and peak generation density;

[0090] A high-frequency word determination module 32 is used to determine the high-frequency words in each log according to the number of times each keyword in each log is accessed and a pre-stored high-frequency word list;

[0091] The high-frequency word screening module 33 is used to sort all high-frequency words in the same log according to the number of accesses and access duration of each high-frequency word in the same log, and obtain a set number of target high-frequency words according to the high-frequency word sorting results;

[0092] The log sorting module 34 is used to determine the total number of accesses and the total access duration of the log where the target high-frequency word is located according to the number of accesses and the access duration corresponding to each target high-frequency word, and sort each log according to the total number of accesses and the total access duration corresponding to each log;

[0093] The log level determination module 35 is used to determine the level to which each log belongs according to the sorting result of each log and the number of logs in each level.

[0094] The technical solution in this embodiment solves the problem that the log level marked by the developer cannot be flexibly adjusted, resulting in a large amount of additional manpower required for adjustment when there is a need to adjust the log level in the future, through the mutual cooperation of the module for determining the number of logs per layer, the module for determining the high-frequency words, the module for filtering the high-frequency words, the log sorting module and the log level determination module. It can realize regular and automatic determination of the level to which each log belongs, reducing the cost of updating the level to which the log belongs.

[0095] Optionally, the high-frequency word screening module 33 is specifically used to: preliminarily sort all high-frequency words under the same log according to the number of times each high-frequency word under the same log is visited, and obtain an initial sorting result; determine whether there are high-frequency words to be rearranged with the same sorting order in the initial sorting result; if so, re-sort each high-frequency word to be rearranged belonging to the same sorting order according to the access duration of each high-frequency word to be rearranged, and update the initial sorting result according to the re-sorting result of the high-frequency words to be rearranged, to obtain a high-frequency word sorting result; if not, use the initial sorting result as the high-frequency word sorting result.

[0096] Optionally, the log sorting module 34 is specifically used to: determine the total number of visits to the log where the target high-frequency word is located based on the sum of the number of visits corresponding to each target high-frequency word; determine the total visit duration of the log where the target high-frequency word is located based on the sum of the visit duration corresponding to each target high-frequency word.

[0097] Optionally, the device also includes a multiplier value determination module, which is used to: obtain the current search conditions for all logs and determine whether the current search conditions are the final search conditions; if so, obtain each answer display page corresponding to the current search conditions, and obtain the target answer display page according to the display order of each answer display page; obtain each answer log on the target answer display page, and determine the first multiplier value corresponding to each answer log; if not, obtain each search display page corresponding to the current search conditions, and obtain the target display page according to the display order of each search display page; obtain each search log on the target display page, and determine the second multiplier value corresponding to each search log.

[0098] Optionally, the log sorting module 34 is specifically used to: after preliminarily updating the total number of accesses and the total access time of each log according to the number of times each log is copied, take each log as the current log in turn, and determine whether the current log is a search log and / or an answer log; if the current log is both a search log and an answer log, update the total number of accesses and the total access time of the current log according to the first multiplier value and the second multiplier value; if the current log is only an answer log, update the total number of accesses and the total access time of the current log according to the first multiplier value; if the current log is only a search log, update the total number of accesses and the total access time of the current log according to the second multiplier value; sort each log according to the updated total number of accesses and the updated total access time corresponding to each log.

[0099] Optionally, the device further includes a target log determination module, which is used to obtain a target hierarchical log having the smallest total number of accesses and total access duration among hierarchical logs belonging to the same level.

[0100] Optionally, the device also includes a log classification module, which is used to: after receiving a new log corresponding to a target application, if the total number of access times of the new log is greater than or equal to the total number of access times of the target classified log, and the total access time of the new log is greater than or equal to the total access time of the target classified log, then determine that the level to which the new log belongs is the level to which the target classified log belongs.

[0101] Optionally, the module 31 for determining the number of logs per layer is specifically used to determine the number of logs per layer according to an intermediate value between the average generation density and the peak generation density.

[0102] The log classification device provided in the embodiment of the present invention can execute the log classification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in this embodiment, reference can be made to the description in any method embodiment of the present application.

[0103] Embodiment 4

[0104] Figure 4 FIG. 1 is a schematic diagram showing the structure of an electronic device 10 that can be used to implement an embodiment of the present invention. Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0105] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0106] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a log classification method.

[0107] In some embodiments, the log grading method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the log grading method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the log grading method in any other appropriate manner (e.g., by means of firmware).

[0108] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0110] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0112] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0113] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A log classification method, characterized in that: The method comprises: Obtain all logs of the target application within a set period, as well as the average generation density and peak generation density corresponding to all the logs, and determine the number of logs per layer according to the average generation density and the peak generation density; According to the number of visits of each keyword in each log and the pre-stored high-frequency word list, the high-frequency words in each log are determined; According to the number of visits and the duration of visits of each high-frequency word in the same log, all high-frequency words in the same log are sorted, and a set number of target high-frequency words are obtained according to the high-frequency word sorting results; According to the number of visits and the visit duration corresponding to each target high-frequency word, the total number of visits and the total visit duration of the log where the target high-frequency word is located are determined, and each log is sorted according to the total number of visits and the total visit duration corresponding to each log; The level to which each log belongs is determined based on the sorting result of each log and the number of logs in each level.

2. The method according to claim 1, characterized in that: According to the number of visits and the duration of visits of each high-frequency word in the same log, all high-frequency words in the same log are sorted, including: According to the number of visits of each high-frequency word in the same log, all high-frequency words in the same log are preliminarily sorted to obtain the initial sorting result; Determine whether there are high-frequency words to be rearranged with the same sorting order in the initial sorting results; If yes, then reorder each high-frequency word to be reordered that belongs to the same sorting order according to the access time of each high-frequency word to be reordered, and update the initial sorting result according to the reordering result of the high-frequency word to be reordered to obtain the high-frequency word sorting result; If not, the initial sorting result is used as the high-frequency word sorting result.

3. The method according to claim 1, characterized in that According to the number of visits and the duration of visits corresponding to each target high-frequency word, the total number of visits and the total duration of visits of the log where the target high-frequency word is located are determined, including: According to the sum of the number of visits corresponding to each target high-frequency word, the total number of visits to the log where the target high-frequency word is located is determined; The total access time of the log containing the target high-frequency word is determined according to the sum of the access time corresponding to each target high-frequency word.

4. The method according to claim 1, characterized in that Before sorting each log according to the total number of visits and total visit duration corresponding to each log, it also includes: Obtaining current search conditions for all the logs, and determining whether the current search conditions are final search conditions; If so, obtain each answer display page corresponding to the current search condition, and obtain the target answer display page according to the display order of each answer display page; Obtain each answer log on the target answer display page, and determine a first multiplier value corresponding to each answer log; If not, then obtaining each search display page corresponding to the current search condition, and obtaining the target display page according to the display order of each search display page; Each search log on the target display page is obtained, and a second multiplier value corresponding to each search log is determined.

5. The method according to claim 4, characterized in that Sort each log entry by the total number of visits and total visit duration corresponding to each log entry, including: After preliminarily updating the total number of accesses and the total access duration of each log according to the number of times each log is copied, each log is taken as the current log in turn, and it is determined whether the current log is a search log and / or an answer log; If the current log is both a search log and an answer log, the total number of accesses and the total access duration of the current log are updated according to the first multiplier value and the second multiplier value; If the current log is only the answer log, the total number of visits and the total visit duration of the current log are updated according to the first multiplier value; If the current log is only a search log, the total number of accesses and the total access duration of the current log are updated according to the second multiplier value; Each log is sorted according to the total update access count and the total update access duration corresponding to each log.

6. The method according to claim 1, characterized in that After determining the level to which each log belongs based on the sorting results of each log and the number of logs in each level, the following steps are also included: Obtain the target hierarchical log with the smallest total number of visits and total visit duration among all hierarchical logs belonging to the same level; The method further comprises: After receiving the newly added log corresponding to the target application, if the total access times of the newly added log is greater than or equal to the total access times of the target graded log, and the total access duration of the newly added log is greater than or equal to the total access duration of the target graded log, then it is determined that the level to which the newly added log belongs is the level to which the target graded log belongs.

7. The method according to any one of claims 1 to 6, characterized in that: The number of logs per layer is determined based on the average generation density and the peak generation density, including: The number of logs per layer was determined based on the median value between the average generation density and the peak generation density.

8. A log grading device, characterized in that: The device comprises: A log number determination module for each layer, used to obtain all logs of the target application within a set period, as well as an average generation density and a peak generation density corresponding to all the logs, and determine the log number for each layer according to the average generation density and the peak generation density; A high-frequency word determination module is used to determine the high-frequency words in each log according to the number of times each keyword in each log is accessed and a pre-stored high-frequency word list; The high-frequency word screening module is used to sort all high-frequency words in the same log according to the number of visits and the duration of visits of each high-frequency word in the same log, and obtain a set number of target high-frequency words according to the high-frequency word sorting results; The log sorting module is used to determine the total number of accesses and the total access duration of the log where the target high-frequency word is located according to the number of accesses and the access duration corresponding to each target high-frequency word, and sort each log according to the total number of accesses and the total access duration corresponding to each log; The log level determination module is used to determine the level to which each log belongs based on the sorting result of each log and the number of logs in each level.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log grading method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the log classification method according to any one of claims 1 to 7 when executed.