CN-121996707-A - Log data-based data query statement processing method and device
Abstract
The invention discloses a data query statement processing method and device based on log data. The method comprises the steps of obtaining each candidate business log of a data query statement to be processed after obtaining operation detail data of the data query statement to be processed, determining the matching degree of each candidate business log, determining the association confidence degree of each candidate business log, detecting whether the associated business log of the data query statement to be processed exists in each candidate business log, determining the business operation type associated with the data query statement to be processed according to the associated business log if the associated business log exists, and storing the data query statement to be processed and the associated business operation type. The embodiment of the invention can automatically determine the service operation type associated with the data query statement based on the operation detail data and the service log, and store the data query statement and the service operation type associated with the data query statement.
Inventors
- CHEN QIUHUA
- WANG YAOQI
- ZHANG DAWEI
- LI JIE
- ZHOU MENG
Assignees
- 北京优特捷信息技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260203
Claims (10)
- 1. The data query statement processing method based on the log data is characterized by comprising the following steps of: After operation detail data of a data query statement to be processed are obtained, obtaining each candidate service log of the data query statement to be processed from a service log storage component; Determining the matching degree of each candidate business log according to the operation detail data and the data in each candidate business log, wherein the matching degree comprises time matching degree, resource matching degree, parameter matching degree and semantic matching degree; Determining the association confidence of each candidate business log according to the matching degree of each candidate business log; Detecting whether the associated service logs of the data query statement to be processed exist in each candidate service log according to the associated confidence degree of each candidate service log; If the associated service log of the data query statement to be processed exists, determining a service operation type associated with the data query statement to be processed according to the associated service log, and storing the data query statement to be processed and the service operation type associated with the data query statement to be processed.
- 2. The method for processing a data query statement based on log data according to claim 1, wherein obtaining each candidate service log of the data query statement to be processed from a service log storage component comprises: And detecting whether each service log in the service log storage component is a candidate service log of a data query statement to be processed according to the execution starting time stamp in the operation detail data and the service time stamp in each service log in the service log storage component, and acquiring each detected candidate service log of the data query statement to be processed.
- 3. The log data-based data query statement processing method of claim 1, wherein determining the degree of matching of each candidate service log based on the operation detail data and the data in each candidate service log comprises: Determining the time matching degree of each candidate service log according to the execution starting time stamp in the operation detail data and the service time stamp in each candidate service log; determining the resource matching degree of each candidate service log according to the operation detail data and the execution unit identifier and the interaction identifier in each candidate service log; determining the parameter matching degree of each candidate service log according to the operation detail data and the key service parameters in each candidate service log; And determining the semantic matching degree of each candidate business log according to the expected sentence template of each candidate business log and the actual sentence template corresponding to the operation detail data.
- 4. The method for processing a data query statement based on log data according to claim 1, wherein determining the associated confidence level of each candidate service log according to the matching level of each candidate service log comprises: And determining the association confidence coefficient of each candidate service log according to the confidence coefficient calculation formula and the matching degree of each candidate service log.
- 5. The method for processing data query sentences based on log data according to claim 1, wherein detecting whether the associated service logs of the data query sentences to be processed exist in each candidate service log according to the associated confidence level of each candidate service log comprises: Comparing the association confidence coefficient of each candidate service log with a high confidence coefficient threshold value and a low confidence coefficient threshold value; if the target candidate business logs with the association confidence coefficient larger than the high confidence coefficient threshold value exist, determining that the association business logs of the data query statement to be processed exist in each candidate business log, and determining that the target candidate business logs are the association business logs of the data query statement to be processed; If the association confidence coefficient of each candidate service log is smaller than the low confidence coefficient threshold value, determining that the association service log of the data query statement to be processed does not exist in each candidate service log, and determining that the data query statement to be processed cannot associate service operation types; If the association confidence of each candidate service log is between the high confidence threshold and the low confidence threshold, providing the operation detail data and each candidate service log to a target user, determining that the association service log of the data query statement to be processed exists in each candidate service log after acquiring the recommended candidate service log fed back by the target user, and determining that the recommended candidate service log is the association service log of the data query statement to be processed.
- 6. The method for processing a data query statement based on log data as claimed in claim 5, further comprising: And if the associated service log of the data query statement to be processed does not exist, determining the operation detail data and the associated process data as safety risk information, and providing the safety risk information for a target user.
- 7. The log data based data query statement processing method of claim 1, wherein storing the pending data query statement and a business operation type associated with the pending data query statement comprises: and correspondingly storing the data query statement to be processed and the service operation type associated with the data query statement to be processed into a statement mapping relation table.
- 8. A log data-based data query statement processing apparatus, comprising: The log acquisition module is used for acquiring each candidate service log of the data query statement to be processed from the service log storage component after acquiring the operation detail data of the data query statement to be processed; The matching degree determining module is used for determining the matching degree of each candidate business log according to the operation detail data and the data in each candidate business log, wherein the matching degree comprises time matching degree, resource matching degree, parameter matching degree and semantic matching degree; the confidence coefficient determining module is used for determining the association confidence coefficient of each candidate business log according to the matching degree of each candidate business log; The log detection module is used for detecting whether the associated service log of the data query statement to be processed exists in each candidate service log according to the associated confidence coefficient of each candidate service log; And the statement association module is used for determining the service operation type associated with the data query statement to be processed according to the associated service log if the associated service log of the data query statement to be processed exists, and storing the data query statement to be processed and the service operation type associated with the data query statement to be processed.
- 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 data based data query statement processing method of any one of claims 1 to 7.
- 10. A computer readable storage medium storing computer instructions for causing a processor to implement the log data based data query statement processing method of any one of claims 1 to 7 when executed.
Description
Log data-based data query statement processing method and device Technical Field The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a data query statement based on log data. Background A plurality of application servers are typically provided in an enterprise. Each application server may be a server for managing a specified business of the enterprise. A traffic log may be generated during the operation of the application server. The service log is text generated by the application server to describe a service processing operation performed by the application server. The service log contains service operation types of service processing operations. In the process that the application server executes the service processing operation, when the application server needs to acquire the specified service data in the database server, the application server inputs a data query statement for acquiring the specified service data from the database set in the database server to the database server. The database server obtains the specified service data from the database by running the data query statement, and provides the specified service data to the application server. After the database server runs the data query statement each time, the data query statement needs to be processed in time, the service operation type associated with the data query statement is determined, and whether the operation triggering the database server to run the data query statement is reasonable service processing operation or not is determined conveniently by operation and maintenance personnel according to the service operation type associated with the data query statement. The business operation type associated with the data query statement is a business operation type that triggers a database server to run business processing operations of the data query statement. In the related art, a common data query statement processing scheme is to process a data query statement based on service identification information synchronously transmitted with the data query statement, and determine a service operation type associated with the data query statement. The service identification information is easily lost during the delivery process. The data query statement processing scheme in the related art depends on the service identification information which is easy to lose, and cannot effectively and stably process the data query statement in time after the database server runs the data query statement each time, so as to determine the service operation type associated with the data query statement. Disclosure of Invention The invention provides a data query statement processing method and device based on log data, which are used for solving the problem that a data query statement processing scheme in the related art depends on service identification information which is easy to lose, can not effectively and stably process the data query statement in time after a database server runs the data query statement each time, and determines the service operation type associated with the data query statement. According to an aspect of the present invention, there is provided a data query statement processing method based on log data, including: After operation detail data of a data query statement to be processed are obtained, obtaining each candidate service log of the data query statement to be processed from a service log storage component; Determining the matching degree of each candidate business log according to the operation detail data and the data in each candidate business log, wherein the matching degree comprises time matching degree, resource matching degree, parameter matching degree and semantic matching degree; Determining the association confidence of each candidate business log according to the matching degree of each candidate business log; Detecting whether the associated service logs of the data query statement to be processed exist in each candidate service log according to the associated confidence degree of each candidate service log; If the associated service log of the data query statement to be processed exists, determining a service operation type associated with the data query statement to be processed according to the associated service log, and storing the data query statement to be processed and the service operation type associated with the data query statement to be processed. According to another aspect of the present invention, there is provided a data query statement processing apparatus based on log data, including: The log acquisition module is used for acquiring each candidate service log of the data query statement to be processed from the service log storage component after acquiring the operation detail data of the data query statement to be processed; The matching degree determining module is used for determining the matching degree of