Index data recommendation method and device, computer equipment and readable storage medium
By receiving and analyzing front-end query statements and matching the recommended aggregation styles with the preset template library, the problems of difficult and low efficiency in indicator development in the existing technology are solved, and the richness of indicator data and effective reflection of business characteristics are achieved.
Patent Information
- Application Number
- CN202411647822.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, relying on experience to set indicators for business analysis cannot objectively reflect the characteristics of actual business data, resulting in high difficulty and low efficiency in indicator development.
Receive query statements triggered by the front-end page through message middleware, perform semantic analysis to obtain the intent aggregation style and the intent aggregation data table, combine the preset aggregation template library for matching processing, obtain the recommended aggregation style and push the target metric data.
It improves the richness of indicators, reduces the difficulty of indicator development, improves the efficiency of indicator development, makes the amplified recommended aggregation style meet actual needs, and enhances the ability to reflect business characteristics.
Smart Images

Figure CN119691020A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an indicator data recommendation method, device, computer equipment and computer-readable storage medium. Background Art
[0002] With the digital transformation of various industries, business data has gradually become one of the means of production, which has important guiding significance for actual business. Among them, data indicators (such as financial indicators such as revenue, profit, cost, gross profit margin, and operational indicators such as production efficiency, inventory turnover rate, equipment utilization rate, etc.) can be used to measure and evaluate business performance, operating conditions, etc. Indicators reflect data characteristics, and data characteristics reflect business characteristics. A good indicator can better reflect data characteristics and provide strong support for actual business production.
[0003] In the related technologies, business analysis is mainly performed by setting indicators based on experience. However, the indicators set based on experience cannot objectively reflect the data characteristics of the actual business and require a long period of accumulation and summary. It can be seen that the development of indicators for business data is difficult and the efficiency of indicator development is low. Summary of the invention
[0004] The present application provides an indicator data recommendation method, device, computer equipment and computer-readable storage medium, which belong to the field of data processing technology and can improve the richness of indicators, reduce the difficulty of indicator development and improve the efficiency of indicator development.
[0005] In a first aspect, the present application provides an indicator data recommendation method, the method comprising:
[0006] Receive query statements triggered by the front-end page through the message middleware;
[0007] Perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement;
[0008] Performing matching processing based on the intended aggregation pattern and a preset aggregation template library to obtain a recommended aggregation pattern for the query statement;
[0009] Based on the intention aggregation data table, the intention aggregation style, and the recommended aggregation style, obtaining target indicator data of the query statement;
[0010] The target indicator data matched by the query statement is pushed to the front-end page so that the front-end page can display the target indicator data.
[0011] In a second aspect, the present application provides an indicator data recommendation device, the indicator data recommendation device comprising:
[0012] A receiving unit, used for receiving query statements triggered by the front-end page through the message middleware;
[0013] An analysis unit, configured to perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement;
[0014] A matching unit, configured to perform matching processing based on the intended aggregation pattern and a preset aggregation template library to obtain a recommended aggregation pattern for the query statement;
[0015] A recommendation unit, configured to obtain target indicator data of the query statement based on the intention aggregation data table, the intention aggregation style, and the recommendation aggregation style;
[0016] The recommendation unit is further used to push the target indicator data matched by the query statement to the front-end page, so that the front-end page can display the target indicator data.
[0017] In a third aspect, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the indicator data recommendation method when executing the computer program.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the indicator data recommendation method.
[0019] In the present application, on the one hand, by performing semantic analysis on the query statement triggered by the front-end page received by the message middleware, the intent aggregation style and the intent aggregation data table are obtained, and the intent aggregation style and the preset aggregation template library are used for matching processing to obtain the recommended aggregation style, which can expand the number of aggregation styles, thereby improving the richness of indicators, reducing the difficulty of indicator development, and improving the efficiency of indicator development; on the other hand, since the intent aggregation style is obtained based on the semantic analysis of the query statement, the recommended aggregation style is matched, so that the expanded recommended aggregation style meets the actual needs; on the third hand, by obtaining the target indicator data based on the intent aggregation data table, the intent aggregation style and the recommended aggregation style, the expanded recommended set style can be combined to mine the indicator data that can potentially feedback the data characteristics, improve the ability to reflect business characteristics, and provide strong support for actual business production. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 This is a flow chart of the indicator data recommendation method provided in the embodiment of the present application;
[0022] Figure 2 This is a flowchart of an embodiment of step 102 in the embodiment of the present application;
[0023] Figure 3 This is a flowchart of an embodiment of step 1021B in the embodiment of the present application;
[0024] Figure 4 It is a flowchart of the data template and aggregation template recommendation provided in the embodiments of the present application;
[0025] Figure 5 It is a flow chart of matching a data template and an aggregation template provided in an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of the structure of an embodiment of the indicator data recommendation device provided in the embodiment of the present application;
[0027] Figure 7 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0030] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0031] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, the known process will not be elaborated in detail to avoid unnecessary details that make the description of the present application embodiment obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in accordance with the embodiments of the present application.
[0032] Embodiments of the present application provide an indicator data recommendation method, apparatus, computer equipment, and computer-readable storage medium.
[0033] The executor of the indicator data recommendation method of the embodiment of the present application may be the indicator data recommendation device provided in the embodiment of the present application, or the computer device provided in the embodiment of the present application, wherein the indicator data recommendation device may be implemented in hardware or software.
[0034] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0035] See also Figure 1 , Figure 1 1 is a flow chart of an indicator data recommendation method provided in an embodiment of the present application. The indicator data recommendation method includes steps 101 to 105, wherein:
[0036] 101. Receive the query statement triggered by the front-end page through the message middleware.
[0037] Among them, the business data for which indicator data recommendation is to be performed can be set according to the actual business scenario requirements. For example, in a digital medical business scenario, the business data can be medical equipment sales data, and indicator data recommendation can be performed on the medical equipment sales data.
[0038] For example, in order to meet the needs of indicator data recommendation scenarios, business data is stored and maintained through the data system backend and visualized through the data system frontend. The pages provided by the data system frontend can perform operations such as querying, changing, and deleting business data.
[0039] Among them, the front-end page refers to the page provided by the front-end of the data system.
[0040] Among them, message middleware is a platform for message transmission and communication in distributed systems, which is used for real-time data flow, log collection, and event-driven at the front end and / or back end of the data system.
[0041] In some embodiments, the user can enter a query statement on the front-end page, such as "calculate the percentage of data under a specific condition in the total data", and collect the query statement entered by the user through the embedding point on the front-end page and send it to the message middleware. Then, the query statement collected by the message middleware can be consumed by the real-time computing engine. Exemplarily, the query statement sent to the message middleware can be an SQL statement.
[0042] In order to better understand this embodiment, some names involved in this embodiment are introduced below:
[0043] 1. Indicators: Indicators are attributes used to feedback data characteristics of business data.
[0044] 2. Aggregation style: As one of the manifestations of indicators, aggregation style refers to the form of data aggregation, which is the logic of calculating, summarizing or counting data. For example, the aggregation function "average of column data" can be used as an aggregation style. For another example, the custom aggregation form "first calculate the column sum, then calculate the ratio of individual data to the column sum" can also be used as an aggregation style.
[0045] 102. Perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement.
[0046] Among them, the intention aggregation style is the aggregation style obtained by semantic analysis of the query statement.
[0047] Among them, the intent aggregation data table is a data table obtained by semantic analysis of the query statement and is aggregated using the intent aggregation style. Exemplarily, the table name, column name, field name, etc. can be used to find the corresponding data table in the business data maintained in the back end of the data system as the intent aggregation data table. For example, if the query statement mentions the "sales" or "number of orders" field, it is necessary to find the corresponding data table matching the field from the business data maintained in the back end of the data system as the intent aggregation data table.
[0048] Exemplarily, first, use NLP technology to segment, tag and parse the query statement, and identify key information in the statement, such as entities, attributes, relationships and actions; for example, for "statistics of sales of each sales department", the system needs to identify "department" and "sales" as key data objects. Then, identify the relationship between these entities and determine the data requirement type in the description, such as aggregation (COUNT, SUM, AVG, etc.) and grouping method (such as by department, date, etc.), so as to obtain the intended aggregation style of the query statement; for example, "statistics of sales of each sales department" means grouping by department and counting the sales in each group.
[0049] 103. Perform matching processing based on the intention aggregation style and a preset aggregation template library to obtain a recommended aggregation style for the query statement.
[0050] The recommended aggregation pattern is an aggregation pattern obtained by matching the intended aggregation pattern.
[0051] There are many ways to implement step 103, illustratively including:
[0052] (1) In some embodiments, matching can be performed based on the intended aggregation style, and N recommended aggregation styles with similarity less than a preset similarity can be found from a preset aggregation template library. In this case, step 103 can specifically include the following step 1031A:
[0053] 1031A. Obtain, from a preset aggregation template library, an aggregation pattern whose similarity to the intended aggregation pattern is less than a preset similarity threshold, as the recommended aggregation pattern.
[0054] The similarity between the recommended aggregation styles is less than a preset similarity threshold.
[0055] (2) In some embodiments, in order to retain the hot indicators (i.e., aggregation styles) that can truly reflect the data characteristics, and to mine the aggregation styles with lower heat, so as to mine the indicators that can truly reflect the data characteristics, matching can be performed based on the intended aggregation style, and N recommended aggregation styles with similarity less than the preset similarity and high heat ranking can be searched from the preset aggregation template library. At this time, if Figure 2 As shown, step 103 may specifically include the following steps 1031B to 1032B:
[0056] 1031B. Obtain, from a preset aggregation template library, each preliminary selected aggregation pattern whose similarity with the intended aggregation pattern is less than a preset similarity threshold.
[0057] Among them, the similarity between the preliminary selected aggregation styles is less than the preset similarity threshold. Therefore, the similarity between the preliminary selected aggregation styles is less than the preset similarity threshold, so more diverse indicators (i.e., aggregation styles) can be mined as preliminary selected aggregation styles, and finally the top N aggregation styles with the highest popularity are obtained from the preliminary selected aggregation styles as the recommended aggregation styles. On the basis of the indicators (i.e., aggregation styles) with the highest popularity, more diverse indicators (i.e., aggregation styles) can be mined, which improves the richness of the indicator data and reduces the difficulty of indicator development. In addition, since indicators with lower similarity can be developed, the problem of indicators being isolated in data due to experience problems can be avoided, so that more indicators that truly reflect data characteristics can be developed.
[0058] For example, the graph neural network model can be used to determine the similarity between the aggregation styles. Figure 3 As shown, step 1031B may specifically include the following steps A1 to A4:
[0059] A1. Construct an aggregation graph structure according to each aggregation style of the preset aggregation template library, wherein the aggregation graph structure includes interconnected aggregation style nodes and style theme nodes, the aggregation style nodes correspond to the aggregation styles, and the style theme nodes correspond to the style themes.
[0060] Among them, each aggregation style of the preset aggregation template library constructs an aggregation graph structure, and the construction of the aggregation graph structure includes two parts: 1. Node construction of the aggregation graph structure: exemplarily, each aggregation style can be used as an aggregation style node, and each style theme can be used as a style theme node. The node characteristics of each aggregation style node can adopt the calculation formula, keywords and other information of the aggregation style, and the node characteristics of each style theme node can adopt the theme of the aggregation style (such as A e-commerce platform, B e-commerce platform, A mall, B mall and other themes); 2. Edge construction of the aggregation graph structure: exemplarily, style and style edges, theme and style edges, and theme and theme edges can be constructed; style and style edges are used to represent the common characteristics between aggregation styles (such as design style, theme, structure); theme and style edges are used to represent the theme to which the aggregation style belongs, for example, the themes of the aggregation style "A e-commerce platform", "B e-commerce platform", "A mall", "B mall" can be used as edges to reflect the content attributes of the aggregation style; theme and theme edges are used to represent the common characteristics between style themes (such as online and offline).
[0061] A2. Train the preset graph neural network model according to the aggregate graph structure to obtain a target graph neural network model.
[0062] Exemplarily, a graph neural network model such as GCN, GAT or GraphSAGE can be selected and trained using the aggregate graph structure to learn the embedded representation of aggregate style nodes and the embedded representation of style topic nodes.
[0063] A3. Obtain the embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model.
[0064] In some embodiments, when the intended aggregation style node exists in the aggregation graph structure, the embedded representation of each aggregation style node of the aggregation graph structure can be directly obtained through the target graph neural network model.
[0065] In some embodiments, the aggregation graph structure does not have an intent aggregation style node. In this case, there is a cold start problem of the intent aggregation style. In order to avoid the low matching accuracy of the recommended aggregation style caused by the cold start of the intent aggregation style, in step a1, when the aggregation graph structure does not have the intent aggregation style node, the aggregation graph structure is updated based on the intent aggregation style to obtain an updated graph structure, wherein the updated graph structure includes the intent aggregation style node corresponding to the intent aggregation style; based on the updated graph structure and the target graph neural network, an embedded representation of the intent aggregation style node is obtained.
[0066] A4. Obtain each of the preliminary selected aggregation styles based on the similarity between the embedding representation of each of the aggregation style nodes and the embedding representation of the intention aggregation style node.
[0067] There are many ways to determine the preliminary aggregation pattern in step A4, illustratively including:
[0068] Method ①: Make the similarity between the initial selected aggregation styles less than the preset similarity threshold, and use the graph neural network model to determine the similarity between the aggregation styles. At this time, step A4 can specifically include the following steps a1 to a4
[0069] a1. Based on the embedded representation of each of the aggregation style nodes and the embedded representation of the intention aggregation style node, obtain the similarity between each of the aggregation style nodes and the intention aggregation style node.
[0070] For example, the aggregation graph structure includes aggregation style nodes T1, T2, T3, ..., T10, where the aggregation style node T1 is an intended aggregation node. Therefore, the similarity (such as cosine similarity) between the embedded representation of the aggregation style node T1 and the embedded representation of the aggregation style node T2 can be obtained as the similarity between the aggregation style node T1 and the aggregation style node T2; and by analogy, the similarity between the aggregation style node T1 and the aggregation style nodes T2, T3, ..., T10 can be obtained.
[0071] a2. Based on the similarity between each of the aggregation style nodes and the intention aggregation style node, obtain a third aggregation style node whose similarity with the intention aggregation style node is less than a preset similarity threshold.
[0072] a3. Use the aggregation pattern corresponding to the third aggregation pattern node as the primary aggregation pattern.
[0073] Method ②: Make the similarity between the preliminary selected aggregation styles less than the preset similarity threshold, and match the target theme of the preliminary selected aggregation style with the intended aggregation style, and use the graph neural network model to determine the similarity between the aggregation styles and the similarity between the themes. At this time, step A4 can specifically include the following steps b1 to b6:
[0074] b1. Obtain an embedded representation of the target topic node of the intention aggregation style through the target graph neural network.
[0075] Specifically, first, the query subject corresponding to the query statement is determined by identifying the query statement as the target subject of the intention aggregation style; when the target subject node of the intention aggregation style exists in the aggregation graph structure, the embedded representation of the target subject node of the intention aggregation style can be directly obtained through the target graph neural network model.
[0076] b2. Based on the embedded representation of each of the aggregated style nodes and the embedded representation of the target topic node, obtain the similarity between each of the aggregated style nodes and the target topic node.
[0077] For example, the aggregate graph structure includes style theme nodes S1, S2, S3, ..., S20, where style theme node S1 is the target theme node. Therefore, the similarity (such as cosine similarity) between the embedded representation of the target theme node S1 and the embedded representation of the style theme node S2 can be obtained as the similarity between the target theme node S1 and the style theme node S2; and by analogy, the similarity between the target theme node S1 and the style theme nodes S2, S3, ..., S20 can be obtained.
[0078] b3. Based on the similarity between each of the aggregated style nodes and the target subject node, obtain a first aggregated style node that matches the target subject node.
[0079] The first aggregation style nodes are the aggregation style nodes of the aggregation graph structure, and the similarity between the first aggregation style nodes and the target topic node is greater than the preset topic similarity.
[0080] b4. Based on the embedded representation of the first aggregation style node and the embedded representation of the intention aggregation style node, obtain the similarity between the first aggregation style node and the intention aggregation style node.
[0081] b5. Based on the similarity between the first aggregation style node and the intention aggregation style node, obtain a second aggregation style node whose similarity with the intention aggregation style node is less than a preset similarity threshold.
[0082] The second aggregated style node is an aggregated style node in the first aggregated style node, the similarity between which and the intended aggregated style node is greater than the preset style similarity.
[0083] b6. Use the aggregation pattern corresponding to the second aggregation pattern node as the primary aggregation pattern.
[0084] 1032B. Obtain the top N aggregation patterns in terms of popularity from the initially selected aggregation patterns as the recommended aggregation patterns.
[0085] For example, the preset aggregation template library includes aggregation styles 1, 2, 3, ..., 100, and the similarity between the intended aggregation style and the aggregation styles 1, 2, 3, 4, 5, 6 is less than the preset similarity threshold, and the similarity between the aggregation styles 1, 2, 3, 4, 5 and 6 is also less than the preset similarity threshold (such as 50%), then the aggregation styles 1, 2, 3, 4, 5, 6 can be used as the preliminary aggregation styles. Then, the top N aggregation styles with the highest popularity are selected from the preliminary aggregation styles 1, 2, 3, 4, 5, 6 as the recommended aggregation styles.
[0086] Among them, the specific value of the preset similarity threshold can be set according to the actual business scenario requirements, and there is no restriction on the specific value of the preset similarity threshold here.
[0087] 104. Based on the intention aggregation data table, the intention aggregation style, and the recommended aggregation style, obtain target indicator data of the query statement.
[0088] There are many ways to implement step 104, illustratively including:
[0089] (1) In some embodiments, the user selects one or more intent aggregation data tables, and the intent aggregation style and the recommended aggregation style are selected by default to generate target indicator data. In this case, step 104 may specifically include:
[0090] Recommending the intention aggregation data table to the front-end page;
[0091] In response to a first selection operation of the front-end page on the intended aggregate data table, selecting an aggregate data table based on the first selection operation;
[0092] From the selected aggregation data table, the index value of the intended aggregation style and the index value of the recommended aggregation style are obtained to form the target index data of the query statement.
[0093] (2) In some embodiments, the user selects one or more intended aggregation data tables and one or more aggregation styles to generate target indicator data. In this case, step 104 may specifically include:
[0094] Recommending the intention aggregation data table and the aggregation style recommendation set to the front-end page, wherein the aggregation style recommendation set includes the intention aggregation style and the recommended aggregation style;
[0095] In response to a first selection operation of the front-end page on the intended aggregate data table, selecting an aggregate data table based on the first selection operation;
[0096] In response to a second selection operation on the front-end page for the recommended set of aggregated styles, selecting an aggregated style based on the second selection operation;
[0097] From the selected aggregation data table, the index value of the selected aggregation style is obtained to form the target index data of the query statement.
[0098] In some embodiments, the selected aggregate data table includes an aggregate structure, and the index value of the selected aggregate style can be obtained from the aggregate structure of the selected aggregate data table, thereby forming the target index data of the query statement. In some embodiments, the selected aggregate data table includes a fact data sub-table, an associated data sub-table, and a dimension data sub-table, and the index value of the selected aggregate style can be calculated in real time from the fact data sub-table of the selected aggregate data table and the selected aggregate style, thereby forming the target index data of the query statement.
[0099] The fact data subtable is used to store numerical data or measurement values in the business process. These measurement values can be, for example, sales, order quantity, profit, income, etc., which can be summarized through aggregate calculations (such as sum, average, count, etc.). For example, each row of the fact data subtable represents a specific record of a business process (such as a sale, a transaction, an order, etc.).
[0100] The associated data subtable is used to establish a relationship between the fact data subtable and the dimension data subtable, especially in the scenario of many-to-many relationship. The associated data subtable is used to solve the complex relationship between the dimension data subtables, or to represent the combination of certain dimensions.
[0101] The dimension data subtable stores descriptive information related to the measurement data in the fact data subtable. The data in the dimension data subtable can be text or categorical data, such as product category, customer name, time, region, etc. The dimension data subtable helps analysts understand the numbers and measurement values in the fact data subtable, and it provides dimensions for classification and grouping.
[0102] Aggregation is a design in the data model specifically used to optimize query performance. It is used to pre-calculate and store aggregate results in certain situations to avoid repeated calculations during queries. These pre-calculated aggregate results are based on the measure data in the fact data subtable, such as the summary of sales by region or time.
[0103] Further, after receiving the first selection operation on the intended aggregated data table from the front-end page, the heat of the selected aggregated data table of the first selection operation is updated, for example, the heat of the selected aggregated data table is increased by 1. When the aggregated data table is recommended next time, the aggregated data table with high heat can be recommended first.
[0104] Further, after receiving the second selection operation on the front-end page for the recommended set of aggregated styles, the heat of the selected aggregated style of the second selection operation is updated, for example, the heat of the selected aggregated style is increased by 1. When recommending aggregated styles next time, aggregated styles with high heat can be recommended first.
[0105] Furthermore, when performing aggregation pattern matching in step 103, when the intended aggregation pattern is matched in the preset aggregation template library, that is, when the intended aggregation pattern exists in the preset aggregation template library, the heat of the intended aggregation pattern recorded in the preset aggregation template library is updated; for example, the heat of the intended aggregation pattern is increased by 1. When recommending aggregation patterns next time, aggregation patterns with high heat can be recommended first.
[0106] Furthermore, when performing aggregation style matching in step 103, when the intended aggregation style is not matched in the preset aggregation template library, that is, when the intended aggregation style does not exist in the preset aggregation template library, the intended aggregation style is written into the preset aggregation template library to enrich the aggregation style and dynamically update the aggregation style in combination with the real-time needs of users, thereby improving the diversity of indicators and reducing the difficulty of indicator development.
[0107] 105. Push the target indicator data matched by the query statement to the front-end page, so that the front-end page can display the target indicator data.
[0108] To better understand the embodiments of this application, please refer to Figure 4 and Figure 5 , Figure 4 is a flowchart of a data template and an aggregation template recommendation provided in an embodiment of the present application. Figure 5 This is a flow chart of the matching of the data template and the aggregation template provided in the embodiment of the present application. The following takes the query statement "calculate the percentage of data under a specific condition to the total data" as an example to illustrate the indicator data recommendation process, as follows:
[0109] 1. Collect query statement data in real time: Set up tracking points in the front-end and back-end systems of business data, and send the query statements successfully executed by users to the message middleware (for example: Kafka). In this way, the query statements triggered by the front-end page can be received by the message middleware.
[0110] 2. Real-time inference of user intent: Use a real-time computing engine (for example, Flink) to consume the collected query statements, filter out query statements containing aggregation purposes, and perform semantic analysis, mainly to extract the aggregation method (i.e., intent aggregation style) and aggregated data features (i.e., intent data style).
[0111] Among them, inferring user intent includes inferring intent data style and intent aggregation style. Intent data style includes fields and table names of related fact tables, association tables, dimension tables, and aggregation tables. For example, for the query statement "calculate the percentage of data under specific conditions in the total data", an aggregation style of "sum first and then find the quotient" can be extracted as the intent aggregation style.
[0112] 3. Real-time matching of existing data templates: that is, matching again from the preset data template library based on the intended data style. According to the aggregated data features (i.e. the intended data style), specific rules are used to match the existing data templates (i.e. the preset data template library). If a match is found, the matched data template is used as the intent aggregation data table, and the heat of the matched data template (i.e. the intent aggregation data table) is updated; if a match is not found, a new data template (i.e. the intent aggregation data table) is created, and the template (i.e. the intent aggregation data table) is written into the preset data template library.
[0113] If the input is a table, all data templates are matched based on the table and table features first, and then the popularity of data templates and aggregate templates is combined to select the top few.
[0114] 4. Real-time matching of existing aggregation templates: that is, matching again from the preset aggregation template library based on the intent aggregation style. Match the existing templates in the preset aggregation template library according to the intent aggregation style extracted in the previous step. If a match is found, update the popularity of the template (i.e., the intent aggregation style): for example, the number of matches within 7 days, and then match the relevant data templates under the template. If no match is found, calculate the similarity between the template (i.e., the intent aggregation style) and other templates, and write the template (i.e., the intent aggregation style) into the preset aggregation template library. And based on the intent aggregation style, further combine the preset aggregation template library to match the recommended aggregation style.
[0115] If an aggregate function is entered, the aggregate template and similar templates are matched first. After combining, the top few are selected based on the data template under the template.
[0116] If no template is matched in steps 3 and 4, the template with the highest popularity ranking (i.e., the aggregation style with the highest popularity, the data table with the highest popularity) is recommended, and the corresponding index value is calculated and recommended to the user.
[0117] 5. Recommend the intention aggregation data table and the aggregation style recommendation set to the user through the front-end page, where the aggregation style recommendation set includes the intention aggregation style and the recommended aggregation style.
[0118] 6. The user selects the aggregation data table to be used from the recommended intent aggregation data table and selects the aggregation style to be used from the recommended aggregation style recommendation set.
[0119] 7. From the aggregate data table selected by the user (i.e., the aggregate data table is selected), the corresponding indicator value is obtained using the aggregation style selected by the user (i.e., the aggregation style is selected). Multiple indicator values together form the target indicator data, thereby increasing the richness of indicators, reducing the difficulty of indicator development, and improving the efficiency of indicator development.
[0120] From the above content, it can be seen that, on the one hand, by performing semantic analysis on the query statement triggered by the front-end page received by the message middleware, the intent aggregation style and the intent aggregation data table are obtained, and the recommended aggregation style is obtained by matching the intent aggregation style and the preset aggregation template library. The number of aggregation styles can be expanded, thereby improving the richness of indicators, reducing the difficulty of indicator development, and improving the efficiency of indicator development; on the other hand, since the recommended aggregation style is matched based on the intent aggregation style obtained by semantic analysis of the query statement, the expanded recommended aggregation style meets the actual needs; on the third hand, by obtaining the target indicator data based on the intent aggregation data table, the intent aggregation style and the recommended aggregation style, the expanded recommended collection style can be combined to mine the indicator data that can potentially feedback data characteristics, improve the ability to reflect business characteristics, and provide strong support for actual business production.
[0121] In addition, in order to better implement the indicator data recommendation method in the embodiment of the present application, based on the indicator data recommendation method, an indicator data recommendation device is also provided in the embodiment of the present application, such as Figure 6 FIG. 1 is a schematic diagram of a structure of an embodiment of an indicator data recommendation device provided in an embodiment of the present application. The indicator data recommendation device 600 includes:
[0122] The receiving unit 601 is used to receive the query statement triggered by the front-end page through the message middleware;
[0123] An analysis unit 602 is used to perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement;
[0124] A matching unit 603 is used to perform matching processing based on the intention aggregation pattern and a preset aggregation template library to obtain a recommended aggregation pattern for the query statement;
[0125] A recommendation unit 604, configured to obtain target indicator data of the query statement based on the intention aggregation data table, the intention aggregation style, and the recommendation aggregation style;
[0126] The recommendation unit 604 is further configured to push the target indicator data matched by the query statement to the front-end page, so that the front-end page can display the target indicator data.
[0127] In some embodiments, the matching unit 603 is specifically used to:
[0128] Acquire, from a preset aggregation template library, each preliminary selected aggregation pattern whose similarity with the intended aggregation pattern is less than a preset similarity threshold, wherein the similarity between the preliminary selected aggregation patterns is less than the preset similarity threshold;
[0129] The top N aggregation patterns in terms of popularity are obtained from each of the initially selected aggregation patterns as the recommended aggregation patterns.
[0130] In some embodiments, the matching unit 603 is specifically used to: construct an aggregation graph structure according to each aggregation style of the preset aggregation template library, wherein the aggregation graph structure includes interconnected aggregation style nodes and style theme nodes, the aggregation style nodes correspond to the aggregation style, and the style theme nodes correspond to the style theme;
[0131] Training a preset graph neural network model according to the aggregate graph structure to obtain a target graph neural network model;
[0132] Obtaining an embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model;
[0133] Based on the similarity between the embedding representation of each of the aggregation style nodes and the embedding representation of the intention aggregation style node, each of the preliminary selected aggregation styles is obtained.
[0134] In some embodiments, the matching unit 603 is specifically used to: obtain an embedded representation of the target topic node of the intention aggregation style through the target graph neural network;
[0135] Based on the embedded representation of each of the aggregated style nodes and the embedded representation of the target topic node, obtaining the similarity between each of the aggregated style nodes and the target topic node;
[0136] Based on the similarity between each of the aggregated style nodes and the target subject node, obtaining a first aggregated style node matching the target subject node;
[0137] Based on the embedding representation of the first aggregation style node and the embedding representation of the intention aggregation style node, obtaining a similarity between the first aggregation style node and the intention aggregation style node;
[0138] Based on the similarity between the first aggregation style node and the intention aggregation style node, obtaining a second aggregation style node whose similarity to the intention aggregation style node is less than a preset similarity threshold;
[0139] The aggregation pattern corresponding to the second aggregation pattern node is used as the primary aggregation pattern.
[0140] In some embodiments, the matching unit 603 is specifically used to:
[0141] When the intended aggregation style node exists in the aggregation graph structure, acquiring an embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model;
[0142] Alternatively, when the aggregation graph structure does not have the intention aggregation style node, the aggregation graph structure is updated based on the intention aggregation style to obtain an updated graph structure, wherein the updated graph structure includes the intention aggregation style node corresponding to the intention aggregation style;
[0143] Based on the updated graph structure and the target graph neural network, an embedded representation of the intent aggregation style node is obtained.
[0144] In some embodiments, the recommendation unit 604 is specifically used to:
[0145] Recommending the intention aggregation data table and the aggregation style recommendation set to the front-end page, wherein the aggregation style recommendation set includes the intention aggregation style and the recommended aggregation style;
[0146] In response to a first selection operation of the front-end page on the intended aggregate data table, selecting an aggregate data table based on the first selection operation;
[0147] In response to a second selection operation on the front-end page for the recommended set of aggregated styles, selecting an aggregated style based on the second selection operation;
[0148] From the selected aggregation data table, the index value of the selected aggregation style is obtained to form the target index data of the query statement.
[0149] In some embodiments, the indicator data recommendation device further includes an updating unit (not shown in the figure), which is specifically used to:
[0150] When the intention aggregation pattern exists in the preset aggregation template library, updating the heat of the intention aggregation pattern recorded in the preset aggregation template library;
[0151] Alternatively, when the intention aggregation pattern does not exist in the preset aggregation template library, the intention aggregation pattern is written into the preset aggregation template library.
[0152] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above units can refer to the previous indicator data recommendation method embodiment, which will not be repeated here.
[0153] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0154] like Figure 7 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0155] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any indicator data recommendation method.
[0156] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0157] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any indicator data recommendation method.
[0158] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0160] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0161] Receive query statements triggered by the front-end page through the message middleware; perform semantic analysis based on the query statement to obtain the intent aggregation style and intent aggregation data table of the query statement; perform matching processing based on the intent aggregation style and a preset aggregation template library to obtain the recommended aggregation style of the query statement; obtain target indicator data of the query statement based on the intent aggregation data table, the intent aggregation style and the recommended aggregation style; push the target indicator data matched by the query statement to the front-end page so that the front-end page can display the target indicator data.
[0162] A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned indicator data recommendation method can be completed by instructions, or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0163] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute any indicator data recommendation method provided in the embodiment of the present application.
[0164] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0165] In the above-mentioned indicator data recommendation device and computer-readable storage medium embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the indicator data recommendation device, computer-readable storage medium and its corresponding units described above can refer to the description of the indicator data recommendation method in the above embodiment, and will not be repeated here.
[0166] The above is a detailed introduction to an indicator data recommendation method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application. The non-company software tools or components that appear in the embodiments of the present application are only examples and do not represent actual use.
Claims
1. A method for recommending indicator data, characterized in that: The method comprises: Receive query statements triggered by the front-end page through the message middleware; Perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement; Performing matching processing based on the intended aggregation pattern and a preset aggregation template library to obtain a recommended aggregation pattern for the query statement; Based on the intention aggregation data table, the intention aggregation style, and the recommended aggregation style, obtaining target indicator data of the query statement; The target indicator data matched by the query statement is pushed to the front-end page so that the front-end page can display the target indicator data.
2. The indicator data recommendation method according to claim 1, characterized in that: The matching process based on the intention aggregation pattern and the preset aggregation template library to obtain the recommended aggregation pattern of the query statement includes: Acquire, from a preset aggregation template library, each preliminary selected aggregation pattern whose similarity with the intended aggregation pattern is less than a preset similarity threshold, wherein the similarity between the preliminary selected aggregation patterns is less than the preset similarity threshold; The top N aggregation patterns in terms of popularity are obtained from each of the initially selected aggregation patterns as the recommended aggregation patterns.
3. The indicator data recommendation method according to claim 2, characterized in that: The obtaining, from a preset aggregation template library, each of the preliminary selected aggregation patterns whose similarity with the intended aggregation pattern is less than a preset similarity threshold comprises: Constructing an aggregation graph structure according to each aggregation style of the preset aggregation template library, wherein the aggregation graph structure includes aggregation style nodes and style theme nodes connected to each other, the aggregation style nodes correspond to the aggregation styles, and the style theme nodes correspond to the style themes; Training a preset graph neural network model according to the aggregate graph structure to obtain a target graph neural network model; Obtaining an embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model; Based on the similarity between the embedding representation of each of the aggregation style nodes and the embedding representation of the intention aggregation style node, each of the preliminary selected aggregation styles is obtained.
4. The indicator data recommendation method according to claim 3, characterized in that: The obtaining each of the preliminary selected aggregation styles based on the similarity between the embedding representation of each of the aggregation style nodes and the embedding representation of the intended aggregation style node includes: Obtaining an embedded representation of a target topic node of the intention aggregation style through the target graph neural network; Based on the embedded representation of each of the aggregated style nodes and the embedded representation of the target topic node, obtaining the similarity between each of the aggregated style nodes and the target topic node; Based on the similarity between each of the aggregated style nodes and the target subject node, obtaining a first aggregated style node matching the target subject node; Based on the embedding representation of the first aggregation style node and the embedding representation of the intention aggregation style node, obtaining a similarity between the first aggregation style node and the intention aggregation style node; Based on the similarity between the first aggregation style node and the intention aggregation style node, obtaining a second aggregation style node whose similarity to the intention aggregation style node is less than a preset similarity threshold; The aggregation pattern corresponding to the second aggregation pattern node is used as the primary aggregation pattern.
5. The indicator data recommendation method according to claim 3, characterized in that: The step of obtaining the embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model includes: When the intended aggregation style node exists in the aggregation graph structure, acquiring an embedded representation of each aggregation style node of the aggregation graph structure through the target graph neural network model; Alternatively, when the aggregation graph structure does not have the intention aggregation style node, the aggregation graph structure is updated based on the intention aggregation style to obtain an updated graph structure, wherein the updated graph structure includes the intention aggregation style node corresponding to the intention aggregation style; Based on the updated graph structure and the target graph neural network, an embedded representation of the intent aggregation style node is obtained.
6. The indicator data recommendation method according to claim 1, characterized in that: The acquiring target indicator data of the query statement based on the intention aggregation data table, the intention aggregation style, and the recommended aggregation style includes: Recommending the intention aggregation data table and the aggregation style recommendation set to the front-end page, wherein the aggregation style recommendation set includes the intention aggregation style and the recommended aggregation style; In response to a first selection operation of the front-end page on the intended aggregate data table, selecting an aggregate data table based on the first selection operation; In response to a second selection operation on the front-end page for the recommended set of aggregated styles, selecting an aggregated style based on the second selection operation; From the selected aggregation data table, the index value of the selected aggregation style is obtained to form the target index data of the query statement.
7. The indicator data recommendation method according to claim 1, characterized in that: The method further comprises: When the intention aggregation pattern exists in the preset aggregation template library, updating the heat of the intention aggregation pattern recorded in the preset aggregation template library; Alternatively, when the intention aggregation pattern does not exist in the preset aggregation template library, the intention aggregation pattern is written into the preset aggregation template library.
8. An indicator data recommendation device, characterized in that: The indicator data recommendation device comprises: A receiving unit, used for receiving query statements triggered by the front-end page through the message middleware; An analysis unit, configured to perform semantic analysis based on the query statement to obtain an intent aggregation style and an intent aggregation data table of the query statement; A matching unit, configured to perform matching processing based on the intended aggregation pattern and a preset aggregation template library to obtain a recommended aggregation pattern for the query statement; A recommendation unit, configured to obtain target indicator data of the query statement based on the intention aggregation data table, the intention aggregation style, and the recommendation aggregation style; The recommendation unit is further used to push the target indicator data matched by the query statement to the front-end page, so that the front-end page can display the target indicator data.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the indicator data recommendation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the indicator data recommendation method according to any one of claims 1 to 7.