CN111078721A - Query statement analysis method and system, and analysis result processing method and system - Google Patents

Query statement analysis method and system, and analysis result processing method and system Download PDF

Info

Publication number
CN111078721A
CN111078721A CN201811216744.1A CN201811216744A CN111078721A CN 111078721 A CN111078721 A CN 111078721A CN 201811216744 A CN201811216744 A CN 201811216744A CN 111078721 A CN111078721 A CN 111078721A
Authority
CN
China
Prior art keywords
aggregation
query statement
type
information
current layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811216744.1A
Other languages
Chinese (zh)
Other versions
CN111078721B (en
Inventor
方权耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201811216744.1A priority Critical patent/CN111078721B/en
Publication of CN111078721A publication Critical patent/CN111078721A/en
Application granted granted Critical
Publication of CN111078721B publication Critical patent/CN111078721B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a system for analyzing query statements and processing analysis results, wherein the method comprises the following steps: receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement; traversing the identified aggregations of each layer, and determining the aggregation type of the aggregations; judging whether the aggregation has aggregation information to be recorded or not according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system. According to the technical scheme, the Grafana analysis system can support complex index aggregation and pipeline aggregation.

Description

Query statement analysis method and system, and analysis result processing method and system
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a system for analyzing query statements and processing analysis results.
Background
With the development of data processing technology, the types of data capable of being processed are increasing. In the face of a wide variety of data types, data analysis systems are often available to query, filter, and analyze the complex data.
Currently, the Grafana analysis system can support some data sources which are mainstream at present, so that the Grafana analysis system is widely applied to the field of data processing. For example, the Grafana analytics system can support the ElasticSerch data Source (ES). ES itself can support more complex polymerization methods, which may include pipeline polymerization and index polymerization, among others. However, the Grafana analysis system can only support simple index aggregation, and cannot be compatible with complex index aggregation and pipeline aggregation. This results in a significant limitation of the Grafana analysis system and a failure to fully exploit the advantages of ES.
Disclosure of Invention
The application aims to provide a method and a system for analyzing query statements and processing analysis results, so that a Grafana analysis system can support complex index aggregation and pipeline aggregation.
In order to achieve the above object, an aspect of the present application provides a method for parsing a query statement, where the method includes: receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement; traversing the identified aggregations of each layer, and determining the aggregation type of the aggregations; judging whether the aggregation has aggregation information to be recorded or not according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
In order to achieve the above object, another aspect of the present application further provides a query statement parsing system, including: the aggregation identification unit is used for receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement; the aggregation type determining unit is used for traversing each identified aggregation and determining the aggregation type of the aggregation; the aggregation information recording unit is used for judging whether the aggregation has aggregation information to be recorded according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
In order to achieve the above object, another aspect of the present application further provides a method for processing an analytic result, where the method is applied to Grafana, and the method includes: acquiring an analysis result of a query statement conforming to an ElasticSearch grammar, wherein the analysis result comprises aggregation information of each layer of aggregation identified from the query statement; determining an aggregation type of a final aggregation for characterizing a final display result in the analysis result; traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer of aggregation or identifying the position of the current layer of aggregation in the query statement according to the aggregation type of the final aggregation; and processing the aggregation value or the attribute information of the current layer aggregation according to the identification result to generate a query result of the query statement.
In order to achieve the above object, another aspect of the present application further provides a system for processing parsing results, where the system is applied in Grafana, and the system includes: the analysis result acquisition unit is used for acquiring the analysis result of the query statement conforming to the ElasticSearch grammar, and the analysis result comprises the aggregation information of each layer of aggregation identified from the query statement; a final aggregation identification unit, configured to determine, in the parsing result, an aggregation type of a final aggregation used for characterizing a final display result; the current layer aggregation identification unit is used for traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer aggregation or identifying the position of the current layer aggregation in the query statement according to the final aggregation type; and the query result generating unit is used for processing the aggregation value or the attribute information of the current layer aggregation according to the identification result so as to generate a query result of the query statement.
Therefore, according to the technical scheme provided by the application, the query statement conforming to the ES grammar can be written in Grafana, and the query statement can be analyzed through the scheme provided by the application. In particular, all aggregations contained in the query statement may be identified. The identified respective layer aggregations may then be traversed, and the aggregation types of the respective layer aggregations are determined one by one as the traversal proceeds. In practical applications, the aggregation types may include barrel aggregation, pipe aggregation, and index aggregation. The pipeline aggregation can be divided into pipeline aggregation for representing data filtering and pipeline aggregation for representing numerical calculation. According to different aggregation types, whether the aggregation information to be recorded exists in the aggregation can be judged. And if so, recording the aggregated information, and feeding back the recorded aggregated information as the analysis result of the query statement to the Grafana system. After the Grafana system receives the analysis result of the query statement, the analysis result can be processed according to the scheme provided by the application. In particular, an aggregation type for characterizing a final aggregation of the final display result may be determined from the parsed result. Then, according to the difference of the aggregation type of the final aggregation, different processing modes can be performed on the current layer aggregation. For example, an aggregation type of the current layer aggregation may be identified or a location in the query statement at which the current layer aggregation is located. Finally, the aggregation value or the attribute information of the current layer aggregation may be processed according to the identification result, so as to generate a query result of the query statement. Therefore, according to the technical scheme provided by the application, the query statement conforming to the ES grammar can be written in the Grafana system, the query statement can be analyzed, and the query result of the query statement can be finally generated, so that the Grafana analysis system can support complex index aggregation and pipeline aggregation.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a diagram illustrating a method for parsing a query statement according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for parsing a query statement according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a query statement parsing system according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a processing method of an analysis result according to an embodiment of the present invention;
FIG. 5 is a flow chart of a method for processing a parsed result in an embodiment of the present invention;
FIG. 6 is a functional block diagram of a processing system for parsing results according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1 and 2, the method may include the following steps.
S11: receiving a query statement which is input by a user and conforms to the ElasticSearch grammar, and identifying an aggregation contained in the query statement.
In this embodiment, a user may write a query statement conforming to the ElasticSearch syntax in the Grafana system, and the query statement may include a plurality of aggregations. For example, the query statement may include bucket aggregation, pipe aggregation, and index aggregation. Wherein, the bucket aggregation can be used for filtering data so as to screen out the data to be processed. The index aggregation may be a simple numerical calculation of the screened data, for example, a maximum value, a minimum value, an average value, and the like may be calculated. The pipe aggregation can be classified into a pipe aggregation representing data filtering and a pipe aggregation representing numerical calculation. Wherein the pipeline aggregation of the characterization numerical calculations can perform more complex calculations on the data. For example, in table 1, for a 1 month loan amount, index aggregation may be employed in calculating the maximum and average values.
Table 1 book borrowing amount schematic table
Figure BDA0001833734700000041
However, if the ratio of the increment of 2 months and the borrowing amount between books of different categories as shown in table 2 is to be calculated, it is necessary to calculate your pipeline aggregation by characterizing the values.
TABLE 2 two month book borrowing amount schematic tables
Figure BDA0001833734700000042
Figure BDA0001833734700000051
In addition, the pipeline aggregation for the characterization data filtering can filter a plurality of numerical values obtained by index aggregation calculation. For example, the index aggregation calculation obtains four data, and through the pipeline aggregation representing the data filtering, three data can be filtered out from the four data, and finally the contents of the three data are displayed.
In this embodiment, when receiving a query sentence input by a user, it is also possible to determine whether the query sentence meets the format requirement of the ES syntax. Specifically, it may be determined whether the input query statement is in json format, and if so, the query statement is in accordance with the format requirement of the ES syntax. If not, the current parsing process can be exited, and the query statement is waited for to be input again. Upon receiving a satisfactory query statement, all aggregations contained in the query statement may be identified. Specifically, the aggregations in the query statement are written layer by layer from top to bottom, and then the included aggregations in each layer can be identified layer by layer according to the writing sequence of the query statement.
S13: and traversing the identified aggregation of each layer, and determining the aggregation type of the aggregation.
In this embodiment, after identifying the included layer aggregates from the query statement, the identified layer aggregates may be traversed in the order of writing the layer aggregates in the query statement. And for each level of aggregation for the traversal, an aggregation type for the aggregation may be determined. The aggregation types may be barrel aggregation, pipeline aggregation characterizing data filtering, pipeline aggregation characterizing numerical calculations, and index aggregation as described above.
S15: judging whether the aggregation has aggregation information to be recorded or not according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
In the present embodiment, different processing methods can be adopted for different types of aggregation. Specifically, referring to fig. 2, if the aggregation type of the current layer aggregation is a bucket aggregation, the unique identifier of the current layer aggregation and the aggregation type of the current layer aggregation may be recorded, and the recorded unique identifier and aggregation type may be used as aggregation information of the current layer aggregation. The reason for this is that bucket aggregation is typically to filter and group the data at that level without participating in the presentation of the final result, so only the unique identification and aggregation type of bucket aggregation is recorded. For index aggregation and pipeline aggregation of characterization numerical calculation, data needs to be calculated, and the calculated result may be an intermediate result and may be a final displayed result. Therefore, for the index aggregation and the pipeline aggregation of the characterization numerical calculation, in addition to recording the corresponding unique identifier and aggregation type, the position depth of the aggregation in the query statement is also recorded. The location depth may represent which level of the query statement the aggregation is located at. According to the position depth, whether the calculation result corresponding to the aggregation needs to be used as a final display result can be judged. Thus, if the aggregation type is index aggregation or pipeline aggregation representing numerical calculation, the unique identifier of the aggregation, the aggregation type of the aggregation, and the position depth of the aggregation in the query statement may be recorded, and the recorded unique identifier, the aggregation type, and the position depth may be used as aggregation information of the aggregation. For the pipeline aggregation for the representation data filtering, the result obtained by the index aggregation calculation is often filtered and finally displayed, and the calculation result of the index aggregation is also displayed, so that the corresponding aggregation information may not be recorded for the pipeline aggregation for the representation data filtering.
As can be seen from the above, if the determined aggregation type is barrel aggregation or index aggregation or pipeline aggregation by means of token numerical calculation, it can be determined that aggregation information to be recorded exists in the aggregation; if the determined aggregation type is the pipeline aggregation for characterizing data filtering, it can be determined that the aggregation does not have aggregation information to be recorded. The content of the recorded aggregation information may also be different for different types of aggregations.
In this embodiment, after the aggregation information of each layer of aggregation is recorded, the recorded aggregation information may be used as an analysis result of the query statement and fed back to the Grafana system, so as to perform a subsequent result display process through the Grafana system. In practical applications, in order to facilitate the Grafana system to determine the final exposed result, the type of aggregation used for result exposure may be marked in the analyzed result during the analysis phase of the query statement. In particular, since bucket aggregation is merely grouping and filtering data, bucket aggregation does not participate in the presentation of the final result, and thus, only pipeline aggregation and index aggregation in a query statement need to be analyzed. In addition, the pipeline aggregation of the feature data filtering in the pipeline aggregation also does not participate in the display of the final result, so that only the pipeline aggregation of index aggregation and feature numerical calculation needs to be analyzed actually.
In this embodiment, if the query statement does not include the pipe aggregation for characterizing numerical calculation, but only includes the index aggregation, the result calculated by the index aggregation located at the innermost layer may be used as the final display result of the Grafana system. Therefore, if the query statement does not include the pipeline aggregation representing numerical calculation, but only includes the index aggregation, the index aggregation located at the innermost layer may be determined in the query statement, and the aggregation type of the index aggregation located at the innermost layer is marked in the fed-back parsing result.
In addition, if the query statement contains both the pipeline aggregation representing the numerical calculation and the index aggregation, the pipeline aggregation representing the numerical calculation is usually further calculated on the result of the index aggregation calculation, and the pipeline aggregation representing the final display result is usually located at the outermost layer, so that if the query statement contains the pipeline aggregation representing the numerical calculation, the target pipeline aggregation representing the numerical calculation located at the outermost layer can be determined in the query statement, and the aggregation type of the target pipeline aggregation can be noted in the fed-back parsing result.
In this way, in the fed-back analysis result, besides the aggregation information recorded by each layer of aggregation, an aggregation type used for representing a final aggregation of a final display result is also marked, and the aggregation type may be a standard aggregation or a pipeline aggregation used for representing numerical calculation.
Referring to fig. 3, the present application further provides a query statement parsing system, including:
the aggregation identification unit is used for receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement;
the aggregation type determining unit is used for traversing each identified aggregation and determining the aggregation type of the aggregation;
the aggregation information recording unit is used for judging whether the aggregation has aggregation information to be recorded according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
For a specific scheme implemented by each unit in the query statement parsing system, reference may be made to the description in the foregoing method embodiment, and details are not repeated here.
The present application further provides a method for processing an analysis result, which may be applied to Grafana, and in particular, referring to fig. 4 and 5, the method may include the following steps.
S21: and acquiring an analysis result of the query statement conforming to the ElasticSearch grammar, wherein the analysis result comprises aggregation information of all layers of aggregation identified from the query statement.
S23: determining an aggregation type used for characterizing a final aggregation of a final display result in the parsing result.
In this embodiment, the analysis result obtained in the foregoing embodiment may be fed back to the Grafana system, so that the Grafana system may obtain the analysis result of the query statement conforming to the ElasticSearch syntax. In the parsing result, aggregation information of each layer aggregation identified from the query statement may be included. In addition, the polymerization type marked for characterizing the final polymerization of the final display result can be included.
In this embodiment, the Grafana system may identify the labeled aggregation type from the parsing result, and use the labeled aggregation type as the aggregation type used to characterize the final aggregation of the final presentation result.
S25: traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer of aggregation or identifying the position of the current layer of aggregation in the query statement according to the aggregation type of the final aggregation.
S27: and processing the aggregation value or the attribute information of the current layer aggregation according to the identification result to generate a query result of the query statement.
In this embodiment, the Grafana system may traverse aggregation information of each layer aggregation included in the analysis result, and in the traversing process, may perform different processing on the current layer aggregation according to different aggregation types of the final aggregation. Specifically, if the polymerization type of the final polymerization is a pipe polymerization characterizing numerical calculation, the final result may be represented by a pipe polymerization characterizing numerical calculation of the outermost layer. Thus, the Grafana system can identify the aggregation type of the current layer aggregation as it traverses the layer aggregations from top to bottom (outside-in). If the identified aggregation type of the current layer aggregation is the pipeline aggregation, the pipeline aggregation is represented as the outermost layer pipeline aggregation, and an aggregation value corresponding to the pipeline aggregation can be used as a final display result. Therefore, the aggregation value of the current layer aggregation may be obtained from the parsing result. And if the identified aggregation type of the current layer aggregation is not the pipeline aggregation, indicating that the current layer aggregation is not the final display result correspondingly. Therefore, whether the current layer aggregation has attribute information to be collected or not can be judged, and if yes, the attribute information of the current layer aggregation can be collected; if not, the next layer of polymerization can continue to be processed. Wherein, the attribute information may be description information for describing a final presentation result. For example, "finance-finance politics" or "computer-hacker entry" information obtained based on the contents of table 2 may be the above-described attribute information.
In this embodiment, if the polymerization type of the final polymerization is index polymerization, the final result can be represented by index polymerization of the innermost layer. Thus, in traversing the tier aggregates, the location in the query statement where the current tier aggregate is located can be identified. If the current layer aggregation is identified as the last aggregation in the query statement, the aggregation value corresponding to the current layer aggregation is represented, and the result is the final result to be displayed. At this time, an aggregation value of the current layer aggregation may be acquired from the parsing result. If the current layer aggregation is identified not to be the last aggregation in the query statement, it indicates that the aggregation value of the current layer aggregation may be only a value calculated in the middle, and is not the final displayed result. At this time, it may be determined whether the current layer aggregation has attribute information to be collected, and if so, the attribute information of the current layer aggregation may be collected; if not, the next layer of polymerization can continue to be processed.
In this embodiment, after traversing each layer aggregate included in the analysis result, an aggregate value of the aggregate may be obtained, and attribute information of the aggregate may also be obtained. Thus, according to the requirements of final display, the acquired aggregation value or the combination of the aggregation value and the attribute information can be correspondingly processed, so that a final query result is generated. Specifically, if only numerical values are included in the final displayed result, the aggregate value can be directly displayed in the final visual interface. If the final displayed result contains the numerical values and also needs to be configured with corresponding descriptive characters, the combination of the aggregation value and the attribute information can be displayed in the final visual interface.
Referring to fig. 6, the present application further provides a system for processing parsing results, where the system is applied in Grafana, and the system includes:
the analysis result acquisition unit is used for acquiring the analysis result of the query statement conforming to the ElasticSearch grammar, and the analysis result comprises the aggregation information of each layer of aggregation identified from the query statement;
a final aggregation identification unit, configured to determine, in the parsing result, an aggregation type of a final aggregation used for characterizing a final display result;
the current layer aggregation identification unit is used for traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer aggregation or identifying the position of the current layer aggregation in the query statement according to the final aggregation type;
and the query result generating unit is used for processing the aggregation value or the attribute information of the current layer aggregation according to the identification result so as to generate a query result of the query statement.
For a specific implementation scheme of each unit in the processing system for the analysis result, reference may be made to the description in the above method embodiment, and details are not described here again.
Therefore, according to the technical scheme provided by the application, the query statement conforming to the ES grammar can be written in Grafana, and the query statement can be analyzed through the scheme provided by the application. In particular, all aggregations contained in the query statement may be identified. The identified respective layer aggregations may then be traversed, and the aggregation types of the respective layer aggregations are determined one by one as the traversal proceeds. In practical applications, the aggregation types may include barrel aggregation, pipe aggregation, and index aggregation. The pipeline aggregation can be divided into pipeline aggregation for representing data filtering and pipeline aggregation for representing numerical calculation. According to different aggregation types, whether the aggregation information to be recorded exists in the aggregation can be judged. And if so, recording the aggregated information, and feeding back the recorded aggregated information as the analysis result of the query statement to the Grafana system. After the Grafana system receives the analysis result of the query statement, the analysis result can be processed according to the scheme provided by the application. In particular, an aggregation type for characterizing a final aggregation of the final display result may be determined from the parsed result. Then, according to the difference of the aggregation type of the final aggregation, different processing modes can be performed on the current layer aggregation. For example, an aggregation type of the current layer aggregation may be identified or a location in the query statement at which the current layer aggregation is located. Finally, the aggregation value or the attribute information of the current layer aggregation may be processed according to the identification result, so as to generate a query result of the query statement. Therefore, according to the technical scheme provided by the application, the query statement conforming to the ES grammar can be written in the Grafana system, the query statement can be analyzed, and the query result of the query statement can be finally generated, so that the Grafana analysis system can support complex index aggregation and pipeline aggregation.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (15)

1. A method for parsing a query statement, the method comprising:
receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement;
traversing the identified aggregations of each layer, and determining the aggregation type of the aggregations;
judging whether the aggregation has aggregation information to be recorded or not according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
2. The method of claim 1, wherein determining whether the aggregation has aggregation information to be recorded according to the determined aggregation type comprises:
if the determined aggregation type is barrel aggregation or index aggregation or pipeline aggregation of characterization numerical calculation, judging that aggregation information to be recorded exists in the aggregation;
and if the determined aggregation type is the pipeline aggregation for representing data filtering, judging that the aggregation does not have aggregation information to be recorded.
3. The method of claim 1 or 2, wherein recording the aggregated aggregation information comprises:
and if the aggregation type is barrel aggregation, recording the unique identification of the aggregation and the aggregation type of the aggregation.
4. The method of claim 1 or 2, wherein recording the aggregated aggregation information comprises:
if the aggregation type is index aggregation or pipeline aggregation of the characterization numerical calculation, recording the unique identification of the aggregation, the aggregation type of the aggregation and the position depth of the aggregation in the query statement.
5. The method according to claim 1, wherein when the recorded aggregation information is fed back to the Grafana system as a result of parsing the query statement, the method further comprises:
and if the query statement comprises the pipeline aggregation of the characteristic numerical calculation, determining the target pipeline aggregation of the characteristic numerical calculation positioned at the outermost layer in the query statement, and marking the aggregation type of the target pipeline aggregation in the feedback analysis result.
6. The method of claim 5, further comprising:
and if the query statement does not contain the pipeline aggregation for representing numerical calculation, determining the index aggregation positioned in the innermost layer in the query statement, and marking the aggregation type of the index aggregation positioned in the innermost layer in the feedback analysis result.
7. A system for parsing a query statement, the system comprising:
the aggregation identification unit is used for receiving a query statement which is input by a user and accords with the ElasticSearch grammar, and identifying an aggregation contained in the query statement;
the aggregation type determining unit is used for traversing each identified aggregation and determining the aggregation type of the aggregation;
the aggregation information recording unit is used for judging whether the aggregation has aggregation information to be recorded according to the determined aggregation type; and if so, recording the aggregated information, and feeding back the recorded aggregated information as an analysis result of the query statement to the Grafana system.
8. A method for processing analysis results, which is applied to Grafana, and comprises the following steps:
acquiring an analysis result of a query statement conforming to an ElasticSearch grammar, wherein the analysis result comprises aggregation information of each layer of aggregation identified from the query statement;
determining an aggregation type of a final aggregation for characterizing a final display result in the analysis result;
traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer of aggregation or identifying the position of the current layer of aggregation in the query statement according to the aggregation type of the final aggregation;
and processing the aggregation value or the attribute information of the current layer aggregation according to the identification result to generate a query result of the query statement.
9. The method of claim 8, wherein identifying an aggregation type of a current layer aggregation or identifying a location in the query statement where the current layer aggregation is located according to the aggregation type of the final aggregation comprises:
if the polymerization type of the final polymerization is the pipeline polymerization of the characterization numerical calculation, identifying the polymerization type of the current layer polymerization;
and if the final aggregation type is index aggregation, identifying the position of the current layer aggregation in the query statement.
10. The method according to claim 8 or 9, wherein processing the aggregation value or attribute information of the current layer aggregation according to the recognition result comprises:
and under the condition that the polymerization type of the final polymerization is the pipeline polymerization of the characterization numerical calculation, if the identified polymerization type of the current layer polymerization is the pipeline polymerization, acquiring the polymerization value of the current layer polymerization from the analysis result.
11. The method of claim 10, further comprising:
if the identified aggregation type of the current layer aggregation is not the pipeline aggregation, judging whether the current layer aggregation has attribute information to be collected;
if yes, collecting attribute information of the current layer aggregation; if not, continuing to process the next layer of polymerization.
12. The method according to claim 8 or 9, wherein processing the aggregation value or attribute information of the current layer aggregation according to the recognition result comprises:
and under the condition that the aggregation type of the final aggregation is index aggregation, if the current layer aggregation is identified to be the last aggregation in the query statement, acquiring an aggregation value of the current layer aggregation from the analysis result.
13. The method of claim 12, further comprising:
if the current layer aggregation is identified not to be the last aggregation in the query statement, judging whether the current layer aggregation has attribute information to be collected;
if yes, collecting attribute information of the current layer aggregation; if not, continuing to process the next layer of polymerization.
14. The method of claim 8, wherein generating the query result for the query statement comprises:
and taking the aggregation value or the combination of the aggregation value and the attribute information acquired from the analysis result as a query result of the query statement.
15. A system for processing results of Grafana, the system comprising:
the analysis result acquisition unit is used for acquiring the analysis result of the query statement conforming to the ElasticSearch grammar, and the analysis result comprises the aggregation information of each layer of aggregation identified from the query statement;
a final aggregation identification unit, configured to determine, in the parsing result, an aggregation type of a final aggregation used for characterizing a final display result;
the current layer aggregation identification unit is used for traversing the aggregation information of each layer of aggregation, and identifying the aggregation type of the current layer aggregation or identifying the position of the current layer aggregation in the query statement according to the final aggregation type;
and the query result generating unit is used for processing the aggregation value or the attribute information of the current layer aggregation according to the identification result so as to generate a query result of the query statement.
CN201811216744.1A 2018-10-18 2018-10-18 Analysis of query statement and processing method and system of analysis result Active CN111078721B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811216744.1A CN111078721B (en) 2018-10-18 2018-10-18 Analysis of query statement and processing method and system of analysis result

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811216744.1A CN111078721B (en) 2018-10-18 2018-10-18 Analysis of query statement and processing method and system of analysis result

Publications (2)

Publication Number Publication Date
CN111078721A true CN111078721A (en) 2020-04-28
CN111078721B CN111078721B (en) 2023-06-23

Family

ID=70309124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811216744.1A Active CN111078721B (en) 2018-10-18 2018-10-18 Analysis of query statement and processing method and system of analysis result

Country Status (1)

Country Link
CN (1) CN111078721B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170185673A1 (en) * 2015-12-25 2017-06-29 Le Holdings (Beijing) Co., Ltd. Method and Electronic Device for QUERY RECOMMENDATION
CN107368517A (en) * 2017-06-02 2017-11-21 上海恺英网络科技有限公司 A kind of method and apparatus of high amount of traffic inquiry
CN107463479A (en) * 2017-07-11 2017-12-12 上海精数信息科技有限公司 A kind of social data monitoring system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170185673A1 (en) * 2015-12-25 2017-06-29 Le Holdings (Beijing) Co., Ltd. Method and Electronic Device for QUERY RECOMMENDATION
CN107368517A (en) * 2017-06-02 2017-11-21 上海恺英网络科技有限公司 A kind of method and apparatus of high amount of traffic inquiry
CN107463479A (en) * 2017-07-11 2017-12-12 上海精数信息科技有限公司 A kind of social data monitoring system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曹亮,王茜,卢菁: "XML数据在关系数据库中存储和检索的研究和实现" *

Also Published As

Publication number Publication date
CN111078721B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
US9304672B2 (en) Representation of an interactive document as a graph of entities
CN102314460B (en) Data analysis method and system and servers
CN110443552B (en) Method and device for automatically transmitting product main data information
CN110377704B (en) Data consistency detection method and device and computer equipment
CN111367976B (en) Method and device for exporting EXCEL file data based on JAVA reflection mechanism
CN106970958B (en) A kind of inquiry of stream file and storage method and device
US20130018848A1 (en) Determining and presenting provenance and lineage for content in a content management system
CN111813804A (en) Data query method and device, electronic equipment and storage medium
CN108932257A (en) The querying method and device of multi-dimensional data
CN109815448B (en) Slide generation method and device
CN111414410B (en) Data processing method, device, equipment and storage medium
EP3040876A1 (en) Information processing device, information processing method and program
CN110210038A (en) Kernel entity determines method and its system, server and computer-readable medium
US11061934B1 (en) Method and system for characterizing time series
CN104321753B (en) For the method for usage amount that monitoring resource is presented, computing device and record has the recording medium of the program for execution thereon
US20170300461A1 (en) Representation of an Interactive Document as a Graph of Entities
US20140324839A1 (en) Determining candidate scripts from a catalog of scripts
CN110837519A (en) Index data management method and device, electronic equipment and machine-readable storage medium
CN113553360A (en) Multi-enterprise relationship analysis method, device, electronic equipment, storage medium and computer program
CN108629592B (en) Settlement configuration method and device and electronic equipment
CN110781211B (en) Data analysis method and device
CN106358220A (en) Detection method of abnormal contact person information, device and system
US20180173776A1 (en) Mapping 1:Many Relationships for Elements in a Database System
CN112100400A (en) Node recommendation method and device based on knowledge graph
CN111078721B (en) Analysis of query statement and processing method and system of analysis result

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant