Log processing method and device, equipment and storage medium

By the retrieval of the retracting server, the retaining log and other logs are deleted according to the historical retrieval request, and the reliability of the log processing due to the preset time in the existing technology is solved, and a more accurate and timely log process is achieved.

CN119336719APending Publication Date: 2025-01-21CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310890622.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-19
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the logs are processed through manual experience determining the preset time, resulting in the inability to accurately determine the cold logs, and the hot logs may be migrated to the mechanical disk or the memory space of the solid state hard disk cannot be released in time, resulting in poor processing reliability.

Method used

By determining multiple historical retrieval requests in the historical period in the retrieval server, determine the retaining log according to the retrieval information of each historical retrieval request, and delete other logs to avoid the preset time of artificial experience.

Benefits of technology

Improve the reliability of log processing, ensure the accuracy and timelyness of the log processing, and avoid the problem of memory space release due to uncertain time at the preset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336719A_ABST
    Figure CN119336719A_ABST
Patent Text Reader

Abstract

The invention provides a log processing method and device, equipment and a storage medium. The method comprises the following steps: determining a plurality of historical retrieval requests received in a historical time period; retrieval information corresponding to each historical retrieval request is determined, multiple pieces of retrieval information are obtained, and the retrieval information comprises retrieval time periods and / or retrieval keywords; determining reserved logs in logs of the retrieval server according to the multiple pieces of retrieval information; and deleting other logs except the reserved log in the retrieval server. According to the method, the reliability of log processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] A large number of logs are stored in the retrieval server, and users can retrieve historical logs through the retrieval server. Due to the limited storage space in the retrieval server, historical logs need to be deleted to free up storage space.

[0003] In the prior art, the staff determines the preset time based on experience, identifies the cold logs in the historical logs whose business processing time is earlier than the preset time, and migrates the cold logs from the solid-state hard disk of the retrieval server to the mechanical disk for storage to free up the memory space of the solid-state hard disk of the retrieval server. However, based on the staff's experience, the preset time cannot be accurately determined. If the time between the preset time and the current time is too short, the hot logs may be migrated from the solid-state hard disk of the retrieval server to the mechanical disk. If the time between the preset time and the current time is too long, the memory space of the solid-state hard disk cannot be released in time, resulting in poor reliability in processing the logs. Summary of the invention

[0004] The present application provides a log processing method, apparatus, device and storage medium to solve the problem of poor reliability in log processing.

[0005] In a first aspect, the present application provides a log processing method, which is applied to a retrieval server, and the method comprises:

[0006] determining a plurality of historical retrieval requests received during a historical period;

[0007] Determine the search information corresponding to each historical search request to obtain a plurality of search information, wherein the search information includes a search period and / or a search keyword;

[0008] Determining a reserved log in a log of the retrieval server according to the plurality of retrieval information;

[0009] The other logs except the reserved log are deleted in the retrieval server.

[0010] In a possible implementation, determining, according to the plurality of search information, to retain the log in the log of the search server includes:

[0011] Determining a plurality of initial search time periods and a plurality of initial keywords according to the plurality of search information;

[0012] Determine the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword;

[0013] According to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword, a reserved log is determined in the log of the search server.

[0014] In a possible implementation, determining a plurality of initial search time periods and a plurality of initial keywords according to the plurality of search information includes:

[0015] Determine a retrieval period set according to the retrieval periods in the plurality of retrieval information, wherein the retrieval period set includes the retrieval period in each retrieval information;

[0016] Determining the plurality of initial search time periods according to the search time period set;

[0017] Determine a keyword set according to the search keywords in the plurality of search information, wherein the keyword set includes the search keywords in each search information;

[0018] De-duplication processing is performed on the multiple search keywords in the keyword set to obtain the multiple initial keywords.

[0019] In a possible implementation, determining the multiple initial search time periods according to the search time period set includes:

[0020] Performing time period deduplication processing on multiple search time periods in the search time period set to obtain at least one search time period to be selected, wherein there is no overlapping time period between any two search time periods to be selected;

[0021] Each to-be-selected search period is segmented according to a preset duration to obtain the multiple initial search periods.

[0022] In a possible implementation, determining the reserved log in the log of the search server according to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword includes:

[0023] determining a first number of the plurality of historical retrieval requests;

[0024] Determine at least one target retrieval period among the multiple initial retrieval periods according to the first number and the number of retrievals corresponding to each initial retrieval period;

[0025] Determining at least one target keyword from the plurality of initial keywords according to the first number and the number of searches corresponding to each initial keyword;

[0026] A reserved log is determined in a log of the search server according to the at least one target search period and the at least one target keyword.

[0027] In a possible implementation manner, determining at least one target search period from the multiple initial search periods according to the first number and the number of searches corresponding to each initial search period includes:

[0028] Determine a first search coverage rate corresponding to each initial search period according to the number of searches corresponding to each initial search period and the first number;

[0029] Determining a first threshold value according to a service type corresponding to the search server;

[0030] Sorting the multiple initial search time periods in descending order of the first search coverage to obtain a plurality of sorted initial search time periods;

[0031] According to the first threshold, the first N initial retrieval time periods after sorting are determined as the at least one target retrieval time period, the sum of the first retrieval coverage of the at least one target retrieval time period is greater than or equal to the first threshold, and N is an integer greater than or equal to 1.

[0032] In a possible implementation, determining at least one target keyword from the multiple initial keywords according to the first number and the number of searches corresponding to each initial keyword includes:

[0033] Determining a second search coverage rate corresponding to each initial keyword according to the number of searches corresponding to each initial keyword and the first number;

[0034] Sorting the multiple initial keywords in descending order of the second search coverage to obtain a plurality of sorted initial keywords;

[0035] According to the first threshold, the first M initial keywords after sorting are determined as the at least one target keyword, the sum of the second retrieval coverage of the at least one target keyword is greater than or equal to the first threshold, and M is an integer greater than or equal to 1.

[0036] In a possible implementation, determining the reserved log in the log of the search server according to the at least one target search period and the at least one target keyword includes:

[0037] According to the at least one target retrieval period, determining a first log in the logs of the retrieval server, wherein the generation time of the first log is within the at least one target retrieval period;

[0038] According to the at least one target keyword, determining a second log in the log of the search server, wherein at least one target keyword exists in the keywords corresponding to the second log;

[0039] The reserved log is determined according to the first log and the second log, and the reserved log includes the first log and / or the second log.

[0040] In a second aspect, the present application provides a log processing device, applied to a search server, the device comprising a first determination module, a second determination module, a third determination module and a deletion module:

[0041] The first determination module is used to determine a plurality of historical search requests received within a historical period;

[0042] The second determination module is used to determine the search information corresponding to each historical search request to obtain a plurality of search information, wherein the search information includes a search period and / or a search keyword;

[0043] The third determination module is used to determine the reserved log in the log of the search server according to the plurality of search information;

[0044] The deleting module is used to delete other logs except the reserved log in the retrieval server.

[0045] In a possible implementation manner, the third determining module is specifically configured to:

[0046] Determining a plurality of initial search time periods and a plurality of initial keywords according to the plurality of search information;

[0047] Determine the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword;

[0048] According to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword, a reserved log is determined in the log of the search server.

[0049] In a possible implementation manner, the third determining module is specifically configured to:

[0050] Determine a retrieval period set according to the retrieval periods in the plurality of retrieval information, wherein the retrieval period set includes the retrieval period in each retrieval information;

[0051] Determining the plurality of initial search time periods according to the search time period set;

[0052] Determine a keyword set according to the search keywords in the plurality of search information, wherein the keyword set includes the search keywords in each search information;

[0053] De-duplication processing is performed on the multiple search keywords in the keyword set to obtain the multiple initial keywords.

[0054] In a possible implementation manner, the third determining module is specifically configured to:

[0055] Performing time period deduplication processing on multiple search time periods in the search time period set to obtain at least one search time period to be selected, wherein there is no overlapping time period between any two search time periods to be selected;

[0056] Each to-be-selected search period is segmented according to a preset duration to obtain the multiple initial search periods.

[0057] In a possible implementation manner, the third determining module is specifically configured to:

[0058] determining a first number of the plurality of historical retrieval requests;

[0059] Determine at least one target retrieval period among the multiple initial retrieval periods according to the first number and the number of retrievals corresponding to each initial retrieval period;

[0060] Determining at least one target keyword from the plurality of initial keywords according to the first number and the number of searches corresponding to each initial keyword;

[0061] A reserved log is determined in a log of the search server according to the at least one target search period and the at least one target keyword.

[0062] In a possible implementation manner, the third determining module is specifically configured to:

[0063] Determine a first search coverage rate corresponding to each initial search period according to the number of searches corresponding to each initial search period and the first number;

[0064] Determining a first threshold value according to a service type corresponding to the search server;

[0065] Sorting the multiple initial search time periods in descending order of the first search coverage to obtain a plurality of sorted initial search time periods;

[0066] According to the first threshold, the first N initial retrieval time periods after sorting are determined as the at least one target retrieval time period, the sum of the first retrieval coverage of the at least one target retrieval time period is greater than or equal to the first threshold, and N is an integer greater than or equal to 1.

[0067] In a possible implementation manner, the third determining module is specifically configured to:

[0068] Determining a second search coverage rate corresponding to each initial keyword according to the number of searches corresponding to each initial keyword and the first number;

[0069] Sorting the multiple initial keywords in descending order of the second search coverage to obtain a plurality of sorted initial keywords;

[0070] According to the first threshold, the first M initial keywords after sorting are determined as the at least one target keyword, the sum of the second retrieval coverage of the at least one target keyword is greater than or equal to the second threshold, and M is an integer greater than or equal to 1.

[0071] In a possible implementation manner, the third determining module is specifically configured to:

[0072] According to the at least one target retrieval period, determining a first log in the logs of the retrieval server, wherein the generation time of the first log is within the at least one target retrieval period;

[0073] According to the at least one target keyword, determining a second log in the log of the search server, wherein at least one target keyword exists in the keywords corresponding to the second log;

[0074] The reserved log is determined according to the first log and the second log, and the reserved log includes the first log and / or the second log.

[0075] In a third aspect, the present application provides an electronic device, including: a memory and a processor;

[0076] The memory stores computer-executable instructions;

[0077] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the log processing method described in any one of the first aspects.

[0078] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the log processing method described in any one of the first aspects.

[0079] The log processing method, device, equipment and storage medium provided in the present application can determine multiple historical retrieval requests received within a historical period, obtain multiple retrieval information based on the retrieval information corresponding to each historical retrieval request, determine the retained logs in the to-be-retrieved logs of the retrieval server based on the multiple retrieval information, delete other logs besides the retained logs, determine the user's frequently used searches based on the multiple retrieval information, and determine the retained logs, which can avoid determining the preset time based on manual experience and improve the reliability of log processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0081] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0082] Figure 2 A flow chart of a log processing method provided in an embodiment of the present application;

[0083] Figure 3 A flowchart of another log processing method provided in an embodiment of the present application;

[0084] Figure 4 A schematic diagram of a process for determining a retained log provided in an embodiment of the present application;

[0085] Figure 5 A schematic diagram of the structure of the log processing method provided in the embodiment of the present application;

[0086] Figure 6 A schematic diagram of the structure of a log processing device provided in an embodiment of the present application;

[0087] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0088] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0089] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0090] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , including a user terminal 101 and a retrieval server 102.

[0091] The user can select the retrieval period and retrieval keywords of the logs to be retrieved on the user terminal 101. The user terminal 101 can generate a retrieval request based on the user's selection and send the retrieval request to the retrieval server 102. The retrieval server 102 can determine the request log from multiple logs to be retrieved based on the retrieval request and send the request log to the user terminal 101. The user terminal 101 can receive the request log sent by the retrieval server 102.

[0092] The retrieval server 102 can store multiple logs to be retrieved, and can also store multiple historical retrieval requests within a historical period. Based on the multiple historical retrieval requests, multiple retrieval information can be determined. Based on the multiple retrieval information, the retained logs can be determined from the multiple logs to be retrieved in the retrieval server 102, and other logs except the retained logs in the retrieval server 102 can be deleted to release memory space of the solid-state drive.

[0093] In the prior art, the staff determines the preset time based on experience, identifies the logs whose business processing time is earlier than the preset time as cold logs, and migrates the cold logs from the solid-state hard disk of the retrieval server to the mechanical disk for storage to free up the memory space of the solid-state hard disk of the retrieval server. However, based on the staff's experience, it is impossible to accurately determine the preset time. If the time between the preset time and the current time is too short, the hot logs may be migrated from the solid-state hard disk of the retrieval server to the mechanical disk. If the time between the preset time and the current time is too long, the memory space of the solid-state hard disk cannot be released in time, resulting in poor reliability in processing the logs.

[0094] The embodiment of the present application can determine multiple historical retrieval requests received within a historical period, obtain multiple retrieval information based on the retrieval information corresponding to each historical retrieval request, determine the retained logs in the to-be-retrieved log of the retrieval server based on the multiple retrieval information, delete other logs besides the retained logs, determine the user's frequently used searches based on the multiple retrieval information, and determine the retained logs, which can avoid determining the preset time based on manual experience and improve the reliability of log processing.

[0095] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0096] Figure 2 A flow chart of a log processing method provided in an embodiment of the present application. Figure 2 , the method may include:

[0097] S201. Determine a plurality of historical search requests received within a historical period.

[0098] The execution subject of the embodiment of the present application may be a search server, or a log processing device arranged in the search server. The log processing device may be implemented by software, or by a combination of software and hardware.

[0099] The historical moment when the log is processed can be determined, and the historical moment to the current moment can be determined as the historical period.

[0100] In a historical period, multiple users may search for logs according to historical search requests. Multiple historical search requests may include search requests of multiple users. The search request may include a search period and a search keyword.

[0101] The search period may be the period in which the log to be searched is generated.

[0102] A plurality of logs to be retrieved may be stored in the retrieval server, and the logs to be retrieved may be business logs of users.

