Index generation method and device, electronic equipment and storage medium
By deploying the calculation engine in the preset database to receive and process the user's statistical instructions, the problem of the cumbersome indicator generation process in the existing technology is solved, and rapid and simplified indicator data generation is achieved.
Patent Information
- Application Number
- CN202411294374.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, the method of user operation to generate specified indicators is cumbersome and technical requirements are high, making it difficult to quickly help users generate the indicator data that users want.
By deploying the computing engine in the preset database, receiving the statistical instructions entered by the user, based on statistical fields, time particle size, dimensions, and statistical functions to generate index data, and allow users Index data.
Realize the indicator data that users want quickly, simplify the index generation steps, and reduce the technical requirements.
Smart Images

Figure CN119357251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an indicator generation method, device, electronic equipment and storage medium. Background Art
[0002] In group organizations, data analysis and decision-making rely on accurate indicators. Indicator systems can collect and store data, analyze data to generate indicators, and these indicators can measure various aspects, such as business performance, user activities, system resource utilization, etc., to help organizations better understand the operation status and trends of the business. However, the methods for users to generate specified indicators in related technologies are usually cumbersome and technically demanding. Therefore, how to quickly help users generate the indicator data they want is an urgent problem to be solved. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide an indicator generation method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In a first aspect, an embodiment of the present invention discloses an indicator generation method, comprising:
[0005] Deploy a first computing engine in a preset database; the preset database includes gas data;
[0006] Receive a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension;
[0007] determining target gas data from the gas data according to the statistical field, statistical time granularity, and statistical dimension in the first statistical instruction by the first calculation engine, and performing statistics on the target gas data according to the first statistical function to generate first indicator data;
[0008] Receive a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data;
[0009] The target indicator data is counted by the first computing engine according to the second statistical function in the second statistical instruction to generate second indicator data.
[0010] Optionally, the method further comprises:
[0011] The first statistical function, the statistical field, the statistical time granularity and the statistical dimension are parsed by a second computing engine, and a first structured query language SQL statistical instruction is generated according to the parsing result; wherein the second computing engine includes an antrl4 component, and the antrl4 component is used to parse the first statistical function;
[0012] And, the second statistical function and the target indicator data are parsed by the second computing engine, and a second SQL statistical instruction is generated according to the parsing result; wherein the antrl4 component is used to parse the second statistical function;
[0013] Then, the first calculation engine determines the target gas data from the gas data according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performs statistics on the target gas data according to the first statistical function to generate first indicator data, including:
[0014] Determining target gas data from the gas data by the first computing engine according to the statistical field, statistical time granularity, and statistical dimension in the first SQL statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data;
[0015] The performing statistics on the target indicator data according to the second statistical function in the second statistical instruction by the first computing engine to generate second indicator data includes:
[0016] The target indicator data is counted by the first computing engine according to the second statistical function in the second SQL statistical instruction to generate second indicator data.
[0017] Optionally, the first computing engine includes a presto computing engine and a starrocks computing engine, and the method further includes:
[0018] When the preset database is the starrocks database, determining that the first computing engine is the starrocks computing engine;
[0019] When the preset database is a hive database, it is determined that the first computing engine is a presto computing engine.
[0020] Optionally, the method further comprises:
[0021] Displaying an atomic indicator configuration interface: wherein the atomic indicator configuration interface includes a statistical field input field and a first statistical function input field, wherein the first statistical function input field includes a plurality of statistical function options;
[0022] Acquire the statistical field and the first statistical function input by the user in the atomic indicator configuration interface;
[0023] Displaying a derived indicator configuration interface: wherein the derived indicator configuration interface includes a time granularity input field and a dimension input field, and the dimension input field includes multiple dimension options;
[0024] Obtaining the statistical time granularity and statistical dimension entered by the user in the derivative indicator configuration interface;
[0025] The receiving a first statistics instruction input by a user comprises:
[0026] A first statistical instruction is generated according to the statistical field and the first statistical function input by the user in the atomic indicator configuration interface, and the statistical time granularity and the statistical dimension input by the user in the derived indicator configuration interface.
[0027] Optionally, the method further comprises:
[0028] Displaying a composite index configuration interface: wherein the composite index configuration interface includes a target gas data input field and a second statistical function input field, the target gas data input field includes a plurality of first index data options, and the second statistical function input field includes a plurality of statistical function options;
[0029] Acquire the target indicator data and the second statistical function input by the user in the composite indicator configuration interface;
[0030] The receiving a second statistical instruction input by a user comprises:
[0031] A second statistical instruction is generated according to the target indicator data and the second statistical function input by the user in the composite indicator configuration interface.
[0032] Optionally, the method further comprises:
[0033] Get user-defined time fields, dimension fields, and measurement fields;
[0034] Arrange the gas data according to the customized time field, dimension field, and metric field to generate a gas data table;
[0035] The determining target gas data from the gas data by the first calculation engine according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data includes:
[0036] The first computing engine determines a target gas data table from the gas data table according to the statistical fields, statistical time granularity and statistical dimensions in the first statistical instruction, and performs statistics on the data in the target gas data table according to the first statistical function to generate first indicator data.
[0037] Optionally, the method further comprises:
[0038] The first indicator data and the second indicator data are stored in a hive database;
[0039] The first indicator data and the second indicator data are written into elasticsearch based on the elasticsearch spark plug-in.
[0040] In a second aspect, an embodiment of the present invention discloses an indicator generating device, comprising:
[0041] A computing engine deployment module, used to deploy a first computing engine in a preset database; the preset database includes gas data;
[0042] A first statistical instruction receiving module, used to receive a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension;
[0043] a first statistical module, configured to determine target gas data from the gas data according to the statistical field, statistical time granularity, and statistical dimension in the first statistical instruction through the first calculation engine, and perform statistics on the target gas data according to the first statistical function to generate first indicator data;
[0044] A second statistical instruction receiving module, configured to receive a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data;
[0045] The second statistical module is used to perform statistics on the target indicator data according to the second statistical function in the second statistical instruction through the first computing engine to generate second indicator data.
[0046] In a third aspect, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the indicator generation method as described above when executed by the processor.
[0047] In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the indicator generation method as described above are implemented.
[0048] The embodiments of the present invention include the following advantages:
[0049] The first indicator data can be generated according to the first statistical function, statistical field, statistical time granularity and statistical dimension input by the user. The user specifies the target indicator data from the first indicator data and inputs the second statistical function for the target indicator data to generate the second indicator data. Through the embodiment of the present invention, it can help users quickly generate the indicator data they want and simplify the indicator generation steps. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flowchart of a method for generating an indicator provided by an embodiment of the present invention;
[0051] Figure 2 It is a table management interface provided by an embodiment of the present invention;
[0052] Figure 3 It is a table field setting interface provided by an embodiment of the present invention;
[0053] Figure 4 It is an atomic indicator configuration interface provided by an embodiment of the present invention;
[0054] Figure 5 It is a derivative indicator configuration interface provided by an embodiment of the present invention;
[0055] Figure 6 It is a composite indicator configuration interface provided by an embodiment of the present invention;
[0056] Figure 7 This is a flow chart of indicator generation provided by an embodiment of the present invention;
[0057] Figure 8 It is a structural block diagram of an indicator generating device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] Reference Figure 1 , shows a flowchart of a method for generating an indicator provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0060] Step 101, deploying a first computing engine in a preset database; the preset database includes gas data.
[0061] The gas data of the enterprise can be stored in a preset database. The preset database can be a relational database, hive, iceberg, hudi, etc. Among them, Hive is a data warehouse tool based on the distributed system infrastructure Hadoop, iceberg is an open source big data table management library, and hudi is a transactional data lake platform.
[0062] The first computing engine can be Presto, Starrocks, or Doris. Presto is a fast, scalable, distributed SQL query engine. Starrocks is a high-performance analytical data warehouse that implements multi-dimensional, real-time, and high-concurrency data analysis functions through technologies such as a columnar storage engine that can be updated in real time. Doris is a big data analysis engine.
[0063] In one embodiment, when the preset database is the starrocks database, the first computing engine is determined to be the starrocks computing engine; when the preset database is the hive database, the first computing engine is determined to be the presto computing engine.
[0064] Step 102, receiving a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension.
[0065] The user may input a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension, and then send a first statistical instruction.
[0066] The first statistical function may be a function such as sum, count, average, count deduplication, maximum, minimum, etc. The statistical field may be a field representing a metric, for example, gas volume, sales, number of security checks, etc. The statistical time granularity is the statistical time period, for example, it may be 2023, every month of 2023, January 2023, etc. The statistical dimension may be a category of the statistical data, for example, the statistical dimension may be a regional dimension, an organizational structure dimension, a company entity dimension, etc.
[0067] Step 103, determining target gas data from the gas data through the first calculation engine according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data.
[0068] In response to the first statistical instruction, the first computing engine determines the target gas data from the gas data according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and then performs statistics on the target gas data according to the first statistical function to obtain the first indicator data.
[0069] For example, the first statistical function is a summation function, the statistical field is gas volume, the statistical time granularity is January 2023, and the statistical dimension is region A. The first calculation engine finds all the gas volume data in region A in January 2023 from the gas data based on the gas volume, January 2023, and region A, and then sums the gas volume data.
[0070] Step 104, receiving a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data.
[0071] The user can select the target gas data to be used from the first indicator data, input the second statistical function for the target indicator data, and then send the second statistical instruction. The second statistical function can be a function of summing, difference, ratio, average, maximum, minimum, etc. For example, the second statistical function can be: target index 1 / target index 2 (target index 1 divided by target index 2).
[0072] Step 105: Use the first computing engine to perform statistics on the target indicator data according to the second statistical function in the second statistical instruction to generate second indicator data.
[0073] In response to the second statistical instruction, the first computing engine may generate second indicator data by performing statistics on the target indicator data according to the second statistical function.
[0074] The first indicator data can be generated according to the first statistical function, statistical field, statistical time granularity and statistical dimension input by the user. The user specifies the target indicator data from the first indicator data and inputs the second statistical function for the target indicator data to generate the second indicator data. Through the embodiment of the present invention, it can help users quickly generate the indicator data they want and simplify the indicator generation steps.
[0075] In one embodiment, the indicator generation method further includes: obtaining a user-defined time field, a dimension field, and a metric field; and sorting the gas data according to the user-defined time field, the dimension field, and the metric field to generate a gas data table.
[0076] Then, step 103 specifically includes: determining the target gas data table from the gas data table through the first calculation engine according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performing statistics on the data in the target gas data table according to the first statistical function to generate first indicator data.
[0077] Reference Figure 2 , showing a table management interface provided by an embodiment of the present invention. The interface displays three types of tables, namely, a dimension table storing raw gas data, a fact table refined according to the dimension table, and an indicator table. Users can customize time fields, dimension fields, and metric fields. The platform organizes gas data according to the user-defined time fields, dimension fields, and metric fields to obtain a gas data table, i.e., a fact table.
[0078] Reference Figure 3 , shows a table field setting interface provided by an embodiment of the present invention. The user can enter a field and define the attributes of the field, and the attributes of the field include measurement, dimension, etc.
[0079] In one embodiment, the indicator generation method also includes: parsing the first statistical function, statistical field, statistical time granularity and statistical dimension through a second computing engine, and generating a first structured query language SQL statistical instruction based on the parsing result; wherein the second computing engine includes an antrl4 component, and the antrl4 component is used to parse the first statistical function; and, parsing the second statistical function and target indicator data through the second computing engine, and generating a second SQL statistical instruction based on the parsing result; wherein the antrl4 component is used to parse the second statistical function.
[0080] Then, step 103 specifically includes: determining target gas data from the gas data by the first calculation engine according to the statistical field, statistical time granularity and statistical dimension in the first SQL statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data;
[0081] Step 105 specifically includes: using the first computing engine to perform statistics on the target indicator data according to the second statistical function in the second SQL statistical instruction to generate second indicator data.
[0082] The second computing engine is an engine for converting natural language into SQL language. The second computing engine includes an antrl4 component, which is used to parse statistical functions.
[0083] After obtaining the first statistical instruction and the second statistical instruction input by the user, it is necessary to convert the first statistical instruction and the second statistical instruction into SQL language to facilitate the first calculation engine to execute the SQL language for data query and data statistics. When converting the first statistical instruction and the second statistical instruction into SQL language, it is necessary to specifically call the antrl4 component to interpret the first statistical function and the second statistical function. The antrl4 component supports parsing complex calculation formulas, such as supporting calculation formulas like isnull(a,b)if(a>b and b<c)else.
[0084] For example, the first SQL statistical instruction can be: select table1.field + table2.field2 from table1 inner join table2 group by dimension1, dimension2.
[0085] In one embodiment, the indicator generation method further includes: displaying an atomic indicator configuration interface: wherein, the atomic indicator configuration interface includes a statistical field input column and a first statistical function input column, and the first statistical function input column includes multiple statistical function options; obtaining the statistical field and the first statistical function input by the user in the atomic indicator configuration interface; displaying a derived indicator configuration interface: wherein, the derived indicator configuration interface includes a time granularity input column and a dimension input column, and the dimension input column includes multiple dimension options; obtaining the statistical time granularity and the statistical dimension input by the user in the derived indicator configuration interface. Then, step 102 specifically includes: generating a first statistical instruction according to the statistical field and the first statistical function input by the user in the atomic indicator configuration interface, and the statistical time granularity and the statistical dimension input by the user in the derived indicator configuration interface.
[0086] Refer to Figure 4 , which shows an atomic indicator configuration interface provided by an embodiment of the present invention. Atomic indicator configuration: an abstraction of the indicator statistical caliber and specific algorithms. In the atomic indicator configuration interface, the user can select functions and fields.
[0087] Refer to Figure 5 , which shows a derived indicator configuration interface provided by an embodiment of the present invention. Derived indicator configuration: composed of atomic indicators + business dimension limitation (data filtering in the dataset) + (data span statistically counted in the statistical period) + statistical dimension. In the derived indicator configuration interface, the user can select a dataset, and each dataset records data of a certain business type, as well as select dimensions and time granularity.
[0088] When the user finishes configuring in the atomic indicator configuration interface and the derived indicator configuration interface, the calculation button can be clicked to enable the calculation engine to query and calculate in the dataset selected by the user.
[0089] In one embodiment, the index generation method further includes: displaying a composite index configuration interface: wherein the composite index configuration interface includes a target gas data input column and a second statistical function input column, the target gas data input column includes a plurality of first index data options, and the second statistical function input column includes a plurality of statistical function options; obtaining the target index data and the second statistical function input by the user in the composite index configuration interface. Then, step 104 specifically includes: generating a second statistical instruction according to the target index data and the second statistical function input by the user in the composite index configuration interface.
[0090] Reference Figure 6 , showing a composite index configuration interface provided by an embodiment of the present invention. Composite index configuration: is an index obtained by four arithmetic operations of derived indexes. In the composite index configuration interface, the user can select target index data from the first index data (derived index) and input a second statistical function for the target index data. Figure 6 In the example, the target indicator data selected by the user are the number of industrial and commercial household security inspection tasks completed in month a and the number of industrial and commercial household security inspections to be completed in month b, and the second statistical function input by the user is a / b.
[0091] In one embodiment, the indicator generation method also includes: storing the first indicator data and the second indicator data in a hive database; and writing the first indicator data and the second indicator data into elasticsearch based on an elasticsearch spark plug-in.
[0092] In one embodiment, the indicator generation method further includes: storing the generated indicators in correspondence with the dimensions.
[0093] Reference Figure 7 , showing an indicator generation flow chart provided by an embodiment of the present invention. Gas data is stored in a data source, time fields, dimension fields, and metric fields are defined, atomic indicators, derived indicators, and composite indicators are set, and the Presto computing engine sorts the gas data according to the time field, dimension field, and metric field, and queries and counts the gas data according to the set atomic indicators, derived indicators, and composite indicators, and finally generates indicator data. The indicator data is stored in hive, and is written from hive to elasticsearch based on the elasticsearch spark plug-in to provide massive and highly concurrent data retrieval.
[0094] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0095] Reference Figure 8 , shows a structural block diagram of an indicator generation device provided by an embodiment of the present invention, which may specifically include the following modules:
[0096] The computing engine deployment module 201 is used to deploy the first computing engine in a preset database; the preset database includes gas data;
[0097] A first statistical instruction receiving module 202 is used to receive a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension;
[0098] A first statistical module 203 is used to determine target gas data from the gas data according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction through the first calculation engine, and perform statistics on the target gas data according to the first statistical function to generate first indicator data;
[0099] A second statistical instruction receiving module 204 is used to receive a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data;
[0100] The second statistical module 205 is used to perform statistics on the target indicator data according to the second statistical function in the second statistical instruction through the first computing engine to generate second indicator data.
[0101] Optionally, the device further comprises:
[0102] A first SQL statistical instruction generation module is used to parse the first statistical function, the statistical field, the statistical time granularity and the statistical dimension through a second computing engine, and generate a first SQL statistical instruction according to the parsing result; wherein the second computing engine includes an antrl4 component, and the antrl4 component is used to parse the first statistical function;
[0103] and, a second SQL statistical instruction generation module, used for parsing the second statistical function and the target indicator data through the second computing engine, and generating a second SQL statistical instruction according to the parsing result; wherein the antrl4 component is used for parsing the second statistical function;
[0104] Then, the first statistical module 203 is specifically used to determine the target gas data from the gas data according to the statistical field, statistical time granularity and statistical dimension in the first SQL statistical instruction through the first calculation engine, and perform statistics on the target gas data according to the first statistical function to generate first indicator data;
[0105] The second statistical module 205 is specifically configured to perform statistics on the target indicator data according to the second statistical function in the second SQL statistical instruction through the first computing engine to generate second indicator data.
[0106] Optionally, the first computing engine includes a presto computing engine and a starrocks computing engine, and the device further includes:
[0107] A first engine determination module, configured to determine that the first computing engine is a StarRocks computing engine when the preset database is a StarRocks database;
[0108] The second engine determination module is used to determine that the first computing engine is a Presto computing engine when the preset database is a Hive database.
[0109] Optionally, the device further comprises:
[0110] An atomic indicator configuration interface display module, used to display an atomic indicator configuration interface: wherein the atomic indicator configuration interface includes a statistical field input field and a first statistical function input field, wherein the first statistical function input field includes a plurality of statistical function options;
[0111] An atomic indicator configuration acquisition module, used to acquire a statistical field and a first statistical function input by a user in the atomic indicator configuration interface;
[0112] A derived indicator configuration interface display module, used to display a derived indicator configuration interface: wherein the derived indicator configuration interface includes a time granularity input field and a dimension input field, and the dimension input field includes multiple dimension options;
[0113] A derived indicator configuration acquisition module, used to acquire the statistical time granularity and statistical dimension input by the user in the derived indicator configuration interface;
[0114] Then, the first statistical instruction receiving module 202 is specifically used to generate a first statistical instruction according to the statistical field and the first statistical function entered by the user in the atomic indicator configuration interface, and the statistical time granularity and statistical dimension entered by the user in the derived indicator configuration interface.
[0115] Optionally, the device further comprises:
[0116] A composite index configuration interface display module, used to display a composite index configuration interface: wherein the composite index configuration interface includes a target gas data input field and a second statistical function input field, the target gas data input field includes a plurality of first index data options, and the second statistical function input field includes a plurality of statistical function options;
[0117] A composite indicator configuration acquisition module, used to acquire target indicator data and a second statistical function input by a user on the composite indicator configuration interface;
[0118] Then, the second statistical instruction receiving module 204 is specifically used to generate a second statistical instruction according to the target indicator data and the second statistical function input by the user in the composite indicator configuration interface.
[0119] Optionally, the device further comprises:
[0120] Custom field acquisition module, used to obtain user-defined time fields, dimension fields, and measurement fields;
[0121] A gas data table generating module, used for collating the gas data according to the customized time field, dimension field, and metric field to generate a gas data table;
[0122] The first statistical module 203 is specifically used to determine the target gas data table from the gas data table according to the statistical fields, statistical time granularity and statistical dimensions in the first statistical instruction through the first calculation engine, and to perform statistics on the data in the target gas data table according to the first statistical function to generate first indicator data.
[0123] Optionally, the device further comprises:
[0124] An indicator storage module, used to store the first indicator data and the second indicator data in a hive database;
[0125] The indicator writing module is used to write the first indicator data and the second indicator data into elasticsearch based on the elasticsearch spark plug-in.
[0126] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0127] An embodiment of the present invention further provides an electronic device, including:
[0128] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned indicator generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0129] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned indicator generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0130] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0131] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0132] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0136] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0137] The above is a detailed introduction to an indicator generation method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for generating an indicator, characterized in that: include: Deploy a first computing engine in a preset database; the preset database includes gas data; Receive a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension; determining target gas data from the gas data according to the statistical field, statistical time granularity, and statistical dimension in the first statistical instruction by the first calculation engine, and performing statistics on the target gas data according to the first statistical function to generate first indicator data; Receive a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data; The target indicator data is counted by the first computing engine according to the second statistical function in the second statistical instruction to generate second indicator data.
2. The method according to claim 1, characterized in that The method further comprises: The first statistical function, the statistical field, the statistical time granularity and the statistical dimension are parsed by a second computing engine, and a first structured query language SQL statistical instruction is generated according to the parsing result; wherein the second computing engine includes an antrl4 component, and the antrl4 component is used to parse the first statistical function; And, the second statistical function and the target indicator data are parsed by the second computing engine, and a second SQL statistical instruction is generated according to the parsing result; wherein the antrl4 component is used to parse the second statistical function; Then, the first calculation engine determines the target gas data from the gas data according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performs statistics on the target gas data according to the first statistical function to generate first indicator data, including: Determining target gas data from the gas data by the first computing engine according to the statistical field, statistical time granularity, and statistical dimension in the first SQL statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data; The performing statistics on the target indicator data according to the second statistical function in the second statistical instruction by the first computing engine to generate second indicator data includes: The target indicator data is counted by the first computing engine according to the second statistical function in the second SQL statistical instruction to generate second indicator data.
3. The method according to claim 2, characterized in that The first computing engine includes a presto computing engine and a starrocks computing engine, and the method further includes: When the preset database is the starrocks database, determining that the first computing engine is the starrocks computing engine; When the preset database is a hive database, it is determined that the first computing engine is a presto computing engine.
4. The method according to claim 1, characterized in that The method further comprises: Displaying an atomic indicator configuration interface: wherein the atomic indicator configuration interface includes a statistical field input field and a first statistical function input field, wherein the first statistical function input field includes a plurality of statistical function options; Acquire the statistical field and the first statistical function input by the user in the atomic indicator configuration interface; Displaying a derived indicator configuration interface: wherein the derived indicator configuration interface includes a time granularity input field and a dimension input field, and the dimension input field includes multiple dimension options; Obtaining the statistical time granularity and statistical dimension entered by the user in the derivative indicator configuration interface; The receiving a first statistics instruction input by a user comprises: A first statistical instruction is generated according to the statistical field and the first statistical function input by the user in the atomic indicator configuration interface, and the statistical time granularity and the statistical dimension input by the user in the derived indicator configuration interface.
5. The method according to claim 1, characterized in that The method further comprises: Displaying a composite index configuration interface: wherein the composite index configuration interface includes a target gas data input field and a second statistical function input field, the target gas data input field includes a plurality of first index data options, and the second statistical function input field includes a plurality of statistical function options; Acquire the target indicator data and the second statistical function input by the user in the composite indicator configuration interface; The receiving a second statistical instruction input by a user comprises: A second statistical instruction is generated according to the target indicator data and the second statistical function input by the user in the composite indicator configuration interface.
6. The method according to claim 2, characterized in that The method further comprises: Get user-defined time fields, dimension fields, and measurement fields; Arrange the gas data according to the customized time field, dimension field, and metric field to generate a gas data table; The determining target gas data from the gas data by the first calculation engine according to the statistical field, statistical time granularity and statistical dimension in the first statistical instruction, and performing statistics on the target gas data according to the first statistical function to generate first indicator data includes: The first computing engine determines a target gas data table from the gas data table according to the statistical fields, statistical time granularity and statistical dimensions in the first statistical instruction, and performs statistics on the data in the target gas data table according to the first statistical function to generate first indicator data.
7. The method according to claim 1, characterized in that The method further comprises: The first indicator data and the second indicator data are stored in a hive database; The first indicator data and the second indicator data are written into elasticsearch based on the elasticsearch spark plug-in.
8. An indicator generating device, characterized in that: include: A computing engine deployment module, used to deploy a first computing engine in a preset database; The preset database includes gas data; A first statistical instruction receiving module, used to receive a first statistical instruction input by a user; wherein the first statistical instruction includes a first statistical function, a statistical field, a statistical time granularity, and a statistical dimension; a first statistical module, configured to determine target gas data from the gas data according to the statistical field, statistical time granularity, and statistical dimension in the first statistical instruction through the first calculation engine, and perform statistics on the target gas data according to the first statistical function to generate first indicator data; A second statistical instruction receiving module, configured to receive a second statistical instruction input by a user; wherein the second statistical instruction includes target indicator data determined by the user from the first indicator data, and a second statistical function for the target indicator data; The second statistical module is used to perform statistics on the target indicator data according to the second statistical function in the second statistical instruction through the first computing engine to generate second indicator data.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the indicator generation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the indicator generation method according to any one of claims 1 to 7 are implemented.