Search

CN-122019636-A - Log statistics query method, device, equipment and medium

CN122019636ACN 122019636 ACN122019636 ACN 122019636ACN-122019636-A

Abstract

The invention discloses a log statistics query method, device, equipment and medium. The method comprises the steps of determining query modes of log statistics query requests, marking the query modes meeting high-frequency conditions as high-frequency query modes, acquiring service logs meeting the high-frequency query modes from a service log library at regular time to obtain acceleration aggregation data, determining the query modes of the log statistics query requests after the log statistics query requests are acquired when at least one query mode is marked as the high-frequency query mode, detecting whether matched target high-frequency query modes exist or not, and determining query results according to target time intervals, acceleration aggregation data and the service logs in the service log library if the matched target high-frequency query modes exist. The embodiment of the invention can determine the query result based on the pre-acquired service logs and the original service logs in the service log library, thereby remarkably reducing the number of the service logs which need to be acquired from the service log library in real time.

Inventors

  • CHEN QIUHUA
  • ZHANG DAWEI
  • LI JIE
  • WANG YAOQI
  • ZHOU MENG

Assignees

  • 北京优特捷信息技术有限公司

Dates

Publication Date
20260512
Application Date
20260203

Claims (10)

  1. 1. A log statistics query method, comprising: After acquiring query indication information, processing the acquired log statistics query requests, determining query modes of the log statistics query requests, continuously counting the triggered times of the determined query modes in a preset time window, marking the query modes meeting high-frequency conditions as high-frequency query modes, and acquiring service logs conforming to the high-frequency query modes from a service log library at regular time to acquire acceleration aggregation data of the high-frequency query modes; When at least one query mode is marked as a high-frequency query mode, determining the query mode of the log statistics query request after the log statistics query request is acquired, and detecting whether a target high-frequency query mode matched with the query mode of the log statistics query request exists or not; If the target frequency query mode exists, determining a query result of the log statistics query request according to a target time interval of the log statistics query request, the accelerated aggregate data of the target high frequency query mode and the service logs in the service log library, and outputting the query result.
  2. 2. The log statistical query method of claim 1, wherein determining a query pattern for each log statistical query request comprises: And determining the query mode of the log statistics query request according to the key query parameters in the log statistics query request aiming at each obtained log statistics query request.
  3. 3. The log statistics query method as recited in claim 1, wherein marking the query pattern satisfying the high frequency condition as a high frequency query pattern comprises: and determining a query mode with the triggered times larger than a preset times threshold value in a preset time window as a high-frequency query mode, and storing the high-frequency query mode into a high-frequency mode storage component.
  4. 4. The log statistics query method according to claim 1, wherein the step of periodically obtaining the service log conforming to the high-frequency query pattern from the service log library to obtain the accelerated aggregate data of the high-frequency query pattern comprises: the following is performed for each high frequency query pattern: determining a data storage component corresponding to the high frequency query pattern; And according to the preset time granularity, acquiring the service logs conforming to the high-frequency query mode from the service log library at regular time, and storing the acquired service logs into a data storage component corresponding to the high-frequency query mode, wherein the service logs conforming to the high-frequency query mode stored in the data storage component corresponding to the high-frequency query mode form acceleration aggregation data of the high-frequency query mode.
  5. 5. The log statistics query method as recited in claim 1, wherein determining the query result of the log statistics query request based on the target time interval of the log statistics query request, the accelerated aggregate data of the target high frequency query pattern, and the service logs in the service log library comprises: if the target time interval of the log statistics query request comprises an aggregated interval and an ungrouped interval, determining a query result of the log statistics query request in the aggregated interval according to the accelerated aggregation data of the target frequency query mode; according to the service logs in the service log library, determining the query result of the log statistics query request in the non-aggregated section; and merging the query results of the log statistics query requests in the aggregated interval and the non-aggregated interval to obtain the query results of the log statistics query requests.
  6. 6. The method according to claim 5, wherein determining the query result of the log statistics query request according to the target time interval of the log statistics query request, the accelerated aggregate data of the target high frequency query pattern, and the service log in the service log library, further comprises: If the target time interval of the log statistics query request only comprises the aggregated interval, determining a query result of the log statistics query request according to the accelerated aggregation data of the target frequency query mode.
  7. 7. The log statistics query method as recited in claim 3, further comprising: And determining the query heat of each high-frequency query mode according to the matching query times and the latest hit time of each high-frequency query mode in the high-frequency mode storage component at regular time, and deleting the high-frequency query modes with the query heat lower than a preset heat threshold.
  8. 8. A log statistics query apparatus, comprising: The mode processing module is used for starting to process each acquired log statistics query request after acquiring query indication information, determining a query mode of each log statistics query request, continuously counting the triggered times of the determined query mode in a preset time window, marking the query mode meeting high-frequency conditions as a high-frequency query mode, and acquiring service logs conforming to the high-frequency query mode from the service log library at regular time to obtain acceleration aggregation data of the high-frequency query mode; the pattern matching module is used for determining the query pattern of the log statistics query request after acquiring the log statistics query request when at least one query pattern is marked as a high-frequency query pattern, and detecting whether a target high-frequency query pattern matched with the query pattern of the log statistics query request exists or not; And the mode query module is used for determining a query result of the log statistics query request according to the target time interval of the log statistics query request, the acceleration aggregation data of the target high-frequency query mode and the service logs in the service log library if the target high-frequency query mode exists, and outputting the query result.
  9. 9. An electronic device, the electronic device comprising: At least one processor; and a memory communicatively coupled to the at least one processor; Wherein the memory stores a computer program for execution by the at least one processor to enable the at least one processor to perform the log statistics query method of any of claims 1-7.
  10. 10. A computer readable storage medium storing computer instructions for causing a processor to implement the log statistics query method of any one of claims 1-7 when executed.