[0103] The retrieval server may receive historical retrieval requests and store the historical retrieval requests in a pipeline.

[0104] For example, assuming that within historical period 1, the retrieval server receives historical retrieval request 1, then stores historical retrieval request 1 in the pipeline, and then after receiving historical retrieval request 2, stores historical retrieval request 2 in the pipeline.

[0105] S202: Determine the search information corresponding to each historical search request to obtain multiple search information.

[0106] For any historical search request, the historical search request can be obtained in the pipeline, and the historical search request is parsed and processed to obtain search information, which may include a search period and / or a search keyword.

[0107] For example, assuming that there are three historical retrieval requests in the pipeline, namely historical retrieval requests 1-3, assuming that historical retrieval request 1 is obtained, and the historical retrieval request is parsed, the retrieval period 1 and retrieval keyword 1 can be obtained; assuming that historical retrieval request 2 is obtained, and the historical retrieval request is parsed, the retrieval period 2 can be obtained; assuming that historical retrieval request 3 is obtained, and the historical retrieval request is parsed, the retrieval keyword 2 can be obtained.

[0108] S203: Determine a retained log in the log of the search server according to the plurality of search information.

[0109] The retention log can be determined in the following manner: based on multiple search information, determine multiple initial search time periods and multiple initial keywords; determine the number of searches corresponding to each initial search time period, and the number of searches corresponding to each initial keyword; based on the number of searches corresponding to each initial search time period, and the number of searches corresponding to each initial keyword, determine the retention log in the log of the search server.

[0110] For example, assuming that there are 4 search information in total, namely search information 1-4, as shown in Table 1, where “—” indicates that the keyword is empty, the initial search period can be determined to be period 1 and period 2, the initial keyword can be determined to be keyword 1-3, the number of searches for period 1 is 2, the number of searches for period 2 is 1, the number of searches for keyword 1 is 1, the number of searches for keyword 2 is 2, and the number of searches for keyword 3 is 1.

[0111] Table 1

[0112]

[0113] S204: Deleting other logs except the retained logs in the retrieval server.

[0114] For example, assuming that there are 4 logs in the retrieval server, namely logs 1 to 4, and assuming that the retained logs are logs 1 and 2, then logs 3 and 4 in the retrieval server are deleted.

[0115] The log processing method provided in the embodiment of the present application can determine multiple historical retrieval requests received within a historical period, obtain multiple retrieval information based on the retrieval information corresponding to each historical retrieval request, determine the retained logs in the log of the retrieval server based on the multiple retrieval information, delete other logs besides the retained logs, and determine the retained logs based on the user's retrieval situation. This can avoid determining the preset time based on manual experience and improve the reliability of log processing.

[0116] Based on the above embodiments, Figure 3 , the log processing method shown in the embodiment of the present application is further described in detail.

[0117] Figure 3 A flowchart of another log processing method provided in an embodiment of the present application. Figure 3 , the method may include:

[0118] S301. Determine multiple historical search requests received within a historical period.

[0119] S302: Determine the search information corresponding to each historical search request to obtain multiple search information.

[0120] The execution process of S301-S302 can refer to the execution process of S201-S202, which will not be repeated here.

[0121] S303: Determine a search period set according to the search periods in the multiple search information.

[0122] The retrieval period set may include the retrieval period in each retrieval information.

[0123] For example, assuming that there are 4 pieces of search information, as shown in Table 1, it can be determined that the search period set includes period 1 and period 2.

[0124] S304: Perform time period deduplication processing on multiple search time periods in the search time period set to obtain at least one search time period to be selected.

[0125] There is no overlapping period between any two selected search periods.

[0126] If there is an overlap between any two search periods, one of the search periods will be determined as the selected search period 1, and the overlapping part of the other search period will be removed to determine it as the selected search period 2; if among any two search periods, search period 1 includes search period 2, then search period 1 will be determined as the selected search period 3, and search period 2 will be deleted.

[0127] For example, suppose there are 3 retrieval time periods in the retrieval time period set, namely time periods 1-3. Suppose time period 1 is 9:00-13:00, time period 2 is 12:00-16:00, and time period 3 is 10:00-12:00. Since time period 1 and time period 2 are stored in the retrieval time period overlap, any overlapping time period of time period 1 and time period 2 can be removed. Since time period 1 includes time period 3, time period 3 can be removed to obtain 2 candidate retrieval time periods, namely candidate retrieval time period 1 (9:00-13:00) and candidate retrieval time period 2 (13:00-16:00).

[0128] S305 , dividing each candidate search period according to a preset duration to obtain a plurality of initial search periods.

[0129] The preset duration can be determined by the staff, and the preset duration can be 1 hour, 2 hours, 1 day, etc.

