Index release method, index query method and related devices
By building a granular object model and entity relationship model in the Pandora metric platform, publishing and querying metrics, the problem of excessive resource use in traditional methods is solved, and efficient data processing and rapid analysis is achieved.
Patent Information
- Application Number
- CN202411496745.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-18
AI Technical Summary
In the Pandora metric platform, traditional metric publishing and query methods lead to excessive resource usage, resulting in concurrent and waste of computing resources.
By obtaining the granular object of the indicator, building a granular object model, generating an object tree, filling the entity relationship model, publishing the indicators, and determining the target granularity based on the indicators to be queried for aggregate query, adopting a multi-object granularity publishing and query engine strategy.
It reduces the use of platform resources, reduces concurrent behavior and waste of computing resources, and improves data processing efficiency and data analysis speed.
Smart Images

Figure CN119474228A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an indicator publishing method, an indicator query method and related devices. Background Art
[0002] In the Pandora indicator platform, there are many data analyses with consistent granularity but relatively scattered. For example, for bank customers with the same strategic behavior granularity, it is necessary to analyze the corresponding PV, UV, crowd analysis, strategy display, behavior occurrence and other data. In the traditional Pandora indicator release, users are required to release multiple corresponding indicators; at the same time, when analyzing data, indicator queries also require users to find the corresponding analysis data dimensions based on their own analysis to perform aggregation and clustering analysis. This will generate a large amount of usage for the resources released by the platform and the resources queried, resulting in concurrency and waste of computing resources. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an indicator publishing method, an indicator query method and related devices, which can reduce the usage of resources published by the platform and the resources queried.
[0004] To achieve the above purpose, a first aspect of an embodiment of the present application proposes an indicator publishing method, including:
[0005] Get the granularity object of the indicator;
[0006] Constructing a granular object model of indicators according to the association relationship between different granular objects;
[0007] generating an object tree according to the granular object model;
[0008] Obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity;
[0009] According to the complete entity relationship model, the indicators and dimensions corresponding to each granularity object are published, and the indicators corresponding to the objects with the same granularity have the same granularity.
[0010] In some embodiments, the granularity object of the obtained indicator includes:
[0011] In response to receiving a marking instruction from a user, granular objects are marked on a fact table and a dimension table of the indicator according to the marking instruction.
[0012] In some embodiments, the granular object model of constructing indicators according to the association relationship between different granular objects includes:
[0013] Acquire association relationships between objects of different granularities;
[0014] Classifying granular objects having the same granularity according to the association relationship;
[0015] The indicators are associated with various types of granular objects to construct a granular object model with the same granularity.
[0016] In some embodiments, obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity includes:
[0017] Determine an entity according to the granular object of the object tree;
[0018] Determine the relationship and relationship type between entities according to the hierarchy and connection relationship of the object tree;
[0019] According to the preset entity constraints, the entity relationship model of the granularity is filled according to the entities, the relationships between the entities and the relationship types to obtain a complete entity relationship model.
[0020] To achieve the above purpose, the second aspect of the embodiment of the present application proposes an indicator query method, including:
[0021] Get the indicator to be queried;
[0022] Determine the target granularity according to the indicator to be queried;
[0023] Aggregate data according to the target granularity and the published indicators;
[0024] generating a query statement according to the aggregated data;
[0025] Perform a query according to the query statement to obtain a query result;
[0026] Among them, the published indicators are published according to the indicator publishing method described in the first aspect of the embodiment of the present application.
[0027] In some embodiments, the step of aggregating the target granularity and the published indicators to obtain aggregated data includes:
[0028] Determining a complete entity relationship model according to the target granularity and the published indicators;
[0029] Query the associated foreign key between the to-be-queried index and the granular object according to the complete entity relationship model;
[0030] When the associated foreign key meets the preset aggregation condition, data aggregation is performed between the indicators according to the indicator to be queried to obtain aggregated data.
[0031] In some embodiments, the step of aggregating data between indicators according to the indicator to be queried to obtain aggregated data includes:
[0032] Determine the type of the indicator to be queried;
[0033] When the type of the indicator to be queried is a first type indicator, aggregation is performed according to the dimension of the granular object associated with the indicator to be queried to obtain aggregated data;
[0034] When the type of the indicator to be queried is a second type of indicator, aggregation is performed according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0035] In some embodiments, the aggregating according to the dimension of the granular object associated with the indicator to be queried to obtain aggregated data includes:
[0036] Querying the dimension path of the granular object associated with the to-be-queried indicator through a complete entity relationship model;
[0037] Verify the dimension path to obtain a dimension combination;
[0038] Aggregation is performed according to the dimension combination to obtain aggregated data.
[0039] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the indicator publishing method described in the first aspect of the embodiment of the present application and the indicator query method described in the second aspect of the embodiment of the present application when executing the computer program.
[0040] To achieve the above-mentioned objectives, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program, and is characterized in that when the computer program is executed by a processor, it implements the indicator publishing method described in the first aspect of the embodiment of the present application and the indicator query method described in the second aspect of the embodiment of the present application.
[0041] The indicator publishing method, indicator query method and related devices proposed in the present application construct a granular object model according to the association relationship between granular objects of different indicators; generate an object tree according to the granular object model; fill the granular entity relationship model according to the object tree; publish indicators according to the complete entity relationship model; and determine the target granularity according to the indicator to be queried; obtain aggregated data by aggregating the target granularity and the published indicators; query according to the aggregated data; adopt a multi-object granular publishing and query engine strategy, according to the self-service analysis business scenario and batch granular indicator calculation, it can strategically perform data rapid analysis and multi-object granular dimension aggregated data output, so as to quickly display the published data and analysis data required by the user, efficiently compare data, improve the data analysis method, improve data processing efficiency, reduce the use of platform published resources and query resources, and reduce concurrent behavior and computing resource waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a step diagram of the indicator publishing method provided in the embodiment of the present application;
[0043] Figure 2 It is a sub-step diagram of step S100 provided in an embodiment of the present application;
[0044] Figure 3 is a step diagram of step S200 provided in an embodiment of the present application;
[0045] Figure 4 is a step diagram of step S400 provided in an embodiment of the present application;
[0046] Figure 5 is a step diagram of the indicator query method provided in an embodiment of the present application;
[0047] Figure 6 is a step diagram of step S800 provided in an embodiment of the present application;
[0048] Figure 7 is a step diagram of step S830 provided in an embodiment of the present application;
[0049] Figure 8 is a step diagram of step S832 provided in an embodiment of the present application;
[0050] Fig. 9 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0054] In the Pandora indicator platform, there are many data analyses with consistent granularity but relatively scattered. For example, for bank customers with the same strategic behavior granularity, it is necessary to analyze the corresponding PV, UV, crowd analysis, strategy display, behavior occurrence and other data. In the traditional Pandora indicator release, users are required to release multiple corresponding indicators; at the same time, when analyzing data, indicator queries also require users to find the corresponding analysis data dimensions based on their own analysis to perform aggregation and clustering analysis. This will generate a large amount of usage for the resources released by the platform and the resources queried, resulting in concurrency and waste of computing resources.
[0055] In order to solve the above problems, the embodiments of the present application provide an indicator publishing method, an indicator query method and related devices, which can improve data processing efficiency and reduce concurrent behavior and waste of computing resources.
[0056] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0057] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0058] The indicator publishing method, indicator query method and related devices provided in the embodiments of the present application relate to the field of artificial intelligence technology. The indicator publishing method and indicator query method provided in the embodiments of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the indicator publishing method and the indicator query method, etc., but is not limited to the above forms.
[0059] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0060] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant regulations. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0061] The indicator publishing method, indicator query method and related devices provided in the embodiments of the present application are specifically described through the following embodiments, and firstly, the indicator publishing method in the embodiments of the present application is described.
[0062] Reference Figure 1 The indicator publishing method of the embodiment of the present application includes but is not limited to the following steps:
[0063] Step S100, obtaining the granularity object of the indicator;
[0064] Step S200, constructing a granular object model of indicators according to the association relationship between objects of different granularities;
[0065] Step S300, generating an object tree according to the granular object model;
[0066] Step S400, obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity;
[0067] Step S500: According to the complete entity relationship model, the indicators and dimensions corresponding to each granular object are published.
[0068] Reference Figure 2 For step S100, obtaining the granularity object of the indicator includes but is not limited to the following steps:
[0069] Step S110 , in response to receiving a marking instruction from a user, marking granular objects on the fact table and the dimension table of the indicator according to the marking instruction.
[0070] It can be understood that the user inputs a marking instruction through an input device, the system receives the user's marking instruction, and in response to receiving the user's marking instruction, marks the granular objects on the fact table and dimension table of the indicator according to the marking instruction; or, in response to receiving the user's marking instruction, marks the granular objects on the fact table or dimension table of the indicator according to the marking instruction.
[0071] Among them, the fact table is a table used to store data directly related to the business process, usually quantitative values, such as sales, quantity, etc. This data is used to support decision making and data analysis.
[0072] Dimension tables are tables used to store data that classifies and describes the data in the fact table. The data that classifies and describes the data in the fact table usually contains descriptive attributes; for example, dimension information such as time, location, product, and customer.
[0073] A granular object is a data entity at a specific granularity level. Specifically, the granular object is a customer granular object, that is, a granular object based on customers, which means that the level of detail in which the data entity is organized and analyzed is based on customers. For example, if the data is recorded for each transaction of each customer, then this is a fine-grained customer object.
[0074] When users mark relevant customer-granular objects on fact tables and dimension tables, they are actually telling the system which level of data detail users need to focus on. This will affect how data is aggregated, the results of analysis, and the ultimate business insights. For example, a retailer may want to analyze the purchasing behavior of different customer groups. It can mark customer-granular objects on the fact table containing sales data and the dimension table containing customer information so that the system can aggregate and analyze data according to the customer dimension.
[0075] By marking customer-granular objects, the most valuable data for users can be extracted from a large amount of data, thereby supporting more accurate indicator business decisions.
[0076] Reference Figure 3 For step S200, a granular object model of an indicator is constructed according to the association relationship between objects of different granularities, including the following steps:
[0077] Step S210, obtaining association relationships between objects of different granularities;
[0078] Step S220, classifying granular objects with the same granularity according to the association relationship;
[0079] Step S230 , associating the indicators with various granular objects to construct a granular object model with the same granularity.
[0080] Exemplarily, the granular object is customer transaction data, and the association relationship between different customer transaction data is obtained. For example, customer transaction data A and customer transaction data B are different transactions of customer a, customer transaction data A and customer transaction data C are transaction data in days, and customer transaction data B is transaction data in weeks.
[0081] According to the association relationship, objects with the same granularity are classified; for example, customer transaction data A and customer transaction data C have the same granularity and are both transaction data in days, so customer transaction data A and customer transaction data C are classified into one category. Customer transaction data B is transaction data in weeks, so customer transaction data B is classified into another category.
[0082] Associate the indicators with the corresponding types of granular objects. For example, associate the indicators corresponding to the number of days with a type of granular objects with the granularity of the day, and associate the indicators corresponding to the number of weeks with a type of granular objects with the granularity of the week. According to the multi-object indicator model system of the indicator platform, build multiple batches of granular object models based on the association between the indicators and various types of granular objects. Group granular object models with the same granularity into one batch.
[0083] For step S300, an object tree is generated according to the granular object model.
[0084] An object tree is a hierarchical structure that shows the relationship between objects of different granularity. For example, in a bank, an object tree starts from the head office, then breaks down to branches, business departments, account managers, and finally to individual customers or corporate customers. Each node is an object, and they are connected to each other through hierarchical relationships.
[0085] Reference Figure 4 For step S400, obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity includes the following steps:
[0086] Step S410, determining an entity according to the granular object of the object tree;
[0087] Step S420, determining the relationship and relationship type between entities according to the hierarchy and connection relationship of the object tree;
[0088] Step S430, according to the preset entity constraints, the entity relationship model of the granularity is filled according to the entities, the relationships between the entities and the relationship types to obtain a complete entity relationship model.
[0089] It is understood that the entity-relationship model is a conceptual data model that is used to describe entities and the relationships between them. This model is the basis of database design, especially in relational database management systems. The entity-relationship model usually includes the following three main components: entities, relationships, and attributes.
[0090] An entity is a distinguishable object in the real world, which can be a person, place, thing, or concept. In the entity-relationship model, entities are usually represented by rectangles.
[0091] Relationships describe the associations between entities. They can be one-to-one, one-to-many, or many-to-many. In entity-relationship models, relationships are usually represented by diamonds and are shown by lines connecting the entities. The lines can be labeled with the type and name of the relationship.
[0092] Attributes are properties or characteristics of entities. They are usually represented by ellipses and connected to entities. Attributes can be single-valued or multi-valued. Single-valued attributes correspond to only one value for each entity instance, while multi-valued attributes can correspond to multiple values.
[0093] In addition, the entity-relationship model also includes primary keys, foreign keys, cardinality, and participation. The primary key is used to uniquely identify the attribute or combination of attributes of each row in the entity table. The foreign key is an attribute used to establish a link between two entities. It is usually contained in the relationship table and is used to reference the primary key of another entity. Cardinality is used to describe the role of an entity in a relationship, for example, whether it is required (mandatory) or optional (optional). Participation is used to describe the degree of participation of an entity in a relationship, which can be full participation (every entity instance participates in the relationship) or partial participation (only some entity instances participate in the relationship).
[0094] First, you need to understand the structure and meaning of the object tree. Identify all entities in the object tree. Entities usually represent people, places, things, or concepts in a business process. For example, in banking, entities may include "customer", "account", "transaction", "branch", etc. Determine the attributes of each entity. Attributes are data items that describe the characteristics of an entity. For example, the attributes of the "customer" entity may include "customer ID", "name", "address", "phone number", etc. Determine the relationships between entities based on the hierarchy and connections in the object tree. Relationships can be one-to-one, one-to-many, or many-to-many. For example, there may be a one-to-many relationship between "customer" and "account" because a customer can have multiple accounts. Determine the type and nature of the relationship; for example, a relationship can be mandatory or optional, or deterministic or non-deterministic. Determine the key of each entity, that is, the attribute or combination of attributes used to uniquely identify an entity instance. For example, the key of the "account" entity may be "account ID". Determine the constraints of the entity, such as foreign key constraints, non-null constraints, unique constraints, etc. According to the preset entity constraints, the granular entity relationship model is filled according to the entities, the relationships between entities and the relationship types to obtain a complete entity relationship model to ensure the accuracy and completeness of the information.
[0095] In addition, the complete entity relationship model can be further optimized according to actual indicator requirements to improve its performance, readability and maintainability. For example, normalization can be used to reduce data redundancy and improve data consistency.
[0096] For example, if the object tree shows that the "Customer" entity is at the top level, with two child nodes "Account" and "Transaction", then in the complete entity-relationship model, create a "Customer" entity, which is connected to the "Account" entity through a one-to-many relationship, and the "Account" entity is also a one-to-many relationship with the "Transaction" entity. The attributes of each entity will be filled according to business rules, such as "Customer" has "Name" and "Address", "Account" has "Account Number" and "Balance", "Transaction" has "Transaction ID" and "Amount", etc.
[0097] Through the above filling process, the complete entity-relationship model can comprehensively reflect business entities and their relationships, providing a solid foundation for subsequent database design and data analysis.
[0098] For step S500, the indicators and dimensions corresponding to the objects of each granularity are published according to the complete entity relationship model, and the indicators corresponding to the objects of the same granularity have the same granularity.
[0099] The following describes the indicator query method in the embodiment of the present application.
[0100] Reference Figure 5 The index query method of the embodiment of the present application includes but is not limited to the following steps:
[0101] Step S600, obtaining the index to be queried;
[0102] Step S700, determining the target granularity according to the index to be queried;
[0103] Step S800, performing aggregation according to the target granularity and the published indicators to obtain aggregated data;
[0104] Step S900, generating a query statement according to the aggregated data;
[0105] Step S1000, perform a query according to the query statement to obtain a query result.
[0106] Among them, the published indicators are published according to the above indicator publishing method.
[0107] In step S600, the user inputs the index to be queried through an input device, and the system receives the index to be queried.
[0108] For step S700, the target granularity is determined according to the indicator to be queried. For example, if the indicator to be queried is "daily sales volume reaches requirement S", the target granularity is in days.
[0109] Reference Figure 6 , for step S800, aggregating the target granularity and the published indicators to obtain aggregated data includes the following steps:
[0110] Step S810, determining a complete entity relationship model according to the target granularity and the published indicators;
[0111] Step S820, querying the associated foreign key between the to-be-queried index and the granular object according to the complete entity relationship model;
[0112] Step S830, when the associated foreign key meets the preset aggregation condition, data aggregation is performed between the indicators according to the indicator to be queried to obtain aggregated data.
[0113] For step S810, an indicator corresponding to the indicator to be queried is searched from the published indicators, and a corresponding complete entity relationship model is determined according to the target granularity and the indicator corresponding to the indicator to be queried.
[0114] For step S820, according to the relationship between the index and the object in the complete entity relationship model, the associated foreign key between the index to be queried and the granular object is queried.
[0115] Reference Figure 7 For step S830, data aggregation between indicators is performed according to the indicator to be queried to obtain aggregated data, including the following steps:
[0116] Step S831, determining the type of the indicator to be queried;
[0117] Step S832: when the type of the indicator to be queried is a first type indicator, aggregation is performed according to the dimension of the granular object associated with the indicator to be queried to obtain aggregated data;
[0118] Step S833: when the type of the indicator to be queried is a second type of indicator, aggregation is performed according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0119] For step S831, the type of the indicator to be queried is determined. The type of the indicator to be queried includes a first type of indicator and a second type of indicator. The first type of indicator is a deduplication type indicator and the second type of indicator is a non-deduplication type indicator.
[0120] Deduplication metrics are metrics that require the removal of duplicate data during the calculation process. These metrics usually reflect the number of unique entities rather than the total number of entities. For example, when calculating the number of daily active users (DAU) or unique visitors (UV), user IDs need to be deduplicated to ensure that each user or visitor is counted only once, even if they have multiple transactions or multiple visits.
[0121] Non-deduplication indicators do not need to remove duplicate data. They usually reflect the total number or cumulative value of an entity. For example, when calculating the total transaction amount or total page views (PV), even if the same user has multiple transactions or multiple visits, each transaction or visit will be counted in the total.
[0122] Deduplication metrics are important for understanding the user base and market coverage, while non-deduplication metrics help understand the overall scale of the business and user engagement. For example, in banking, if you want to analyze the transaction behavior of each customer, you tend to focus on deduplication metrics, such as the number of transactions per customer. If you want to calculate the total number of transactions for the bank, it doesn't matter how many different customers the transaction is completed by, so you tend to focus on non-deduplication metrics.
[0123] Reference Figure 8 For step S832, aggregating the dimensions of the granular objects associated with the queried indicator to obtain aggregated data includes the following steps:
[0124] Step S8321, querying the dimension path of the granular object associated with the indicator to be queried through the complete entity relationship model;
[0125] Step S8322, obtaining a dimension combination according to the dimension path verification;
[0126] Step S8323, perform aggregation according to the dimension combination to obtain aggregated data.
[0127] When the type of the indicator to be queried is a deduplication indicator, the class is aggregated based on the dimension selected by the user. The dimension path of the aggregate field corresponding to the granular object associated with the indicator to be queried is queried through the complete entity relationship model. Aggregation fields are data fields used for aggregation operations, such as SUM, COUNT, AVG, etc. These fields usually correspond to entity attributes in the ER model. The dimension path refers to the path from an entity to other entities through its attributes and relationships. These paths define the dimensions of data analysis. According to the dimension path verification, the dimension combination that can be fully aggregated is obtained. Full aggregation means summarizing all data without considering the subdivision of any dimension. Aggregate according to the dimension combination to obtain aggregated data. Generate the corresponding SQL statement based on the aggregated data and submit it to the unified query self-service analysis thread pool for aggregation type calculation query.
[0128] For example, in banking, if you want to analyze a customer's transaction behavior, you can query the customer's transaction record through the ER model based on the customer granularity object. In this model, the entities can be "customer" and "transaction", and the relationship is "customer-owner-transaction". The aggregation field can be the transaction amount, and the dimension path can be "customer ID-transaction date-transaction amount". Through this path, you can verify and determine the dimension combination that can be fully aggregated, such as aggregating by "customer ID" to obtain the total transaction amount of each customer.
[0129] For step S833, when the type of the indicator to be queried is a second type of indicator, aggregation is performed according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0130] When the type of the indicator to be queried is a non-deduplication indicator, aggregation is performed based on the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0131] For step S900, a corresponding query statement is generated according to the aggregated data, and the query statement is specifically a SQL statement.
[0132] For step S1000, the query statement is submitted to the unified query self-service analysis thread pool for aggregate type calculation query to obtain the query result.
[0133] By building a granular object model based on the association relationship between granular objects of different indicators; generating an object tree based on the granular object model; filling the granular entity relationship model based on the object tree; publishing indicators based on the complete entity relationship model; and determining the target granularity based on the indicator to be queried; aggregating the aggregated data based on the target granularity and the published indicators; querying based on the aggregated data; adopting multi-object granularity publishing and query engine strategies, according to the self-service analysis business scenarios and batch granularity indicator calculations, data rapid analysis and multi-object granularity dimension aggregated data output can be strategically performed, thereby quickly displaying the published data and analysis data required by users, efficiently comparing data, improving data analysis methods, improving data processing efficiency, reducing the use of platform published resources and query resources, and reducing concurrent behavior and computing resource waste.
[0134] The present application also provides an electronic device. Fig. 9 The electronic device includes a memory 902 and a processor 901. The memory 902 stores a computer program. When the processor 901 executes the computer program, the above-mentioned index publishing method and index query method are implemented. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0135] The processor 901 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; the memory 902 can be implemented in the form of a read-only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM), etc. The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 902, and the processor 901 is used to call and execute the training method and the speech recognition method of the speech recognition model of the embodiments of the present application.
[0136] The input / output interface 903 is used to realize information input and output; the communication interface 904 is used to realize communication interaction between this device and other devices, and communication can be realized through wired methods (such as USB, network cable, etc.) or wireless methods (such as mobile network, WI FI, Bluetooth, etc.); the bus 905 transmits information between the various components of the device (such as the processor 901, the memory 902, the input / output interface 903 and the communication interface 904); the processor 901, the memory 902, the input / output interface 903 and the communication interface 904 realize communication connection with each other within the device through the bus 905.
[0137] The electronic device executes the indicator publishing method to obtain the granular object of the indicator; constructs the granular object model of the indicator according to the association relationship between objects of different granularities; generates an object tree according to the granular object model; fills the granular entity relationship model according to the object tree to obtain a complete entity relationship model; and publishes the indicators and dimensions corresponding to each granular object according to the complete entity relationship model.
[0138] Acquiring the granular object of the indicator includes: in response to receiving a marking instruction from a user, marking the granular object on the fact table and / or dimension table of the indicator according to the marking instruction.
[0139] It can be understood that the user inputs a marking instruction through an input device, the system receives the user's marking instruction, and in response to receiving the user's marking instruction, marks the granular objects on the fact table and dimension table of the indicator according to the marking instruction; or, in response to receiving the user's marking instruction, marks the granular objects on the fact table or dimension table of the indicator according to the marking instruction.
[0140] Among them, the fact table is a table used to store data directly related to the business process, usually quantitative values, such as sales, quantity, etc. This data is used to support decision making and data analysis.
[0141] Dimension tables are tables used to store data that classifies and describes the data in the fact table. The data that classifies and describes the data in the fact table usually contains descriptive attributes; for example, dimension information such as time, location, product, and customer.
[0142] A granular object is a data entity at a specific granularity level. Specifically, the granular object is a customer granular object, that is, a granular object based on customers, which means that the level of detail in which the data entity is organized and analyzed is based on customers. For example, if the data is recorded for each transaction of each customer, then this is a fine-grained customer object.
[0143] When users mark relevant customer-granular objects on fact tables and dimension tables, they are actually telling the system which level of data detail users need to focus on. This will affect how data is aggregated, the results of analysis, and the ultimate business insights. For example, a retailer may want to analyze the purchasing behavior of different customer groups. It can mark customer-granular objects on the fact table containing sales data and the dimension table containing customer information so that the system can aggregate and analyze data according to the customer dimension.
[0144] By marking customer-granular objects, the most valuable data for users can be extracted from a large amount of data, thereby supporting more accurate indicator business decisions.
[0145] The granular object model of the indicator is constructed according to the association relationship between objects of different granularities, including: obtaining the association relationship between objects of different granularities; classifying granular objects with the same granularity according to the association relationship; associating the indicator with each type of granular object to construct a granular object model with the same granularity.
[0146] Exemplarily, the granular object is customer transaction data, and the association relationship between different customer transaction data is obtained. For example, customer transaction data A and customer transaction data B are different transactions of customer a, customer transaction data A and customer transaction data C are transaction data in days, and customer transaction data B is transaction data in weeks.
[0147] According to the association relationship, objects with the same granularity are classified; for example, customer transaction data A and customer transaction data C have the same granularity and are both transaction data in days, so customer transaction data A and customer transaction data C are classified into one category. Customer transaction data B is transaction data in weeks, so customer transaction data B is classified into another category.
[0148] Associate the indicators with the corresponding types of granular objects. For example, associate the indicators corresponding to the number of days with a type of granular objects with the granularity of the day, and associate the indicators corresponding to the number of weeks with a type of granular objects with the granularity of the week. According to the multi-object indicator model system of the indicator platform, build multiple batches of granular object models based on the association between the indicators and various types of granular objects. Group granular object models with the same granularity into one batch.
[0149] Generate an object tree based on the granular object model. The object tree is a hierarchical structure that shows the relationship between objects of different granularity. For example, in a bank, an object tree starts from the head office, then breaks down to branches, business departments, account managers, and finally to individual customers or corporate customers. Each node is an object, and they are connected to each other through hierarchical relationships.
[0150] The complete entity relationship model is obtained by filling the granular entity relationship model according to the object tree, including: determining entities according to the granular objects of the object tree; determining the relationships and relationship types between entities according to the hierarchy and connection relationships of the object tree; and obtaining the complete entity relationship model by filling the granular entity relationship model according to the entities, the relationships and relationship types between entities according to the preset entity constraints.
[0151] It is understood that the entity-relationship model is a conceptual data model that is used to describe entities and the relationships between them. This model is the basis of database design, especially in relational database management systems. The entity-relationship model usually includes the following three main components: entities, relationships, and attributes.
[0152] An entity is a distinguishable object in the real world, which can be a person, place, thing, or concept. In the entity-relationship model, entities are usually represented by rectangles.
[0153] Relationships describe the associations between entities. They can be one-to-one, one-to-many, or many-to-many. In entity-relationship models, relationships are usually represented by diamonds and are shown by lines connecting the entities. The lines can be labeled with the type and name of the relationship.
[0154] Attributes are properties or characteristics of entities. They are usually represented by ellipses and connected to entities. Attributes can be single-valued or multi-valued. Single-valued attributes correspond to only one value for each entity instance, while multi-valued attributes can correspond to multiple values.
[0155] In addition, the entity-relationship model also includes primary keys, foreign keys, cardinality, and participation. The primary key is used to uniquely identify the attribute or combination of attributes of each row in the entity table. The foreign key is an attribute used to establish a link between two entities. It is usually contained in the relationship table and is used to reference the primary key of another entity. Cardinality is used to describe the role of an entity in a relationship, for example, whether it is required (mandatory) or optional (optional). Participation is used to describe the degree of participation of an entity in a relationship, which can be full participation (every entity instance participates in the relationship) or partial participation (only some entity instances participate in the relationship).
[0156] First, you need to understand the structure and meaning of the object tree. Identify all entities in the object tree. Entities usually represent people, places, things, or concepts in a business process. For example, in banking, entities may include "customer", "account", "transaction", "branch", etc. Determine the attributes of each entity. Attributes are data items that describe the characteristics of an entity. For example, the attributes of the "customer" entity may include "customer ID", "name", "address", "phone number", etc. Determine the relationships between entities based on the hierarchy and connections in the object tree. Relationships can be one-to-one, one-to-many, or many-to-many. For example, there may be a one-to-many relationship between "customer" and "account" because a customer can have multiple accounts. Determine the type and nature of the relationship; for example, a relationship can be mandatory or optional, or deterministic or non-deterministic. Determine the key of each entity, that is, the attribute or combination of attributes used to uniquely identify an entity instance. For example, the key of the "account" entity may be "account ID". Determine the constraints of the entity, such as foreign key constraints, non-null constraints, unique constraints, etc. According to the preset entity constraints, the granular entity relationship model is filled according to the entities, the relationships between entities and the relationship types to obtain a complete entity relationship model to ensure the accuracy and completeness of the information.
[0157] In addition, the complete entity relationship model can be further optimized according to actual indicator requirements to improve its performance, readability and maintainability. For example, normalization can be used to reduce data redundancy and improve data consistency.
[0158] For example, if the object tree shows that the "Customer" entity is at the top level, with two child nodes "Account" and "Transaction", then in the complete entity-relationship model, create a "Customer" entity, which is connected to the "Account" entity through a one-to-many relationship, and the "Account" entity is also a one-to-many relationship with the "Transaction" entity. The attributes of each entity will be filled according to business rules, such as "Customer" has "Name" and "Address", "Account" has "Account Number" and "Balance", "Transaction" has "Transaction ID" and "Amount", etc.
[0159] Through the above filling process, the complete entity-relationship model can comprehensively reflect business entities and their relationships, providing a solid foundation for subsequent database design and data analysis.
[0160] According to the complete entity relationship model, the indicators and dimensions corresponding to each granularity object are published, and the indicators corresponding to the objects of the same granularity have the same granularity.
[0161] The indicator query method includes: obtaining the indicator to be queried; determining the target granularity according to the indicator to be queried; aggregating the target granularity and the published indicators to obtain aggregated data; generating a query statement according to the aggregated data; and querying according to the query statement to obtain a query result.
[0162] Among them, the published indicators are published according to the above indicator publishing method.
[0163] The user inputs the indicator to be queried through the input device, and the system receives the indicator to be queried.
[0164] Determine the target granularity based on the indicator to be queried. For example, if the indicator to be queried is "daily sales volume reaches requirement S", the target granularity is in days.
[0165] Aggregation is performed according to the target granularity and the published indicators to obtain aggregated data, including: determining a complete entity relationship model according to the target granularity and the published indicators; querying the associated foreign key between the indicator to be queried and the granular object according to the complete entity relationship model; when the associated foreign key meets the preset aggregation condition, data aggregation between the indicators is performed according to the indicator to be queried to obtain aggregated data.
[0166] The indicators corresponding to the indicators to be queried are found from the published indicators, and the corresponding complete entity relationship model is determined according to the target granularity and the indicators corresponding to the indicators to be queried.
[0167] According to the relationship between the index and the object in the complete entity relationship model, the query obtains the associated foreign key between the index to be queried and the granular object.
[0168] Aggregating data between indicators according to the indicator to be queried to obtain aggregated data includes: determining the type of the indicator to be queried; when the type of the indicator to be queried is a first-type indicator, aggregating according to the dimension of the granular object associated with the indicator to be queried to obtain aggregated data; when the type of the indicator to be queried is a second-type indicator, aggregating according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data. Determining the type of the indicator to be queried, the type of the indicator to be queried includes a first-type indicator and a second-type indicator, the first-type indicator is a deduplication indicator and the second-type indicator is a non-deduplication indicator.
[0169] Deduplication metrics are metrics that require the removal of duplicate data during the calculation process. These metrics usually reflect the number of unique entities rather than the total number of entities. For example, when calculating the number of daily active users (DAU) or unique visitors (UV), user IDs need to be deduplicated to ensure that each user or visitor is counted only once, even if they have multiple transactions or multiple visits.
[0170] Non-deduplication indicators do not need to remove duplicate data. They usually reflect the total number or cumulative value of an entity. For example, when calculating the total transaction amount or total page views (PV), even if the same user has multiple transactions or multiple visits, each transaction or visit will be counted in the total.
[0171] Deduplication metrics are important for understanding the user base and market coverage, while non-deduplication metrics help understand the overall scale of the business and user engagement. For example, in banking, if you want to analyze the transaction behavior of each customer, you tend to focus on deduplication metrics, such as the number of transactions per customer. If you want to calculate the total number of transactions for the bank, it doesn't matter how many different customers the transaction is completed by, so you tend to focus on non-deduplication metrics.
[0172] Aggregating according to the dimensions of the granular objects associated with the to-be-queried indicators to obtain aggregated data includes: querying the dimension path of the granular objects associated with the to-be-queried indicators through a complete entity relationship model; obtaining a dimension combination according to the dimension path verification; and aggregating according to the dimension combination to obtain aggregated data.
[0173] When the type of the indicator to be queried is a deduplication indicator, the class is aggregated based on the dimension selected by the user. The dimension path of the aggregate field corresponding to the granular object associated with the indicator to be queried is queried through the complete entity relationship model. Aggregation fields are data fields used for aggregation operations, such as SUM, COUNT, AVG, etc. These fields usually correspond to entity attributes in the ER model. The dimension path refers to the path from an entity to other entities through its attributes and relationships. These paths define the dimensions of data analysis. According to the dimension path verification, the dimension combination that can be fully aggregated is obtained. Full aggregation means summarizing all data without considering the subdivision of any dimension. Aggregate according to the dimension combination to obtain aggregated data. Generate the corresponding SQL statement based on the aggregated data and submit it to the unified query self-service analysis thread pool for aggregation type calculation query.
[0174] For example, in banking, if you want to analyze a customer's transaction behavior, you can query the customer's transaction record through the ER model based on the customer granularity object. In this model, the entities can be "customer" and "transaction", and the relationship is "customer-owner-transaction". The aggregation field can be the transaction amount, and the dimension path can be "customer ID-transaction date-transaction amount". Through this path, you can verify and determine the dimension combination that can be fully aggregated, such as aggregating by "customer ID" to obtain the total transaction amount of each customer.
[0175] When the type of the indicator to be queried is a second type of indicator, aggregation is performed according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0176] When the type of the indicator to be queried is a non-deduplication indicator, aggregation is performed based on the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
[0177] Generate a corresponding query statement based on the aggregated data, where the query statement is specifically an SQL statement.
[0178] Submit the query statement to the unified query self-service analysis thread pool for aggregate type calculation query to obtain the query result.
[0179] By building a granular object model based on the association relationship between granular objects of different indicators; generating an object tree based on the granular object model; filling the granular entity relationship model based on the object tree; publishing indicators based on the complete entity relationship model; and determining the target granularity based on the indicator to be queried; aggregating the aggregated data based on the target granularity and the published indicators; querying based on the aggregated data; adopting multi-object granularity publishing and query engine strategies, according to the self-service analysis business scenarios and batch granularity indicator calculations, data rapid analysis and multi-object granularity dimension aggregated data output can be strategically performed, thereby quickly displaying the published data and analysis data required by users, efficiently comparing data, improving data analysis methods, improving data processing efficiency, reducing the use of platform published resources and query resources, and reducing concurrent behavior and computing resource waste.
[0180] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned indicator publishing method and indicator query method are implemented.
[0181] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0183] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0184] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0185] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0186] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0187] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0188] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0189] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0190] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0191] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0192] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for publishing indicators, characterized in that: include: Get the granularity object of the indicator; Constructing a granular object model of indicators according to the association relationship between different granular objects; generating an object tree according to the granular object model; Obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity; According to the complete entity relationship model, the indicators and dimensions corresponding to each granularity object are published, and the indicators corresponding to the objects with the same granularity have the same granularity.
2. The indicator publishing method according to claim 1, characterized in that: The granularity object of the obtained indicator includes: In response to receiving a marking instruction from a user, granular objects are marked on a fact table and a dimension table of the indicator according to the marking instruction.
3. The indicator publishing method according to claim 1, characterized in that: The granular object model for constructing indicators according to the association relationship between different granular objects includes: Acquire association relationships between objects of different granularities; Classifying granular objects having the same granularity according to the association relationship; The indicators are associated with various types of granular objects to construct a granular object model with the same granularity.
4. The indicator publishing method according to claim 1, characterized in that: The step of obtaining a complete entity relationship model according to the entity relationship model of the object tree filling granularity includes: Determine an entity according to the granular object of the object tree; Determine the relationship and relationship type between entities according to the hierarchy and connection relationship of the object tree; According to the preset entity constraints, the entity relationship model of the granularity is filled according to the entities, the relationships between the entities and the relationship types to obtain a complete entity relationship model.
5. An indicator query method, characterized in that: include: Get the indicator to be queried; Determine the target granularity according to the indicator to be queried; Aggregate data according to the target granularity and the published indicators; generating a query statement according to the aggregated data; Perform a query according to the query statement to obtain a query result; The published indicator is published according to the indicator publishing method according to any one of claims 1 to 4.
6. The index query method according to claim 5, characterized in that: The aggregating according to the target granularity and the published indicators to obtain aggregated data includes: Determining a complete entity relationship model according to the target granularity and the published indicators; Query the associated foreign key between the to-be-queried index and the granular object according to the complete entity relationship model; When the associated foreign key meets the preset aggregation condition, data aggregation is performed between the indicators according to the indicator to be queried to obtain aggregated data.
7. The index query method according to claim 6, characterized in that: The step of aggregating data between indicators according to the indicator to be queried to obtain aggregated data includes: Determine the type of the indicator to be queried; When the type of the indicator to be queried is a first type indicator, aggregation is performed according to the dimension of the granular object associated with the indicator to be queried to obtain aggregated data; When the type of the indicator to be queried is a second type of indicator, aggregation is performed according to the associated primary key and associated foreign key between the indicator to be queried and the granular object to obtain aggregated data.
8. The index query method according to claim 7, characterized in that: The step of aggregating the dimensions of the granular objects associated with the to-be-queried indicator to obtain aggregated data includes: Querying the dimension path of the granular object associated with the to-be-queried indicator through a complete entity relationship model; Obtaining a dimension combination according to the dimension path verification; Aggregation is performed according to the dimension combination to obtain aggregated data.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the indicator publishing method described in any one of claims 1 to 4 and the indicator query method described in any one of claims 5 to 8 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the indicator publishing method described in any one of claims 1 to 4 and the indicator query method described in any one of claims 5 to 8 are implemented.