Description

Log statistics query method, device, equipment and medium Technical Field The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for inquiring log statistics. Background The business system of the enterprise generates a business log of business processing operations during each execution of the business processing operations. The service log of the service processing operation is data for recording the service processing operation. The service log contains time information of the service processing operation and field information of each service parameter of the service processing operation. The field information of the service parameter includes a parameter name and a parameter value of the service parameter. Data storage devices are typically provided in enterprises. The data storage device is provided with a service log library. The service system stores the generated service log in a service log library. During operation of the business system, business personnel can send a log statistics query request to the data storage device. The log statistics query request may be information for requesting a statistics query of parameter values of target service parameters in service logs within a target time interval in the service log library. And carrying out statistical query according to the log statistical query request to obtain a query result of the log statistical query request. In the related art, the common log statistics query scheme is that after each log statistics query request is obtained, service logs related to the log statistics query request are obtained from a service log library in real time, and statistics is carried out according to the obtained service logs, so that a query result of the log statistics query request is obtained. The log statistics query scheme in the related art needs to acquire service logs related to the log statistics query request from a service log library containing a large number of service logs in real time after each log statistics query request is acquired, so that the query time is long, and the resource consumption in the query process is large. Disclosure of Invention The invention provides a log statistics query method, a device, equipment and a medium, which are used for solving the problems of long query time and large resource consumption in the query process of a log statistics query scheme in the related technology. According to an aspect of the present invention, there is provided a log statistics query method, including: After acquiring query indication information, processing the acquired log statistics query requests, determining query modes of the log statistics query requests, continuously counting the triggered times of the determined query modes in a preset time window, marking the query modes meeting high-frequency conditions as high-frequency query modes, and acquiring service logs conforming to the high-frequency query modes from a service log library at regular time to acquire acceleration aggregation data of the high-frequency query modes; When at least one query mode is marked as a high-frequency query mode, determining the query mode of the log statistics query request after the log statistics query request is acquired, and detecting whether a target high-frequency query mode matched with the query mode of the log statistics query request exists or not; If the target frequency query mode exists, determining a query result of the log statistics query request according to a target time interval of the log statistics query request, the accelerated aggregate data of the target high frequency query mode and the service logs in the service log library, and outputting the query result. According to another aspect of the present invention, there is provided a log statistics query apparatus, including: The mode processing module is used for starting to process each acquired log statistics query request after acquiring query indication information, determining a query mode of each log statistics query request, continuously counting the triggered times of the determined query mode in a preset time window, marking the query mode meeting high-frequency conditions as a high-frequency query mode, and acquiring service logs conforming to the high-frequency query mode from the service log library at regular time to obtain acceleration aggregation data of the high-frequency query mode; the pattern matching module is used for determining the query pattern of the log statistics query request after acquiring the log statistics query request when at least one query pattern is marked as a high-frequency query pattern, and detecting whether a target high-frequency query pattern matched with the query pattern of the log statistics query request exists or not; And the mode query module is used for determining a query result of the log statistics query request according to the target