[0130] For example, assuming that there are 2 selected retrieval time periods, selected retrieval time period 1 is 9:00-10:00, and selected retrieval time period 2 is 14:00-16:00, and assuming that the preset duration is 1 hour, 3 initial retrieval time periods can be obtained, namely initial retrieval time period 1 (9:00-10:00), initial retrieval time period 2 (14:00-15:00), and initial retrieval time period 3 (15:00-16:00).

[0131] S306: Determine a keyword set according to the search keywords in the multiple search information.

[0132] The keyword set may include the search keywords in each search information.

[0133] For example, assuming that there are 4 search information, namely search information 1-4, then the 4 search keywords can be determined to be search keywords 1-4 respectively.

[0134] S307: De-duplicate multiple search keywords in the keyword set to obtain multiple initial keywords.

[0135] The same keyword among the multiple search keywords can be determined as an initial keyword. For example, assuming that search keyword 1 is keyword 1 and search keyword 2 is keyword 1, search keyword 1 and search keyword 2 have the same keyword.

[0136] For example, assuming there are 4 search keywords in total, search keyword 1 is keyword 1, search keyword 2 is keyword 2, search keyword 3 is keyword 2, and search keyword 4 is keyword 3, then 3 initial keywords can be obtained, initial keyword 1 is keyword 1, initial keyword 2 is keyword 2, and initial keyword 3 is keyword 3.

[0137] S308: Determine the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword.

[0138] For example, assuming that there are 5 search information in total, the search information is shown in Table 2, where the “—” indicates that the keyword is empty, and 4 keywords can be determined, namely keywords 1-4, and the number of searches corresponding to each keyword can be shown in Table 3; assuming that the preset time length is 1 hour, 6 initial search time periods and the number of searches corresponding to each initial search time period can be determined, as shown in Table 4.

[0139] Table 2

[0140]

[0141] Table 3

[0142] Keywords Number of searches Keyword 1 3 Keyword 2 1 Keyword 3 2 Keyword 4 1

[0143] Table 4

[0144]

[0145] S309: Determine a reserved log in the log of the search server according to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword.

[0146] The retention log may be determined in the following manner: determining a first number of multiple historical retrieval requests; determining at least one target retrieval period among the multiple initial retrieval periods based on the first number and the number of retrievals corresponding to each initial retrieval period; determining at least one target keyword among the multiple initial keywords based on the first number and the number of retrievals corresponding to each initial keyword; determining the retention log in the log of the retrieval server based on at least one target retrieval period and at least one target keyword.

[0147] The execution process of S309 is specifically described in the following embodiments and will not be repeated here.

[0148] S310: Deleting other logs except the retained logs in the retrieval server.

[0149] The execution process of S310 can refer to the execution process of S204, which will not be described in detail here.

[0150] The log processing method provided in the embodiment of the present application can determine multiple initial search time periods and multiple initial keywords based on multiple search information, determine the retained logs in the log of the search server based on the number of searches corresponding to each initial search time period and each initial keyword, and can determine the retained logs based on the user's search needs, avoiding the need to determine a preset time length through manual experience and improving the reliability of log processing.

[0151] Based on the above embodiments, Figure 4 , the execution process of determining the retention log in the log of the search server according to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword in step S309 shown in the embodiment of the present application is further described in detail.

[0152] Figure 4 A flowchart of determining the log retention process provided in the embodiment of the present application. Figure 4 , the method may include:

[0153] S401: Determine a first quantity of multiple historical retrieval requests.

[0154] For example, assuming that there are 5 history retrieval requests in total, the first number can be determined to be 5.

[0155] S402: Determine a first search coverage rate corresponding to each initial search period according to the number of searches and the first quantity corresponding to each initial search period.

[0156] For any initial search period, the number of searches may be divided by the first quantity to obtain a first search coverage rate corresponding to the initial search period.

[0157] For example, assuming that there are 6 initial search time periods in total, as shown in Table 4, and assuming that the first number is 5, the first search coverage corresponding to each initial search time period can be determined as shown in Table 5.

[0158] Table 5

[0159] Initial search period Number of searches First search coverage Initial search period 1 1 0.2 Initial search period 2 2 0.4 Initial search period 3 1 0.2 Initial search period 4 1 0.2 Initial search period 5 2 0.4 Initial search period 6 1 0.2

[0160] S403: Determine a first threshold according to the service type corresponding to the search server.

[0161] The first threshold may be determined according to the business type of the specific application of the retrieval server, and the first threshold may be 99%, 90%, and the like.

[0162] For example, assuming that for more important business log data, the first threshold may be 99%; and for less important business log data, the first threshold may be 90%.

[0163] S404 , sorting the multiple initial search time periods in descending order of the first search coverage to obtain a plurality of sorted initial search time periods.

