Index generation method and device and storage medium

By retrieving and executing SQL in the indicator library to obtain indicator data, the problem of cumbersome and low automation in the prior art indicator generation process is solved, and more efficient and accurate indicator generation is achieved.

CN120144609APending Publication Date: 2025-06-13CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510266186.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The existing technology cannot meet the complex index data types and data association relationships during the indicator generation process, resulting in cumbersome and lengthy generation process, low degree of automation, and low generation efficiency.

Method used

By identifying the indicator entity in the indicator demand information, searching and obtaining the SQL corresponding to the target indicator entity in the indicator library, and executing SQL queries to obtain indicator data, so as to achieve automatic generation of indicators.

Benefits of technology

The SQL retrieval process in the indicator library is simplified, the efficiency and accuracy of indicator generation are improved, and the consumption of manual intervention and computing resources is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144609A_ABST
    Figure CN120144609A_ABST
Patent Text Reader

Abstract

The invention provides an index generation method and device and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: identifying an index entity in index demand information, wherein the index demand information is used for describing information of an index to be generated; on the basis of the index entities, a query statement SQL corresponding to the target index entity is retrieved and obtained in an index library, the index library is used for storing existing index entities and SQL corresponding to the existing index entities, and the SQL is a standardized programming language stored in the index library and used for obtaining index data; and executing the SQL for query to obtain the index data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a method, apparatus, and storage medium for generating metrics. Background Art

[0002] A metric refers to quantitative data that measures, evaluates, or reflects the characteristics, status, or progress of a certain thing. For example: sales volume, unemployment rate, pass rate, etc. Metric generation refers to converting raw data or historical data into meaningful and visual metrics through specific formulas, algorithms, or calculation methods. For example: calculating metrics such as average customer satisfaction and student grade pass rate based on existing data.

[0003] In related technologies, metrics are mainly managed through documents or metric dictionaries. All relevant metrics are listed according to the generation target, and the listed metrics and their corresponding weights are organized into a list for steps such as metric searching, evaluation, and calculation based on the list and metric database during a project or production process.

[0004] However, the existing method of predefining or managing metrics cannot meet complex metric data types and data association relationships. The metric generation process is cumbersome and lengthy, with low automation and low metric generation efficiency. Summary of the Invention

[0005] This application provides a method, apparatus, and storage medium for generating metrics, which improves the metric generation efficiency.

[0006] To achieve the above object, this application adopts the following technical solutions:

[0007] In a first aspect, this application provides a method for generating metrics, the method comprising:

[0008] Identifying metric entities in metric requirement information. Based on the metric entities, retrieving in a metric library the query statements (Structured Query Language, SQL) corresponding to the target metric entities, and executing the SQL for querying to obtain metric data.

[0009] Wherein, the metric requirement information is used to describe information of metrics to be generated, the metric library is used to store existing metric entities and the SQL corresponding to the existing metric entities, and the SQL is a standardized programming language stored in the metric library for obtaining metric data.

[0010] The solution provided by this application pre - processes the index requirement information, that is, identifies the index entities in the index requirement information, then retrieves SQL in the index library based on the index entities, and obtains index data through the retrieved SQL, realizing the automatic generation of indexes. At the same time, compared with the index requirement information, the index entities describe the indexes to be generated more standardly, making the process of retrieving SQL in the index library more simple and efficient, and improving the index generation efficiency.

[0011] A possible implementation method is to retrieve and obtain the SQL corresponding to the target index entity in the index library based on the index entity, which can be specifically implemented as: determining the target index entity in the index library based on the similarity value between the index entity and the existing index entities in the index library; obtaining the SQL corresponding to the target index entity based on the target index entity. When the target index entity exists in the index library, the existing target index entity and its corresponding SQL can be directly used to obtain index data without generating SQL, improving the index generation efficiency.

[0012] Another possible implementation method is that the target index entity is any one of the following index entities: the same index entity, the recommended index entity. Both the same index entity and the recommended index entity are used as the target index entity, with a high fault tolerance rate for determining the target index entity. At the same time, as many existing index entities as possible are recommended to the user, increasing the probability of the user using the existing index entities, and thus reducing the duration of the index generation process.

[0013] Another possible implementation method is that the index generation method provided by this application further includes: splitting the index entity to obtain at least one key entity; retrieving and generating the first virtual SQL in the virtual wide table based on the key entity, and executing the first virtual SQL for querying to obtain index data. Among them, the first virtual SQL refers to a standardized programming language for obtaining index data generated based on the virtual wide table, and the virtual wide table refers to a logical wide table formed by combining data from different sources. Splitting the index entity and generating the first virtual SQL based on the key entity obtained after splitting enhances the understanding of the index to be generated, and the generated first virtual SQL has a higher degree of fit, thereby improving the accuracy of index generation.

[0014] Another possible implementation method is that the key entity includes at least one of the following: dimension, dimension value, basic index. Based on dimensions, dimension values, and basic indexes, the index entity is disassembled from multiple aspects and angles, reducing the difficulty of understanding complex index entities.

[0015] Another possible implementation is to retrieve and generate the first virtual SQL in the virtual wide table based on the key entity, which can be specifically implemented as follows: In the virtual wide table, query and obtain the list content corresponding to the key entity, and generate the first virtual SQL according to the list content. The virtual wide table integrates data from multiple data sources, narrowing the search scope of the data required for SQL generation and metric generation, reducing the need for cross-table queries, and further improving the efficiency of metric generation.

[0016] Another possible implementation is that the virtual wide table includes at least one of the following: an existing virtual wide table, or a virtual wide table corresponding to the key entity generated based on the data warehouse model. The virtual wide table includes an existing virtual wide table and a virtual wide table generated in real time, ensuring the usage status of the virtual wide table, and at the same time being able to generate a virtual wide table that better meets user needs according to different application scenarios, supporting the generation of the first virtual SQL.

[0017] Another possible implementation is that the metric generation method provided in this application further includes: generating a second virtual SQL based on the key entity and the metric configuration table. Among them, the metric configuration table is used to describe the conversion relationship between data and metrics. The definition and description of metric entities in the metric configuration table are relatively clear, and the second virtual SQL is directly generated through the metric configuration table and the key entity, and the accuracy of the generated second virtual SQL is higher.

[0018] In a second aspect, a metric generation device is provided, and the device includes an identification module and a processing module.

[0019] The above-mentioned identification module is used to identify the metric entity in the metric requirement information.

[0020] The above-mentioned processing module is used to retrieve and obtain the SQL corresponding to the target metric entity in the metric library based on the metric entity, and execute the SQL to perform a query to obtain metric data.

[0021] Among them, the metric requirement information is used to describe the information of the metric to be generated, the metric library is used to store existing metric entities and the SQL corresponding to the existing metric entities, and the SQL is a standardized programming language stored in the metric library for obtaining metric data.

[0022] In a possible implementation, the above-mentioned processing module is further used to: determine the target metric entity in the metric library based on the similarity value between the metric entity and the existing metric entities in the metric library; obtain the SQL corresponding to the target metric entity based on the target metric entity.

[0023] In a possible implementation, the target metric entity is any one of the following metric entities: the same metric entity, the recommended metric entity.

[0024] In a possible implementation, the above processing module is further configured to: split the metric entity to obtain at least one key entity; based on the key entity, retrieve and generate a first virtual SQL in the virtual wide table, and execute the first virtual SQL to perform a query to obtain metric data. The first virtual SQL refers to a standardized programming language for obtaining metric data generated based on the virtual wide table, and the virtual wide table refers to a logical wide table formed by combining data from different sources.

[0025] In another possible implementation, the key entity includes at least one of a dimension, a dimension value, and a basic metric.

[0026] In another possible implementation, the above processing module is further configured to: query and obtain the list content corresponding to the key entity in the virtual wide table, and generate a first virtual SQL according to the list content.

[0027] In another possible implementation, the virtual wide table includes at least one of the following: an existing virtual wide table, or a virtual wide table corresponding to the key entity generated based on the data warehouse model.

[0028] In another possible implementation, the above processing module is further configured to: generate a second virtual SQL based on the key entity and the metric configuration table. The metric configuration table is used to describe the conversion relationship between data and metrics.

[0029] For the technical effects corresponding to any implementation manner in the second aspect, reference may be made to the technical effects corresponding to any implementation manner in the first aspect above, which will not be elaborated here.

[0030] In a third aspect, a computer device is provided. The computer device includes: a processor and a memory. At least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the metric generation method in the above aspect.

[0031] In a fourth aspect, a computer-readable storage medium is provided. At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the metric generation method in the above aspect.

[0032] In a fifth aspect, a computer program product is provided. The computer program product includes a computer program or instruction. When the computer program or instruction is executed by the processor, the metric generation method in the above aspect is implemented.

[0033] The solutions provided in the above third aspect to fifth aspect are used to implement the method provided in the above first aspect, and the specific implementation will not be elaborated one by one. For the technical effects corresponding to any implementation manner in the solutions provided in the above third aspect to fifth aspect, reference may be made to the technical effects corresponding to any implementation manner in the first aspect above, which will not be elaborated here.

[0034] It should be noted that, on the premise that the solutions do not conflict, various possible implementation manners of any one of the above aspects can be combined. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic structural diagram of a computer system provided by an embodiment of the present application;

[0036] Figure 2 It is a schematic flowchart of a method for generating an index provided by an embodiment of the present application;

[0037] Figure 3 It is a schematic flowchart of another method for generating an index provided by an embodiment of the present application;

[0038] Figure 4 It is a schematic structural diagram of a logical architecture of an index system provided by an embodiment of the present application;

[0039] Figure 5 It is a schematic structural diagram of a data warehouse model architecture provided by an embodiment of the present application;

[0040] Figure 6 It is a schematic structural diagram of an index tree provided by an embodiment of the present application;

[0041] Figure 7 It is a schematic flowchart of yet another method for generating an index provided by an embodiment of the present application;

[0042] Figure 8 It is a schematic flowchart of yet another method for generating an index provided by an embodiment of the present application;

[0043] Figure 9 It is a schematic diagram of a conversation for generating SQL by an SQL generation model provided by an embodiment of the present application;

[0044] Figure 10 It is a schematic structural diagram of an index generation device provided by an embodiment of the present application;

[0045] Figure 11 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] In the embodiments of the present application, for the convenience of clearly describing the technical solutions of the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and "first", "second", etc. do not necessarily mean different. There is no sequential or size order between the technical features described by "first" and "second".

[0047] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific way for easy understanding.

[0048] In the embodiments of the present application, at least one can also be described as one or more, and multiple can be two, three, four or more, which is not limited in the present application.

[0049] In addition, the network architectures and scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of network architectures and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0050] For ease of understanding, the nouns involved in the embodiments of the present application are first explained.

[0051] Indicator: It refers to a quantitative standard or data that measures, evaluates or reflects the characteristics, status or progress of a certain thing, and helps users understand complex phenomena more objectively, monitor the achievement of goals or make decisions through specific numerical values or levels. It is often used in the fields of business and economy, health and medicine, technology and the Internet, etc. For example: key performance indicators (KPIs) such as sales volume, customer retention rate, conversion rate; macroeconomic indicators such as unemployment rate, gross domestic product (GDP); physical health indicators such as blood pressure, blood sugar, body mass index (BMI); system performance indicators such as server response time, central processing unit (CPU) occupancy rate.

[0052] Indicator Generation: It refers to the process of converting raw data (such as historical prices, trading volumes, etc.) into numerical values with specific meanings and uses through specific formulas and calculation methods. Specifically, the indicator generation process requires collecting and preprocessing the data needed to generate indicators, then calculating the data according to the calculation rules to obtain the corresponding indicator values, and finally generating charts, dashboards, etc. from the calculated indicator values to visualize the indicators, so as to more intuitively display the characteristics and trends of the data.

[0053] SQL: It is a structured query language for managing and operating relational databases, which can specifically implement functions such as data query, data operation, data definition, and permission control. Data query means retrieving data from a database through SQL. For example, the SQL statement "SELECT A, B FROM C" is used to select column A and column B from the data table "C". Data operation means inserting (INSERT), updating (UPDATE), and deleting (DELETE) data in the database through SQL. Data definition means creating or modifying database structures such as tables, indexes, and views. Permission control means managing the permissions of users who operate on the database. For example, giving user a the permission to add data to the database. As an example, an SQL statement for creating a data table: CREATE TABLE Users (id INT PRIMARY KEY, name VARCHAR(50), email VARCHAR(100)). Among them, the identifier (id) of the data table is a field of integer (INT) type and is set as the primary key (PRIMARY KEY). The role of the primary key is to uniquely identify each row record in the table to ensure that each record can be accurately distinguished; the name of the data table (name) is a field of variable-length character (VARCHAR) type with a maximum length of 50 characters, which is used to store name information, such as the name of a user or the name of a product, etc.; the email of the data table is also a field of variable-length character (VARCHAR) type with a maximum length of 100 characters, which is used to store email address information.

[0054] It should be noted that the information (including but not limited to device information, personal information of the object, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in this application are all authorized by the object or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards. For example, the indicator library, database, indicator requirement information, etc. involved in this application are all obtained under full authorization.

[0055] The commonly used method for generating metrics in the industry often achieves this by establishing pre-management or definition of metrics. A brief explanation is provided below.

[0056] First, according to the requirements of project implementation, the systems or components required for the project are determined in advance, such as basic engineering, main structure, decoration, etc. Then, through the definition of metrics managed by documents or metric dictionaries, a list of required metrics is listed. Next, the metric data and technical calibers (rules / methods for calculating metrics) required for generating metrics are searched based on the metric list. Finally, based on the obtained metric data and technical calibers, the metrics required for the project are calculated and generated.

[0057] However, the metric data in the above method is scattered in different databases / data tables. The process of confirming the metric list and searching for metric data and technical calibers is cumbersome, lengthy, and has a low degree of automation. In the case where the types of metric data and the data association relationships are complex, it is impossible to determine the metric data and technical calibers in a timely manner, resulting in low efficiency in generating metrics.

[0058] Based on this, the present application provides a method for generating metrics. By identifying the metric entities in the metric requirement information, SQL is retrieved from the metric library based on the metric entities, and then the metric data is obtained through the retrieved SQL, realizing the automatic generation of metrics. At the same time, compared with the metric requirement information, the description of the metrics to be generated by the metric entities is more standard, making the process of retrieving SQL from the metric library simpler and more efficient, and improving the efficiency of generating metrics.

[0059] The following will specifically elaborate on the solution provided by the embodiments of the present application in conjunction with the accompanying drawings.

[0060] The solution provided by the present application can be applied to Figure 1 the computer system shown in Figure 1 the schematic diagram of the architecture of the computer system shown.

[0061] Exemplarily, Figure 1 the computer system shown includes a computer device 100 and a database 102.

[0062] The computer device 100 can be a high-performance server. As the core of the metric generation process, it is responsible for analyzing and processing the metric description information 101, generating metrics based on the metric description information 101 and the data in the database 102 to obtain metric data, and thus enabling users to quantitatively evaluate the characteristics, status, or progress of the things represented by the metrics based on the metric data.

[0063] Optionally, the computer device 100 may directly / indirectly obtain the metric description information 101 and perform identification, analysis, etc. on the metric description information 101. The computer device 100 may also deploy a human-computer interaction module to enable the user to directly input the metric description information into the computer device 100. The computer device 100 may also deploy an artificial intelligence model, etc., generate an SQL based on the artificial intelligence model, and then obtain metric data based on the SQL. The computer device 100 may also deploy a metric tree map to be able to analyze and process the metric description information 101 based on the metric tree map. The computer device 100 may also construct / improve the metric tree map based on data sets from multiple sources. The "obtaining" of the computer device 100 in this application includes any term with an obtaining function such as querying, discovering, extracting, etc., and this application does not limit this.

[0064] Optionally, the computer device 100 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or may also be a cloud server, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content delivery network (CDN), and cloud servers for basic cloud computing services such as big data that provide cloud computing services. The embodiments of this application do not limit the implementation manner and application scenario of this computer device 100.

[0065] Figure 2 A flowchart of a metric generation method provided for an exemplary embodiment. The computer device may be Figure 1 the computer device 100 in

[0066] such as Figure 2 shown, the metric generation method provided by the embodiments of this application may include:

[0067] Step S201: The computer device identifies the metric entity in the metric requirement information.

[0068] Among them, the metric requirement information is used to describe the information of the metric to be generated. For example: The metric requirement information is "the number of Jiangsu broadband development users analyzing the sub-markets and channel types in June 2024", indicating that it is necessary to generate the metric of the number of broadband development users corresponding to different sub-markets and channel types in Jiangsu Province within June 2024.

[0069] In some embodiments, the manner in which the computer device obtains the metric requirement information is as follows:

[0070] Method 1: The computer device directly receives / stores the metric requirement information through a human-computer interaction system, an application-side system, etc. For example, the computer device receives the metric requirement information input by the user to the human-computer interaction interface.

[0071] Method 2: The computer device communicates with other devices / servers through the Internet to obtain the metric requirement information stored / sent by other devices / servers.

[0072] A metric entity refers to a standardized metric that can be directly used for business analysis. The computer device identifies the metric entity corresponding to the metric requirement information, which is also called standardizing the metric requirement information.

[0073] For example, the metric requirement information includes "the proportion of customers who return goods after purchasing", and the corresponding standardized metric entity is "return rate"; the metric requirement information includes "measuring the proportion of website visitors who are converted into actual purchasing customers", and the corresponding standardized metric entity is "customer conversion rate"; the metric requirement information includes "the total amount of goods purchased by customers on the e-commerce platform", and the corresponding standardized metric entity is "order amount"; the metric requirement information is "how many mobile network development users are there in August 2024", and the corresponding standardized metric entity is "the number of mobile business development users in August 2024".

[0074] In some embodiments, the computer device identifies the metric entity corresponding to the metric requirement information based on a metric library.

[0075] Exemplarily, the metric library stores existing metric entities and descriptions of the existing metric entities. The computer device determines the metric entity corresponding to the metric requirement information based on the existing metric entities in the metric library or the descriptions of the existing metric entities.

[0076] Specifically, the computer device retrieves the existing metric entities in the metric library that are the same / similar to the metric requirement information and determines them as the metric entities corresponding to the metric requirement information.

[0077] For example, the metric requirement information includes or implies contents such as "GDP", "average", "population ratio", etc. The metric library stores the metric "per capita GDP", as well as related words of this metric such as "per capita value of GDP, gross domestic product", and descriptions of this metric such as "the value obtained by dividing the GDP achieved in an accounting period (usually one year) of a region by the average permanent population of the region". Through similarity analysis based on text similarity algorithms, etc., it can be seen that the metric described by the metric requirement information is similar to "per capita GDP", and "per capita GDP" can be determined as the metric entity corresponding to this metric requirement information.

[0078] Among them, the metrics described in the metric requirement information are similar to the existing metric entities, which means that the similarity between the description of the metrics in the metric requirement information and the description of the existing metric entities is higher than the first threshold. For example, the metric requirement information is "the proportion of the number of students with qualified Chinese scores in the class to the total number of students in the class", and this metric requirement information is similar to "the ratio of the number of students with qualified Chinese scores in the class to the total number of students in the class"; or, the similarity between the metrics in the metric requirement information and the existing metric entities is higher than the second threshold. For example, the metric requirement information includes the metric "per capita GDP", and this metric is similar to "per capita value of gross domestic product".

[0079] The text similarity algorithm is a series of technologies and methods used to calculate and compare the similarity between two or more texts. For example: methods based on word embedding, methods based on semantics, methods based on deep learning, etc. In this application, the text similarity algorithm is used to compare the similarity between the metric entity and the existing metric entities.

[0080] Optionally, the first threshold and the second threshold are default values or manually set values, and this application does not limit this.

[0081] Step S202: The computer device retrieves the SQL corresponding to the target metric entity in the metric library based on the metric entity.

[0082] Among them, the metric library stores the existing metric entities and the SQLs corresponding to the existing metric entities.

[0083] Exemplarily, the existing metric entity is the metric entity used in the historical metric generation process, and the SQL corresponding to the existing metric entity is the SQL corresponding to the metric entity used in the historical metric generation process; or, the existing metric entity is the metric entity pre-stored / defined according to historical experience, and the SQL corresponding to the existing metric entity is the SQL pre-generated according to historical experience. For example: the historical metric generation process generates the metric entity "class pass rate", referring to the "class pass rate" and its corresponding SQL, and pre-defines the "grade pass rate" and its corresponding SQL.

[0084] Optionally, the target metric entity includes the same metric entity and the recommended metric entity, and the SQL corresponding to the target metric entity is the SQL required to generate the metric data.

[0085] Among them, the same metric entity refers to the existing metric entity that is the same as the metric entity in the metric library. For example: the metric entity is "national employment rate in 2023", and if this existing metric entity is stored in the metric library, then this existing metric entity is used as the target metric entity, and the metric data corresponding to "national employment rate in 2023" can be obtained by using its corresponding SQL.

[0086] A recommended metric entity refers to an existing metric entity in the metric library that is similar to the metric entity. For example: If the metric entity is "National employment rate in 2023", and the metric library stores "National employment rate in 2022", then this existing metric entity is used as the target metric entity, and by adjusting its corresponding SQL, the SQL for generating the metric data of "National employment rate in 2023" can be obtained.

[0087] SQL is a standardized programming language stored in the metric library for obtaining metric data. For example: If the data table sales stores the quantity of sold goods quantity and the price of goods price, then the SQL for obtaining the metric data of "Total sales amount" is as follows.

[0088] SELECT SUM(quantity*price)AS total_sales

[0089] FROM sales.

[0090] In some embodiments, the computer device retrieves the target metric entity in the metric library based on the metric entity, and then obtains the SQL corresponding to the target metric entity based on the target metric entity.

[0091] Among them, the association between the existing metric entity in the metric library and its corresponding SQL is structured and stored in a table or other form convenient for association, so as to directly obtain the corresponding SQL after determining the target metric entity. For example: The existing metric entity is "Unique identifier", and its corresponding SQL is "total_sales,monthly_active_users".

[0092] Step S203: The computer device executes the SQL for querying to obtain the metric data.

[0093] Among them, the metric data is the specific data value corresponding to the metric entity. For example: The metric data corresponding to the metric entity "Qualified rate" is 78%.

[0094] In some embodiments, the computer device performs lexical analysis on the SQL, identifies different lexical units, such as: table names, column names, keywords, operators, etc., and then generates an execution plan based on the lexical units, and accesses the data and obtains / calculates the metric data based on the execution plan.

[0095] Among them, the execution plan is used to describe the way of accessing data.

[0096] For example: The database table employees contains information such as the first name, last name, job title, and salary of employees. To query the salary of employees named "Pat" in the table employees according to SQL, the execution plan may include the following methods:

[0097] Method 1: In the case where there is no index for the first_name field in the table employees, select the Table Scan method to find all records with the first_name being "Pat".

[0098] Method 2: In the case where there is an index for the first_name field in the table employees, use this index to quickly locate all records with the first_name being "Pat".

[0099] Method 3: In the case where the query condition can be converted into a range query condition, for example: LIKE 'Pat%', use this range query condition, that is, Index Range Scan to locate all records with the first_name being "Pat".

[0100] In summary, the index generation method provided by this application identifies the index entity in the index requirement information, retrieves SQL in the index library based on the index entity, and then obtains the index data through the retrieved SQL to achieve the automatic generation of indexes. At the same time, the index entity describes the index to be generated more standardly relative to the index requirement information, making the process of retrieving SQL in the index library simpler and more efficient, and improving the index generation efficiency.

[0101] Figure 3 It is a schematic flowchart of another index generation method provided for an exemplary embodiment. This method can be executed by the computer device 100 or other devices supporting the data processing process. This method includes:

[0102] Step S301: The computer device identifies the index entity in the index requirement information.

[0103] For the introduction of this step, please refer to step S201, and no more details will be provided here.

[0104] Step S302: The computer device determines the target index entity in the index library based on the similarity value between the index entity and the existing index entities in the index library, and obtains the SQL corresponding to the target index entity based on the target index entity.

[0105] In some embodiments, determining the target index entity in the index library includes the following methods:

[0106] Method 1: Use the existing metric entities in the metric library that have a similarity higher than the first similarity threshold with the metric entity as the same metric entity.

[0107] Method 2: Use the existing metric entities in the metric library that have a similarity higher than the second similarity threshold but not reaching the first similarity threshold as the recommended metric entities.

[0108] Method 3: In the case where the similarity between the existing metric entities in the metric library and the metric entity does not reach the first similarity threshold, use at least one existing metric entity with the highest similarity to the metric entity in the metric library as the recommended metric entity.

[0109] Among them, the first similarity threshold is greater than the second similarity threshold, and the first similarity threshold and the second similarity threshold are default values or values set manually. This application does not make any limitations on this.

[0110] In some embodiments, in the case of the existence of the same metric entity, use the same metric entity as the target metric entity, obtain the SQL corresponding to the same metric entity in the metric library, and obtain the metric data based on this SQL.

[0111] In the case of the non - existence of the same metric entity, use the recommended metric entity with the highest similarity to the metric entity as the target metric entity; or, display all the recommended metric entities to the user, and let the user choose whether to use the recommended metric entity / which recommended metric entity to use as the target metric entity.

[0112] Exemplarily, the computer device receives the information / instructions representing the user's selection result to confirm the target metric entity.

[0113] Exemplarily, the computer device identifies information such as the unique identifier (such as name), calculation logic (such as SUM(amount)), data source (such as table name, field), filtering conditions (such as time range), etc. in the metric entity, selects one or more of this information to retrieve in the metric library, and determines the target metric entity.

[0114] Step S303: The computer device splits the metric entity to obtain at least one key entity.

[0115] Among them, the key entity is a constituent element of the metric entity.

[0116] Optionally, as Figure 4The logical architecture of the indicator system shown in the figure forms the key entities that make up the indicator entities, including basic indicators 401, dimensions 402, dimension values 403, etc. In the embodiments of the present application, the indicator entities in the indicator requirement information (such as comprehensive management indicators 410, analysis indicators 411, or combined indicators 412) are split into basic indicators 401, dimensions 402, and dimension values 403, and the indicator tree 400 is used to represent the indicator entities and the basic indicators 401, dimensions 402, and dimension values 403 that make up the indicator entities.

[0117] Among them, the basic indicator refers to an indicator measurement that cannot be further split, reflecting the most basic quantitative results, such as: sales amount, number of users, etc.

[0118] Exemplarily, the basic indicator is used as the calculation basis of the composite indicator to measure the business result. For example: if the basic indicators include "total number of products" and "number of qualified products", then "product qualification rate" can be calculated based on "total number of products" and "number of qualified products".

[0119] The dimension is the classification attribute of the indicator entity, which is the perspective or classification basis for observing and analyzing data. For example: time, region, user attribute, etc.

[0120] The dimension value refers to the specific value of the dimension, representing an instance under a certain classification. For example: the specific value of the time dimension is "August 2023".

[0121] In some embodiments, the computer device splits the indicator entity to obtain the key entity in the following ways:

[0122] Method 1: The computer device splits the indicator entity based on the indicator library to obtain the key entity.

[0123] Exemplarily, the indicator library stores existing indicator entities and their corresponding key entities. By retrieving the target indicator entity in the indicator library based on the indicator entity, the corresponding key entity of the target indicator entity can be obtained.

[0124] Method 2: The computer device directly splits the indicator entity to obtain the key entity.

[0125] Exemplarily, the computer device identifies the calculation logic in the indicator entity as the basic indicator. Specifically, the core aggregation formulas in the indicator entity are retained (such as SUM, COUNT); for example: if the indicator entity is "total sales amount in Beijing in 2023", the calculation logic "total sales amount = SUM(sales.amount)" is identified as the basic indicator. The computer device extracts the fields used for grouping in the indicator entity (such as GROUP BY region), or identifies the enumerable fields in the filtering conditions in the indicator entity (such as Beijing - the dimension is the city) as the dimension. The computer device extracts the fixed value (such as Beijing) from the filtering conditions as the dimension value corresponding to the dimension.

[0126] Step S304: The computer device retrieves and generates a first virtual SQL in the virtual wide table based on the key entity.

[0127] Among them, the virtual wide table refers to a logical wide table formed by combining data from different sources.

[0128] Exemplarily, the virtual wide table consists of basic fields, associated fields, calculation and filtering conditions, etc.

[0129] Among them, the basic fields are directly from physical tables and data table fields, such as: order ID, amount, etc.

[0130] The associated fields refer to the fields obtained by "joining" other tables. For example: product name, customer region, etc.

[0131] The calculated fields are composite metrics calculated based on existing fields. For example: total price = unit price × quantity.

[0132] The filtering conditions refer to the logic for filtering data. For example: time range, status, etc.

[0133] The first virtual SQL refers to a standardized programming language generated based on the virtual wide table for obtaining metric data.

[0134] Exemplarily, determine the technical caliber knowledge (calculation logic, calculation method) and data for generating metric data based on the key entity. For example: if the key entity includes "2023", "total sales volume", "sales amount", and "sales quantity", then the calculation logic is: total sales volume in 2023 = sales amount in 2023 * sales quantity in 2023, and two data, namely "sales amount in 2023" and "sales quantity in 2023", are required for the calculation.

[0135] Then, in the virtual wide table, query and obtain the list content corresponding to the key entity. The list content reflects the specific location of the key entity in the virtual wide table, that is, the location of the key entity for generating metric data in the virtual wide table. For example: query the location and specific content of "sales amount in 2023" and "sales quantity in 2023" in the virtual wide table.

[0136] Finally, generate the first virtual SQL based on the list content corresponding to the key entity in the virtual wide table. For example: based on the list content corresponding to the key entity in the virtual wide table, as well as technical caliber knowledge, etc., through a prompt template, guide the artificial intelligence model to output the first virtual SQL that meets the user's requirements.

[0137] Exemplarily, the list content corresponding to the key entities in the virtual wide table is represented by virtual wide table fields. For example: product category field (product_category), region field (region), sales amount field (sales_amount), and order date field (order_date). Based on the virtual wide table fields and technical caliber knowledge, the first virtual SQL is generated.

[0138] For example: First, construct the SELECT clause of the first virtual SQL. Specifically, determine the SQL of the technical caliber knowledge (calculation logic) (such as SUM(sale_amount) AS total_sales), and perform dimension selection (such as region, order_month); then determine the FROM and JOIN clauses. Specifically, select the virtual wide table on which the key metrics depend / are located (such as FROM sales_wide); finally, add filtering conditions (such as the region field in the virtual wide table: region = Beijing), and specify the grouping of dimensions (such as GROUP BY region, order_month).

[0139] Exemplarily, the generated first virtual SQL is as follows:

[0140]

[0141]

[0142] In some embodiments, the computer device retrieves the mapping relationship and technical caliber knowledge of the virtual wide table through the metric tree, and then generates the first virtual SQL based on the technical caliber knowledge and the virtual wide table with the mapping relationship.

[0143] Among them, the mapping relationship of the virtual wide table refers to the logical rules of how the fields / data in the virtual wide table are associated and transformed with the fields / data of other data sources (underlying physical tables). The virtual wide table has a mapping relationship, which is also called the virtual wide table can support, indicating that there are fields / data in the virtual wide table that can generate metric data and can execute the first virtual SQL query to obtain metric data; the virtual wide table does not have a mapping relationship, which is also called the virtual wide table cannot support, indicating that it is impossible to execute the first virtual SQL query to obtain metric data.

[0144] Optionally, the virtual wide table includes an existing virtual wide table and a virtual wide table corresponding to the key entities generated based on the data warehouse model.

[0145] Exemplarily, in the case where the existing virtual wide table cannot support, a virtual wide table that can support is generated based on the data warehouse model, and then the first virtual SQL is generated based on the virtual wide table that can support, and the first virtual SQL query is executed to obtain metric data.

[0146] Among them, a data warehouse model refers to an architecture for organizing, storing, and managing a large amount of data, which is used to integrate data from different sources and provide a centralized data platform for users to query and analyze data.

[0147] Exemplarily, Figure 5 As shown in a data warehouse model architecture, the data warehouse model includes a data middle platform 500, a metric mart 510, and a common layer 520.

[0148] Among them, the data middle platform 500 is used to realize data aggregation, purification, processing, modeling, algorithm learning, etc., and provide data to the business in the form of shared services. For example, it provides data applications such as business analysis for users.

[0149] The metric mart 510 is a subset of the data warehouse model, which is used to store and manage specific metric data for a certain business area or analysis theme. In the embodiments of the present application, it is used to store metric entities such as comprehensive management metrics, analysis metrics, and combined metrics, as well as metric specifications and metric quality, etc. The metric mart 510 includes a multi-dimensional metric mart 511 and a dimension-wide table 512. The multi-dimensional metric mart 511 is a type of data mart, which is used to store and manage multi-dimensional metric data. For example, metric data in multiple dimensions such as time, product, and customer, and the storage form is a horizontal table + a vertical table. The dimension-wide table 512 is a horizontal table that integrates the information of multiple dimension tables, avoiding multiple table join operations during data query.

[0150] The common layer 520 is used to provide a unified data view and interface for different data sources. The common layer 520 includes a data summary layer (Data Warehouse Application, DWA), a detail data layer (DataWarehouse Detail, DWD) for data derivation, and a common dimension layer (Dimension, DIM) for storing / managing dimension data.

[0151] Exemplarily, based on the data in the common layer of the data warehouse model, determine the mapping relationship of the virtual wide table and generate a virtual wide table that can be supported.

[0152] Specifically, determine the mapping relationship of the virtual wide table through field mapping, inter-table association, and dimension integration.

[0153] Among them, the field mapping is a direct mapping that directly selects fields from the common layer. For example, the DWD table field: dwd_sales.order_id, and the mapped virtual wide table field: sales_wide.order_id; or calculate fields based on the formula or aggregation logic of the common layer fields. For example, fields: quantity, unit_price, calculation logic: total_price = quantity * unit_price, virtual wide table field: sales_wide.total_price. The inter-table association defines the association relationship between the tables in the common layer. For example, the main table: dwd_sales, the associated table: dwd_products, association relationship: dwd_sales.product_id = dwd_products.id. The dimension integration associates the dimension table (such as dim_product) in the common layer with the fact table. For example, the virtual wide table field: product_category, sourced from the dimension table: dim_product.category.

[0154] The indicator tree, also known as the indicator tree atlas, is used to display the association relationships and influencing factors between indicator entities and key entities, etc.

[0155] Optionally, the nodes in the indicator tree include indicator entities, dimensions, dimension values, basic indicators, virtual wide tables, technical caliber knowledge, etc., and the relationships between the nodes include calculation logic relationships, mapping relationships, association relationships, etc.

[0156] Exemplarily, based on the key entity, traverse the nodes or the relationships between the nodes in the indicator tree, and retrieve the technical caliber knowledge of the key entity and the mapping relationship of the virtual wide table, etc., so that when constructing the prompt word template to generate indicators, the structured indicator information in the indicator tree atlas can be injected, enhancing the question-answering and reasoning capabilities of the indicator generation model / SQL generation model, and thus improving the accuracy of the indicator generation result.

[0157] Exemplarily, through the Retrieval-Augmented Generation (RAG) technology, combined with the indicator tree atlas and the indicator generation model / SQL generation model, enhance the semantic understanding ability of the indicator entity and improve the indicator generation ability.

[0158] Exemplarily, as Figure 6 shown is the structural schematic diagram of an indicator tree provided by an embodiment of the present application. Figure 6The dimension to which the dimension values of China Mobile's service a, fixed network, fixed telephone, broadband access, 4G, and 5G belong is service type 600. The dimension to which the dimension value of mobile service b belongs is mobile service a. The basic indicator included in mobile service b is revenue. The source table of revenue is table c. The dimension value included in mobile service b is billed. The dimension to which billed belongs is whether to be billed. The dimension source table of whether to be billed and the dimension value source table of service type 600 are both table d.

[0159] Step S305: The computer device generates a second virtual SQL based on the key entity and the indicator configuration table.

[0160] Among them, the indicator configuration table is used to describe the conversion relationship between data and indicators.

[0161] Exemplarily, the indicator configuration table stores data such as the definition of the indicator entity, calculation formula, relevant dimensions, etc.

[0162] In some embodiments, the key entity is retrieved and queried in the indicator configuration table, as well as the calculation formula of the key entity, the conversion relationship between data and indicators, etc. Then, based on the retrieval result in the indicator configuration table, a second virtual SQL is generated.

[0163] Exemplarily, the key entity and the indicator configuration table are input into an artificial intelligence model, and a second virtual SQL is generated through the artificial intelligence model.

[0164] Among them, the second virtual SQL is a standardized programming language for obtaining indicator data, or the second virtual SQL is a standardized programming language returned to the user in the case where indicator data cannot be generated (for example: the virtual wide table cannot support).

[0165] Step S306: The computer device executes the SQL, the first virtual SQL, and / or the second virtual SQL for querying to obtain indicator data.

[0166] Exemplarily, the situations where the computer device executes the SQL, the first virtual SQL, or the second virtual SQL for querying to obtain indicator data are as follows, but are not limited thereto.

[0167] Situation 1: The computer device executes the SQL, the first virtual SQL, or the second virtual SQL for querying respectively to obtain multiple indicator data, and presents the multiple indicator data to the user at the same time. The embodiments of the present application do not limit the order of step S302, step S304, and step S305.

[0168] Situation 2: The computer device first executes step S302. In the case where the user determines to use the target indicator entity and its corresponding SQL, it executes the SQL for querying to obtain indicator data, and there is no need to execute step S303 and step S304.

[0169] Case 3: When the user does not use the target metric entity and its corresponding SQL, step S303 or step S304 is executed to perform a query based on the first virtual SQL or the second virtual SQL to obtain metric data.

[0170] Case 4: When the virtual wide table does not support / cannot generate a supported virtual wide table, that is, when the first virtual SQL cannot query metric data, step S304 is executed to perform a query based on the second virtual SQL to obtain metric data.

[0171] In summary, the metric generation method provided in this application identifies the metric entity in the metric requirement information and the key entities obtained after splitting the metric entity, and generates SQL, the first virtual SQL, and the second virtual SQL through multiple channels. While realizing the automatic generation of metrics, the metric generation method is more diverse, adapts to different application scenarios, and the management of metrics is clearer and more convenient. At the same time, the first virtual SQL and the second virtual SQL are generated based on the key entities, further increasing the understanding of the metric description information and improving the accuracy of metric generation.

[0172] Figure 7 It is a flowchart of another metric generation method provided by an embodiment of this application. The method includes:

[0173] Step S701: The user inputs metric requirement information.

[0174] Among them, the metric requirement information is used to describe the information of the metric to be generated.

[0175] Step S702: The computer device identifies the metric entity in the metric requirement information.

[0176] Among them, the metric entity refers to a standard and directly usable standardized metric for business analysis. The computer device identifying the metric entity corresponding to the metric requirement information is also called standardizing the metric requirement information.

[0177] For example: If the metric requirement information includes "the proportion of customers who return goods after purchasing products", the corresponding standardized metric entity is "return rate"; if the metric requirement information includes "measuring the proportion of website visitors who convert into actual purchasing customers", the corresponding standardized metric entity is "customer conversion rate"; if the metric requirement information includes "the total amount of products purchased by customers on the e-commerce platform", the corresponding standardized metric entity is "order amount"; if the metric requirement information is "how many mobile network development users are there in August 2024", the corresponding standardized metric entity is "the number of mobile business development users in August 2024".

[0178] Step S703: The computer device disassembles the metric entity into at least one key entity, and determines the technical caliber knowledge of the key entity based on the metric tree.

[0179] Among them, the key entity is a constituent element of the metric entity.

[0180] Optionally, the key entities that make up the metric entity include basic metrics, dimensions, dimension values, etc.

[0181] Step S704: The computer device inputs the technical caliber knowledge into the SQL generation model and outputs SQL based on the SQL generation model.

[0182] Among them, SQL is a standardized programming language stored in the metric library for obtaining metric data.

[0183] Optionally, the SQL generation model can be a relational model, a data warehouse model, an artificial intelligence model, etc.

[0184] Step S705: The computer device returns the SQL to the user and executes the SQL for querying to obtain metric data.

[0185] Figure 8 This is a schematic flowchart of another metric generation method provided by the embodiments of this application. The method includes:

[0186] Step S801: Start.

[0187] Step S802: The user inputs metric requirement information.

[0188] Among them, the metric requirement information is used to describe the information of the metric to be generated.

[0189] Step S803: Identify the metric entity in the metric requirement information based on the metric library.

[0190] A metric entity refers to a standard and directly usable standardized metric for business analysis. The computer device identifies the metric entity corresponding to the metric requirement information, which is also called standardizing the metric requirement information.

[0191] For example: if the metric requirement information includes "the proportion of customers who return the purchased goods", the corresponding standardized metric entity is "return rate"; if the metric requirement information includes "measuring the proportion of website visitors who convert into actual purchasing customers", the corresponding standardized metric entity is "customer conversion rate"; if the metric requirement information includes "the total amount of goods purchased by customers on the e-commerce platform", the corresponding standardized metric entity is "order amount"; if the metric requirement information is "how many mobile network development users are there in August 2024", the corresponding standardized metric entity is "the number of mobile business development users in August 2024".

[0192] Step S804: Using a text similarity algorithm, based on the metric entity, check whether there is the same metric entity in the metric library. If there is, execute Step S805; if not, execute Step S806.

[0193] Among them, the same metric entity refers to the existing metric entity in the metric library that is the same as the metric entity. For example: if the metric entity is "National employment rate in 2023", and the existing metric entity is stored in the metric library, then this existing metric entity is used as the target metric entity, and the corresponding SQL can be used to obtain the metric data corresponding to "National employment rate in 2023".

[0194] The text similarity algorithm is a series of technologies and methods used to calculate and compare the similarity between two or more texts. For example: methods based on word embedding, methods based on semantics, methods based on deep learning, etc. In this application, the text similarity algorithm is used to compare the similarity between the metric entity and the existing metric entity.

[0195] Step S805: Return to the user the technical caliber knowledge and SQL of the same metric entity / recommended metric entity, and execute Step S814.

[0196] Among them, SQL is the standardized programming language stored in the metric library for obtaining metric data.

[0197] Step S806: Return at least one recommended metric entity in the metric library to the user.

[0198] Among them, the recommended metric entity refers to the existing metric entity in the metric library that is similar to the metric entity. For example: if the metric entity is "National employment rate in 2023", and "National employment rate in 2022" is stored in the metric library, then this existing metric entity is used as the target metric entity, and its corresponding SQL is adjusted to obtain the SQL for generating the metric data of "National employment rate in 2023".

[0199] Step S807: If the user determines to use the recommended metric entity, execute Step S805; if the user does not use the recommended metric entity, execute Step S808.

[0200] Step S808: Identify the key entities in the metric entity.

[0201] Among them, the key entity is the constituent element of the metric entity.

[0202] Optionally, the key entities constituting the metric entity include basic metrics, dimensions, dimension values, etc.

[0203] Step S809: Judge whether the existing virtual wide table can support it. If it can support, execute Step S810; if it cannot support, execute Step S811.

[0204] Among them, that the virtual wide table can support means that the virtual wide table has a mapping relationship, indicating that there are fields / data in the virtual wide table for generating index data and it can execute the first virtual SQL query to obtain the index data. That the virtual wide table cannot support means that the virtual wide table does not have a mapping relationship, indicating that it is impossible to execute the first virtual SQL query to obtain the index data.

[0205] Step S810: Generate the first virtual SQL and execute step S814.

[0206] Among them, the first virtual SQL is a standardized programming language generated based on the virtual wide table for obtaining index data.

[0207] Step S811: Determine whether the common layer data is available. If available, execute step S812; if not, execute step S813.

[0208] Among them, the common layer data is the data in the common layer of the data warehouse model and can be used to generate a virtual wide table with a mapping relationship.

[0209] Step S812: Generate a supportable virtual wide table and execute step S810.

[0210] Step S813: Return the second virtual SQL and execute step S815.

[0211] Among them, the second virtual SQL is a standardized programming language for obtaining index data, or the second virtual SQL is a standardized programming language returned to the user in the case where index data cannot be generated.

[0212] Step S814: Execute the SQL or the first virtual SQL for querying to obtain the index data.

[0213] Step S815: End.

[0214] Such as Figure 9 is a dialogue schematic diagram for generating SQL by an SQL generation model provided in an embodiment of the present application. The specific steps for the SQL generation model to generate SQL are as follows:

[0215] Step S901: Generate a basic index query SQL.

[0216] with a as / / a is used to store the number of users

[0217] (select user_id / / If user_id is repeated, only keep one

[0218] from cube DM_M_CUS_AL_USER_DETAIL_ZWFLY / / Source table

[0219] where mouth_id = '202408'

[0220] and 1=1

[0221] ).

[0222] Step S902: Generate multiple dimension value query SQLs.

[0223] with b1 as / / b1 is used to store online users

[0224] (select user_id

[0225] from cube dwa_v_m_cus_cb_user_info

[0226] where mouth_id = '202408'

[0227] and is_innet='1' )

[0229] b2 as / / b2 is used to store broadband access users and government and enterprise channel users

[0230] (select user_id

[0231] from cube DM_M_CUS_AL_USER_DETAIL_ZWFLY

[0232] where mouth_id = '202408'

[0233] and substr(service_type, 1, 4) in ('0401', '0403') and channel_code in ('1020200', '1010500', '2050400', '2020200')

[0234] ).

[0235] Step S903: Generate multiple dimension query SQLs.

[0236] with c1 as / / c1 is used to store the dimension "province"

[0237] (select user_id, prov_id

[0238] from cube DM_M_CUS_AL_USER_DETAIL_ZWFLY

[0239] where mouth_id = '202408'

[0240] and 1 = 1 )

[0242] c2 as / / c2 is used to store the dimension "whether single-width"

[0243] (select user_id, is_dk as is_dk

[0244] from cube DM_M_CUS_CBB_KD_BASE_DETAIL

[0245] where mouth_id = '202408'

[0246] and 1 = 1 )

[0248] c3 as / / c3 is used to store the dimension "sub - market type"

[0249] (select user_id, market_segment_code as market_segment_code from cubeDM_M_CUS_AL_USER_DETAIL_ZWFLY

[0250] where mouth_id = '202408'

[0251] and 1 = 1

[0252] )

[0253] Step S904: Combine the results of Step 1, Step 2, and Step 3 into an indicator query statement SQL. select prov_id, is_dk, market_segment_code, count(distinct a user_id) as kpi from a / / starting from table a

[0254] inner join b1 / / join the in - network users stored in b1

[0255] on a user_id = b1 user_id inner join b2 / / join the broadband - access users and enterprise - government channel users stored in b2 on a user_id = b2 user_id left join c1 / / join the province information of the users stored in c1

[0256] on a user_id = c1 user_id left join c2 / / Join the single-broadband information of users stored in c2

[0257] on a user_id = c2 user_id left join c3 / / Join the market segment type information of users stored in c3

[0258] on a user_id = c3 user_id where prov_id = ‘085’ / / Restrict the query results to only include users from the province “085” group by prov_id, is_dk, market_segment_code / / Group by different dimensions. Exemplarily, the metric data obtained based on the SQL query is shown in Table 1:

[0259] Table 1: Metric Data

[0260]

[0261] Among them, “085” indicates that the user belongs to the province represented by “085”; “1” indicates that the user belongs to single broadband, that is, separate broadband service; “0” indicates that the user does not belong to separate broadband service and is bundled with other services; “99” and “04” respectively represent different market segment types. For example: “99” represents the commercial user market type, and “04” represents the home user market type.

[0262] Exemplarily, the present application also provides a metric generation device, which is used to implement the above method embodiments.

[0263] Such as Figure 10 is a schematic structural diagram of a metric generation device provided by an embodiment of the present application. The metric generation device may include an identification module 1001 and a processing module 1002. Among them, the identification module 1001 is used to execute Figure 2 the operations of step S201 in the method shown, and Figure 3 the operations of step S301 in the method shown; the processing module 1002 is used to execute Figure 2 the operations of step S202 and step S203 in the method shown, and Figure 3 the operations of step S302, step S303, step S304, step S305, and step S306 in the method shown.

[0264] In some embodiments, in order to implement the above functions, the above-mentioned index generation device includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this application, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0265] The embodiments of this application can divide the function modules of the index generation device according to the above method embodiments. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of this application is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0266] As Figure 11 shown, the computer device provided by the embodiments of this application may include a processor 1101, a bus 1102, a communication interface 1103, and a memory 1104. The processor 1101, the memory 1104, and the communication interface 1103 communicate with each other through the bus 1102. It should be understood that this application does not limit the number of processors and memories in the network device.

[0267] The bus 1102 may be a PCI bus or an extended industry standard architecture (EISA) bus, or a UB bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 11 only one line is shown in, but it does not mean that there is only one bus or one type of bus. The bus 1102 may include a path for transmitting information between various components of the network device (for example, the memory 1104, the processor 1101, the communication interface 1103).

[0268] The processor 1101 may include any one or more of a CPU, a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.

[0269] The memory 1104 may include volatile memory, such as random access memory (RAM). The processor 1101 may also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0270] The communication interface 1103 uses a transceiver module, such as but not limited to a network interface card or a transceiver, to implement communication between the network device and other devices or communication networks.

[0271] The executable program code is stored in the memory 1104, and the processor 1101 executes the executable program code to implement the functions of the foregoing method embodiments respectively. That is, the instructions for executing the above-mentioned index generation method are stored on the memory 1104.

[0272] In another aspect, a computer-readable storage medium is provided. At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the index generation method provided in the foregoing method embodiments.

[0273] In another aspect, a computer program product is provided. The computer program product includes a computer program or instructions. When the computer program or instructions are executed by the processor, the index generation method provided in the foregoing method embodiments is implemented.

[0274] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the module is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.

[0275] Since the index generation module, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above method, the technical effects that can be obtained can also refer to the foregoing method embodiments and will not be elaborated here.

