A log retrieval method, device, equipment and medium

By dividing the log into tokens and filtering the target tokens based on the reverse word frequency, combining the training model to improve the accuracy and efficiency of log retrieval, solving the bottleneck of URL retrieval under massive access logs.

CN114661867BActive Publication Date: 2025-08-05HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210318431.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2025-08-05
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

The existing technology has bottlenecks in the efficiency and accuracy of URL retrieval under massive access logs, and it is impossible to automatically optimize for specific web application systems.

Method used

By dividing the unified resource locator of the original log into tokens, using the preset classification method to determine the reverse word frequency, filtering out the target tokens that meet business needs, and determining the original log corresponding to the unified resource locator based on the trained model.

Benefits of technology

The accuracy and efficiency of log retrieval are improved, and the problems of high complexity and low efficiency of URL retrieval in the prior art are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661867B_ABST
    Figure CN114661867B_ABST
Patent Text Reader

Abstract

The present application discloses a log retrieval method, apparatus, device and medium, including: obtaining an original log, and using a preset division method to divide the uniform resource locator of the original log into tokens, and creating a database based on the uniform resource locator and each token; using a preset classification method to classify each token in the database to obtain different types of tokens, and determining the reverse word frequency of each token based on the different types of tokens and all tokens in the database; determining each target token that meets business needs based on the reverse word frequency of each token, and saving each target token and the original log corresponding to each target token to the database; using the database to train a preset model to obtain a trained model, then obtaining the target uniform resource locator, and determining the original log corresponding to the target uniform resource locator based on the trained model. Through the above technical solution of the present application, the accuracy of log retrieval can be further improved, and the efficiency of log retrieval can be effectively increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data log analysis, and in particular to a log retrieval method, device, equipment and medium. Background Art

[0002] At present, in Web (World Wide Web) application systems, it is usually necessary to record business access history data, generally in the form of access logs. Access logs generally include: time, client IP (Internet Protocol), access domain name, access URL (Uniform Resource Locator), etc. The access log storage system is required to provide necessary retrieval capabilities, such as retrieval by time, client IP, domain name, URL, etc. URL retrieval under massive access logs is more complex than other conditional retrieval, and its retrieval algorithm is crucial. Currently common retrieval algorithms are usually based on the optimization of classic algorithms such as hash hashing, red-black tree dictionary tree, etc., and there are large bottlenecks in the efficiency and overhead of data preprocessing and real-time retrieval, and it is impossible to automatically optimize the efficiency of the access logs of specific Web application systems.

[0003] As can be seen from the above, in the process of log retrieval, how to increase the efficiency of log retrieval and improve the accuracy of log retrieval is a problem to be solved in this field. Summary of the Invention

[0004] In view of this, the present invention aims to provide a log retrieval method, apparatus, device, and medium that can effectively increase the efficiency and accuracy of log retrieval. The specific solution is as follows:

[0005] In a first aspect, the present application discloses a log retrieval method, comprising:

[0006] Obtaining an original log, dividing the uniform resource locator of the original log into tokens using a preset division method, and creating a database based on the uniform resource locator and the tokens;

[0007] Classifying each token in the database using a preset classification method to obtain different types of tokens, and determining a reverse word frequency of each token based on the different types of tokens and all tokens in the database;

[0008] Determine target tokens that meet business requirements based on the reverse word frequency of each token, and save the target tokens and the original logs corresponding to the target tokens to the database;

[0009] The preset model is trained using the database to obtain a trained model, and then a target uniform resource locator is obtained, and an original log corresponding to the target uniform resource locator is determined based on the trained model.

[0010] Optionally, the dividing the Uniform Resource Locator of the original log into tokens using a preset dividing method includes:

[0011] Determine the position of the target character from the uniform resource locator of the original log; wherein the target character includes a slash " / ", a question mark "?" and a connector "&";

[0012] The uniform resource locator of the original log is segmented based on the position of the target character to obtain tokens.

[0013] Optionally, determining the reverse word frequency of each token based on the different types of tokens and all tokens in the database includes:

[0014] Determine the number of each token and count the number of all tokens in the database;

[0015] The ratio of the number of each token to the number of all tokens is calculated to obtain the word frequency of each token, and the inverse word frequency of each token is determined based on the word frequency of each token.

[0016] Optionally, determining target tokens that meet business requirements based on the reverse word frequency of each token includes:

[0017] Determine a preset threshold value corresponding to each token using the number of all tokens in the database and the number of each token;

[0018] Each token is arranged according to a preset arrangement method and using the inverse word frequency of each token, and then target tokens that meet business requirements are determined based on each token with a ranking number added and the preset threshold.