[0164] For example, assuming there are 6 initial retrieval time periods, namely initial retrieval time periods 1-6, the first retrieval coverage corresponding to the initial retrieval time periods can be as shown in Table 5. The order after sorting from large to small according to the first retrieval coverage is: initial retrieval time period 2, initial retrieval time period 3, initial retrieval time period 1, initial retrieval time period 3, initial retrieval time period 4 and initial retrieval time period 6.

[0165] S405: According to a first threshold, determine the sorted first N initial search time periods as at least one target search time period.

[0166] The sum of the first retrieval coverage rates of at least one target retrieval period is greater than or equal to a first threshold.

[0167] N is an integer greater than or equal to 1.

[0168] For example, assuming that there are four initial retrieval time periods, namely initial retrieval time periods 1-4, the first retrieval coverage rate 1 corresponding to the initial retrieval time period 1 is 25%, the first retrieval coverage rate 2 corresponding to the initial retrieval time period 2 is 30%, the first retrieval coverage rate 3 corresponding to the initial retrieval time period 3 is 36%, and the first retrieval coverage rate 4 corresponding to the initial retrieval time period 4 is 15%. Assuming that the first threshold is 90%, after sorting according to the first retrieval coverage rate, the sum of the coverage rates of the first coverage rates 1-3 is greater than the first threshold, and the initial retrieval time period 1-3 corresponding to the first retrieval coverage rate 1-3 is determined as the target retrieval time period, that is, N is 3.

[0169] S406: Determine a second search coverage rate corresponding to each initial keyword according to the number of searches corresponding to each initial keyword and the first quantity.

[0170] For example, assuming that there are 4 initial keywords in total, as shown in Table 3, and assuming that the first number is 5, the second search coverage corresponding to each initial keyword can be as shown in Table 6.

[0171] Table 6

[0172] Initial keywords Number of searches Second search coverage Initial keyword 1 3 0.6 Initial keyword 2 1 0.2 Initial keyword 3 2 0.4 Initial keyword 4 1 0.2

[0173] S407 , sorting the multiple initial keywords in descending order of the second search coverage to obtain the sorted multiple initial keywords.

[0174] For example, assuming there are four initial keywords, namely initial keywords 1-4, the second search coverage corresponding to the initial keywords can be shown in Table 6. The order after sorting from large to small according to the second search coverage is: keyword 1, keyword 3, keyword 2 and keyword 4.

[0175] S408: According to a first threshold, determine the first M sorted initial keywords as at least one target keyword.

[0176] The sum of the second search coverage of at least one target keyword is greater than or equal to a second threshold.

[0177] M is an integer greater than or equal to 1.

[0178] For example, assuming that there are 4 initial keywords in total, the second retrieval coverage rate 1 corresponding to initial keyword 1 is 10%, the second retrieval coverage rate 2 corresponding to initial keyword 2 is 35%, the second retrieval coverage rate 3 corresponding to initial keyword 3 is 36%, and the first retrieval coverage rate 4 corresponding to initial keyword 4 is 20%. Assuming that the first threshold is 90%, after sorting according to the second retrieval coverage rate, the sum of the second retrieval coverage rates 2-4 is greater than the first threshold, then the initial keyword 2-4 corresponding to the second retrieval coverage rate 2-4 is determined as the target keyword, that is, M is 3.

[0179] S409: Determine a first log in the logs of the retrieval server according to at least one target retrieval period.

[0180] The generation time of the first log is within at least one target retrieval period.

[0181] For example, assuming that target retrieval period 1 is 9:00-10:00, assuming that log 1 is generated at 9:34 and log 2 is generated at 9:56, and the generation times of log 1 and log 2 are within target retrieval period 1, log 1 and log 2 are determined as the first log.

[0182] S410: Determine a second log in the log of the search server according to at least one target keyword.

[0183] There is at least one target keyword among the keywords corresponding to the second log.

[0184] For example, assuming the target keyword is keyword 1, and assuming there are 4 logs in the retrieval server, as shown in Table 7, it can be determined that keyword 1 exists in the keywords of log 1, log 2 and log 3, and log 1, log 2 and log 3 are determined as the second log.

[0185] Table 7

[0186]

[0187] S411. Determine a retained log according to the first log and the second log.

[0188] The retention log may include the first log and / or the second log.

[0189] For example, assuming that the first log is log 1 and log 2, and the second log is log 3 and log 4, and assuming that the first log is determined to be a retained log, then log 1 and log 2 are retained logs; assuming that the second log is determined to be a retained log, then log 3 and log 4 are retained logs; assuming that the first log and the second log are determined to be retained logs, then log 1, log 2, log 3, and log 4 are retained logs.