[0276] The method steps in this embodiment can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), register, hard disk, removable hard disk, CD-ROM, or any other form of storage medium well-known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device. Of course, the processor and the storage medium can also exist as discrete components in the network device.

[0277] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions of the embodiments of the present application are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable modules. The computer program or instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer program or instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrating one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as a solid state drive (SSD). As mentioned above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for generating an indicator, characterized in that: The method comprises: Identify an indicator entity in the indicator requirement information, where the indicator requirement information is used to describe information of the indicator to be generated; Based on the indicator entity, a query statement SQL corresponding to the target indicator entity is retrieved in the indicator library, wherein the indicator library is used to store existing indicator entities and SQL corresponding to the existing indicator entities, and the SQL is a standardized programming language stored in the indicator library and used to obtain indicator data; Execute the SQL to query and obtain the indicator data.

2. The method according to claim 1, characterized in that The step of retrieving the SQL corresponding to the target indicator entity in the indicator library based on the indicator entity includes: Determining the target indicator entity in the indicator library based on a similarity value between the indicator entity and an existing indicator entity in the indicator library; Based on the target indicator entity, the SQL corresponding to the target indicator entity is obtained.

3. The method according to claim 2, characterized in that The target indicator entity is any one of the following indicator entities: the same indicator entity, and a recommended indicator entity.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Splitting the indicator entity to obtain at least one key entity; Based on the key entity, a first virtual SQL is retrieved and generated in a virtual wide table, where the first virtual SQL refers to a standardized programming language generated based on the virtual wide table and used to obtain the indicator data, and the virtual wide table refers to a logical wide table formed by combining data from different sources; Execute the first virtual SQL to query and obtain the indicator data.

