CN117807092A - Table processing method, apparatus, electronic device and storage medium - Google Patents

Table processing method, apparatus, electronic device and storage medium Download PDF

Info

Publication number
CN117807092A
CN117807092A CN202410145714.5A CN202410145714A CN117807092A CN 117807092 A CN117807092 A CN 117807092A CN 202410145714 A CN202410145714 A CN 202410145714A CN 117807092 A CN117807092 A CN 117807092A
Authority
CN
China
Prior art keywords
data table
data
target
dimension
tables
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410145714.5A
Other languages
Chinese (zh)
Inventor
桑文锋
曹犟
刘耀洲
付力力
杨岚钦
刘烨
冯敬舜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sensors Data Network Technology Beijing Co Ltd
Original Assignee
Sensors Data Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sensors Data Network Technology Beijing Co Ltd filed Critical Sensors Data Network Technology Beijing Co Ltd
Priority to CN202410145714.5A priority Critical patent/CN117807092A/en
Publication of CN117807092A publication Critical patent/CN117807092A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The application provides a table processing method, a table processing device, electronic equipment and a storage medium, wherein a data table set in a data source is obtained by screening according to a target dimension and index names under the target dimension; acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension; according to the first quantity and the second quantity, the first data table and/or the second data table are aggregated, and an association relation between the first data table and the second data table is established; inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name. The method and the device can realize flexible association of the tables and improve the processing efficiency of the tables.

Description