[0190] The method for determining the retained logs provided in the embodiment of the present application can determine the first number of multiple historical retrieval requests, and determine the first retrieval coverage of each initial retrieval period based on the number of retrievals and the first number corresponding to each initial retrieval period; determine the second retrieval coverage of each initial retrieval keyword based on the number of retrievals and the first number corresponding to each initial retrieval keyword; determine the retained logs based on the first retrieval coverage and the second retrieval coverage, which can improve the reliability of log processing.

[0191] In order to facilitate the understanding of the embodiments of the present application, Figure 5 , a specific embodiment of the log processing method provided in the embodiment of the present application is described.

[0192] Figure 5 This is a structural diagram of the log processing method provided in the embodiment of the present application. Figure 5, multiple logs are stored in the retrieval server. After receiving a retrieval request, the retrieval request can be stored; multiple historical retrieval requests within a historical period can be determined, the retrieval information of each historical retrieval request can be determined, multiple initial retrieval periods and multiple initial keywords can be determined based on the multiple retrieval information, and the retention logs can be determined based on the number of retrievals corresponding to each initial retrieval period and the number of retrievals corresponding to each initial keyword, and the logs other than the retained logs can be deleted.

[0193] Figure 6 This is a structural diagram of a log processing device provided in an embodiment of the present application. Figure 6 , the log processing device 10 may include a first determining module 11, a second determining module 12, a third determining module 13 and a deleting module 14:

[0194] The first determination module 11 is used to determine a plurality of historical search requests received within a historical period;

[0195] The second determination module 12 is used to determine the search information corresponding to each historical search request, and obtain multiple search information, wherein the search information includes a search period and / or a search keyword;

[0196] The third determination module 13 is used to determine the reserved log in the log of the retrieval server according to the multiple retrieval information;

[0197] The deleting module 14 is used to delete other logs except the reserved logs in the retrieval server.

[0198] The log processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0199] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0200] Determine multiple initial search time periods and multiple initial keywords based on multiple search information;

[0201] Determine the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword;

[0202] According to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword, a reserved log is determined in the log of the search server.

[0203] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0204] Determine a search period set according to the search periods in the plurality of search information, wherein the search period set includes the search period in each search information;

[0205] Determine a plurality of initial search periods according to the search period set;

[0206] Determine a keyword set according to the search keywords in the plurality of search information, wherein the keyword set includes the search keywords in each search information;

[0207] Multiple search keywords in the keyword set are deduplicated to obtain multiple initial keywords.

[0208] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0209] Performing time period deduplication processing on multiple search time periods in the search time period set to obtain at least one search time period to be selected, wherein there is no overlapping time period between any two search time periods to be selected;

[0210] Each candidate search period is segmented according to a preset duration to obtain a plurality of initial search periods.

[0211] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0212] determining a first number of the plurality of historical retrieval requests;

[0213] Determine at least one target retrieval period in the plurality of initial retrieval periods according to the first number and the number of retrievals corresponding to each initial retrieval period;

[0214] Determining at least one target keyword from the plurality of initial keywords according to the first number and the number of searches corresponding to each initial keyword;

[0215] A reserved log is determined in a log of a search server according to at least one target search period and at least one target keyword.

[0216] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0217] Determine a first search coverage rate corresponding to each initial search period according to the number of searches corresponding to each initial search period and the first quantity;

[0218] Determining a first threshold value according to a service type corresponding to the search server;

[0219] Sorting the multiple initial search time periods in descending order of the first search coverage to obtain multiple sorted initial search time periods;

[0220] According to the first threshold, the first N initial search time periods after sorting are determined as at least one target search time period, the sum of the first search coverage of at least one target search time period is greater than or equal to the first threshold, and N is an integer greater than or equal to 1.

[0221] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0222] Determine a second search coverage rate corresponding to each initial keyword according to the number of searches corresponding to each initial keyword and the first quantity;

[0223] Sorting the multiple initial keywords in descending order of the second search coverage to obtain the sorted multiple initial keywords;

[0224] According to the first threshold, the first M initial keywords after sorting are determined as at least one target keyword, the sum of the second search coverage of at least one target keyword is greater than or equal to the first threshold, and M is an integer greater than or equal to 1.

[0225] In a possible implementation manner, the third determining module 13 is specifically configured to:

[0226] According to at least one target retrieval period, determining a first log in the logs of the retrieval server, wherein the generation time of the first log is within the at least one target retrieval period;

[0227] According to the at least one target keyword, determining a second log in the log of the search server, wherein at least one target keyword exists in the keywords corresponding to the second log;

[0228] A reserved log is determined according to the first log and the second log, and the reserved log includes the first log and / or the second log.

[0229] The log processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0230] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.

[0231] The memory 22 stores computer executable instructions;