5. The method according to claim 4, characterized in that The key entity includes: at least one of dimension, dimension value, and basic indicator.

6. The method according to claim 4, characterized in that The step of searching and generating a first virtual SQL in a virtual wide table based on the key entity includes: In the virtual wide table, query and obtain the list content corresponding to the key entity; The first virtual SQL is generated according to the list content.

7. The method according to claim 6, characterized in that The virtual wide table includes at least one of the following: There is already a virtual wide table; or, A virtual wide table corresponding to the key entity is generated based on the data warehouse model.

8. The method according to any one of claims 4 to 7, characterized in that: The method further comprises: Based on the key entity and indicator configuration table, generate a second virtual SQL; The indicator configuration table is used to describe the conversion relationship between data and indicators.

9. An indicator generating device, characterized in that: The device includes: An identification module, used to identify an indicator entity in the indicator requirement information, wherein the indicator requirement information is used to describe information of the indicator to be generated; A processing module, used for retrieving a query statement SQL corresponding to a target indicator entity in an indicator library based on the indicator entity, wherein the indicator library is used for storing existing indicator entities and SQL corresponding to the existing indicator entities, and the SQL is a standardized programming language stored in the indicator library and used for obtaining indicator data; The processing module is also used to execute the SQL to query and obtain the indicator data.

10. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the indicator generation method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the indicator generation method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product comprises a computer program or instructions, and when the computer program or instructions are executed by a processor, the indicator generation method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • SQL intelligent generation and optimization system and method based on index semantic model

    CN120704695A

  • A SQL intelligent generation and optimization system and method based on indicator semantic model

    CN120704695B