[0019] Optionally, the determining of target tokens that meet business requirements based on each token with a ranking number added and the preset threshold includes:

[0020] It is determined whether the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold. If the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold, the token with the added ranking number is determined as each target token that meets the business requirements.

[0021] Optionally, the step of saving each target token and the original log corresponding to each target token to the database includes:

[0022] The target tokens are associated with the original logs corresponding to the target tokens, and the associated target tokens and the original logs corresponding to the target tokens are saved in a preset association list in the database.

[0023] Optionally, determining the original log corresponding to the target uniform resource locator based on the trained model includes:

[0024] Determining each target token corresponding to the target uniform resource locator from the preset association list based on the trained model;

[0025] The preset association list is used to determine the original logs corresponding to the target tokens.

[0026] In a second aspect, the present application discloses a log retrieval device, comprising:

[0027] A database creation module, configured to obtain an original log, divide the uniform resource locator of the original log into tokens using a preset division method, and create a database based on the uniform resource locator and the tokens;

[0028] a reverse word frequency determination module, configured to classify each token in the database using a preset classification method to obtain different types of tokens, and determine a reverse word frequency of each token based on the different types of tokens and all tokens in the database;

[0029] A target token determination module is configured to determine target tokens that meet business requirements based on the reverse word frequency of each token, and save the target tokens and the original logs corresponding to the target tokens to the database;

[0030] The log determination module is used to train the preset model using the database to obtain a trained model, then obtain the target uniform resource locator, and determine the original log corresponding to the target uniform resource locator based on the trained model.

[0031] In a third aspect, the present application discloses an electronic device, comprising:

[0032] Memory, used to store computer programs;

[0033] The processor is configured to execute the computer program to implement the aforementioned disclosed log retrieval method.

[0034] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed log retrieval method are implemented.

[0035] It can be seen that the present application provides a log retrieval method, including obtaining an original log, and using a preset division method to divide the uniform resource locator of the original log into tokens, and creating a database based on the uniform resource locator and the tokens; using a preset classification method to classify the tokens in the database to obtain different types of tokens, and determining the reverse word frequency of each token based on the different types of tokens and all tokens in the database; determining each target token that meets business needs based on the reverse word frequency of each token, and saving the target tokens and the original logs corresponding to the target tokens to the database; using the database to train a preset model to obtain a trained model, and then obtaining a target uniform resource locator, and determining the original log corresponding to the target uniform resource locator based on the trained model. The present application calculates the reverse word frequency of each token in the original log, and then determines the target token and saves it to the database, and trains the model based on the database, so that in the process of log retrieval, the accuracy of log retrieval can be further improved, and the efficiency of log retrieval can be effectively increased. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0037] Figure 1 A flow chart of a log retrieval method disclosed in this application;

[0038] Figure 2 A flow chart of a log retrieval method disclosed in this application;

[0039] Figure 3A specific flow chart of a log retrieval method disclosed in this application;

[0040] Figure 4 This is a system structure diagram of a log retrieval method disclosed in this application;

[0041] Figure 5 This is a structural diagram of a log retrieval device disclosed in this application;

[0042] Figure 6 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION

[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.

[0044] In the current context, URL retrieval from massive access logs is more complex than other search methods in existing technologies, making retrieval algorithms crucial. Common retrieval algorithms are typically based on optimizations of classic algorithms such as hashing and red-black tree dictionaries. These algorithms face significant bottlenecks in efficiency and overhead in data preprocessing and real-time retrieval, and are unable to automatically optimize the efficiency of access logs for specific web application systems. As can be seen from the above, increasing the efficiency and accuracy of log retrieval is an unresolved issue in this field.

[0045] See also Figure 1 As shown, the embodiment of the present invention discloses a log retrieval method, which may specifically include:

[0046] Step S11: obtaining an original log, dividing the Uniform Resource Locator of the original log into tokens using a preset division method, and creating a database based on the Uniform Resource Locator and the tokens.

[0047] In this embodiment, after obtaining the original log, the position of the target character is determined from the uniform resource locator of the original log; wherein the target character includes a slash " / ", a question mark "?", and a connector "&", and then the uniform resource locator of the original log is segmented based on the position of the target character to obtain tokens, and a database is created based on the uniform resource locators and the tokens.

[0048] Step S12: using a preset classification method to classify each token in the database to obtain different types of tokens, and determining the reverse word frequency of each token based on the different types of tokens and all tokens in the database.

[0049] Step S13: determining target tokens that meet the business requirements based on the reverse word frequency of each token, and saving the target tokens and the original logs corresponding to the target tokens to the database.

[0050] In this embodiment, after determining the reverse word frequency of each token, the target tokens that meet the business needs are determined based on the reverse word frequency of each token, and then the target tokens are associated with the original logs corresponding to the target tokens, and the associated target tokens and the original logs corresponding to the target tokens are saved to the preset association list in the database.

[0051] Step S14: training the preset model using the database to obtain a trained model, then obtaining a target uniform resource locator, and determining an original log corresponding to the target uniform resource locator based on the trained model.

[0052] In this embodiment, after the target tokens and the original logs corresponding to the target tokens are saved in the database, the preset model is trained using the database to obtain a trained model, and then the target uniform resource locator is obtained. Based on the trained model, the target tokens corresponding to the target uniform resource locator are determined from the preset association list, and the preset association list is used to determine the original logs corresponding to the target tokens.

[0053] In this embodiment, the original log is obtained, and the uniform resource locator of the original log is divided into tokens using a preset division method, and a database is created based on the uniform resource locator and the tokens; the tokens in the database are classified using a preset classification method to obtain different types of tokens, and the reverse word frequency of each token is determined based on the different types of tokens and all tokens in the database; the target tokens that meet the business needs are determined based on the reverse word frequency of each token, and the target tokens and the original logs corresponding to the target tokens are saved to the database; the preset model is trained using the database to obtain a trained model, and then the target uniform resource locator is obtained, and the original log corresponding to the target uniform resource locator is determined based on the trained model. This application calculates the reverse word frequency of each token in the original log, and then determines the target token and saves it to the database, and trains the model based on the database, so that in the process of log retrieval, the accuracy of log retrieval can be further improved, and the efficiency of log retrieval can be effectively increased.

[0054] See also Figure 2 As shown, the embodiment of the present invention discloses a log retrieval method, which may specifically include:

[0055] Step S21: obtaining an original log, dividing the uniform resource locator of the original log into tokens using a preset division method, and creating a database based on the uniform resource locator and the tokens.

[0056] Step S22: Classify each token in the database using a preset classification method to obtain different types of tokens, determine the number of each token, and count the number of all tokens in the database, then calculate the ratio of the number of each token to the number of all tokens to obtain the word frequency of each token, and determine the inverse word frequency of each token based on the word frequency of each token.

[0057] Step S23: determining target tokens that meet the business requirements based on the reverse word frequency of each token, and saving the target tokens and the original logs corresponding to the target tokens to the database.

[0058] Step S24: using the database to train the preset model to obtain a trained model, then obtaining a target uniform resource locator, and determining an original log corresponding to the target uniform resource locator based on the trained model.

[0059] In this embodiment, after determining the reverse word frequency of each token based on the word frequency of each token, the preset threshold corresponding to each token is determined using the number of all tokens in the database and the number of each token, and then each token is arranged according to the preset arrangement method and using the reverse word frequency of each token, and then it is judged whether the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold. If the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold, the token with the added ranking number is determined as each target token that meets the business needs; the preset model is trained using the database to obtain a trained model, and then a target uniform resource locator is obtained, and the corresponding uniform resource locator of the target is determined based on the trained model. Original log; using a preset classification method to classify each token in the database to obtain different types of tokens, determine the number of each token, and count the number of all tokens in the database, and then calculate the ratio of the number of each token to the number of all tokens to obtain the word frequency of each token, and determine the reverse word frequency of each token based on the word frequency of each token; based on the reverse word frequency of each token, determine each target token that meets the business needs, and save each target token and the original log corresponding to each target token to the database; using the database to train the preset model to obtain a trained model, and then obtain the target uniform resource locator, and determine the original log corresponding to the target uniform resource locator based on the trained model. This application calculates the reverse word frequency of each token in the original log, and then determines the target token and saves it to the database, and trains the model based on the database, so that in the process of log retrieval, it can further improve the accuracy of log retrieval and effectively increase the efficiency of log retrieval.

[0060] For example, Figure 3As shown, the original log is obtained, and the uniform resource locator of the original log is divided to obtain each token, and the ratio of the number of each token to the number of all tokens is calculated to obtain the word frequency of each token, and then the reverse word frequency of each token is determined based on the word frequency of each token, and each target token that meets the business needs is determined based on the reverse word frequency of each token, and each target token and the original log corresponding to each target token are saved to the database, and the preset model is trained using the database. When the target uniform resource locator is obtained, the original log corresponding to each target token is determined from the preset association list based on the trained model. For example, Figure 4 As shown, the log retrieval system includes a word frequency recording device, a word frequency calculation device and a log retrieval device. The word frequency recording device is specifically used to save and determine the number of each token, and count the number of all tokens in the database; the word frequency calculation device is used to respectively calculate the ratio of the number of each token to the number of all tokens to obtain the word frequency of each token, and determine the reverse word frequency of each token based on the word frequency of each token; the log retrieval device is used to associate each target token with the original log corresponding to each target token, and save the associated target tokens and the original log corresponding to each target token to a preset association list in the database, so that after obtaining the target uniform resource locator, the preset association list is used to determine the original logs corresponding to each target token.

[0061] See also Figure 5 As shown, an embodiment of the present invention discloses a log retrieval device, which may specifically include:

[0062] The database creation module 11 is configured to obtain an original log, divide the uniform resource locator of the original log into tokens using a preset division method, and create a database based on the uniform resource locator and the tokens;

[0063] A reverse word frequency determination module 12 is configured to classify each token in the database using a preset classification method to obtain different types of tokens, and determine a reverse word frequency of each token based on the different types of tokens and all tokens in the database;

[0064] A target token determination module 13 is configured to determine target tokens that meet business requirements based on the reverse word frequency of each token, and save the target tokens and the original logs corresponding to the target tokens to the database;

[0065] The log determination module 14 is configured to train a preset model using the database to obtain a trained model, then obtain a target uniform resource locator, and determine an original log corresponding to the target uniform resource locator based on the trained model.

[0066] In this embodiment, the original log is obtained, and the uniform resource locator of the original log is divided into tokens using a preset division method, and a database is created based on the uniform resource locator and the tokens; the tokens in the database are classified using a preset classification method to obtain different types of tokens, and the reverse word frequency of each token is determined based on the different types of tokens and all tokens in the database; the target tokens that meet the business needs are determined based on the reverse word frequency of each token, and the target tokens and the original logs corresponding to the target tokens are saved to the database; the preset model is trained using the database to obtain a trained model, and then the target uniform resource locator is obtained, and the original log corresponding to the target uniform resource locator is determined based on the trained model. This application calculates the reverse word frequency of each token in the original log, and then determines the target token and saves it to the database, and trains the model based on the database, so that in the process of log retrieval, the accuracy of log retrieval can be further improved, and the efficiency of log retrieval can be effectively increased.

[0067] In some specific embodiments, the database creation module 11 may specifically include:

[0068] a target character determination module, configured to determine the position of a target character from the uniform resource locator of the original log; wherein the target character includes a slash " / ", a question mark "?", and a connector "&";

[0069] The segmentation module is configured to segment the uniform resource locator of the original log based on the position of the target character to obtain tokens.

[0070] In some specific embodiments, the reverse word frequency determination module 12 may specifically include:

[0071] A quantity determination module is used to determine the quantity of each token and count the quantity of all tokens in the database;

[0072] The reverse word frequency determination module is used to calculate the ratio of the number of each token to the number of all tokens to obtain the word frequency of each token, and determine the reverse word frequency of each token based on the word frequency of each token.

[0073] In some specific embodiments, the target token determination module 13 may specifically include:

[0074] A preset threshold determination module, configured to determine a preset threshold value corresponding to each token by using the number of all tokens in the database and the number of each token;

[0075] The arrangement module is used to arrange each token according to a preset arrangement method and using the reverse word frequency of each token, and then determine each target token that meets the business requirements based on each token with a ranking number added and the preset threshold.

[0076] In some specific embodiments, the target token determination module 13 may specifically include:

[0077] A judgment module, configured to judge whether the reverse word frequency of the token with the added ranking number is less than a corresponding preset threshold;

[0078] The target token determination module is used to determine the tokens with the added ranking numbers as target tokens that meet business requirements if the reverse word frequency of the tokens with the added ranking numbers is less than the corresponding preset threshold.

[0079] In some specific embodiments, the target token determination module 13 may specifically include:

[0080] The association module is used to associate the target tokens with the original logs corresponding to the target tokens, and save the associated target tokens and the original logs corresponding to the target tokens to a preset association list in the database.

[0081] In some specific embodiments, the log determination module 14 may specifically include:

[0082] a target token determination module, configured to determine target tokens corresponding to the target uniform resource locator from the preset association list based on the trained model;

[0083] The log determination module is used to determine each original log corresponding to each target token using the preset association list.

[0084] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the log retrieval method performed by the log retrieval device disclosed in any of the aforementioned embodiments.

[0085] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0086] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, a magnetic disk, or an optical disk. The resources stored thereon may include an operating system 221, a computer program 222, and data 223. The data 223 may include various data. The storage method can be temporary storage or permanent storage.