Table processing method, apparatus, electronic device and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a table processing method, apparatus, electronic device, and computer readable storage medium.
Background
In the existing table analysis, the design, modeling and storage of a data model are generally completed according to the data analysis requirement of a service, and then the data analysis in a specified dimension, a specified index or a specified mode can be performed by utilizing a customized data query statement or a customized developed billboard.
The prior table analysis is generally carried out by adopting a table fixed connection mode, so that the flexibility of table connection is poor, and the efficiency of subsequent table data processing is greatly influenced.
Disclosure of Invention
The embodiment of the application provides a table processing method, a table processing device, electronic equipment and a computer readable storage medium, and aims to realize flexible association of tables and improve table processing efficiency.
In a first aspect, embodiments of the present application provide a table processing method, including:
acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
According to the first quantity and the second quantity, the first data table and/or the second data table are aggregated, and an association relation between the first data table and the second data table is established;
inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name.
In a second aspect, embodiments of the present application provide a table processing apparatus, including:
the first acquisition module is used for acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
the second acquisition module is used for acquiring a first number of target fields in the first data table and a second number of target fields in the second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
the establishing module is used for aggregating the first data table and/or the second data table according to the first quantity and the second quantity, and establishing an association relationship between the first data table and the second data table;
And the query module is used for querying the first data table and the second data table according to the association relation and obtaining the index scale value corresponding to the target index name.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the table processing method described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the table processing method described above.
The beneficial effects of the embodiment of the application are that:
in this embodiment, the corresponding data model is not required to be built for the connection relationship between the tables, and the model parameters are adjusted to adapt to different table connection requirements, but the association relationship between the multiple data tables can be automatically determined directly according to the number of the shared data fields in the multiple data tables, so that more flexible table connection is realized, the complexity of data multidimensional analysis is reduced, the data analysis efficiency is further improved, and the user data multidimensional analysis requirements are met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a form management interface provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of multi-table associations provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of an index analysis interface provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a configuration interface provided in an embodiment of the present application;
FIG. 5 is a schematic flow chart provided in an embodiment of the present application;
fig. 6 is a schematic diagram of comparison between the association relationship and the connection relationship provided in the embodiment of the present application;
FIG. 7 is a schematic diagram of an index and dimension screening flow provided in an embodiment of the present application;
FIG. 8 is a schematic diagram of a table processing device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application. Furthermore, it should be understood that the detailed description is presented herein for purposes of illustration and explanation only and is not intended to limit the present application. In this application, unless otherwise indicated, terms of orientation such as "upper" and "lower" are used to generally refer to the upper and lower positions of the device in actual use or operation, and specifically the orientation of the drawing figures; while "inner" and "outer" are for the outline of the device. Meanwhile, in the description of the embodiments of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Data analysis may be understood as considering data in multiple dimensions simultaneously in data analysis, looking at the data from different angles, finding potential associations and trends in the data. The market environment is complicated, the enterprise is provided with multiple visual data analysis, the decision efficiency is hoped to be improved through multidimensional data analysis, and the decision cost is reduced. In addition, the multidimensional analysis is also very important for the effect of the fine operation, can help the enterprise to locate the problems existing in the product or the operation, decompose the problems from top to bottom, and obtain a conclusion, thereby providing data support for the fine operation of the enterprise.
The existing data multidimensional analysis mode generally comprises two steps: the first step: according to the data analysis requirement of the service, completing the design, modeling and storage of a data analysis model; and a second step of: and completing analysis of specified dimensions, specified indexes and specified modes by utilizing customized data query sentences or customized developed signboards in the data analysis model.
However, the conventional data multidimensional analysis method has at least the following problems:
1. the analysis threshold is high: the traditional data modeling tool is mainly designed for a database, has high technical threshold, generally needs special data development engineers, cannot be directly operated by service personnel, has long links and has high communication cost;
2. The analytical flexibility is low: designing a data model aiming at single analysis requirements, developing a customized analysis billboard, and after the development is completed, if the user changes the requirements, re-designing the model is needed, so that the data model is low in multiplexing degree, a large number of data models are repeatedly built and used, the efficiency is low, the multiplexing performance is poor, and cost and resource waste are caused;
3. data model restriction: connection (join) is a specific type of operation that combines two tables together based on a common column, but such a form-fixed connection limits the flexibility and integrity of the data, while different types of connections (e.g., inner, left, right, and full) may determine the data aggregation, which may result in the selection of an improper connection type in a specific case, affecting the accuracy of the final analysis result. When the connection operation is carried out, the data model is sometimes required to be adjusted or reconstructed to adapt to different connection requirements, so that the complexity of data management and maintenance is increased;
4. the development period is long: the method comprises the steps of providing a data model from user requirements to design, modeling and scheduling storage of the data model, and finally completing data analysis, wherein the period of obtaining effective information by service personnel is long, analysis requirements cannot be responded in time, and service loss is possibly caused;
5. The data is difficult to open and trace back: the data source lacks visual link tracking capability, and the abnormal problem of index data is solved by turning the codes to see the data source, so that the path is long and the time is long.
Therefore, in order to solve the above-mentioned problems, the present embodiment proposes a form processing method, apparatus, electronic device, and computer readable storage medium, which aims to provide functions of easy and flexible index construction and management, dimension definition management, relationship modeling, etc., and on the basis thereof, provide multidimensional analysis capability, simplify index definition to data calculation flow, change business usage pattern, reduce development cost, and better satisfy multidimensional analysis requirements of enterprises.
Specifically, the form processing method in this embodiment may be applied to an electronic device, where the electronic device may be a terminal device such as a mobile phone, a tablet, or a computer, where the terminal device may store a form processing program, and when the form processing program is started, an interactive form management interface shown in fig. 1 may be displayed, and various functional controls, for example, an "index platform" control, an "analysis" control, and the like are integrated in the form management interface.
On the basis, the user can operate the functional control, click the corresponding control and trigger the corresponding operation.
For example, the terminal device may respond to the above operation to display a corresponding interactive interface, for example, as shown in fig. 1, if the user clicks on the "index platform" control, the terminal device may display a corresponding interface, where the interface may include a plurality of controls for table data analysis, for example, "index management," "dimension management," "relationship management," and "table application management," and the user clicks on the corresponding controls, and the terminal device may display a corresponding functional interface, so that the user may implement operations such as index screening, dimension screening, and table relationship screening through the corresponding functional interface.
For example, index management: the method has the advantages that a user is supported to conveniently generate a service index in a visual operation mode, the user can define a service index system on the interface, maintain a data caliber, run through business analysis through the uniqueness of a caliber name, and provide analyzed metadata for a subsequent business analysis model;
dimension management: the method and the system support the user to conveniently generate the dimension through a visual operation mode, penetrate through the whole business analysis through the uniqueness of the dimension name, meet the data security requirement under a multi-level architecture through a flexible authorization mode, and provide analyzed metadata for a subsequent business analysis model.
Relationship management: through the function, the user establishes the association relationship between the data table and the data table in a click interaction mode, and the dimension associated with the index can be flexibly taken and expanded in the subsequent operation analysis, so that the analysis process is more flexible and powerful.
The association relationship is a flexible connection line created between logic tables in a data source, describing how two tables are associated with each other based on a common field, but not combining the tables together, after the association between a plurality of tables is established, a user can introduce dimensions from the plurality of tables to analyze together with the index in index analysis, and it is worth noting that, unlike the prior art in which a plurality of tables are directly combined together, the embodiment can realize a more flexible and adjustable table association mode.
For example, as shown in fig. 2, when analyzing data of an Event table (Event), dimensions in a Product table, a Seller (Seller), and a User (User) table may be respectively introduced through 3 association relations, and further an order Event may be analyzed according to a "country of the Seller", an order Event may be analyzed according to a price of the Product, or an Event may be analyzed according to a country of the User.
On this basis, as shown in fig. 3, the index analysis interface can be added by the user, such as dimension, index, user grouping, global screening, time range, etc., in fig. 3, a "advanced analysis condition configuration" control is also included, the user can click on the control, the advanced condition analysis configuration interface shown in fig. 4 is displayed, and in the advanced condition analysis configuration interface, the user can select the main time field.
On this basis, the table processing method in this embodiment, as shown in fig. 5, specifically may include the following steps:
s10, acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
in this embodiment, according to the above description, the user may add dimensions, indexes, and main time fields in the interfaces shown in fig. 3 and 4, and trigger the corresponding table processing operation. The terminal equipment can respond to the table processing operation, screen candidate tables in the data sources according to the target index names and the target dimensions selected by the user and by combining the main time fields, and obtain a data table set, wherein the candidate tables can be all tables in the data sources in the platform, and the data table set comprises a plurality of data tables.
It is understood that an index is typically a specific numerical value or measurement, while a dimension is a descriptive attribute or aspect.
For the main time field in this embodiment, in the index analysis, the system defaults to select a field with the first column data type of Datetime (date and time) in each data table as the main time field (according to analysis habit, the most commonly used time field can be placed in the first column of the data table), and when analysis is supported, the main time field of each data table is switched.
It will be appreciated that, according to the above description, the table analysis may involve an event table, a commodity table, a vendor table, a user table, etc., and the indexes created based on the behavior analysis model and/or the event table may only be based on the "event occurrence time" as the main time field, and not support the handover, otherwise may cause the system performance problem, where the behavior analysis model is actually a model built in advance for creating according to the event indexes, such as the commodity purchase event.
For example, GMV (total transaction) and daily activity are analyzed simultaneously, wherein GMV comes from an order service table, daily activity comes from event analysis, time range selection 2023-04-06, time screening can be simultaneously applied to the order service table and event table, wherein the main time field of the order service table supports switching, GMV with "order time" 2023-04-06 can be browsed, and switching to "payment time" or "order completion time" can be performed, and the main time field of the event table does not support switching.
S20, acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
in this embodiment, after the user selects the target index name, the target dimension, and the main event field by using the interface shown in fig. 3, the terminal device may screen according to the target index name, the target dimension, and the main time field to obtain at least two data tables such as a first data table and a second data table with a shared dimension, where it can be understood that the shared dimension may be understood that the first data table and the second data table both have the dimension, such as a user ID.
In this way, in this embodiment, multiple data tables Table a, table B, table C, etc. may be screened, where the dimensions and/or indexes of the multiple data tables are different.
It should be noted that, in this embodiment, there is a radix correspondence between data tables, and the radix correspondence may be understood as a number correspondence between the same target fields in the data tables, for example, for the field "user ID" in the order Table a: 1042", this field" user ID:1042 "is unique in the order Table a, however, there are a plurality of" user IDs "in Table B: 1042", the radix correspondence of the target field in the first data table and the second data table may be one-to-many relationship 1: m. In addition, the radix correspondence in the present embodiment may further include a one-to-one relationship 1: the relation M is 1 or the relation M is many to many, and the description is omitted.
Therefore, the embodiment may first obtain the same target fields in the first data table and the second data table, and count the first number of the target fields in the first data table and the second number of the target fields in the second data table, where the ratio between the first number and the second number characterizes the radix correspondence.
S30, aggregating the first data table and/or the second data table according to the first quantity and the second quantity, and establishing an association relationship between the first data table and the second data table;
in this embodiment, after acquiring the plurality of data tables, the terminal device may aggregate the first data table and/or the second data table according to the radix correspondence relationship between the plurality of data tables, that is, the first number and the second number. It will be appreciated that, according to the above description, the radix correspondence in this embodiment may include one-to-many relationship 1:M, one-to-one relationship 1:1 or many-to-many relationship m:m, so that it is necessary to aggregate and re-associate a plurality of data tables first.
For example, if the number correspondence between the first data table and the second data table may be the one-to-many relationship 1:M, the first data table is first aggregated, and then the second data table and the aggregated first data table are associated; if the number correspondence between the first data table and the second data table may be the many-to-many relationship 1:M, the first data table and the second data table are first aggregated, and then the aggregated first data table and the aggregated second data table are associated.
It should be noted that, the association relationship in this embodiment is completely different from the connection "Join" in the prior art, as shown in fig. 6, there is a significant difference between the Join and the association relationship in this embodiment in the operation level, the output and the connection direction, and the operation level of the Join is only a row level, whereas the association level in this embodiment is an aggregation level; the Join's output is a logical table (middle table) formed, but the relationship output in this embodiment is a logical rule how to dynamically combine multiple tables in custom analysis; the form connection mode of Join is fixed, and in this embodiment, the form connection mode can be dynamically confirmed according to the combination of dimension heel. On this basis, in this embodiment, after acquiring multiple data tables, the terminal device may establish an association relationship between the multiple data tables, for example, an inner-outer connection relationship inner and an outer connection relationship outer, where the outer connection relationship may include a left connection, a right connection, a full connection, and so on.
It will be appreciated that existing relationships between tables may be defined when creating a table relationship data model, each relationship may have a different connection type, such as an inner connection, left connection, right connection, full connection, etc., for determining how to match records in two tables and how to aggregate metrics in the result dataset. In this embodiment, the association relationship between the multiple data tables may be automatically determined according to the number of the target fields in the multiple data tables by means of context connection, where the association means that a single relationship that can support all connection types at the same time may be created without creating a separate relationship for each connection type.
For example, assuming a Table a containing client information and a Table B containing sales data, if a relationship between the two tables is created according to the index "client ID" and sales amount and product dimension are selected, it can be determined that an interconnection is appropriate by the above-described context connection, and only records having matching records in both tables are displayed; if the customer name dimension is selected, the context connection may determine that a left connection is appropriate, displaying all customer records even though there are no matching records in sales data Table Table B. In general, contextual connections provide a more flexible and efficient way to manage relationships in a relational data model, making it easier for users to analyze and understand data.
S40, inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name.
After determining the association relationship between the multiple data tables, the terminal device may associate the multiple data tables according to the association relationship, and according to the target index name, aggregate the associated first data table and second data table, and query the index scale value corresponding to the target index name in the associated first data table and second data table.
Moreover, the aggregation in this embodiment is automatic aggregation, that is, the terminal device may automatically aggregate the index metrics with the detail granularity of the data, so that when creating a relational data model containing a plurality of tables, it is ensured that the index metrics are aggregated at a meaningful level of detail.
For example, if there is a table containing sales data including a column of transaction date, product and sales amount, the terminal device may aggregate according to sales amount of each product per month when grouping data by product and month, which means that the user can see the total sales amount of each product per month without losing any level of detail.
In the prior art, when connection Join is used, the detail level of the post-connection form is actually adopted. This may lead to incorrect polymerization, especially when the polymerization is not simultaneous with many recorded metrics. Thus, in general, the present embodiment can maintain accurate aggregation from a data model of combined data in a plurality of tables through intelligent aggregation, so that a user can analyze and understand the data more easily.
Therefore, in this embodiment, a plurality of data models are not required to be built for different connection relations between the tables to connect the data together, but the association relation between the tables can be automatically determined according to the index selected by the user, the dimension and other parameters, and the plurality of tables are logically associated according to the association relation, so that the business use pattern is changed, and the multidimensional analysis requirement of the user is satisfied.
Therefore, in this embodiment, it is not necessary to construct a corresponding data model for the connection relationship between tables, and adjust the model parameters to adapt to different table connection requirements, but the association relationship between multiple data tables can be automatically determined directly according to the number of the shared data fields in multiple data tables, so that more flexible table connection is realized, the complexity of multidimensional data analysis is reduced, the efficiency of data analysis is further improved, and the multidimensional data analysis requirements of users are satisfied.
In an embodiment, in the above S30, "aggregating the first data table and/or the second data table according to the first number and the second number" may include:
s301, if the first number is at least two, aggregating the first number of target fields in the first data table to obtain an updated first data table with a first number of one; and/or the number of the groups of groups,
s302, if the second number is at least two, aggregating the target fields of the second number in the second data table to obtain an updated second data table with the second number of one;
s303, obtaining a common field between a first data table and the second data table;
S304, setting the association relation between the first data table and the second data table as an external connection relation according to the public field.
On this basis, after the terminal device obtains the plurality of data tables, the terminal device may obtain the number of the same target fields in each data table, and further may determine the radix correspondence between the plurality of data tables according to the number (i.e., the first number and the second number in the embodiment). According to the above description, the number correspondence between the same dimensions (or indexes) in the data table includes one-to-many relationship 1:M, one-to-one relationship 1:1 and many-to-many relationship M:M. Further, the association relationship between the plurality of data tables may be determined based on the above-determined radix correspondence.
Therefore, in this embodiment, the terminal device may establish the association relationship between the first data table and the second data table according to the first number of the target fields in the first data table and the second number of the target fields in the second data table.
Specifically, for example, if the terminal device detects that any one of the first number and the second number is plural, that is, the radix correspondence between the two tables may be a one-to-many relationship 1: and M, at this time, the terminal equipment can set a data table with a plurality of target fields as a reference table and set another data table as a primary key table, and further, can aggregate a plurality of rows of data corresponding to the target fields in the reference table, and set the association relationship between the primary key table and the aggregated reference table as an external connection relationship according to the common field between the two tables.
It may be understood that, in order to ensure that the index measurement value corresponding to the target index name can be all statistically measured, in this embodiment, the association relationship between the primary key table and the aggregated reference table may be set to be an external connection relationship (such as a left connection, a right connection, or a full connection, etc.), and if the index measurement calculation is not required, an internal connection manner may also be adopted according to the requirement.
According to the above description, the radix correspondence between two tables is in addition to the one-to-many relationship 1: m, the radix correspondence in this embodiment may further include a one-to-one relationship 1:1 or a many-to-many relationship M: M.
On this basis, if the terminal device detects that the first number and the second number are both single, that is, the radix correspondence between the two tables may be a one-to-many relationship 1:1, directly establishing the association relationship between the first data table and the first data table to be set as an external connection relationship; if it is detected that the number of the first and second numbers is multiple, that is, the radix correspondence between the two tables may be a one-to-many relationship M: M, according to the foregoing description, the rows of data corresponding to the target fields in the first data table and the second data table may be first aggregated respectively, and the association relationship between the aggregated first data table and the aggregated second data table is established as an external connection relationship, which is not described herein again.
After establishing the association relationship between the first data table and the second data table according to the first number and the second number, S40 may further include:
s50, receiving a query request, querying the data source, and acquiring a target data table set corresponding to a query dimension and a query index name in the query request;
s60, if the target data table set has the data table combination with the association relation, determining whether the common data table exists in each data table combination;
s70, splicing the association relation corresponding table relation chain of the target data combination with the public data table to obtain a target table relation chain;
s80, inquiring each data table in the target table relation chain, and acquiring the index scale value corresponding to the inquired index name.
It is noted that, in this embodiment, when the association relationship between the data tables is constructed to perform data analysis, cross-table analysis, splicing and/or switching of the association relationship, and the like may be supported.
For example, the dimensions and indexes created based on the same data table can be analyzed together, after the association relation is established, the cross-table use of index dimensions can be realized, for example, basic information such as class, id and the like of each commodity is stored in a commodity basic information table, commodity id contained in each ordering event is recorded in an event table, and the relationship of taking the commodity information table as a main key table and taking the event table as a reference table can be established, so that the analysis can use commodity class as dimensions to analyze the index measurement such as the purchased times, the money and the like of different classes.
For example, according to the above embodiment, the association relationship between two data tables may be constructed, and during analysis, the association relationship may be spliced to a maximum of 4 degrees for use, that is, table a-Table B </Table C </Table D </Table E), and the dimension and the index are located in the data tables and span up to 4 degrees, for example, in the relationship management, there are two association relationship provider Table-commodity Table and commodity Table-event Table, and during analysis, the relationship splicing may be provider Table-commodity Table-event Table, so that the dimension in the provider Table may be used for analyzing the index in the event Table.
For another example, the relationship between the dimension and the data table of the index is flexibly switched in the analysis, and the calculation is performed according to the selected relationship when the query is initiated, for example, two fields of a 'spelling initiator' and a 'participant' exist in the spelling order table; the user information of the initiator and the participant are stored in the user information table, so that two relations can be established between the group order table and the user information table: one takes the 'spelling initiator' as an external key, and one takes the 'participant' as an external key, so that indexes such as order amount and the like can be checked according to the member level of the spelling initiator (the relation taking the 'spelling initiator' as the external key) or the member level of the participant (the relation taking the 'spelling participant' as the external key) during analysis.
According to the above description, the present embodiment may construct a plurality of pairs of data tables having association relationships in the form of "primary key Table-reference Table", and further may obtain Table relationship chains corresponding to the plurality of pairs of data tables, such as Table a-Table B, table B-Table C, table C-Table D, and the like, where each Table relationship chain includes a pair of primary key Table and a corresponding reference Table, and an association relationship between the primary key Table and the reference Table.
On the basis, the terminal equipment can receive a table query request triggered by a user, acquire a query dimension and a query index name corresponding to the index query request, and further acquire a target data table set corresponding to the query dimension and the query index name according to the query dimension and the query index name.
Furthermore, the terminal device may determine that a data table combination having an association relationship exists in the target data table set, if the data table combination having an association relationship exists in the target data table set, it may determine whether a common data table exists in each data table combination, and splice the association relationship correspondence relationship links of the target data combination of the common data table to obtain a target table relationship link, for example, splice the two table relationship link provider table-commodity table and the commodity table-event table according to the commodity table (i.e. the common table in the embodiment), so as to obtain a target table relationship link "provider table-commodity table-event table", and it may be seen that the target relationship link includes the common table and other data tables associated with the common table, so that dimensions in the provider table may be used to analyze the indexes in the event table, and then the terminal device may query each data table in the target table relationship link, so as to obtain the index scale value corresponding to the query index name.
On the basis, the embodiment can also support the flexible switching of the relation between the dimension and the data table of the index during analysis, the calculation can be performed according to the selected relation when the query is initiated, and the shorter association relation newly created between the two tables is selected by default in the embodiment.
For example, if the query dimension and the query index name are respectively from Table a and Table C, three related relationships are currently created in the relationship management: relationship 1: table a-Table B, relationship 2: table B-Table C, relationship 3: table A-Table C, at this time, there are two available relationships between Table A and Table C: table A-Table C and the relation spliced by the relation 1 and the relation 2 are as follows: table A-Table B-Table C.
The terminal equipment defaults to select the Table A-Table C as a preset default Table relation chain, and can be switched into the Table A-Table B-Table C when receiving the association relation switching request.
After establishing the association relationship between the first data table and the second data table according to the first number and the second number, S40 may further include:
s90, responding to the association relation management operation, and acquiring a target data table with the table creation time exceeding a preset duration threshold;
S100, obtaining a table relation chain containing the target data table, and obtaining the number of data tables associated with the target data table in the table relation chain;
s110, if the number is a plurality of data tables, canceling the association relationship between the target data table and the corresponding plurality of data tables, and establishing a new association relationship between the plurality of data tables;
and S120, if the number is single, canceling the association relationship between the target data table and the associated single data table.
It should be noted that, in this embodiment, the terminal device may establish a plurality of association relationships, for example, table B-Table C, table a-Table B-Table C, and the like, on the basis of which, the user may manage the association relationships between the created tables, and the terminal device may respond to the association relationship management operation to obtain the target data Table B in which the Table creation time exceeds the preset duration threshold, and further, may obtain the number of data tables associated with the target data Table in the Table relationship chain.
If the number is multiple, for example, in the Table relation chain capable A-Table B-Table C, the data Table associated with Table B contains Table A and Table C, then the association relation between the target data Table Table B and the corresponding multiple data tables can be canceled, and a new association relation between the multiple data tables, for example, table A-Table C, can be established;
If the number is single, for example, in the Table relationship chain Table B-Table C, the Table B associated data Table is Table C, then the association relationship between the target data Table and the associated single data Table may be directly canceled.
By the method, the user can manage the expired data table and the association relation of the data table.
In the above S40, the "query the first data table and the second data table according to the association relationship to obtain the index measurement value corresponding to the target index name" may include:
s401, connecting the first data table with a second data table according to the association relation and the aggregation dimension;
s402, according to the target index name, inquiring the first data table and the second data table after connection to obtain an index scale value corresponding to the target index name.
In this embodiment, after determining the association relationship between the multiple data tables, the terminal device may associate the first data table with the second data table according to the association relationship and the aggregation dimension, and further may query the index metric value corresponding to the target index name in the associated first data table and second data table by aggregating the associated first data table and second data table, so as to implement flexible multidimensional analysis in index analysis.
Before "obtaining the data table set in the data source" in S10 above, the method may further include:
s130, acquiring configured reference quantity and a main time field;
s140, screening out a target index name or a target dimension from the global reference according to the reference and the main time field;
if the target index name is selected from the global reference quantity, the reference quantity is a target dimension; and if the target dimension is selected from the global reference quantity, the reference quantity is a target index name.
In this embodiment, as shown in fig. 3, the user is supported to complete analysis by clicking dimensions, indexes and screening conditions, so that service personnel can easily get on hand, and association relations between data tables, main time fields of the data tables and the like can be flexibly switched in the analysis process.
As shown in fig. 7, in the custom analysis, the dimension selection is first performed according to the analysis habit, or the index selection is first performed and then the dimension selection is performed.
On the basis, the terminal equipment can configure the main time field and the reference quantity by a user, and further, the target index name or the target dimension can be screened from the global reference quantity according to the reference quantity and the main time field.
It will be appreciated that the index and dimension may constrain the selectable range to each other, e.g., where the user does not select a dimension, the index may be selected to be all; when the user does not select the index, the dimensions are all selectable; when a dimension/index is selected, the other selectable range is affected. In addition, as shown in fig. 7, user grouping, global filtering, and time span are affected by the metrics.
Therefore, in this embodiment, when the target index name is screened from the global reference, the reference is the target dimension, and when the target dimension is screened from the global reference, the reference is the target index name, and finally, based on index management, dimension management and association relation, flexible multidimensional analysis, especially main time field switching, relation splicing and switching and the like, are realized in index analysis, more flexible form connection is realized, the complexity of data multidimensional analysis is reduced, the data analysis efficiency is further improved, and the user data multidimensional analysis requirements are met.
The present embodiment also provides a table processing apparatus, which may be specifically integrated in a terminal device, for example, as shown in fig. 8, and may include:
A first obtaining module 1001, configured to obtain a data table set in a data source, where the data table set is obtained by screening according to a target dimension and an index name in the target dimension;
a second obtaining module 1002, configured to obtain a first number of target fields in the first data table, and a second number of target fields in the second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
an establishing module 1003, configured to aggregate the first data table and/or the second data table according to the first number and the second number, and establish an association relationship between the first data table and the second data table;
and a query module 1004, configured to query the first data table and the second data table according to the association relationship, and obtain a finger scale value corresponding to the target index name.
Optionally, the establishing module 1003 includes:
a first aggregation unit, configured to aggregate a first number of target fields in the first data table if the first number is at least two, to obtain a first updated data table with a first number of one;
And the second aggregation unit is used for aggregating the target fields of the second number in the second data table if the second number is at least two, so as to obtain a second updated data table with the second number of one.
Optionally, the establishing module 1003 includes:
an acquisition unit configured to acquire a common field between a first data table and the second data table;
and the setting unit is used for setting the association relation between the first data table and the second data table as an external connection relation according to the public field.
Alternatively, the table processing apparatus in the present application may include:
the third acquisition module is used for receiving a query request, querying the data source and acquiring a target data table set corresponding to the query dimension and the query index name in the query request;
a fourth obtaining module, configured to determine whether a common data table exists in each data table combination if a data table combination with an association relationship exists in the target data table set;
the splicing module is used for splicing the association relation corresponding table relation chain of the target data combination with the public data table to obtain a target table relation chain;
and the query module is used for querying each data table in the target table relation chain and acquiring the index scale value corresponding to the query index name.
Alternatively, the table processing apparatus in the present application may include:
the fifth acquisition module is used for responding to the association relation management operation and acquiring a target data table of which the table creation time exceeds a preset duration threshold value;
a sixth obtaining module, configured to obtain a table relation chain that includes the target data table, and obtain a number of data tables associated with the target data table in the table relation chain;
the second establishing module is used for canceling the association relation between the target data table and the corresponding multiple data tables and establishing a new association relation between the multiple data tables if the number is multiple;
and the cancellation module is used for canceling the association relationship between the target data table and the associated single data table if the number is single.
Optionally, the query module 1004 includes:
the connection unit is used for connecting the first data table and the second data table according to the association relation and the aggregation dimension;
and the query unit is used for querying the first data table and the second data table which are connected according to the target index name to obtain an index scale value corresponding to the target index name.
Alternatively, the table processing apparatus in the present application may include:
The first acquisition module is used for acquiring the configured reference quantity and the main time field;
screening a target index name or a target dimension from the global reference according to the reference and the main time field;
if the target index name is selected from the global reference quantity, the reference quantity is a target dimension; and if the target dimension is selected from the global reference quantity, the reference quantity is a target index name.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Correspondingly, the embodiment of the application also provides electronic equipment, which can be a terminal, and the terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer, a touch screen, a game machine, a personal computer (PC, personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and the like. Alternatively, the electronic device may be a server.
As shown in fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 1100 includes a processor 1101 having one or more processing cores, a memory 1102 having one or more computer-readable storage media, and a computer program stored on the memory 1102 and executable on the processor. The processor 1101 is electrically connected to the memory 1102. It will be appreciated by those skilled in the art that the electronic device structure shown in the figures is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 1101 is a control center of the electronic device 1100, connects various parts of the entire electronic device 1100 using various interfaces and lines, and performs various functions of the electronic device 1100 and processes data by running or loading software programs and/or units stored in the memory 1102, and invoking data stored in the memory 1102, thereby overall monitoring the electronic device 1100. The processor 1101 may be a processor CPU, a graphics processor GPU, a network processor (Network Processor, NP), etc., that may implement or perform the methods, steps and logic blocks disclosed in embodiments of the present application.
In the embodiment of the present application, the processor 1101 in the electronic device 1100 loads instructions corresponding to the processes of one or more application programs into the memory 1102 according to the following steps, and the processor 1101 executes the application programs stored in the memory 1102, so as to implement various functions, for example:
acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
According to the first quantity and the second quantity, the first data table and/or the second data table are aggregated, and an association relation between the first data table and the second data table is established;
inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 9, the electronic device 1100 further includes: a touch display 1103, a radio frequency circuit 1104, an audio circuit 1105, an input unit 1106, and a power supply 1107. The processor 1101 is electrically connected to the touch display 1103, the radio frequency circuit 1104, the audio circuit 1105, the input unit 1106, and the power supply 1107, respectively. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 9 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The touch display 1103 may be used to display a graphical user interface and receive an operation instruction generated by a user acting on the graphical user interface. The touch display 1103 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection system and a touch controller. The touch detection system detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection system, converts it into touch point coordinates, and sends the touch point coordinates to the processor 1101, and can receive and execute commands sent from the processor 1101. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 1101 to determine the type of touch event, and the processor 1101 then provides a corresponding visual output on the display panel based on the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display 1103 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch screen 1103 may also implement an input function as part of the input unit 1106.
The rf circuit 1104 may be configured to receive and transmit rf signals to and from a network device or other electronic device via wireless communication to and from the network device or other electronic device.
The audio circuit 1105 may be used to provide an audio interface between the user and the electronic device through a speaker, microphone. The audio circuit 1105 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 1105 and converted into audio data, which are processed by the audio data output processor 1101, and transmitted to, for example, another electronic device via the radio frequency circuit 1104, or the audio data are output to the memory 1102 for further processing. The audio circuit 1105 may also include an ear bud jack to provide communication of the peripheral headphones with the electronic device.
The input unit 1106 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
A power supply 1107 is used to power the various components of the electronic device 1100. Alternatively, the power supply 1107 may be logically connected to the processor 1101 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system. The power supply 1107 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 9, the electronic device 1100 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, the embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform any of the table processing methods provided in the embodiments of the present application, the computer programs may perform the steps of the table processing method as follows:
Acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
according to the first quantity and the second quantity, the first data table and/or the second data table are aggregated, and an association relation between the first data table and the second data table is established;
inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the computer program stored in the computer readable storage medium can execute any of the table processing methods provided in the embodiments of the present application, the beneficial effects that any of the table processing methods provided in the embodiments of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
In the above table processing apparatus, computer readable storage medium, and electronic device, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process and the beneficial effects of the table processing apparatus, the computer readable storage medium, the computer program product, the electronic device and the corresponding units described above may refer to the description of the table processing method in the above embodiments, which is not repeated herein.
The foregoing has described in detail a method, a system, an electronic device, and a computer readable storage medium for processing a table provided in embodiments of the present application, where specific examples are applied to illustrate principles and implementations of the present application, and the description of the foregoing examples is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of table processing, comprising:
acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
acquiring a first number of target fields in a first data table of the data table set and a second number of target fields in a second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
according to the first quantity and the second quantity, the first data table and/or the second data table are aggregated, and an association relation between the first data table and the second data table is established;
inquiring the first data table and the second data table according to the association relation, and acquiring the index scale value corresponding to the target index name.
2. The table processing method according to claim 1, wherein the aggregating the first data table and/or the second data table according to the first number and the second number comprises:
If the first number is at least two, aggregating the first number of target fields in the first data table to obtain a first updated data table with a first number of one; and/or the number of the groups of groups,
and if the second number is at least two, aggregating the target fields of the second number in the second data table to obtain a second updated data table with the second number of one.
3. The table processing method according to claim 1, wherein the establishing an association relationship between the first data table and the second data table includes:
acquiring a common field between a first data table and the second data table;
and setting the association relation of the first data table and the second data table as an external connection relation according to the public field.
4. The table processing method according to claim 1, wherein after aggregating the first data table and/or the second data table according to the first number and the second number and establishing an association relationship between the first data table and the second data table, comprising:
receiving a query request, querying the data source, and acquiring a target data table set corresponding to a query dimension and a query index name in the query request;
If the data table combinations with the association relation exist in the target data table set, determining whether public data tables exist in the data table combinations or not;
splicing the association relation corresponding table relation chains of the target data combinations with the public data tables to obtain target table relation chains;
and inquiring each data table in the target table relation chain to obtain the index scale value corresponding to the inquired index name.
5. The table processing method according to claim 4, wherein after establishing the association relationship between the first data table and the second data table according to the first number and the second number, comprising:
responding to the association relation management operation, and acquiring a target data table of which the table creation time exceeds a preset duration threshold value;
obtaining a table relation chain containing the target data table, and obtaining the number of data tables associated with the target data table in the table relation chain;
if the number is a plurality of, canceling the association relationship between the target data table and the corresponding plurality of data tables, and establishing a new association relationship between the plurality of data tables;
and if the number is single, canceling the association relationship between the target data table and the associated single data table.
6. The table processing method according to claim 1, wherein the querying the first data table and the second data table according to the association relationship, and obtaining the index metric value corresponding to the target index name, includes:
according to the association relation and the aggregation dimension, the first data table and the second data table are connected;
and inquiring the first data table and the second data table after connection according to the target index name to obtain an index scale value corresponding to the target index name.
7. The table processing method according to any one of claims 1 to 6, wherein before the step of obtaining the data table set corresponding to the target dimension and the target index name in the data source, the method includes:
acquiring a configured reference quantity and a main time field;
screening a target index name or a target dimension from the global reference according to the reference and the main time field;
if the target index name is selected from the global reference quantity, the reference quantity is a target dimension; and if the target dimension is selected from the global reference quantity, the reference quantity is a target index name.
8. A meter processing device, comprising:
The first acquisition module is used for acquiring a data table set in a data source, wherein the data table set is obtained by screening according to a target dimension and an index name under the target dimension;
the second acquisition module is used for acquiring a first number of target fields in the first data table and a second number of target fields in the second data table; the first data table and the second data table are at least two different data tables with the same aggregation dimension in a data table set, and the target field is a data field shared by the first data table and the second data table in the aggregation dimension;
the establishing module is used for aggregating the first data table and/or the second data table according to the first quantity and the second quantity, and establishing an association relationship between the first data table and the second data table;
and the query module is used for querying the first data table and the second data table according to the association relation and obtaining the index scale value corresponding to the target index name.
9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that it comprises a computer program for causing an electronic device to perform the steps of the method according to any one of claims 1-7 when said computer program is run on the electronic device.
CN202410145714.5A 2024-02-01 2024-02-01 Table processing method, apparatus, electronic device and storage medium Pending CN117807092A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410145714.5A CN117807092A (en) 2024-02-01 2024-02-01 Table processing method, apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410145714.5A CN117807092A (en) 2024-02-01 2024-02-01 Table processing method, apparatus, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN117807092A true CN117807092A (en) 2024-04-02

Family

ID=90428418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410145714.5A Pending CN117807092A (en) 2024-02-01 2024-02-01 Table processing method, apparatus, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN117807092A (en)

Similar Documents

Publication Publication Date Title
CN108038112A (en) Document handling method, mobile terminal and computer-readable recording medium
CN112329184B (en) Network architecture configuration information generation method and device, storage medium and electronic equipment
CN107229392A (en) A kind of method for showing interface and system
US11860758B2 (en) System for adjusting application performance based on platform level benchmarking
CA3169413A1 (en) Report generating method, device, electronic equipment, and computer-readable medium
CN112350872A (en) Network architecture configuration information generation method and device, storage medium and electronic equipment
CN107506494B (en) Document handling method, mobile terminal and computer readable storage medium
CN112667612A (en) Data quality checking method and device, electronic equipment and storage medium
CN114840565A (en) Sampling query method, device, electronic equipment and computer readable storage medium
CN117056352A (en) Data display method, device, terminal equipment and readable storage medium
CN112102099B (en) Policy data processing method and device, electronic equipment and storage medium
CN114816389B (en) Management system building method, device, equipment and medium based on meta-model
CN117807092A (en) Table processing method, apparatus, electronic device and storage medium
CN115080412A (en) Software update quality evaluation method, device, equipment and computer storage medium
CN114996369A (en) Method and device for constructing data warehouse index library
CN114968960A (en) Log processing method and device, computer equipment and storage medium
CN109828983B (en) PG database processing method, device, electronic equipment and storage medium
CN114490859A (en) Data display method and device and electronic equipment
CN111242635A (en) After-sale data maintenance method and system
CN112333029A (en) Network architecture configuration information generation method and device, storage medium and electronic equipment
CN113779117A (en) Data monitoring method and device, storage medium and electronic equipment
CN112015912A (en) Intelligent index visualization method and device based on knowledge graph
CN107220053B (en) BIOS management method and electronic equipment
CN109561146A (en) Document down loading method, device, terminal device
CN110766526B (en) Application discovery and customization system and method for accessing application store of tablet computer

Legal Events

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