Data query method and device, medium, equipment and product
By filtering and using database tables with the smallest data processing volume for querying, the problem of how to improve data query efficiency is solved, and faster and more efficient data query is achieved.
Patent Information
- Application Number
- CN202510065911.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-11
AI Technical Summary
Faced with a large amount of data, how to improve the efficiency of data query is a problem that needs to be solved.
By obtaining query conditions, determining the appropriate database table, and filtering out the table with the smallest data processing volume for querying to improve query efficiency.
Querying in a database table with the smallest data processing volume can significantly improve the speed of data query, reduce delay, and improve query efficiency.
Smart Images

Figure CN119807240A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of database technology, and in particular, to a data query method, device, medium, equipment and product. Background Art
[0002] With the development of the Internet, the amount of data that needs to be processed on the Internet is increasing, and the scope and volume of data are also increasing. Database tables are the main structure for storing data in databases. Database tables are used to organize and store data. Database tables can be created in databases according to business needs to achieve data storage and query. Faced with a large amount of data, how to improve data query efficiency is a problem that needs to be solved. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a data query method, the method comprising: Obtain a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; According to the first query condition, a first database table is determined, the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item; If there are multiple first database tables, determining a first characteristic parameter corresponding to each first database table, where the first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table; Determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter characterized by the smallest data processing amount; Perform a data query in the second database table, and obtain the first data according to the query result.
[0005] In a second aspect, the present disclosure provides a data query device, the device comprising: A first acquisition module, used to acquire a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; A first determination module is used to determine a first database table according to the first query condition, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimensional item, and the second dimension item includes all sub-dimensional items in one first-level sub-dimensional item of the first dimension item; a second determining module, configured to determine a first characteristic parameter corresponding to each of the first database tables if there are multiple first database tables, wherein the first characteristic parameter is used to characterize a data processing amount required to obtain the first data according to the first database table; A third determination module is used to determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter that represents the smallest amount of data processing; A query module is used to perform data query in the second database table and obtain the first data according to the query result.
[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data query method provided in the first aspect of the present disclosure.
[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the data query method provided in the first aspect of the present disclosure.
[0008] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the data query method provided in the first aspect of the present disclosure.
[0009] Through the above technical solution, the first query condition is used to indicate the query of the first data, and the first data is the data of the first indicator corresponding to the first dimension item. According to the first query condition, the first database table is determined, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, that is, the database table that can query the first data is screened out. If there are multiple first database tables, in order to improve the efficiency of data query, the first database table with the smallest data processing volume can be used as the second database table. In this way, data query in the second database table can minimize the data processing volume during query, so that query results can be obtained more quickly, reduce the delay during data query, and improve query efficiency.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 The figure is a flow chart of a data query method according to an exemplary embodiment.
[0012] Figure 2 The figure is a flow chart of a data query method according to an exemplary embodiment.
[0013] Figure 3 It is a block diagram of a data query device according to an exemplary embodiment.
[0014] Figure 4 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0019] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0021] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0022] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0023] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0024] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0025] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0026] Figure 1 is a flow chart of a data query method according to an exemplary embodiment. The method can be applied to an electronic device with processing capabilities, such as a server, Figure 1 As shown, the method may include steps 11 to 15.
[0027] In step 11, a first query condition is obtained.
[0028] The first query condition is used to indicate querying the first data, and the first data is data of the first indicator corresponding to the first dimension item. For example, the user can input a query instruction to query the first data through the client, and after receiving the query instruction input by the user, the client can send a query request to the server, and the query request can include the first query condition for indicating querying the first data, and the server can obtain the first query condition.
[0029] For example, if the first query condition is used to query the short video playback volume in Zhejiang Province, the first dimension item is Zhejiang Province, and the first indicator is the short video playback volume. For example, if the first query condition is used to query the short video playback volume in Zhejiang Province on January 1, the first dimension item includes January 1 and Zhejiang Province, and the first indicator is the short video playback volume. The present disclosure does not limit the number of first dimension items and the number of first indicators.
[0030] In step 12, a first database table is determined according to a first query condition.
[0031] The first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item. The first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item.
[0032] In one implementation, the database table in the present disclosure may be a wide table, which refers to a database table that associates indicators, dimensions, and attributes related to a business subject.
[0033] By way of example, the first database table may include a first indicator corresponding to a first dimension item, that is, the first database table directly stores data of the first indicator corresponding to the first dimension item. Taking the first query condition used to indicate a query on the number of short video views in Zhejiang Province as an example, the first database table directly stores data on the number of short video views in Zhejiang Province.
[0034] For example, the first database table may include a second indicator corresponding to the first dimension item, wherein the data of the first indicator can be calculated based on the data of the second indicator. For example, the first database table may not directly store the data of the first indicator corresponding to the first dimension item, but stores the data of the second indicator corresponding to the first dimension item. Since the data of the first indicator can be calculated based on the data of the second indicator, the data of the first indicator corresponding to the first dimension item can be calculated based on the stored data of the second indicator corresponding to the first dimension item, that is, the first data can be calculated. For example, the first database table stores the data of the second indicator a corresponding to Zhejiang Province and the data of the second indicator b corresponding to Zhejiang Province. According to the data of the second indicator a and the data of the second indicator b, the number of short video plays can be calculated. For example, the calculation can be performed according to a pre-set query caliber, which is a calculation method for obtaining the data of the first indicator from the first database table according to the data of the second indicator. There is no limitation on the number of second indicators, which can be one or more. As an example, the query caliber may indicate that the weighted value of the data of the second indicator a and the data of the second indicator b is used as the data of the number of short video plays, or the product of the data of the second indicator a and the data of the second indicator b is used as the data of the number of short video plays.
[0035] For example, the first database table may include a first indicator corresponding to a second dimension item, wherein the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item. For example, the first dimension item Zhejiang Province may have multiple sub-dimension items, the first-level sub-dimension items may be divided according to cities, and the second-level sub-dimension items may be divided according to counties (districts). The second dimension item may include all sub-dimension items in the first-level sub-dimension item, that is, including all cities belonging to Zhejiang Province, and the second dimension item may also include all sub-dimension items in the second-level sub-dimension item, that is, including all counties (districts) belonging to Zhejiang Province. Among them, since the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item, the data of the first indicator corresponding to the first dimension item can be calculated according to the data of the first indicator corresponding to the second dimension item, that is, the first data can be calculated. For example, according to the short video playback volume of Hangzhou City, the short video playback volume of Ningbo City, and the short video playback volume of other cities in Zhejiang Province, the short video playback volume of each city is accumulated, and the short video playback volume of Zhejiang Province can be calculated.
[0036] For example, the first database table may include a second indicator corresponding to the second dimension item. The second dimension item and the second indicator have been described above. The data of the first indicator can be calculated based on the data of the second indicator. For example, the data of the first indicator corresponding to the second dimension item can be calculated first based on the data of the second indicator corresponding to the second dimension item. Then the second dimension item includes all the sub-dimension items in the second-level sub-dimension item. Then, the data of the first indicator corresponding to each second dimension item is calculated based on the data of the first indicator corresponding to each second dimension item. As an example, the first database table stores the data of the second indicator a and the data of the second indicator b corresponding to Hangzhou. The data of the short video playback volume in Hangzhou can be calculated based on the data of the second indicator a and the data of the second indicator b corresponding to Hangzhou. The data of other cities are similar. In this way, the data of the short video playback volume corresponding to each city can be obtained by adding up the short video playback volume corresponding to each city.
[0037] In step 13, if there are multiple first database tables, a first characteristic parameter corresponding to each first database table is determined.
[0038] The first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table. Among them, the server may store metadata of each database table, and the metadata may include field information stored in the database table, which indicators of data can be calculated through the field information stored in the database table, etc. The server can determine the first characteristic parameter corresponding to the first database table based on the metadata of the first database table, that is, predict the amount of data processing required if data is queried from the first database table. In one example, the first characteristic parameter can be represented by a quantity, that is, the number of data required to be processed to obtain the first data according to the first database table. For example, if N data need to be accumulated to obtain the first data, the first characteristic parameter can be N. The first characteristic parameter can also be represented in other forms, such as representing the required data processing amount by a vector, and reflecting the size of the required data processing amount according to the size of the vector.
[0039] In step 14, a second database table is determined.
[0040] In step 15, data query is performed in the second database table, and first data is obtained according to the query result.
[0041] If there are multiple first database tables, the second database table is the first database table corresponding to the first characteristic parameter with the smallest data processing amount. In this way, the second database table with the smallest required data processing amount can be found from the first database table, and data query can be performed in the second database table, which can improve query efficiency.
[0042] For example, the first database table 1 includes a first indicator corresponding to the first dimension item, and the first database table 2 includes a second indicator corresponding to the first dimension item. The first data can be obtained directly from the first database table 1, and calculation is required to obtain the first data from the first database table 2. In this case, data query is performed in the first database table 1, and the required data processing amount is minimized. The first database table 1 can be used as the second database table.
[0043] In addition, if the number of the first database table is one, the first database table can be directly used as the second database table.
[0044] Through the above technical solution, the first query condition is used to indicate the query of the first data, and the first data is the data of the first indicator corresponding to the first dimension item. According to the first query condition, the first database table is determined, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, that is, the database table that can query the first data is screened out. If there are multiple first database tables, in order to improve the efficiency of data query, the first database table with the smallest data processing volume can be used as the second database table. In this way, data query in the second database table can minimize the data processing volume during query, so that query results can be obtained more quickly, reduce the delay during data query, and improve query efficiency.
[0045] The data query method provided by the present disclosure may also include: If the first database table does not exist and the first indicator can be split, the first indicator is split into multiple third indicators.
[0046] For example, if the first database table does not exist, it can be further determined whether the first indicator is a composite indicator, wherein a composite indicator refers to an indicator obtained by mathematical operation of at least two basic indicators, such as average playback volume per capita and average click-through rate per capita. If the first indicator is a composite indicator, the first indicator can be split. For example, the server can determine whether the first indicator is a composite indicator based on keywords, or, if it is determined that the first indicator is in a pre-established composite indicator list, it can be determined that the first indicator is a composite indicator. If the first indicator can be split, the first indicator can be split into multiple third indicators. Taking the first indicator being the average playback volume of short videos as an example, the first indicator can be split into two third indicators: the number of short video users and the number of short video playbacks.
[0047] The first data can be calculated based on the second data, and the second data is the data of the third indicator corresponding to the first dimension item. Taking the first data of the average number of short video plays per capita in Zhejiang Province as an example, the second data includes the number of short video users in Zhejiang Province and the number of short video plays in Zhejiang Province. The first data can be obtained by dividing the number of short video plays in Zhejiang Province by the number of short video users in Zhejiang Province.
[0048] For each third indicator, a third database table corresponding to the third indicator is determined.
[0049] Among them, the third database table includes the third indicator or the fourth indicator corresponding to the first dimension item, or includes the third indicator or the fourth indicator corresponding to the second dimension item, and the second data can be calculated according to one of the following: data of the fourth indicator corresponding to the first dimension item, data of the third indicator corresponding to the second dimension item, and data of the fourth indicator corresponding to the second dimension item.
[0050] By way of example, the third database table may include a third indicator corresponding to the first dimension item, that is, the third database table directly stores data of the third indicator corresponding to the first dimension item. Taking the first dimension item as Zhejiang Province and the third indicator as the number of short video users as an example, the third database table directly stores data on the number of short video users in Zhejiang Province.
[0051] For example, the third database table may include the fourth indicator corresponding to the first dimension item, wherein the data of the third indicator can be calculated based on the data of the fourth indicator, for example, the data of the fourth indicator is calculated based on a preset query caliber, and the query caliber is a calculation method for obtaining the data of the third indicator from the third database table through the data of the fourth indicator. For example, the third database table stores the data of the fourth indicator c corresponding to Zhejiang Province and the data of the fourth indicator d corresponding to Zhejiang Province. For example, the data of the number of short video users can be calculated based on the product of the data of the fourth indicator c and the data of the fourth indicator d.
[0052] For example, the third database table may include a third indicator corresponding to the second dimension item, and the second dimension item has been explained above. For example, according to the number of short video users in Hangzhou, the number of short video users in Ningbo, and the number of short video users in other cities in Zhejiang Province, the number of short video users in each city is accumulated to calculate the number of short video users in Zhejiang Province.
[0053] For example, the third database table may include the fourth indicator corresponding to the second dimension item. For example, the data of the third indicator corresponding to the second dimension item may be first calculated based on the data of the fourth indicator corresponding to the second dimension item, and then the data of the third indicator corresponding to each second dimension item may be calculated based on the data of the third indicator corresponding to each second dimension item, i.e., the second data. For example, the first database table stores the data of the fourth indicator c and the data of the fourth indicator d corresponding to Hangzhou. The number of short video users in Hangzhou may be calculated based on the data of the fourth indicator c and the data of the fourth indicator d corresponding to Hangzhou. The same is true for other cities. In this way, the number of short video users in Zhejiang Province may be obtained based on the number of short video users corresponding to each city.
[0054] If there are multiple third database tables, a second characteristic parameter corresponding to each third database table is determined, and the second characteristic parameter is used to characterize the data processing amount required to obtain the second data according to the third database table. The second characteristic parameter can be represented by a quantity or a vector, etc., without limitation.
[0055] If there are multiple third database tables, a fourth database table can be determined, and the fourth database table is the third database table corresponding to the second characteristic parameter with the smallest data processing amount. In this way, the fourth database table with the smallest required data processing amount can be found from multiple third database tables, and data query can be performed in the fourth database table, which can improve query efficiency.
[0056] If the number of the third database table is one, the third database table may be directly used as the fourth database table.
[0057] Afterwards, a data query is performed in the fourth database table, and the second data is obtained according to the query result. After the second data corresponding to the third indicator is obtained, the first data can be determined according to the second data corresponding to each third indicator. In addition, if the third database table does not exist, the corresponding data cannot be found, and the query process ends.
[0058] Through the above technical solution, if the first database table does not exist, it can be further determined whether the first indicator can be split. If it can be split, the first indicator is split into multiple third indicators, which can avoid the situation where no data can be queried directly based on the first indicator. Determine the third database table corresponding to the third indicator, that is, filter out the database table that can query the second data. If there are multiple third database tables, the third database table with the smallest data processing volume can be used as the fourth database table. In this way, when querying data in the fourth database table, the data processing volume during the query can be minimized, the delay during data query can be reduced, and the query efficiency can be improved.
[0059] Since different database tables may be built by different technicians at different times, even the same indicators and query dimensions may have different names in different database tables. For example, the query dimension of province is actually named "Province 1" in database table 1 and "Province" in database table 2. If you query the data of Zhejiang Province in database table 1, you can query it through "Province 1 = Zhejiang Province". If you query the data of Zhejiang Province in database table 2, you can query it through "Province = Zhejiang Province". For example, the indicator of short video playback volume is actually named "Play Volume 1" in database table 1 and "VV" (VideoView) in database table 2. When querying the short video playback volume in database table 1, you can query it through the name "Play Volume 1". When querying the short video playback volume in database table 2, you can query it through the name "VV".
[0060] In the present disclosure, in order to unify the naming of indicators and dimensions and ensure unified management of indicators and dimensions, the standard name of the indicator and the standard name of the dimension can be set in advance, and the first corresponding relationship and the second corresponding relationship can be established in advance, wherein the first corresponding relationship is the correspondence between the standard name of the indicator, the database table, and the actual name of the same indicator in the database table, and the second corresponding relationship is the correspondence between the standard name of the query dimension, the database table, and the actual name of the same query dimension in the database table.
[0061] As an example, for example, the indicator of short video playback volume, the standard name of the indicator is pre-set as "short video playback volume", and the database table corresponding to the indicator includes a database table that can query the indicator of short video playback volume, such as database table 1 and database table 2. It should be noted that database table 1 may directly store the data of the indicator of short video playback volume, or it may store the data of indicators a and b, and the data of short video playback volume can be calculated based on the data of indicators a and b. That is, the database table corresponding to the indicator is a database table that can query the data of the indicator, which can be queried from the directly stored data or obtained through certain calculation queries. For example, the first corresponding relationship is, for example, the standard name of the indicator "short video playback volume", and the database tables corresponding to the indicator are database table 1 and database table 2. The actual name of the indicator in database table 1 is "play volume 1", and the actual name of the indicator in database table 2 is "VV".
[0062] As an example, for example, the query dimension of province, the standard name of the query dimension is pre-set as "province", and the database table corresponding to the query dimension includes a database table that can query the province dimension, such as database table 1 and database table 2. Among them, database table 1 may directly store the data of each province, such as directly storing the data of Zhejiang Province and Shandong Province, or it may store the data of each sub-dimensional item, such as storing the data of each city in Zhejiang Province. That is, the database table corresponding to the query dimension is a database table that can query the data under this dimension, which can be queried from the directly stored data or through certain calculations. For example, the second corresponding relationship is, for example, the standard name of the query dimension "province", and the database tables corresponding to the standard name are database table 1 and database table 2. The actual name of the query dimension in database table 1 is "province 1", and the actual name of the query dimension in database table 2 is "Province".
[0063] It should be noted that the above examples of the first correspondence relationship and the second correspondence relationship are for explanation only and do not constitute a limitation to the embodiments of the present disclosure. The first correspondence relationship may include a pre-established correspondence relationship of multiple indicators, and the second correspondence relationship may include a pre-established correspondence relationship of multiple query dimensions.
[0064] The first correspondence relationship and the second correspondence relationship can be stored in the indicator management platform, which can be the server mentioned above, and the meta-information of each database table can be registered in the server. In addition to the field information, indicator information, and dimension information of the database table, the meta-information can also include the storage address of the database table. When executing data query, the server can call the database table according to the storage address.
[0065] The following introduces an embodiment of performing a query operation based on the first corresponding relationship and the second corresponding relationship in the present disclosure.
[0066] Figure 2 is a flow chart of a data query method according to an exemplary embodiment. Figure 2 As shown, step 12 may include step 121 and step 122 , and step 15 may include steps 151 to 153 .
[0067] In step 121, according to the first indicator name and the first corresponding relationship, it is determined that the database table corresponding to the first indicator is the fifth database table.
[0068] Among them, when the user queries through the client, the query can be performed by setting the filtering conditions. The filtering conditions can be set to the standard name of the indicator and the standard name of the query dimension, that is, when the user queries, the standard name of the indicator and the standard name of the dimension are used for query. Therefore, the first query condition may include the first indicator name and the first dimension name. The first indicator name is the standard name of the first indicator, the first dimension name is the standard name of the first query dimension, and the first query dimension is the query dimension to which the first dimension item belongs. For example, if the first dimension item is Zhejiang Province, then the first query dimension is the province, that is, province = Zhejiang Province. For example, if the first dimension item is January 1, then the first query dimension is the date, that is, date = January 1.
[0069] The first correspondence has been explained above. According to the first indicator name and the first correspondence, it can be determined that the database table corresponding to the first indicator is the fifth database table. The fifth database table includes the first indicator or the second indicator, and the data of the first indicator can be calculated based on the data of the second indicator. Taking the query of the short video playback volume in Zhejiang Province as an example, the name of the first indicator is "short video playback volume". Following the above example, both database table 1 and database table 2 can be used as the fifth database table.
[0070] In step 122 , a first database table is determined from the fifth database table.
[0071] Among them, the fifth database table is a database table that can query the data of the first indicator, and it is also necessary to filter out the database table that can query the data of the first dimension item as the first database table. For example, it can be first determined whether the fifth database table is set with a non-queryable label, and whether the fifth database table is located in a queryable database. If the label information of the fifth database indicates that it can be queried and the fifth database table is located in a queryable database, it can be further determined whether the fifth database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, that is, whether the fifth database table can query the first data, and the database table that can query the first data is used as the first database table. For example, if the fifth database table only stores the data of the short video playback volume of some cities in Zhejiang Province, for example, the data of the short video playback volume of Hangzhou City is not stored, then the data of the short video playback volume of Zhejiang Province cannot be obtained from the fifth database table, and the fifth database table is not used as the first database table.
[0072] For example, if both database table 1 and database table 2 can query the short video playback volume in Zhejiang Province, both database table 1 and database table 2 can be used as the first database table. There are multiple first database tables. For example, if the first data is obtained according to database table 1, the required data processing amount is minimal, and database table 1 can be used as the second database table.
[0073] In step 151, according to the first dimension name, the second database table and the second corresponding relationship, a second dimension name corresponding to the first dimension name and the second database table is determined.
[0074] The second dimension name is the actual name of the first query dimension in the second database table, and the second correspondence has been explained above. For example, according to the first dimension name "province" and database table 1, the corresponding second dimension name can be obtained as "province 1" through the second correspondence.
[0075] In step 152, the second indicator name is determined according to the first indicator name, the second database table and the first corresponding relationship.
[0076] The second indicator name is the actual name of the first indicator in the second database table. For example, according to the first indicator name "short video playback volume" and database table 1, the corresponding second indicator name can be obtained as "play volume 1" through the first corresponding relationship.
[0077] In step 153, data query is performed in the second database table according to the second indicator name, the second dimension name and the first dimension item.
[0078] Among them, if the second database table includes the second indicator, for example, the second database table includes the second indicator a and the second indicator b, the data of the first indicator can be queried through the second indicator name "play volume 1", because the second database table is associated with a query scope that calculates the data of the first indicator based on the second indicator a and the second indicator b, that is, when querying based on "play volume 1", according to this query scope, the data of the first indicator can be calculated using the data of the second indicator a and the data of the second indicator b in the second database table.
[0079] If the second database table includes second dimension items, for example, the second database table stores data of various cities in Zhejiang Province, according to the second dimension name "Province 1" and the first dimension item "Zhejiang Province", when querying in the second database table, the data of the number of views of each city will be accumulated to obtain the data of the number of short video views in Zhejiang Province.
[0080] In addition, in the implementation method of splitting the first indicator into multiple third indicators in the above text, taking the first indicator as the average number of short video playbacks per capita as an example, the first indicator can be split into two third indicators, namely the number of short video users and the number of short video playbacks, and the standard name of the third indicator can be determined, for example, by matching the third indicator obtained by the split with the standard names of multiple indicators. For example, based on the first corresponding relationship, the corresponding third database table can be determined according to the standard name of the third indicator, and then the fourth database table can be determined from the third database table. When performing data query in the fourth database table, the actual name of the third indicator in the fourth database table can be determined according to the first corresponding relationship, the actual name of the first query dimension in the fourth database table can be determined according to the second corresponding relationship, and then data query can be performed in the fourth database table according to the actual name.
[0081] By adopting the above technical solution, data query is performed based on the first corresponding relationship and the second corresponding relationship. The standard name of the indicator and the standard name of the dimension can be used for query. Even if the actual names of the same indicator in different database tables are different, and the actual names of the same dimension in different database tables are different, the database table that can query the first data can be found, and the actual name of the first indicator required for the query in the second database table and the actual name of the first query dimension in the second database table can be determined, so that data query can be performed from the second database table.
[0082] In the present disclosure, data query is performed based on the first correspondence relationship and the second correspondence relationship. If the first correspondence relationship and the second correspondence relationship are changed, it is necessary to analyze the impact on the downstream, that is, the data dashboard showing the query results. The following describes an implementation method for changing the first correspondence relationship and the second correspondence relationship.
[0083] After step 153, the data query method may further include: In response to receiving a first change instruction, a first prompt message is output. The first change instruction is used to indicate a change to the first dimension name in the second corresponding relationship, or to indicate deletion of the second database table corresponding to the first dimension name in the second corresponding relationship, or to indicate deletion of the second indicator name in the second corresponding relationship. The first prompt message is used to indicate that the first change instruction cannot be executed.
[0084] Among them, the server may store historical query information, which may include query conditions received in a historical period (such as the past 30 days), the database table determined based on the first correspondence and the second correspondence to perform the query, the actual name of the indicator used in the query and the actual name of the dimension, and the query results corresponding to the query conditions, etc. If a change instruction for the first correspondence or the second correspondence is received, the predicted query results obtained if the query operation is performed based on the changed correspondence can be predicted based on the query conditions received in the historical period, and the predicted query results are analyzed to see whether they are consistent with the actual historical query results corresponding to the query conditions, that is, whether the execution of the change instruction will have an impact on the downstream. By way of example, the change instruction can be entered by the user on the client, and after receiving the change instruction, the client can send the change instruction to the server.
[0085] The query conditions received in the historical period may include the first query conditions. If the first change instruction is used to indicate the change of the first dimension name in the second corresponding relationship, wherein the change of the first dimension name here may include deleting the first dimension name or modifying the first dimension name, since the first query condition includes the first dimension name, that is, the query is performed according to the first dimension name, if it is changed, it will cause the result prediction according to the first query condition, and the first data cannot be queried, thereby affecting the normal use of the first data downstream, so the first prompt information can be output to prompt that the first change instruction cannot be executed. If the first change instruction is used to indicate the deletion of the second database table corresponding to the first dimension name in the second corresponding relationship, or to indicate the deletion of the second indicator name in the second corresponding relationship, then when the result prediction is performed according to the first query condition, the actual name of the first query dimension in the second database table cannot be determined through the second corresponding relationship, so the first data cannot be queried, so the first prompt information can be output.
[0086] After step 153, the data query method may further include: In response to receiving the second change instruction, third data is determined, wherein the second change instruction is used to instruct to modify the second dimension name in the second corresponding relationship, and the third data is the data of the first indicator corresponding to the first dimension item obtained by predicting the first query condition if a query operation is performed based on the first corresponding relationship and the changed second corresponding relationship.
[0087] If the third data is inconsistent with the first data, a second prompt message is output, and the second prompt message is used to prompt manual verification of the third data; in response to receiving a confirmation instruction indicating that the manual verification has passed, a second change instruction is executed to modify the second dimension name in the second corresponding relationship.
[0088] The name of the second dimension is the actual name of the first query dimension in the second database table. If the actual name of the first query dimension in the second database table is not modified synchronously and remains the original name, then the result prediction based on the first query condition will result in no data being found. If the actual name of the first query dimension in the second database table is also modified synchronously, then the result prediction based on the first query condition can determine the third data. Since the third data is inconsistent with the first data, it may be due to normal data updates, such as normal updates of playback volume data, so the second prompt information can be output for manual verification.
[0089] After step 153, the data query method may further include: In response to receiving a third change instruction, fourth data is determined; if the fourth data is inconsistent with the first data, a third prompt information is output, and the third prompt information is used to prompt manual verification of the fourth data; in response to receiving a confirmation instruction used to indicate that the manual verification has passed, the third change instruction is executed to change the first corresponding relationship.
[0090] For example, the third change instruction is used to instruct to change the database table corresponding to the first indicator name in the first corresponding relationship, or to instruct to modify the second indicator name in the first corresponding relationship. The fourth data is the data of the first indicator corresponding to the first dimension item obtained by predicting the query operation based on the first query condition after the change.
[0091] Among them, the change of the database table corresponding to the first indicator name here may include deleting the database table corresponding to the first indicator name, or adding the database table corresponding to the first indicator name. If the corresponding database table is deleted or added, according to the first query condition, based on the changed first corresponding relationship, the database table used for data query may be determined to be different from the second database table. In order to avoid affecting the downstream dashboard data, the third prompt information may be output to prompt manual verification of the fourth data.
[0092] If the third change instruction is used to indicate the modification of the name of the second indicator in the first corresponding relationship, the result prediction can be performed based on the first corresponding relationship after the change according to the first query condition; if the actual name of the first indicator is also modified synchronously in the second database table, the result prediction can be performed according to the first query condition to determine the fourth data, and then the third prompt information is output for manual verification.
[0093] After step 153, the data query method may further include: In response to receiving a fourth change instruction, a fourth prompt message is output, the fourth change instruction is used to indicate a change to the first indicator name in the first correspondence, or to indicate a deletion of the second indicator name in the first correspondence, and the fourth prompt message is used to indicate that the fourth change instruction cannot be executed.
[0094] Among them, the change of the first indicator name in the first corresponding relationship here may include deleting the first indicator name and modifying the first indicator name. If the first indicator name in the first corresponding relationship is changed, since the first query condition includes the first indicator name, when the result is predicted according to the first query condition, the corresponding standard indicator name cannot be found based on the changed first corresponding relationship, and the first data cannot be queried, so the fourth prompt information can be output. If the second indicator name in the first corresponding relationship is deleted, then when the result is predicted according to the first query condition, the actual name of the first indicator in the second database table cannot be determined through the first corresponding relationship, and the first data cannot be queried, so the fourth prompt information can be output.
[0095] Through the above technical solution, if the first corresponding relationship and the second corresponding relationship are changed, it can be predicted that according to the first query condition, the data obtained by the query operation based on the changed corresponding relationship, if the predicted queried data is inconsistent with the first data, it can be manually verified whether the corresponding change instruction is executed, so that the impact of the change instruction on the data query can be analyzed.
[0096] Based on the same inventive concept, the present disclosure also provides a data query device, Figure 3 is a block diagram of a data query device according to an exemplary embodiment. Figure 3 As shown, the device 30 may include: A first acquisition module 31 is used to acquire a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; A first determination module 32 is used to determine a first database table according to the first query condition, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item; A second determining module 33 is used to determine a first characteristic parameter corresponding to each of the first database tables if there are multiple first database tables, wherein the first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table; A third determination module 34 is used to determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter that represents the smallest amount of data processing; The query module 35 is used to query data in the second database table and obtain the first data according to the query result.
[0097] Optionally, the device 30 further includes: a splitting module, configured to split the first indicator into a plurality of third indicators if the first database table does not exist and the first indicator can be split, wherein the first data can be calculated according to second data, and the second data is data of the third indicator corresponding to the first dimension item; a fourth determination module, for determining, for each of the third indicators, a third database table corresponding to the third indicator, wherein the third database table includes the third indicator or the fourth indicator corresponding to the first dimension item, or includes the third indicator or the fourth indicator corresponding to the second dimension item, and the second data can be calculated according to one of the following: data of the fourth indicator corresponding to the first dimension item, data of the third indicator corresponding to the second dimension item, and data of the fourth indicator corresponding to the second dimension item; if there are multiple third database tables, then determining a second characteristic parameter corresponding to each of the third database tables, the second characteristic parameter being used to characterize the amount of data processing required to obtain the second data according to the third database table; determining a fourth database table, the fourth database table being the third database table corresponding to the second characteristic parameter having the smallest amount of data processing; performing data query in the fourth database table, and obtaining the second data according to the query result; The fifth determining module is used to determine the first data according to the second data corresponding to each of the third indicators.
[0098] Optionally, the first query condition includes a first indicator name; The first determining module 32 includes: A first determining submodule is configured to determine, according to the first indicator name and a first corresponding relationship, that the database table corresponding to the first indicator is a fifth database table, wherein the first indicator name is a standard name of the first indicator, the first corresponding relationship is a corresponding relationship between the standard name of the indicator and the database table, the fifth database table includes the first indicator or the second indicator, and the data of the first indicator can be calculated according to the data of the second indicator; The second determining submodule is configured to determine the first database table from the fifth database table.
[0099] Optionally, the first query condition further includes a first dimension name, where the first dimension name is a standard name of a first query dimension, and the first query dimension is a query dimension to which the first dimension item belongs; The query module 35 includes: A third determination submodule is configured to determine, according to the first dimension name, the second database table, and the second corresponding relationship, a second dimension name corresponding to the first dimension name and the second database table, wherein the second dimension name is an actual name of the first query dimension in the second database table, and the second corresponding relationship is a corresponding relationship between a standard name of the query dimension, a database table, and an actual name of the same query dimension in the database table; a fourth determination submodule, configured to determine a second indicator name according to the first indicator name, the second database table, and the first corresponding relationship, wherein the second indicator name is an actual name of the first indicator in the second database table, and the first corresponding relationship is a corresponding relationship between a standard name of an indicator, a database table, and an actual name of the same indicator in the database table; A query submodule is used to perform data query in the second database table according to the second indicator name, the second dimension name and the first dimension item.
[0100] Optionally, the device 30 further includes: A first output module is used for the query submodule to output a first prompt message in response to receiving a first change instruction after performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item. The first change instruction is used to indicate a change to the first dimension name in the second corresponding relationship, or to indicate deletion of the second database table corresponding to the first dimension name in the second corresponding relationship, or to indicate deletion of the second indicator name in the second corresponding relationship. The first prompt message is used to indicate that the first change instruction cannot be executed.
[0101] Optionally, the device 30 further includes: A first data determination module is used for determining third data in response to receiving a second change instruction after the query submodule performs data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, wherein the second change instruction is used to instruct to modify the second dimension name in the second corresponding relationship, and the third data is predicted data of the first indicator corresponding to the first dimension item obtained if a query operation is performed based on the first corresponding relationship and the changed second corresponding relationship according to the first query condition; A second output module, configured to output second prompt information if the third data is inconsistent with the first data, wherein the second prompt information is used to prompt manual verification of the third data; The first execution module is used to execute the second change instruction in response to receiving a confirmation instruction indicating that the manual verification has passed, so as to modify the second dimension name in the second corresponding relationship.
[0102] Optionally, the device 30 further includes: A second data determination module is used for determining fourth data in response to receiving a third change instruction after the query submodule performs data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, wherein the third change instruction is used to indicate a change to the database table corresponding to the first indicator name in the first corresponding relationship, or to indicate a modification of the second indicator name in the first corresponding relationship, and the fourth data is predicted data of the first indicator corresponding to the first dimension item obtained according to the first query condition if a query operation is performed based on the changed first corresponding relationship; A third output module, configured to output third prompt information if the fourth data is inconsistent with the first data, wherein the third prompt information is used to prompt manual verification of the fourth data; The second execution module is used to execute the third change instruction in response to receiving a confirmation instruction indicating that the manual verification has passed, so as to change the first corresponding relationship.
[0103] Optionally, the device 30 further includes: A fourth output module is used for the query submodule to output fourth prompt information in response to receiving a fourth change instruction after performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item. The fourth change instruction is used to indicate a change to the first indicator name in the first corresponding relationship, or to indicate deletion of the second indicator name in the first corresponding relationship. The fourth prompt information is used to indicate that the fourth change instruction cannot be executed.
[0104] Reference below Figure 4 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing an embodiment of the present disclosure. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0105] like Figure 4 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0106] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0108] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0109] In some embodiments, the servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0110] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0111] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; According to the first query condition, a first database table is determined, the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item; If there are multiple first database tables, determining a first characteristic parameter corresponding to each first database table, where the first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table; Determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter characterized by the smallest data processing amount; Perform a data query in the second database table, and obtain the first data according to the query result.
[0112] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring a first query condition".
[0115] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0116] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] According to one or more embodiments of the present disclosure, Example 1 provides a data query method, the method comprising: Obtain a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; According to the first query condition, a first database table is determined, the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item; If there are multiple first database tables, determining a first characteristic parameter corresponding to each first database table, where the first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table; Determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter characterized by the smallest data processing amount; Perform a data query in the second database table, and obtain the first data according to the query result.
[0118] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the method further includes: If the first database table does not exist and the first indicator can be split, split the first indicator into multiple third indicators, wherein the first data can be calculated according to the second data, and the second data is the data of the third indicator corresponding to the first dimension item; For each of the third indicators, determine a third database table corresponding to the third indicator, wherein the third database table includes the third indicator or the fourth indicator corresponding to the first dimension item, or includes the third indicator or the fourth indicator corresponding to the second dimension item, and the second data can be calculated according to one of the following: data of the fourth indicator corresponding to the first dimension item, data of the third indicator corresponding to the second dimension item, and data of the fourth indicator corresponding to the second dimension item; if there are multiple third database tables, determine a second characteristic parameter corresponding to each of the third database tables, the second characteristic parameter is used to characterize the amount of data processing required to obtain the second data according to the third database table; determine a fourth database table, the fourth database table is the third database table corresponding to the second characteristic parameter with the smallest amount of data processing; perform data query in the fourth database table, and obtain the second data according to the query result; The first data is determined according to the second data corresponding to each of the third indicators.
[0119] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the first query condition includes a first indicator name; and determining the first database table according to the first query condition includes: According to the first indicator name and the first corresponding relationship, determining that the database table corresponding to the first indicator is a fifth database table, wherein the first indicator name is a standard name of the first indicator, the first corresponding relationship is a corresponding relationship between the standard name of the indicator and the database table, the fifth database table includes the first indicator or the second indicator, and the data of the first indicator can be calculated according to the data of the second indicator; The first database table is determined from the fifth database table.
[0120] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein the first query condition further includes a first dimension name, the first dimension name is a standard name of the first query dimension, and the first query dimension is a query dimension to which the first dimension item belongs; and performing data query in the second database table includes: Determine, according to the first dimension name, the second database table, and the second corresponding relationship, a second dimension name corresponding to the first dimension name and the second database table, wherein the second dimension name is an actual name of the first query dimension in the second database table, and the second corresponding relationship is a corresponding relationship between a standard name of the query dimension, a database table, and an actual name of the same query dimension in the database table; Determine a second indicator name according to the first indicator name, the second database table and the first corresponding relationship, wherein the second indicator name is the actual name of the first indicator in the second database table, and the first corresponding relationship is the corresponding relationship between the standard name of the indicator, the database table and the actual name of the same indicator in the database table; According to the second indicator name, the second dimension name and the first dimension item, data query is performed in the second database table.
[0121] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, and after performing a data query in the second database table according to the second indicator name, the second dimension name, and the first dimension item, the method further includes: In response to receiving a first change instruction, a first prompt message is output, wherein the first change instruction is used to indicate a change to the first dimension name in the second corresponding relationship, or to indicate deletion of the second database table corresponding to the first dimension name in the second corresponding relationship, or to indicate deletion of the second indicator name in the second corresponding relationship, and the first prompt message is used to indicate that the first change instruction cannot be executed.
[0122] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 4, and after performing a data query in the second database table according to the second indicator name, the second dimension name, and the first dimension item, the method further includes: In response to receiving a second change instruction, determining third data, wherein the second change instruction is used to instruct to modify the second dimension name in the second corresponding relationship, and the third data is predicted data of the first indicator corresponding to the first dimension item obtained if a query operation is performed based on the first corresponding relationship and the changed second corresponding relationship according to the first query condition; If the third data is inconsistent with the first data, outputting second prompt information, wherein the second prompt information is used to prompt manual verification of the third data; In response to receiving a confirmation instruction indicating that the manual verification has passed, the second change instruction is executed to modify the second dimension name in the second corresponding relationship.
[0123] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 4, and after performing a data query in the second database table according to the second indicator name, the second dimension name, and the first dimension item, the method further includes: In response to receiving a third change instruction, fourth data is determined, wherein the third change instruction is used to instruct to change the database table corresponding to the first indicator name in the first corresponding relationship, or is used to instruct to modify the second indicator name in the first corresponding relationship, and the fourth data is predicted data of the first indicator corresponding to the first dimension item obtained if a query operation is performed based on the changed first corresponding relationship according to the first query condition; If the fourth data is inconsistent with the first data, outputting third prompt information, wherein the third prompt information is used to prompt manual verification of the fourth data; In response to receiving a confirmation instruction indicating that the manual verification has passed, the third change instruction is executed to change the first corresponding relationship.
[0124] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 4, and after performing a data query in the second database table according to the second indicator name, the second dimension name, and the first dimension item, the method further includes: In response to receiving a fourth change instruction, a fourth prompt message is output, wherein the fourth change instruction is used to indicate a change to the first indicator name in the first correspondence, or to indicate a deletion of the second indicator name in the first correspondence, and the fourth prompt message is used to indicate that the fourth change instruction cannot be executed.
[0125] According to one or more embodiments of the present disclosure, Example 9 provides a data query device, the device comprising: A first acquisition module, used to acquire a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; A first determination module is used to determine a first database table according to the first query condition, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimensional item, and the second dimension item includes all sub-dimensional items in one first-level sub-dimensional item of the first dimension item; a second determining module, configured to determine a first characteristic parameter corresponding to each of the first database tables if there are multiple first database tables, wherein the first characteristic parameter is used to characterize a data processing amount required to obtain the first data according to the first database table; A third determination module is used to determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter that represents the smallest amount of data processing; A query module is used to perform data query in the second database table and obtain the first data according to the query result.
[0126] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of the method described in any one of Examples 1-8 are implemented.
[0127] According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-8.
[0128] According to one or more embodiments of the present disclosure, Example 12 provides a computer program product, including a computer program, which implements the steps of any one of the methods described in Examples 1 to 8 when executed by a processor.
[0129] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution.
[0130] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0131] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A data query method, characterized in that: The method comprises: Obtain a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; According to the first query condition, a first database table is determined, the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimension item, and the second dimension item includes all sub-dimension items in one first-level sub-dimension item of the first dimension item; If there are multiple first database tables, determining a first characteristic parameter corresponding to each first database table, where the first characteristic parameter is used to characterize the amount of data processing required to obtain the first data according to the first database table; Determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter characterized by the smallest data processing amount; Perform a data query in the second database table, and obtain the first data according to the query result.
2. The method according to claim 1, characterized in that The method further comprises: If the first database table does not exist and the first indicator can be split, split the first indicator into multiple third indicators, wherein the first data can be calculated according to the second data, and the second data is the data of the third indicator corresponding to the first dimension item; For each of the third indicators, determine a third database table corresponding to the third indicator, wherein the third database table includes the third indicator or the fourth indicator corresponding to the first dimension item, or includes the third indicator or the fourth indicator corresponding to the second dimension item, and the second data can be calculated according to one of the following: data of the fourth indicator corresponding to the first dimension item, data of the third indicator corresponding to the second dimension item, and data of the fourth indicator corresponding to the second dimension item; if there are multiple third database tables, determine a second characteristic parameter corresponding to each of the third database tables, the second characteristic parameter is used to characterize the amount of data processing required to obtain the second data according to the third database table; determine a fourth database table, the fourth database table is the third database table corresponding to the second characteristic parameter with the smallest amount of data processing; perform data query in the fourth database table, and obtain the second data according to the query result; The first data is determined according to the second data corresponding to each of the third indicators.
3. The method according to claim 1, characterized in that The first query condition includes a first indicator name; The determining the first database table according to the first query condition includes: According to the first indicator name and the first corresponding relationship, determining that the database table corresponding to the first indicator is a fifth database table, wherein the first indicator name is a standard name of the first indicator, the first corresponding relationship is a corresponding relationship between the standard name of the indicator and the database table, the fifth database table includes the first indicator or the second indicator, and the data of the first indicator can be calculated according to the data of the second indicator; The first database table is determined from the fifth database table.
4. The method according to claim 3, characterized in that The first query condition further includes a first dimension name, where the first dimension name is a standard name of a first query dimension, and the first query dimension is a query dimension to which the first dimension item belongs; The performing data query in the second database table includes: Determine, according to the first dimension name, the second database table, and the second corresponding relationship, a second dimension name corresponding to the first dimension name and the second database table, wherein the second dimension name is an actual name of the first query dimension in the second database table, and the second corresponding relationship is a corresponding relationship between a standard name of the query dimension, a database table, and an actual name of the same query dimension in the database table; Determine a second indicator name according to the first indicator name, the second database table and the first corresponding relationship, wherein the second indicator name is the actual name of the first indicator in the second database table, and the first corresponding relationship is the corresponding relationship between the standard name of the indicator, the database table and the actual name of the same indicator in the database table; According to the second indicator name, the second dimension name and the first dimension item, data query is performed in the second database table.
5. The method according to claim 4, characterized in that After performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, the method further includes: In response to receiving a first change instruction, a first prompt message is output, wherein the first change instruction is used to indicate a change to the first dimension name in the second corresponding relationship, or to indicate deletion of the second database table corresponding to the first dimension name in the second corresponding relationship, or to indicate deletion of the second indicator name in the second corresponding relationship, and the first prompt message is used to indicate that the first change instruction cannot be executed.
6. The method according to claim 4, characterized in that After performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, the method further includes: In response to receiving a second change instruction, determining third data, wherein the second change instruction is used to instruct to modify the second dimension name in the second corresponding relationship, and the third data is predicted data of the first indicator corresponding to the first dimension item obtained if a query operation is performed based on the first corresponding relationship and the changed second corresponding relationship according to the first query condition; If the third data is inconsistent with the first data, outputting second prompt information, wherein the second prompt information is used to prompt manual verification of the third data; In response to receiving a confirmation instruction indicating that the manual verification has passed, the second change instruction is executed to modify the second dimension name in the second corresponding relationship.
7. The method according to claim 4, characterized in that After performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, the method further includes: In response to receiving a third change instruction, fourth data is determined, wherein the third change instruction is used to instruct to change the database table corresponding to the first indicator name in the first corresponding relationship, or is used to instruct to modify the second indicator name in the first corresponding relationship, and the fourth data is predicted data of the first indicator corresponding to the first dimension item obtained if a query operation is performed based on the changed first corresponding relationship according to the first query condition; If the fourth data is inconsistent with the first data, outputting third prompt information, wherein the third prompt information is used to prompt manual verification of the fourth data; In response to receiving a confirmation instruction indicating that the manual verification has passed, the third change instruction is executed to change the first corresponding relationship.
8. The method according to claim 4, characterized in that After performing data query in the second database table according to the second indicator name, the second dimension name and the first dimension item, the method further includes: In response to receiving a fourth change instruction, a fourth prompt message is output, wherein the fourth change instruction is used to indicate a change to the first indicator name in the first correspondence, or to indicate a deletion of the second indicator name in the first correspondence, and the fourth prompt message is used to indicate that the fourth change instruction cannot be executed.
9. A data query device, characterized in that: The device comprises: A first acquisition module, used to acquire a first query condition, where the first query condition is used to indicate a query for first data, where the first data is data of a first indicator corresponding to a first dimension item; A first determination module is used to determine a first database table according to the first query condition, wherein the first database table includes the first indicator or the second indicator corresponding to the first dimension item, or includes the first indicator or the second indicator corresponding to the second dimension item, wherein the first data can be calculated according to one of the following: data of the second indicator corresponding to the first dimension item, data of the first indicator corresponding to the second dimension item, and data of the second indicator corresponding to the second dimension item; the first dimension item has at least one first-level sub-dimensional item, and the second dimension item includes all sub-dimensional items in one first-level sub-dimensional item of the first dimension item; a second determining module, configured to determine a first characteristic parameter corresponding to each of the first database tables if there are multiple first database tables, wherein the first characteristic parameter is used to characterize a data processing amount required to obtain the first data according to the first database table; A third determination module is used to determine a second database table, where the second database table is the first database table corresponding to the first characteristic parameter that represents the smallest amount of data processing; A query module is used to perform data query in the second database table and obtain the first data according to the query result.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method described in any one of claims 1 to 8 are implemented.
11. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.