[0087] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the log retrieval method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of implementing other specific tasks.

[0088] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium, where the computer-readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. When the computer program is executed by the processor, the aforementioned log retrieval method is implemented. For the specific steps of the method, reference can be made to the corresponding content disclosed in the aforementioned embodiments, and no further details will be given here.

[0089] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0090] The steps of the log retrieval method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0091] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0092] The log retrieval method, apparatus, device, and medium provided by the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is intended only to facilitate understanding of the method and core concept of the present invention. Furthermore, those skilled in the art will appreciate that variations in the specific implementation methods and scope of application may occur based on the concepts of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A log retrieval method, characterized in that: include: Obtaining an original log, dividing the uniform resource locator of the original log into tokens using a preset division method, and creating a database based on the uniform resource locator and the tokens; Classifying each token in the database using a preset classification method to obtain different types of tokens, and determining a reverse word frequency of each token based on the different types of tokens and all tokens in the database; Determine target tokens that meet business requirements based on the reverse word frequency of each token, and save the target tokens and the original logs corresponding to the target tokens to the database; Using the database to train a preset model to obtain a trained model, then obtaining a target uniform resource locator, and determining an original log corresponding to the target uniform resource locator based on the trained model; The step of saving each target token and the original log corresponding to each target token to the database includes: The target tokens are associated with the original logs corresponding to the target tokens, and the associated target tokens and the original logs corresponding to the target tokens are saved in the database.