[0232] The processor 21 executes the computer execution instructions stored in the memory 22, so that the processor 21 executes the log processing method shown in the above method embodiment.

[0233] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the log processing method of the above method embodiment.

[0234] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, may implement the log processing method shown in the above method embodiment.

[0235] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0236] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0237] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0238] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0239] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0240] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0241] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0242] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0243] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A log processing method, characterized in that: Applied to a search server, the method comprises: determining a plurality of historical retrieval requests received during a historical period; Determine the search information corresponding to each historical search request to obtain a plurality of search information, wherein the search information includes a search period and / or a search keyword; Determining a reserved log in a log of the retrieval server according to the plurality of retrieval information; The other logs except the reserved log are deleted in the retrieval server.

2. The method according to claim 1, characterized in that Determining, according to the plurality of search information, to retain the log in the log of the search server, comprises: Determining a plurality of initial search time periods and a plurality of initial keywords according to the plurality of search information; Determine the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword; According to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword, a reserved log is determined in the log of the search server.

3. The method according to claim 2, characterized in that Determining a plurality of initial search time periods and a plurality of initial keywords according to the plurality of search information includes: Determine a search period set according to the search periods in the plurality of search information, wherein the search period set includes the search period in each search information; Determining the plurality of initial search time periods according to the search time period set; Determine a keyword set according to the search keywords in the plurality of search information, wherein the keyword set includes the search keywords in each search information; De-duplication processing is performed on the multiple search keywords in the keyword set to obtain the multiple initial keywords.

4. The method according to claim 3, characterized in that Determining the plurality of initial search time periods according to the search time period set includes: Performing time period deduplication processing on multiple search time periods in the search time period set to obtain at least one search time period to be selected, wherein there is no overlapping time period between any two search time periods to be selected; Each to-be-selected search period is segmented according to a preset duration to obtain the multiple initial search periods.

5. The method according to any one of claims 2 to 4, characterized in that: Determining the reserved log in the log of the search server according to the number of searches corresponding to each initial search period and the number of searches corresponding to each initial keyword includes: determining a first number of the plurality of historical retrieval requests; Determine at least one target retrieval period among the multiple initial retrieval periods according to the first number and the number of retrievals corresponding to each initial retrieval period; Determining at least one target keyword from the plurality of initial keywords according to the first number and the number of searches corresponding to each initial keyword; A reserved log is determined in a log of the search server according to the at least one target search period and the at least one target keyword.

6. The method according to claim 5, characterized in that Determining at least one target search period from the multiple initial search periods according to the first number and the number of searches corresponding to each initial search period includes: Determine a first search coverage rate corresponding to each initial search period according to the number of searches corresponding to each initial search period and the first number; Determining a first threshold value according to a service type corresponding to the search server; Sorting the multiple initial search time periods in descending order of the first search coverage to obtain a plurality of sorted initial search time periods; According to the first threshold, the first N initial retrieval time periods after sorting are determined as the at least one target retrieval time period, the sum of the first retrieval coverage of the at least one target retrieval time period is greater than or equal to the first threshold, and N is an integer greater than or equal to 1.

7. The method according to claim 5, characterized in that Determining at least one target keyword from the plurality of initial keywords according to the first number and the number of searches corresponding to each initial keyword includes: Determining a second search coverage rate corresponding to each initial keyword according to the number of searches corresponding to each initial keyword and the first number; Sorting the multiple initial keywords in descending order of the second search coverage to obtain a plurality of sorted initial keywords; According to the first threshold, the first M initial keywords after sorting are determined as the at least one target keyword, the sum of the second retrieval coverage of the at least one target keyword is greater than or equal to the first threshold, and M is an integer greater than or equal to 1.

8. The method according to claim 5, characterized in that Determining a reserved log in a log of the search server according to the at least one target search period and the at least one target keyword includes: According to the at least one target retrieval period, determining a first log in the logs of the retrieval server, wherein the generation time of the first log is within the at least one target retrieval period; According to the at least one target keyword, determining a second log in the log of the search server, wherein at least one target keyword exists in the keywords corresponding to the second log; The reserved log is determined according to the first log and the second log, and the reserved log includes the first log and / or the second log.

9. A log processing device, characterized in that: Applied to a search server, the device comprises a first determination module, a second determination module, a third determination module and a deletion module: The first determination module is used to determine a plurality of historical search requests received within a historical period; The second determination module is used to determine the search information corresponding to each historical search request to obtain a plurality of search information, wherein the search information includes a search period and / or a search keyword; The third determination module is used to determine the reserved log in the log of the search server according to the plurality of search information; The deleting module is used to delete other logs except the reserved log in the retrieval server.

10. An electronic device, characterized in that: include: Memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the log processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the log processing method according to any one of claims 1 to 8 when the computer-executable instructions are executed by a processor.