2. The log retrieval method according to claim 1, characterized in that: The method of dividing the uniform resource locator of the original log into tokens by using a preset division method includes: Determine the position of the target character from the uniform resource locator of the original log; wherein the target character includes a slash " / ", a question mark "?" and a connector "&"; The uniform resource locator of the original log is segmented based on the position of the target character to obtain tokens.

3. The log retrieval method according to claim 1, characterized in that: Determining the reverse word frequency of each token based on the different types of tokens and all tokens in the database includes: Determine the number of each token and count the number of all tokens in the database; The ratio of the number of each token to the number of all tokens is calculated to obtain the word frequency of each token, and the inverse word frequency of each token is determined based on the word frequency of each token.

4. The log retrieval method according to claim 3, characterized in that: The step of determining target tokens that meet business requirements based on the reverse word frequency of each token includes: Determine a preset threshold value corresponding to each token using the number of all tokens in the database and the number of each token; Each token is arranged according to a preset arrangement method and using the inverse word frequency of each token, and then target tokens that meet business requirements are determined based on each token with a ranking number added and the preset threshold.

5. The log retrieval method according to claim 4, characterized in that: The step of determining target tokens that meet business requirements based on each token with a ranking number added and the preset threshold includes: It is determined whether the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold. If the reverse word frequency of the token with the added ranking number is less than the corresponding preset threshold, the token with the added ranking number is determined as each target token that meets the business requirements.

6. The log retrieval method according to any one of claims 1 to 5, characterized in that: Saving each target token and the original log corresponding to each target token to the database includes: The target tokens are associated with the original logs corresponding to the target tokens, and the associated target tokens and the original logs corresponding to the target tokens are saved in a preset association list in the database.

7. The log retrieval method according to claim 6, characterized in that: The determining, based on the trained model, the original log corresponding to the target uniform resource locator, includes: Determining each target token corresponding to the target uniform resource locator from the preset association list based on the trained model; The preset association list is used to determine the original logs corresponding to the target tokens.

8. A log retrieval device, characterized in that: include: A database creation module, configured to obtain an original log, divide the uniform resource locator of the original log into tokens using a preset division method, and create a database based on the uniform resource locator and the tokens; a reverse word frequency determination module, configured to classify each token in the database using a preset classification method to obtain different types of tokens, and determine a reverse word frequency of each token based on the different types of tokens and all tokens in the database; A target token determination module is configured to determine target tokens that meet business requirements based on the reverse word frequency of each token, and save the target tokens and the original logs corresponding to the target tokens to the database; a log determination module, configured to train a preset model using the database to obtain a trained model, then obtain a target uniform resource locator, and determine an original log corresponding to the target uniform resource locator based on the trained model; Among them, the target token determination module is specifically used to: The target tokens are associated with the original logs corresponding to the target tokens, and the associated target tokens and the original logs corresponding to the target tokens are saved in the database.

9. A log retrieval device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the log retrieval method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the log retrieval method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Injection attack detection method and device based on logistic regression algorithm as well as server

    CN108712453A

  • Log file management method and device

    CN113010484A