Data query method and device, cluster and readable storage medium
By obtaining the prompt information of the filter from the dimension table and using the field mapping relationship to convert the filter fields, the problem of low filter count efficiency caused by the large amount of data in a wide table is solved, and more efficient filter value acquisition and data query are achieved.
Patent Information
- Application Number
- CN202311558003.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the large amount of data in a wide table leads to the low efficiency of the number of prompt information taken by the filter, which affects the efficiency of the user inputting the filter value.
By obtaining the prompt information of the filter from the dimension table, using the field mapping relationship between the dimension table and the wide table, the filter field is converted into the associated filter attribute field to improve the efficiency of the filter's value acquisition.
Improves the efficiency of filter values, reduces the complexity and time of query, and improves the speed of data access.
Smart Images

Figure CN120030053A_ABST
Abstract
Description
Technical Field
[0001] The present application provides a field of computer technology, and more particularly, relates to a data query method, device, cluster, and readable storage medium. Background Art
[0002] A wide table is a data table structure. The purpose of wide tables is to improve the efficiency of data query and analysis, as well as to simplify the data model. Compared with traditional narrow tables, wide tables can store related data together, reduce the number of associated queries, and increase the speed of data access. In order to improve query efficiency, wide tables usually store some data redundantly in the table, which can avoid frequent associated queries and reduce the complexity of queries. However, due to the high redundancy of data in wide tables, more storage space is required to store data. In general, a wide table is a data table structure that improves query efficiency and simplifies data models at the cost of redundant data. It has a wide range of applications in fields such as big data analysis and data warehouses.
[0003] When querying a wide table, you need to enter a filter value in the filter, and query the wide table based on the entered filter value to obtain the query data. In order to facilitate users to enter filter values, a prompt button (for example, a drop-down list button) is usually set for the filter, and users can select the data they want to enter through the prompt information. Currently, the prompt information of the filter is to retrieve data from the wide table, but the amount of data in the wide table is very large, resulting in low efficiency in retrieval. Summary of the invention
[0004] The present application provides a data query method, device, cluster and readable storage medium, which can obtain filter prompt information from a dimension table so that a user can select a filter value from the prompt information, thereby improving the efficiency of filter value acquisition.
[0005] In a first aspect, a data query method is provided, and the method is applied to a data query system. The data query system includes a data source storage device. The data source storage device includes a dimension table, a wide table, and a field mapping relationship between the dimension table and the wide table. The dimension table includes multiple first attribute fields. The wide table includes multiple second attribute fields. The field mapping relationship between the dimension table and the wide table is used to record the mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table. The data query system obtains a query request. The query request includes a filter field and a filter value, the filter field belongs to the first attribute field of the dimension table, the filter field is used to indicate that a value is obtained from the same field of the dimension table as prompt information, and the filter value is selected from the prompt information. The data query system determines the filter attribute field associated with the filter field according to the field mapping relationship between the dimension table and the wide table, and the filter attribute field belongs to the second attribute field of the wide table. The data query system performs the operation of the query request according to the filter attribute field and the filter value.
[0006] In the above scheme, because the first attribute field can only be used to query the dimension table, and the second attribute field can only be used to query the wide table, firstly, the filter field belonging to the first attribute field is used to obtain the filter prompt information from the dimension table, and the user is allowed to select the filter value from the filter prompt information, thereby improving the efficiency of the filter value. Then, the filter field and the filter value are sent to the data query system, and the data query system converts the filter field belonging to the first attribute field into the filter attribute field belonging to the second attribute field, so that the filter attribute field belonging to the second attribute field and the filter value can be used to query the wide table. Because the wide table stores related data together, the use of the wide table can reduce the number of associated queries and improve the data access speed.
[0007] In some possible designs, starting from the first first attribute field of the dimension table, each second attribute field of the wide table can be compared respectively, until each first attribute field of the dimension table is traversed to generate a field mapping relationship between the dimension table and the wide table. Taking the first attribute field A of the dimension table and the second attribute field B of the wide table as examples, the first attribute field A of the dimension table and the second attribute field B of the wide table can be obtained respectively. The first attribute field A and the second attribute field B are compared to obtain a comparison result. In the case where the comparison result is that the first attribute field A and the second attribute field B are the same or fuzzy matching, the mapping relationship between the first attribute field A and the second attribute field B is stored as the field mapping relationship between the dimension table and the wide table. Here, the same can mean that the characters of the first attribute field and the characters of the second attribute field are exactly the same, and the fuzzy matching means that the characters of the first attribute field are highly similar or have the same meaning. The similarity can be calculated by the cosine similarity, Hamming distance, etc. between the characters of the first attribute field and the characters of the second attribute field, and the same meaning can be determined by knowledge graph, artificial intelligence translation, etc.
[0008] In the above solution, the field mapping relationship between the dimension table and the wide table can be automatically generated, which improves the efficiency of establishing the field mapping relationship between the dimension table and the wide table compared with manually configuring the field mapping relationship between the dimension table and the wide table.
[0009] In some possible designs, the comparison results and fuzzy matching results of the characters of the first attribute field and the characters of the second attribute field are calculated respectively. Then, the comparison result is generated based on the character comparison result and the fuzzy matching result. Here, the characters of the first attribute field and the characters of the second attribute field can be compared to determine the character comparison result of the first attribute field and the second attribute field. Then, a regular expression can be generated based on the characters of the first attribute field, and the regular expression and the characters of the second attribute field can be compared according to the wildcard rule represented by the wildcard to generate the fuzzy matching result of the first attribute field and the second attribute field. Wherein, the regular expression includes one or more wildcards.
[0010] In some possible designs, the dimension table and the wide table satisfy a similarity condition. The similarity condition is that the number of first attribute fields in the dimension table is greater than a quantity threshold, and the ratio of the number of first attribute fields in the dimension table that are identical or fuzzy matched with any field in the wide table to the number of first attribute fields in the dimension table is greater than a ratio threshold. The quantity threshold is an integer greater than zero set based on experience. The ratio threshold is a real number greater than zero set based on experience.
[0011] In the above scheme, it is stipulated that only when the number of first attribute fields of the dimension table is greater than the quantity threshold, the dimension table and the wide table are considered to meet the similarity condition, thereby avoiding that some dimension tables with a relatively small number of first attribute fields are mistakenly considered to be similar to the wide table. For example, if a dimension table has only two first attribute fields and one of the first attribute fields of the dimension table is the same as a second attribute field of the wide table, it is mistakenly considered to be similar to the wide table.
[0012] In a second aspect, a data query method is provided. The method is applied to a data query system. The data query system includes a data source storage device. The data source storage device includes a dimension table, a wide table, and a field mapping relationship between the dimension table and the wide table. The dimension table includes a plurality of first attribute fields. The wide table includes a plurality of second attribute fields. The field mapping relationship between the dimension table and the wide table is used to record a mapping relationship between a first attribute field of the dimension table and a second attribute field of the wide table. The data query system determines a filter field associated with a filter attribute field according to the field mapping relationship between the dimension table and the wide table. The filter attribute field belongs to the second attribute field of the wide table. The filter field belongs to the first attribute field of the dimension table. The data query system obtains a value from the same field of the dimension table according to the filter field as prompt information, so that a user can select a filter value from the prompt information. The data query system obtains a query request. The query request includes a filter attribute field and a filter value. The data query system performs the operation of the query request according to the filter attribute field and the filter value.
[0013] In some possible designs, starting from the first first attribute field of the dimension table, each second attribute field of the wide table can be compared respectively, until each first attribute field of the dimension table is traversed to generate a field mapping relationship between the dimension table and the wide table. Taking the first attribute field A of the dimension table and the second attribute field B of the wide table as examples, the first attribute field A of the dimension table and the second attribute field B of the wide table can be obtained respectively. The first attribute field A and the second attribute field B are compared to obtain a comparison result. In the case where the comparison result is that the first attribute field A and the second attribute field B are the same or fuzzy matching, the mapping relationship between the first attribute field A and the second attribute field B is stored as the field mapping relationship between the dimension table and the wide table. Here, the same can mean that the characters of the first attribute field and the characters of the second attribute field are exactly the same, and the fuzzy matching means that the characters of the first attribute field are highly similar or have the same meaning. The similarity can be calculated by the cosine similarity, Hamming distance, etc. between the characters of the first attribute field and the characters of the second attribute field, and the same meaning can be determined by knowledge graph, artificial intelligence translation, etc.
[0014] In some possible designs, the comparison results and fuzzy matching results of the characters of the first attribute field and the characters of the second attribute field are calculated respectively. Then, the comparison result is generated based on the character comparison result and the fuzzy matching result. Here, the characters of the first attribute field and the characters of the second attribute field can be compared to determine the character comparison result of the first attribute field and the second attribute field. Then, a regular expression can be generated based on the characters of the first attribute field, and the regular expression and the characters of the second attribute field can be compared according to the wildcard rule represented by the wildcard to generate the fuzzy matching result of the first attribute field and the second attribute field. Wherein, the regular expression includes one or more wildcards.
[0015] In some possible designs, the dimension table and the wide table satisfy a similarity condition. The similarity condition is that the number of first attribute fields in the dimension table is greater than a quantity threshold, and the ratio of the number of first attribute fields in the dimension table that are identical or fuzzy matched with any field in the wide table to the number of first attribute fields in the dimension table is greater than a ratio threshold. The quantity threshold is an integer greater than zero set based on experience. The ratio threshold is a real number greater than zero set based on experience.
[0016] In a third aspect, a data query device is provided. The data query device is applied to the data query system. The data query system includes a data source storage device. The data source storage device includes a dimension table, a wide table, and a field mapping relationship between the dimension table and the wide table. The dimension table includes a plurality of first attribute fields. The wide table includes a plurality of second attribute fields. The field mapping relationship between the dimension table and the wide table is used to record the mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table. The data query device includes an acquisition unit, a determination unit, and a query unit. The acquisition unit is used to acquire a query request, the query request includes a filter field and a filter value, the filter field belongs to the first attribute field of the dimension table in the data source storage device included in the data query system, the filter field is used to indicate that a value is obtained from the same field of the dimension table as prompt information, and the filter value is selected from the prompt information. The determination unit is used to determine the filter attribute field associated with the filter field according to the field mapping relationship between the dimension table and the wide table, wherein the filter attribute field belongs to the second attribute field of the wide table. The query unit is used to perform the operation of the query request according to the filter attribute field and the filter value.
[0017] In a fourth aspect, a data query device is provided. The data query device is applied to the data query system. The data query system includes a data source storage device. The data source storage device includes a dimension table, a wide table, and a field mapping relationship between the dimension table and the wide table. The dimension table includes a plurality of first attribute fields. The wide table includes a plurality of second attribute fields. The field mapping relationship between the dimension table and the wide table is used to record the mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table. The data query system determines a filter field associated with a filter attribute field according to the field mapping relationship between the dimension table and the wide table. The filter attribute field belongs to the second attribute field of the wide table. The filter field belongs to the first attribute field of the dimension table. The data query system obtains a value from the same field of the dimension table according to the filter field as prompt information, so that a user can select a filter value from the prompt information. The data query device includes an acquisition unit and a query unit. The acquisition unit is used to acquire a query request. The query request includes a filter attribute field and a filter value. The query unit is used to perform the operation of the query request according to the filter attribute field and the filter value.
[0018] In a fifth aspect, a computing device is provided, comprising a processor and a memory, wherein the memory stores instructions, and the processor executes the instructions in the memory to implement a method as described in any one of the first aspect, or implements a method as described in any one of the second aspect.
[0019] In a sixth aspect, a computing cluster is provided, comprising a plurality of computing devices, each computing device comprising a processor and a memory, the memory storing instructions, the processor executing the instructions in the memory to implement a method as described in any one of the first aspect, or to implement a method as described in any one of the second aspect.
[0020] In a seventh aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed by a computing device, implement the method as described in any one of the first aspect, or implement the method as described in any one of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a structural diagram of a data query system provided by this application;
[0022] Figure 2 It is a schematic diagram of an attribute field association method provided by this application;
[0023] Figure 3 It is a schematic diagram of each layer of a database provided by the present application;
[0024] Figure 4It is a schematic diagram of a query interface provided by this application;
[0025] Figure 5 is a schematic diagram of a wide table configuration interface provided by this application;
[0026] Figure 6 This application provides a method for establishing a field mapping relationship between a dimension table and a wide table;
[0027] Figure 7 It is a flowchart of a data query method provided by this application;
[0028] Figure 8 It is a flowchart of a data query method provided by this application;
[0029] Fig. 9 It is a structural diagram of a data query system provided by this application;
[0030] Fig.10 It is a structural schematic diagram of a computing device provided by this application. DETAILED DESCRIPTION
[0031] In order to solve the problem of low efficiency of filter data acquisition, the present application provides a data query method, in which the filter can obtain values from a dimension table as filter prompt information, rather than from a wide table, because the dimension table has much less data than the wide table, so the efficiency of obtaining values from the dimension table is higher than that from the wide table, thereby effectively improving the efficiency of filter value acquisition. A data query method provided by the present application is described in detail below in conjunction with the accompanying drawings.
[0032] First, see Figure 1 The following is a schematic diagram of the structure of a data query system provided by the present application. As shown in the figure, the data query system in the present application includes: a data source storage device 110 and a client 120.
[0033] The data source storage device 110 can be a computing device, a computing device cluster or a terminal device, wherein the computing device includes a bare metal server (BMS), a virtual machine, a container or an edge computing device. BMS refers to a general physical server, such as an ARM server or an X86 server; a virtual machine refers to a complete computer system with complete hardware system functions and running in a completely isolated environment simulated by software. All work that can be done in a physical computer can be done in a virtual machine. When creating a virtual machine in a computing device, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent basic input / output system (BIOS), hard disk and operating system, and can operate the virtual machine like a physical machine; a container is a virtualization software that can merge an application and all its dependencies into a software package that is not limited by the underlying host operating system, so there is no need to build a complex environment, simplifying the process from application development to deployment; an edge computing device refers to a device that is closer to the data source and end users and has low latency and high bandwidth characteristics, such as smart routing, edge servers, etc. The computing device cluster may include multiple computing devices as described above, such as a data center, which is not specifically limited in this application; the description of the terminal device can refer to the aforementioned content and will not be repeated here.
[0034] The data source storage device 110 can be used to store multiple dimension tables and wide tables of the database and other tables storing data. Figure 2 The dimensional table and wide table shown are introduced in detail as examples.
[0035] Dimension tables may include customer dimension tables, product dimension tables, and date dimension tables. Customer dimension tables may include basic information associated with customers, such as customer name, customer address, and customer type. Product dimension tables may include basic information associated with products, such as product ID, product name, product category, and product price. Date dimension tables may include basic information, such as year, month, quarter, and week. For ease of description, the fields corresponding to the above basic information may also be referred to as first attribute fields. Dimension tables may be star dimension tables, snowflake dimension tables, and the like.
[0036] The wide table includes an indicator field and a second attribute field, wherein the indicator field may include order quantity and order amount, etc., and the second attribute field includes part or all of the first attribute fields in each dimension table. For example, the second attribute field in the wide table may include customer name, customer address, customer type, product name, product category, product price, year, month, quarter, week, etc. Therefore, the amount of data in the wide table will be greater than that in the dimension table. The wide table can be a flat wide table, a nested wide table, a tall wide table, a hybrid wide table, etc.
[0037] In the above-mentioned examples of dimension tables and wide tables, only a small number of dimension tables and only a small number of fields in the dimension tables and wide tables are used as examples for explanation. Therefore, the data volume of the wide table is greater than or equal to the data volume of the dimension table. In actual applications, more dimension tables can be included, and the dimension tables can also be other dimension tables. The number of first attribute fields in the dimension tables and the number of second attribute fields in the wide tables can also be more. The first attribute fields in the dimension tables and the second attribute fields in the wide tables can also be other fields. However, as the number of dimension tables increases, the number of first attribute fields in the dimension tables increases, the number of second attribute fields in the wide tables increases, and the number of indicator fields in the wide tables increases, the data volume of the wide tables will be much greater than the data volume of the dimension tables. In addition, the wide table can also only include multiple second attribute fields, not including indicator fields, and so on.
[0038] The second attribute field of the wide table includes part or all of the first attribute fields in each dimension table, which can be understood as: all the second attribute fields in the wide table are derived from the first attribute fields of each dimension table, or part of the second attribute fields in the wide table are derived from the first attribute fields of each dimension table, and another part of the second attribute fields in the wide table are not derived from the first attribute fields of each dimension table, but the second attribute fields in the wide table cannot all be not derived from the first attribute fields of each dimension table. Therefore, the number of second attribute fields in the wide table can be greater than the number of sets composed of the first attribute fields in each dimension table, or less than or equal to the set composed of the first attribute fields in each dimension table. For example, assuming that the wide table includes second attribute fields such as customer name, customer address, customer type, product name, product category, product price, year, month, quarter, week, transaction location, etc. The combination of the first attribute fields in the dimension tables such as the customer dimension table, the product dimension table, and the date dimension table includes customer name, customer address, customer type, product name, product category, product price, year, month, quarter, week, therefore, the second attribute field of the wide table adds an attribute field of transaction location to the set composed of the first attribute fields in each dimension table. For another example, suppose that the wide table includes second attribute fields such as customer name, product name, product category, product price, year, month, quarter, week, etc. The combination of the first attribute fields in the customer dimension table, product dimension table, and date dimension table includes customer name, customer address, customer type, product name, product category, product price, year, month, quarter, week, so the second attribute field of the wide table is less than the set of the first attribute fields in each dimension table by the attribute fields of customer address and customer type. Moreover, even if the number of the second attribute fields of the wide table is less than or equal to the set of the first attribute fields in each dimension table, there may be a part of the second attribute fields in the wide table that do not correspond to the first attribute fields in multiple dimension tables. For example, suppose that the wide table includes second attribute fields such as customer name, product name, product category, product price, year, month, quarter, week, transaction location, etc. However, the combination of the first attribute fields in the customer dimension table, product dimension table, and date dimension table includes customer name, customer address, customer type, product name, product category, product price, year, month, quarter, and week. Therefore, the second attribute field of the wide table has one less attribute field than the set of the first attribute fields in each dimension table. However, the second attribute field "transaction location" in the wide table does not correspond to any field in the combination of the first attribute fields in these dimension tables.
[0039] Since the second attribute fields of the wide table include some or all of the first attribute fields in each dimension table, there is a mapping relationship between some of the second attribute fields in the wide table and some fields in the dimension table. For example, there are mapping relationships between the second attribute fields of year, month, quarter, and week in the wide table and the first attribute fields of year, month, quarter, and week in the date dimension table respectively. There are also mapping relationships between the second attribute fields of product name, product category, and product price in the wide table and the first attribute fields of product name, product category, and product price in the product dimension table respectively.
[0040] Whether it is the second attribute fields in the wide table or the first attribute fields in the dimension table, each attribute field includes multiple values. For example, the values of the first attribute field "product price" in the product dimension table include: 1000, 2000, 1500, 1200, etc. The values of the second attribute field "product price" in the wide table include: 1000, 2000, 1500, 1200, etc.
[0041] The client 120 is used to implement human-computer interaction and can be deployed on terminal devices or computing devices. Terminal devices include personal computers, smartphones, wearable devices, handheld processing devices, tablets, mobile notebooks, augmented reality (AR) devices, virtual reality (VR) devices, integrated handheld game consoles, wearable devices, in-vehicle devices, intelligent conference devices, intelligent advertising devices, intelligent home appliances, etc. Intelligent home appliances can be floor-sweeping robots, mopping robots, etc., which are not specifically limited here.
[0042] In a specific implementation, the client 120 can be software or an application program running on a terminal device or computing device controlled by a user, such as a personal computer (PC) client, or a web client accessed based on a browser, or an application (APP) client running on a mobile terminal, or a console of a cloud platform. This application is not specifically limited.
[0043] Optionally, the client 120 may be a software tool or application for interacting and managing a database. The client provides a user interface and functions, enabling a user to operate the database, such as data modeling, data query, etc. The client may include a management client and a consumer client, wherein the management client and the consumer client may be two different clients or may be integrated into the same client. The management client may be used by administrators of the database, who may perform data modeling, etc. through the management client, and the consumer client may be used by users of the database, who may perform data query, etc. through the consumer client. For the sake of simplicity, the following descriptions are all illustrated by taking the management client and the consumer client as two clients as examples.
[0044] Optionally, the client 120 may also be a plug-in or function in a database client for implementing data query management, such as a data query function module of a database client, etc. The above examples are for illustration only and are not specifically limited in this application.
[0045] Optionally, the client 120 may also be a client of the cloud platform, such as a console of the cloud platform, which may be a console based on the World Wide Web (web) or a console based on an application programming interface (API), which is not specifically limited in this application. The console may provide users with cloud services for data query, and users may obtain the right to use the data query system provided by this application by purchasing cloud services.
[0046] The data source storage device 110 and the client 120 may be distributed on the same device or on different devices. When the data source storage device 110 and the client 120 are distributed on the same device, the data source storage device 110 and the client 120 may both be set on a server. When the data source storage device 110 and the client 120 are distributed on different devices, the client 120 may be set on a terminal device, such as a mobile phone, a tablet, a laptop computer, a desktop computer, etc., and the data source storage device 110 may be set on a server. When the management client and the consumer client are two different clients, the management client and the consumer client may be installed on different terminal devices respectively.
[0047] The following first describes how a user performs a data query on the data source storage device 110 through a consumer client, wherein a user refers to a subject that uses a data query service, and may also be referred to as a consumer.
[0048] The consumer client can display Figure 3 The query interface 123 shown. The query interface 123 generally includes a filter area 121 and a display area 122. The filter area includes one or more filters. The filter is used to quickly locate the required specific data in a large amount of data for further analysis and display. The filter includes a filter attribute field and a filter value. The filter attribute field must be the second attribute field in the wide table, so that the filter attribute field can be applied to the wide table for query. The filter value can be a numerical range, text content, a predefined category or label, etc. By combining the filter attribute field and the filter value, the required data can be queried from the wide table. For example, if the filter attribute field is year and the filter value is 2003, then the data whose value in the attribute field of the second attribute field "year" is 2003 can be queried from the wide table. For another example, if the filter field is customer name and the filter value is Company A, then the data whose value in the attribute field of the second attribute field "customer name" is Company A or includes Company A can be filtered out from the wide table by matching or fuzzy matching. Multiple filters can be used at the same time. For example, the filter attribute field of filter 1 is "year" and the filter value is 2021, and the filter attribute field of filter 2 is "customer name" and the filter value is company A. Then, applying filter 1 and filter 2 at the same time will filter out data from the wide table whose attribute field value of the second attribute field "year" is 2021, and whose attribute field value of the second attribute field "customer name" is company A or includes company A. In order to make the interface more user-friendly, the filter can display some prompt information, for example, a default value or a user-friendly prompt label can be set for the filter to help users understand and choose how to set the filter value, or a visual filter can be provided, such as a drop-down button, a slider or a calendar selector. These components can more intuitively display the available filter values and provide users with convenient selection. Taking the drop-down button as an example, the unique value in the value of the second attribute field "year" of the wide table can be used as the option of the drop-down button. The display area is usually used to query the query data obtained after querying the wide table through the filter.
[0049] Filters are often used frequently, so the prompt information of the filter often needs to be updated frequently. However, because the filter attribute field of the filter is the second attribute field of the wide table, when searching for prompt information based on the filter attribute field, only the value in the second attribute field can be obtained from the wide table. However, wide tables are often very large, which will cause this process to take a very long time, greatly affecting efficiency.
[0050] In order to realize the use of values from dimension tables as filter prompts, the database needs to be improved in both the modeling stage and the consumption stage. Figure 4As shown in Figure 1, the database can be divided into a data source, a semantic model layer, and a consumption layer. The data source is used to store and manage wide tables and dimension tables. The semantic model layer is used to model semantic models based on wide tables and dimension tables. The consumption layer is used to provide users with interfaces for using wide tables and dimension tables through semantic models. Therefore, the modeling stage involves the data source and the semantic model layer, and the consumption stage involves the data source, the semantic model layer, and the consumption layer.
[0051] In the process of establishing a semantic model, in addition to the association configuration between the wide table and the dimension table, etc. as in the prior art (which is the same as the prior art and therefore not described in detail here), it is also necessary to establish a field mapping relationship and a mode configuration between the dimension table and the wide table.
[0052] The process of establishing the field mapping relationship between the dimension table and the wide table is as follows: the management client obtains the similarity condition between the wide table and the dimension table input by the user. The similarity condition is: if the number of the first attribute fields of a certain dimension table is greater than the quantity threshold, and the first attribute field in the first attribute field of this dimension table that is the same as or fuzzily matches the second attribute field of the wide table and the proportion of all the first attribute fields in this dimension table is greater than the proportion threshold, then this dimension table can be considered similar to the wide table. Both the quantity threshold and the proportion threshold can be set based on previous expert experience values. Here, the quantity threshold and the proportion threshold cannot be set too high. If they are too high, it may result in failure to find, or only a few dimension tables that are similar to the wide table are found. However, the quantity threshold and the proportion threshold cannot be set too low. If they are set too low, some dimension tables that should not be considered similar to the wide table will also be considered similar. Therefore, in practical applications, the quantity threshold and the proportion threshold can be set by comprehensively considering the hit rate and the accuracy rate. In a specific embodiment, the quantity threshold can be set to 5 and the proportion threshold can be set to 80%. When the user enters similarity conditions between the wide table and the dimension table through the management client, the user can enter the similarity conditions in the text box, check box, radio button, menu, and drop-down button in the condition input interface displayed in the management client, or switch the management client to command line mode and enter the conditions through the command line. Here, the first attribute field of the dimension table and the second attribute field of the wide table are the same, which means that the characters of the two attribute fields are the same. For example, the characters of the first attribute field "year" of the dimension table and the second attribute field "year" of the wide table are exactly the same. As long as the characters are compared one by one, it can be determined whether the two are exactly the same. The fuzzy matching of the first attribute field of the dimension table and the second attribute field of the wide table means that the characters of the two attribute fields are not the same, but are similar or have the same meaning. For example, the first attribute field of the dimension table is "year" and the second attribute field of the wide table is "year". At this time, the two attribute fields are not the same, but similar. At this time, the Hamming distance or Euclidean distance between the first attribute field "year" and the second attribute field "year" of the wide table can be calculated, and the first attribute field "year" and the second attribute field "year" of the wide table can be determined to be similar based on the Hamming distance and the Euclidean distance. Alternatively, the first attribute field of the dimension table is "year" and the second attribute field of the wide table is "year". In this case, the two attribute fields are different, but their meanings are the same. At this time, the knowledge graph can be used to determine that the first attribute field of the dimension table "year" and the second attribute field of the wide table "year" have the same meaning.
[0053] After receiving the similarity condition input by the user, the management client transmits the similarity condition to the data source storage device. If the similarity condition is pre-stored in the data source storage device (the storage process is similar to the above), it is not necessary to obtain the similarity condition input by the user through the above management client, but directly obtain the similarity condition stored in the data source storage device. The data source storage device obtains the wide table and multiple dimension tables stored in the hard disk, and selects the dimension table that meets the similarity condition from the multiple dimension tables as the target dimension table according to the similarity condition. Specifically, the data source storage device obtains the wide table and the first dimension table, and then calculates whether the wide table and the first dimension table meet the similarity condition. If the similarity condition is met, the first dimension table is used as the target dimension table. If the similarity condition is not met, it is considered that the first dimension table is not the target dimension table. Then, the data source storage device obtains the wide table and the second dimension table, and so on, until the data source storage device determines whether the last dimension table is the target dimension table. Alternatively, the data source storage device can select the dimension table that meets the similarity condition from the multiple dimension tables as the to-be-selected dimension table according to the similarity condition. Then, the similarity between the candidate dimension table and the wide table is calculated respectively, wherein the similarity between the candidate dimension table and the wide table can be measured by the ratio of the first attribute field in the first attribute field of the candidate dimension table that is identical to or fuzzily matches the second attribute field of the wide table to all the first attribute fields in this dimension table. When the ratio is larger, the similarity between the candidate dimension table and the wide table is higher, and the ratio is smaller, the similarity between the candidate dimension table and the wide table is smaller. After calculating the similarity between each candidate dimension table and the wide table, the candidate dimension tables can be sorted according to the size of the similarity. For example, the one with the highest similarity can be ranked first, and the one with the lowest similarity can be ranked last. Then, the first few candidate dimension tables with the highest similarity are selected as the target dimension tables. For example, assuming that the wide table includes year, month, quarter, week, product name, product category, and product price, the first attribute field of the order dimension table includes year, month, order batch number, and order source, etc., the first attribute field of the date dimension table includes year, month, quarter, and week, and both the order dimension table and the date dimension table meet similarity conditions, then the first attribute field of the date dimension table and the second attribute field of the wide table have a larger proportion of the attribute fields that are identical or fuzzy matched to the first attribute field of the date dimension table, and the first attribute field of the order dimension table and the second attribute field of the wide table have a smaller proportion of the attribute fields that are identical or fuzzy matched to the first attribute field of the order dimension table. Therefore, the date dimension table can be selected as the target dimension table, and the order dimension table cannot be selected as the target dimension table.
[0054] After the data source storage device determines the target dimension table, it starts from the first first attribute field of the target dimension table and compares the first attribute field of the target dimension table with the first second attribute field of the wide table to determine whether the two are the same. If they are the same, the first attribute field is considered to be the first recommended attribute field and the second attribute field is considered to be the second recommended attribute field. If they are not the same, no processing is performed. Then, the first attribute field of the target dimension table is compared with the second second attribute field of the wide table to determine whether the two are the same. And so on, until the comparison between the first attribute field of the target dimension table and the second second attribute field of the wide table is completed. Then, the data source storage device compares the second first attribute field of the target dimension table with the first second attribute field of the wide table to determine whether the two are the same. And so on, until the comparison between the last first attribute field of the target dimension table and the last second attribute field of the wide table is completed. Continue with Figure 2 Taking the example shown as an example,
[0055] The first attribute field "Product Name" in the product dimension table and the second attribute field "Product Name" in the wide table are the same, so the first attribute field "Product Name" is the first recommended attribute field, and the second attribute field "Product Name" is the second recommended attribute field;
[0056] The first attribute field "Product Category" in the product dimension table and the second attribute field "Product Category" in the wide table are the same, so the first attribute field "Product Category" is the first recommended attribute field, and the second attribute field "Product Category" is the second recommended attribute field;
[0057] The first attribute field "Product Price" in the product dimension table and the second attribute field "Product Price" in the wide table are the same, so the first attribute field "Product Price" is the first recommended attribute field, and the second attribute field "Product Price" is the second recommended attribute field;
[0058] The first attribute field "Year" in the date dimension table and the second attribute field "Year" in the wide table are the same, so the first attribute field "Year" is the first recommended attribute field, and the second attribute field "Year" is the second recommended attribute field;
[0059] The first attribute field "Month" in the date dimension table and the second attribute field "Month" in the wide table are the same, so the first attribute field "Month" is the first recommended attribute field, and the second attribute field "Month" is the second recommended attribute field;
[0060] The first attribute field "quarter" in the date dimension table and the second attribute field "quarter" in the wide table are the same, so the first attribute field "quarter" is the first recommended attribute field, and the second attribute field "quarter" is the second recommended attribute field;
[0061] The first attribute field "Week" in the date dimension table and the second attribute field "Week" in the wide table are the same, so the first attribute field "Week" is the first recommended attribute field, and the second attribute field "Week" is the second recommended attribute field.
[0062] The data source storage device sends the first recommended attribute field and the second recommended attribute field to the management client. The management client displays the first recommended attribute field and the second recommended attribute field and the corresponding relationship between them through the wide table configuration interface. Figure 5 As shown, two columns of text boxes can be displayed on the width configuration interface, wherein the first column of text boxes includes 7 text boxes, which are respectively used to display the 7 second recommended attribute fields "Product Name", "Product Category", "Product Price", "Year", "Month", "Quarter" and "Week" of the wide table. The second column of text boxes includes 7 text boxes, which are respectively used to display the 7 first recommended attribute fields "Product Name", "Product Category", "Product Price", "Year", "Month", "Quarter" and "Week" of the target dimension table.
[0063] In the first text box, "=" indicates the corresponding relationship between the second recommended attribute field "product name" and the first recommended attribute field "product name";
[0064] In the second line of text boxes, "=" is used to indicate the mapping relationship between the first attribute field "product category" and the second attribute field "product category";
[0065] In the third text box, “=” is used to indicate the mapping relationship between the second recommended attribute field “product price” and the first recommended attribute field “product price”;
[0066] In the fourth text box, “=” is used to indicate the mapping relationship between the second recommended attribute field “year” and the first recommended attribute field “year”;
[0067] In the fifth text box, “=” indicates the mapping relationship between the second recommended attribute field “month” and the first recommended attribute field “month”;
[0068] In the sixth line of text box, “=” indicates the mapping relationship between the second recommended attribute field “quarter” and the first recommended attribute field “quarter”;
[0069] In the seventh text box, “=” is used to indicate the mapping relationship between the second recommended attribute field “week” and the first recommended attribute field “week”.
[0070] The user can view the first recommended attribute field and the second recommended attribute field and the mapping relationship between them in the wide table configuration interface. If the data query system display content is determined by the maintenance personnel that there is no problem with the mapping relationship between the first recommended attribute field and the second recommended attribute field, then the user can click the confirmation button in the wide table configuration interface. Then, the management client can store the mapping relationship between the first recommended attribute field and the second recommended attribute field as the field mapping relationship between the dimension table and the wide table. If the data query system display content is determined by the maintenance personnel that the mapping relationship between the first recommended attribute field and the second recommended attribute field does not meet the requirements, the database administrator is allowed to modify it through the wide table configuration interface, and the data query system can store the modified mapping relationship. For example, there is a delete button on the right side of each row of text boxes on the wide table configuration interface. When the delete button is clicked, the text box of the row and the first recommended attribute field and the second recommended attribute field of the text box of the row can be deleted. The administrator of the database can also modify the first recommended attribute field and the second recommended attribute field in the text box. After the modification is completed, the user can click the confirmation button in the wide table configuration interface, so that the management client will save the first recommended attribute field and the second recommended attribute field and the mapping relationship between them as the mapping relationship between the dimension table and the wide table. The above example only takes deleting the entire line of text boxes and modifying the content of the file box as examples to describe some modification methods. In actual applications, more modification methods can be provided. For example, the first recommended attribute field of the entire target dimension table and the second recommended attribute field in the corresponding wide table can be deleted, etc. In addition, if the user thinks that the first recommended attribute field and the second recommended attribute field are not appropriate, he can cancel them by clicking the cancel button in the wide table configuration interface.
[0071] The process of establishing mode configuration is as follows: the No Acceleration radio button, One-way Acceleration radio button, and Two-way Acceleration radio button can be displayed on the wide table configuration interface. When the user selects the No Acceleration radio button, the No Acceleration mode is used, and the filter value is still taken from the wide table. When the user selects the One-way Acceleration radio button, the One-way Acceleration mode is used, and when the user selects the Two-way Acceleration radio button, the Two-way Acceleration mode is used. Whether it is the One-way Acceleration mode or the Two-way Acceleration mode, it means that the filter value is taken from the dimension table. As for the difference between One-way Acceleration and Two-way Acceleration, it will be introduced in detail below.
[0072] After the management client saves the mapping configuration, the management client sends the mapping configuration and the mode configuration to the data source storage device. The data source storage device saves the field mapping relationship between the dimension table and the wide table and the mode configuration in the semantic model. At this point, the processing operation of the modeling phase is completed.
[0073] In the consumption stage, the data query system can determine the mode configuration through interaction with the user. Specifically, after the user logs in to the consumer client, the client will send a login message to the data source storage device. After receiving the login message, the data source storage device will send the name of the semantic model in the database to the consumer client. The consumer client displays the name of the semantic model to the user. If the user selects the semantic model, the consumer client will send the name of the semantic model to the data source storage device. The data source storage device will obtain the mode configuration in the semantic model.
[0074] If the mode is configured as a one-way acceleration mode, the data source storage device will obtain all or part of the first attribute fields of the dimension table, and send all or part of the first attribute fields to the consumer client. The consumer client can display the received first attribute fields of the dimension table in various visual ways, including but not limited to drop-down buttons, check boxes, lists, etc. When the data source storage device sends all the first attribute fields of the dimension table to the consumer client, the "available" first attribute fields can be displayed in an enabled manner, and the "unavailable" first attribute fields can be displayed in a non-enabled manner. Here, the "available" first attribute field is a first attribute field that has established a mapping relationship with the second attribute field in the wide table, and the "unavailable" first attribute field is a first attribute field that has not established a mapping relationship with the second attribute field in the wide table.
[0075] The consumer client obtains the filter field input by the user, wherein the filter field is one or more first attribute fields selected from multiple first attribute fields of the dimension table displayed by the consumer client. When the consumer client obtains that the user has selected a filter field, a filter is generated; when the consumer client obtains that the user has selected multiple filter fields, multiple filters are generated. If the consumer client obtains that the user has deleted the corresponding filter field after selecting the filter field, the consumer client will also delete the corresponding filter. After obtaining the user's input to add a filter field again, the consumer client will add the filter corresponding to the filter field. When the data source storage device sends all the first attribute fields of the dimension table to the consumer client, if the consumer client obtains that the user clicks on the first attribute field displayed in a non-enabled mode, no filter will be generated. When the consumer client obtains that the user clicks on the first attribute field displayed in an enabled mode, the corresponding filter will be generated.
[0076] After the data query system obtains the selection results of the filter field, the consumer client can display the following Figure 3The query interface is displayed. Each filter field corresponds to a filter in the filter area. The consumer client sends the selected filter field to the data source storage device. The data source storage device will traverse each dimension table to find the first attribute field that is the same as the filter field in the dimension table. Then, the data source storage device reads out the non-repeating unique value of the first attribute field found, and then sends all the non-repeating values of the first attribute field found to the consumer client, and displays them as prompt information for the corresponding filter. Because the values of the filter field are sometimes repeated, at this time, only the unique value needs to be taken as the prompt information, and the repeated values do not need to be used as prompt information. Even if the values in the prompt field are all the same, only one unique value needs to be taken, and other repeated values do not need to be used as prompt information. Continue with Figure 2 Taking the example shown, when the filter fields include "Product Category" and "Year", the corresponding values of "Product Category" are "Home Appliances", "Communications", "Home Appliances" and "Home Appliances"; the corresponding values of "Year" are "2021", "2021", "2021", "2021", so the only values corresponding to "Product Category" are "Home Appliances" and "Communications", and the only value corresponding to "Year" is "2021".
[0077] The consumer client obtains the filter value input by the user, wherein the filter value can be selected by the user from the prompt information displayed on the query interface. For example, the filter value "home appliances" is selected from the prompt information "home appliances" and "communications" of the filter corresponding to the "product category" filter field, and the filter value "2021" is selected from the prompt information "2021" of the filter corresponding to the "year" filter field. Then, the consumer client sends a query request containing the filter field and the filter value to the data source storage device. For example, the consumer client sends a query request containing the filter field "product category" and the corresponding filter value "home appliances", the filter field "year" and the corresponding filter value "2021" to the data source storage device.
[0078] Because the filter field of the first attribute field of the dimension table can only be used to search the dimension table, but not the wide table, after receiving the filter field and the filter value, the data source storage device needs to search the field mapping relationship between the dimension table and the wide table for the filter field of the first attribute field of the dimension table, and convert it into the second attribute field of the wide table as the filter attribute field. Then, the data source storage device combines the filter attribute field and the filter value to obtain the filter condition. The data source storage device uses the filter condition to filter the wide table to obtain the filter data.
[0079] If the mode is configured as a bidirectional acceleration mode, the data source storage device will obtain all or part of the second attribute fields of the wide table, and send all or part of the second attribute fields to the consumer client. The consumer client can display the second attribute fields of the received wide table in various visual ways, including but not limited to drop-down buttons, check boxes, lists, etc. When the data source storage device sends all the second attribute fields of the wide table to the consumer client, the "available" second attribute fields can be displayed in an enabled manner, and the "unavailable" second attribute fields can be displayed in a non-enabled manner. Here, the "available" second attribute field is a second attribute field that has established a mapping relationship with the first attribute field in the dimension table, and the "unavailable" second attribute field is a second attribute field that has not established a mapping relationship with the first attribute field in the dimension table.
[0080] The consumer client obtains the filter attribute field input by the user, wherein the filter attribute field is one or more second attribute fields selected from multiple second attribute fields of the wide table displayed by the consumer client. When the consumer client obtains that the user has selected a filter attribute field, a filter is generated; when the consumer client obtains that the user has selected multiple filter attribute fields, multiple filters are generated. If the consumer client obtains that the user has deleted the corresponding filter field after selecting the filter field, the consumer client will also delete the corresponding filter. After obtaining the user's input to add a filter field again, the consumer client will add the filter corresponding to the filter field. When the data source storage device sends all the first attribute fields of the dimension table to the consumer client, if the consumer client obtains that the user clicks on the first attribute field displayed in a non-enabled mode, no filter will be generated. When the consumer client obtains that the user clicks on the first attribute field displayed in an enabled mode, the corresponding filter will be generated.
[0081] After selecting the filter attribute field, the consumer client can display the following Figure 3The query interface is displayed. Each filter attribute field corresponds to a filter in the filter area. The consumer client sends the selected filter attribute field to the data source storage device. The data source storage device maps the filter attribute field of the second attribute field belonging to the wide table to the filter field of the first attribute field belonging to the dimension table according to the mapping configuration. Then, the data source storage device traverses each dimension table to find the first attribute field that is the same as the filter field in the dimension table. Then, the data source storage device reads out the unique non-repeating value of the first attribute field found, and then sends all the non-repeating values of the first attribute field found to the consumer client and displays them as the prompt information of the corresponding filter. The filter value can be selected from the prompt information displayed on the query interface. For example, the filter value "home appliances" is selected from the prompt information "home appliances" and "communication" of the filter corresponding to the filter field "product category", and the filter value "2021" is selected from the prompt information "2021" of the filter corresponding to the filter field "year". Then, the consumer client sends the query request containing the filter attribute field and the filter value to the data source storage device. For example, the consumer client sends the filter attribute field "product category" and the corresponding filter value "home appliances", the filter attribute field "year" and the corresponding filter value "2021" to the data source storage device. The data source storage device combines the filter attribute field and the filter value to obtain the filter condition. The data source storage device uses the filter condition to filter the wide table to obtain the filter data.
[0082] Even for the same wide table and dimension table, one or more of the association configuration, mapping configuration, and mode configuration between the wide table and dimension table may be different under different semantic models. Different businesses may use different semantic models. For example, under semantic model 1, a bidirectional acceleration mode may be used, and under semantic model 2, a unidirectional acceleration mode may be used. Users can select the appropriate semantic model according to their needs.
[0083] As mentioned above, dimension tables are much smaller than wide tables. Therefore, the efficiency of obtaining filter prompt information from dimension tables is much higher than that of obtaining filter prompt information from wide tables. When the one-way acceleration mode is used, users will perceive wide tables and dimension tables, and users need to have a better understanding of wide tables and dimension tables. Therefore, the one-way acceleration mode can be used by people who are more familiar with the underlying principles of the database. When the two-way acceleration model is used, users will only perceive wide tables and not dimension tables. It is suitable for people who do not understand the underlying principles of the database, such as accountants.
[0084] See also Figure 6 , Figure 6This is a method for establishing a field mapping relationship between a dimension table and a wide table provided by the present application. The method for establishing a field mapping relationship between a dimension table and a wide table of the present application can be completed in the modeling stage.
[0085] S101: The client sends a modeling request to a data source storage device. Correspondingly, the data source storage device receives the modeling request sent by the client.
[0086] In some possible embodiments, the modeling request is used to establish a data model. The purpose of data modeling is to convert complex business requirements into a database system that is easy to manage and use, thereby improving the quality and efficiency of data and supporting business development and innovation. In the process of establishing the data model, a field mapping relationship between the dimension table and the wide table can be established. Because the data model usually includes a physical layer, a logical layer and a presentation layer. The field mapping relationship between the dimension table and the wide table can be set at the physical layer or at the logical layer. In order to facilitate the understanding of the data model, the field mapping relationship between the dimension table and the wide table can be set at the logical layer, so that it is also convenient to design and modify the data model. In order to optimize performance and improve the efficiency of data access, the field mapping relationship between the dimension table and the wide table can also be set at the physical layer, and placing the mapping relationship at the physical layer can also be closer to actual data storage and operation. Of course, the field mapping relationship between the dimension table and the wide table can also be used as a mapping relationship establishment module separately. At this time, only the identifier of the wide table and the identifier of the dimension table need to be input to obtain the field mapping relationship between the wide table and the dimension table, thereby improving the reuse rate of the mapping relationship establishment module. The data model can be created using a data modeling tool, for example, a data modeling tool developed by various companies, because data modeling tools usually have the ability to create both logical and physical layers. Therefore, a data modeling tool is used to implement the field mapping relationship between the dimension table and the wide table set at the logical layer, or the field mapping relationship between the dimension table and the wide table set at the physical layer.
[0087] S102: The data source storage device selects the same or matching first recommended attribute field and second recommended attribute field from the dimension table and the wide table according to the modeling request.
[0088] In some possible embodiments, after receiving the modeling request, the logical layer will be created first, and then the physical layer will be created. When creating the logical layer, the processing logic for the wide table and the dimension table can be determined first, for example, inserting, deleting, updating or querying the wide table or the dimension table, or, when the wide table and the dimension table have the same attribute field (for example, the time dimension table has the first attribute field of "year", and the wide table also has the second attribute field of "year"), choose the wide table or the dimension table for access operations, etc., and then encapsulate these operations into objects. Among them, the object can be a data access object, a data transmission object, etc. Therefore, if the field mapping relationship between the dimension table and the wide table is set at the logical layer, then the following operations are added when constructing the logical layer; if the field mapping relationship between the dimension table and the wide table is set at the physical layer, then the logical layer can be constructed first, and then the following operations are added when constructing the physical layer:
[0089] The data source storage device obtains a similarity condition between the wide table and the dimension table. The similarity condition between the wide table and the dimension table may be set in advance based on experience, may be input by the user at the time, or may be obtained after the user modifies the pre-set similarity condition. Then, the data source storage device will compare according to the similarity condition to determine whether the dimension table and the wide table are similar. If the dimension table and the wide table are similar, the first first attribute field is obtained from the dimension table, the first second attribute field is obtained from the wide table, and the character of the first first attribute field is compared with the character of the first second attribute field. If they are the same or fuzzy matching, the first first attribute field of the dimension table and the second second attribute field of the wide table are set as the first recommended attribute field and the second recommended attribute field respectively, and then the second second attribute field of the wide table is obtained, and the first second attribute field of the dimension table is matched with the second second attribute field of the wide table. If they are not the same or not fuzzy matching, the first first attribute field of the dimension table and the first second attribute field of the wide table are not processed, and the second second attribute field of the wide table is directly obtained, and the first second attribute field of the dimension table is matched with the second second attribute field of the wide table. And so on, until the second attribute field of the wide table and the first attribute field of the dimension table are traversed respectively. Here, fuzzy matching can be implemented by using specific functions, regular expressions, knowledge graphs, etc. Among them, the specific function can be the similarity (LIKE) function in the SQL language. Regular expressions are composed of ordinary characters (such as letters, numbers, symbols) and wildcards (for example: ".", "*", "+"). Among them, each wildcard represents a wildcard rule. For example, "." means matching any single character. "*" means matching zero or more of the preceding characters. "+" means matching one or more of the preceding characters. In addition, fuzzy matching can also be implemented through knowledge graphs and the like. After processing the above steps, the data source storage device will obtain one or more groups of identical or matching first recommended attribute fields and second recommended attribute fields.
[0090] S103: The data source storage device sends the first recommended attribute field and the second recommended attribute field to the client. Correspondingly, the client receives the first recommended attribute field and the second recommended attribute field sent by the data source storage device.
[0091] In some possible embodiments, the first recommended attribute field and the second recommended attribute field may be directly applied, or may be applied after user consent or modification. If the first recommended attribute field and the second recommended attribute field are directly applied, they only need to be provided to the user in a viewable form, such as a prompt box, etc. If the first recommended attribute field and the second recommended attribute field are applied after user consent or modification, they need to be provided to the user in an editable form, such as a text box, etc.
[0092] S104: The client sends the mode configuration selected by the user to the data source storage device. Correspondingly, the data source storage device receives the mode configuration sent by the client.
[0093] In some possible embodiments, the mode configuration includes a non-acceleration mode, a one-way acceleration mode, and a two-way acceleration mode. Regardless of whether the non-acceleration mode, the one-way acceleration mode, or the two-way acceleration mode is adopted, the data model can be the same. The mode configuration will only affect whether the field mapping relationship between the dimension table and the wide table is used in the subsequent consumption stage and when the field mapping relationship between the dimension table and the wide table is used. Therefore, the mode configuration can also be set in the consumption stage.
[0094] See also Figure 7 , Figure 7 The data query method of the present application is implemented in a one-way acceleration mode during the consumption phase, such as Figure 7 As shown, the data query method of the present application includes:
[0095] S201: The client sends a request for obtaining a value to the data source storage device. Correspondingly, the data source storage device receives the request for obtaining a value sent by the client.
[0096] In some possible embodiments, the value request includes a filter field. The filter field can be selected by the user from the first attribute field of the dimension table displayed by the client. Therefore, the filter field belongs to the first attribute field and can be directly used to query the dimension table. In a specific embodiment, taking structured query language (SQL) as an example, the parameters of the value request may include a select (SELECT) clause and a from (FROM) clause. The select clause is used to specify the field to be retrieved, such as year, product name, customer name, etc., and the filter field can be filled in here. The from (FROM) clause is used to specify the table from which data is retrieved, and the dimension table can be filled in here. Here, the number of filter fields can be one or more. When the number of filter fields is multiple, multiple filter fields can belong to the same dimension table. Taking the filter fields including "year" and "month" belonging to the time dimension table as an example, the value request can include an SQL statement at this time, and the select clause of the SQL statement is filled with the filter field "year" and the filter field "month" and the from clause is filled with "time dimension table", and the data source storage device can be queried. The above example is explained using one SQL statement as an example. In actual applications, it can also be completed through two SQL statements in the value request or even by sending two value requests. There is no specific limitation here. When there are multiple filter fields, the multiple filter fields can belong to different dimension tables. Taking the filter fields including "year" belonging to the time dimension table and "product category" of the product dimension table as an example, the value request can include two SQL statements at this time. The select clause of the first SQL statement is filled with the filter field "year" and the from clause is filled with "time dimension table". The select clause of the second SQL statement is filled with the filter field "product category" and the from clause is filled with "product dimension table". Then, the data source storage device can be queried. For example:
[0097] The first SQL statement could be:
[0098] SELECT filter field "year",
[0099] FROM time dimension table.
[0100] The second SQL statement could be:
[0101] SELECT filter field "Product Category",
[0102] FROM product dimension table.
[0103] The above example is illustrated by taking two SQL statements as an example. In actual application, it can also be completed in one SQL statement, or even by sending two value-getting requests. No specific limitation is made here.
[0104] S202: The data source storage device obtains a value from the dimension table according to the value obtaining request and obtains prompt information.
[0105] In some possible embodiments, the data source storage device retrieves from the dimension table according to the value request and obtains multiple data values of the filter field as prompt information. Continuing with SQL as an example, the data source storage device will check the correctness of the syntax and semantics of the SQL statement. If the syntax and semantics of the SQL statement are correct, the query operation is performed in the dimension table, starting from the first first attribute field of the dimension table and comparing it with the filter field. If the characters of the two are not the same or are not fuzzy matching, continue to search for the next first attribute field until the first attribute field that is the same as the filter field is found. Then, the unique value of the first attribute field (for example, a column of the dimension table) is extracted as prompt information. When there are multiple filter fields and multiple filter fields belong to the same dimension table, start from the first first attribute field of the dimension table and compare it with the first filter field. If the characters of the two are not the same or cannot be fuzzy matched, continue to search for the next first attribute field until the first attribute field that is the same as the first filter field is found. Then, start from the first first attribute field of the dimension table and compare it with the second filter field. If the characters of the two are not the same or cannot be fuzzy matched, continue to search for the next first attribute field until the first attribute field that is the same as the second filter field is found. And so on, until all filter fields are searched. When there are multiple filter fields and the multiple filter fields belong to different dimension tables, the search of each filter field is performed in the corresponding dimension table.
[0106] S203: The data source storage device sends the prompt information to the client. Correspondingly, the client receives the prompt information sent by the data source storage device.
[0107] S204: The client displays prompt information on the filter.
[0108] In some possible embodiments, the prompt information may include the value of one filter field, or may include the values of multiple filter fields. When there are multiple filter fields, the values of these filter fields can be displayed on their corresponding filters respectively. For example, when the filter fields include "year" and "product category", the only value of the filter field "year" is "2021", and the only value of the filter field "product category" is "home appliances" and "communications". Then, "2021" can be displayed in the drop-down button of the filter as the prompt information of the filter corresponding to "year", and "home appliances" and "communications" can be displayed in the drop-down button of the filter as the prompt information of the filter corresponding to "product category".
[0109] S205: The client sends a query request to the data source storage device. Correspondingly, the data source storage device receives the query request sent by the client.
[0110] In some possible embodiments, the query request includes a filter field and a filter value. In addition, the query request may also include other parameters, such as the identifier of a data table, etc. The filter value may be selected by the user from the prompt information. Taking SQL as an example, the query request may include a select clause, a from clause, and a when clause, wherein the select clause is used to specify the field to be retrieved, such as year, product name, customer name, etc. The from clause is used to specify the table from which data is to be retrieved, and the when clause is used to specify the matching condition. Therefore, the filter field may be filled in the select clause, the wide table may be filled in the from clause, and the filter value may be filled in the when clause. The query request may include the filter field and filter value of one filter, or may include the filter field and filter value of multiple filters. When there are multiple filter fields, and the multiple filter fields belong to the same dimension table or belong to multiple different dimension tables, the query request may only include one SQL statement at this time, and the select clause of the SQL statement may be filled with multiple filter fields, the from clause may be filled with "wide table", and the when clause may be filled with the filter values of each filter field. Here, although the filter fields may belong to different dimension tables, the query is ultimately performed from the wide table, so the same SQL statement can be used. For example, the SQL statement:
[0111] SELECT filter field "year", filter field "product category",
[0112] FROM wide table,
[0113] WHERE "Year" = 2021, "Product Category" = "Home Appliances" && "Communications".
[0114] In the next step, the filter fields of each dimension table are converted into filter attribute fields belonging to the wide table. Similarly, the above example is illustrated by taking one SQL statement as an example. In actual application, it can also be completed in multiple SQL statements, or even by sending multiple query requests. It is not specifically limited here.
[0115] S206: The data source storage device determines the filter attribute field associated with the filter field according to the field mapping relationship between the dimension table and the wide table.
[0116] In some possible embodiments, because the filter field in the query request is the first attribute field of the dimension table, it needs to be converted into the second attribute field of the wide table. Continuing with SQL as an example, the selection clause of the query request is one or more filter fields, and the from clause is filled with a wide table. When the clause is a filter value, however, the filter field in the selection clause is the first attribute field of the dimension table, and the wide table cannot be queried at all. Therefore, it is necessary to determine the filter attribute field associated with the filter field based on the field mapping relationship between the dimension table and the wide table. Specifically, first compare the filter field with the first first attribute field of the dimension table in the field mapping relationship between the dimension table and the wide table. If the two are the same, the first second attribute field of the wide table corresponding to the first first attribute field of the dimension table is determined as the filter attribute field. If the two are not the same, the next first attribute field of the dimension table is obtained, and so on, until the same first attribute field is found or until the last first attribute field of the dimension table. Then, the filter attribute field is used to replace the filter field in the selection clause of the query request to obtain an SQL statement. For example, the SQL statement:
[0117] SELECT filters the attribute fields "year" and "product category".
[0118] FROM wide table WHERE "year" = 2021,
[0119] “Product Category” = “Home Appliances” && “Communications”.
[0120] S207: The data source storage device performs a query operation on the wide table according to the filter attribute field and the filter value.
[0121] In some possible embodiments, the data source storage device may use a query statement to perform a query operation on a wide table. Taking SQL language as an example, the data source storage device may perform syntax parsing, semantic analysis, query optimization, etc. on the SQL statement. The data source storage device will decompose the SQL statement into multiple tags, such as keywords, identifiers, operators, etc. Among them, the keywords may be select (SELECT), from (FROM), when (WHERE), etc. Keywords are usually case-insensitive, so uppercase and lowercase have the same meaning in SQL. Identifiers may be user-defined object names, such as the names of wide tables and dimension tables, attribute field names, etc. Operators may be greater than, less than, or equal to, etc. Then, according to the SQL grammar rules, the combination of tags is checked to ensure that the structure of the statement is correct; the existence and legitimacy of the wide table, dimension table, and attribute field in the SQL statement are checked; and whether the user has the corresponding authority for the queried wide table, dimension table, and attribute field. If the check passes, the data source storage device can perform a query operation on the wide table to obtain the query data.
[0122] See also Figure 8 , Figure 8 The data query method of the present application is implemented in a one-way acceleration mode during the consumption phase. Figure 7 The data query method shown in the figure carries a filter field belonging to the first attribute field of the dimension table in the value request, so it can be applied to the dimension table for value acquisition. However, the query request also carries a filter field belonging to the first attribute field of the dimension table, so it cannot be directly applied to the wide table for data query. Instead, it is necessary to use the field mapping relationship between the dimension table and the wide table to convert the filter field into the filter attribute field before querying. Figure 8 The value request of the data query method shown in the figure carries the second attribute field of the wide table. Therefore, it cannot be directly applied to the dimension table for value acquisition. It is necessary to use the field mapping relationship between the dimension table and the wide table to convert the filter attribute field into the filter field before value acquisition can be performed. However, the query request also carries the second attribute field of the wide table. Therefore, it can be directly applied to the wide table for data query. Figure 8 As shown, the data query method of the present application includes:
[0123] S301: The client sends a request for obtaining a value to the data source storage device. Correspondingly, the data source storage device receives the request for obtaining a value sent by the client.
[0124] In some possible embodiments, the value request includes a filter attribute field. The filter attribute field may be selected by the user from the second attribute field of the wide table displayed by the client. Therefore, the filter attribute field belongs to the second attribute field and cannot be directly used to query the dimension table. In a specific embodiment, taking SQL as an example, the filter attribute field may be filled in the select clause, and the dimension table may be filled in the from clause. Here, the number of filter attribute fields may be one or more. When the number of filter attribute fields is multiple, the filter fields corresponding to the multiple filter attribute fields may belong to the same dimension table. Taking the example that the filter attribute fields include "year" and "month" belonging to the wide table, the value request may include an SQL statement at this time, the select clause of the SQL statement is filled with the filter attribute field "year" and the filter attribute field "month", and the from clause is filled with the "time dimension table". The above example is explained by taking an SQL statement as an example. In actual applications, it can also be completed by two SQL statements in the value request or even by sending two value requests, which is not specifically limited here. When the number of filter fields is multiple, the filter fields corresponding to the multiple filter attribute fields may belong to different dimension tables. For example, if the filter fields include "year" and "product category" which belong to the wide table, the value request can include two SQL statements. The select clause of the first SQL statement is filled with the filter attribute field "year", and the from clause is filled with "time dimension table". The select clause of the second SQL statement is filled with the filter attribute field "product category", and the from clause is filled with "product dimension table". For example,
[0125] The first SQL statement could be:
[0126] SELECT filters the attribute field "year",
[0127] FROM time dimension table.
[0128] The second SQL statement could be:
[0129] SELECT filters the attribute field "Product Category",
[0130] FROM product dimension table.
[0131] The above example is illustrated by taking two SQL statements as an example. In actual application, it can also be completed in one SQL statement, or even by sending two value-getting requests. No specific limitation is made here.
[0132] S302: The data source storage device determines the filter field associated with the filter attribute field according to the field mapping relationship between the dimension table and the wide table.
[0133] In some possible embodiments, because the filter attribute field in the value request is the second attribute field of the wide table, it cannot be used to query the dimension table. Therefore, it needs to be converted into the first attribute field of the dimension table. Continuing with SQL as an example, the selection clause of the value request is one or more filter attribute fields, and the from clause is the dimension table. However, the filter attribute field in the selection clause is the second attribute field of the wide table, and the dimension table cannot be queried at all. Therefore, it is necessary to determine the filter field associated with the filter attribute field based on the field mapping relationship between the dimension table and the wide table, and then use the filter field to replace the filter attribute field in the selection clause of the query request to obtain an SQL statement. For example, the SQL statement:
[0134] SELECT filter field "year", filter field "product category",
[0135] FROM wide table WHERE "year" = 2021,
[0136] “Product Category” = “Home Appliances” && “Communications”.
[0137] S303: The data source storage device obtains a value from the dimension table according to the screening attribute field to obtain prompt information.
[0138] In some possible embodiments, the data source storage device retrieves from the dimension table and obtains multiple values of the filter field as prompt information. Continuing with SQL as an example, the data source storage device will check the correctness of the syntax and semantics of the SQL statement. If the syntax and semantics of the SQL statement are correct, a query operation is performed in the dimension table, that is, starting from the first first attribute field of the dimension table and comparing it with the filter field. If the characters of the two are not the same or cannot be fuzzy matched, continue to search for the next first attribute field until the first attribute field that is the same as the filter field is found. Then, the unique value of the first attribute field (for example, a column of the dimension table) is extracted as prompt information. When there are multiple filter fields and multiple filter fields belong to the same dimension table, start from the first first attribute field of the dimension table and compare it with the first filter field. If the characters of the two are not the same or cannot be fuzzy matched, continue to search for the next first attribute field until the first attribute field that is the same as the first filter field is found. Then, start from the first first attribute field of the dimension table and compare it with the second filter field. If the characters of the two are not the same or cannot be fuzzy matched, continue to search for the next first attribute field until the first attribute field that is the same as the second filter field is found. And so on, until all filter fields are searched. When there are multiple filter fields and the multiple filter fields belong to different dimension tables, the search of each filter field is performed in the corresponding dimension table.
[0139] S304: The data source storage device sends the prompt information to the client. Correspondingly, the client receives the prompt information sent by the data source storage device.
[0140] S305: The client displays prompt information on the filter.
[0141] In some possible embodiments, the prompt information may include the value of one filter field, or may include the values of multiple filter fields. When there are multiple filter fields, the values of these filter fields can be displayed on their corresponding filters respectively. For example, when the filter fields include "year" and "product category", the only value of the filter field "year" is "2021", and the only value of the filter field "product category" is "home appliances" and "communications". Then, "2021" can be displayed in the drop-down button of the filter as the prompt information of the filter corresponding to "year", and "home appliances" and "communications" can be displayed in the drop-down button of the filter as the prompt information of the filter corresponding to "product category".
[0142] S306: The client sends a query request to the data source storage device. Correspondingly, the data source storage device receives the query request sent by the client.
[0143] In some possible embodiments, the query request includes a filter attribute field and a filter value. In addition, the query request may also include other parameters, such as the identifier of the data table, etc. The filter value may be selected by the user from the prompt information. Taking SQL as an example, the query request may include a select clause, a from clause, and a when clause, wherein the select clause is used to specify the field to be retrieved, such as year, product name, customer name, etc. The from clause is used to specify the table from which data is to be retrieved, and the when clause is used to specify the matching condition. Therefore, the filter attribute field may be filled in the select clause, the wide table may be filled in the from clause, and the filter value may be filled in the when clause. The query request may include the filter attribute field and filter value of a filter, or may include the filter attribute field and filter value of multiple filters. When the number of filter attribute fields is multiple, the query request may include only one SQL statement, the select clause of the SQL statement is filled with multiple filter attribute fields, the from clause is filled with "wide table", and the when clause is filled with the filter values of each filter attribute field. For example, the SQL statement:
[0144] SELECT filters the attribute field "year" and the filter field "product category".
[0145] FROM wide table WHERE "year" = 2021,
[0146] “Product Category” = “Home Appliances” && “Communications”.
[0147] Similarly, the above example is described using one SQL statement as an example. In actual applications, it can also be completed in multiple SQL statements, or even by sending multiple query requests. No specific limitation is made here.
[0148] S307: The data source storage device performs a query operation on the wide table according to the filter attribute field and the filter value.
[0149] In some possible embodiments, the data source storage device may use a query statement to perform a query operation on a wide table. Taking SQL language as an example, the data source storage device may perform syntax parsing, semantic analysis, query optimization, etc. on the SQL statement. The data source storage device will decompose the SQL statement into multiple tags, such as keywords, identifiers, operators, etc. Among them, the keywords may be select (SELECT), from (FROM), when (WHERE), etc. Keywords are usually case-insensitive, so uppercase and lowercase have the same meaning in SQL. Identifiers may be user-defined object names, such as the names of wide tables and dimension tables, attribute field names, etc. Operators may be greater than, less than, or equal to, etc. Then, according to the SQL grammar rules, the combination of tags is checked to ensure that the structure of the statement is correct; the existence and legitimacy of the wide table, dimension table, and attribute field in the SQL statement are checked; and whether the user has the corresponding authority for the queried wide table, dimension table, and attribute field. If the check passes, the data source storage device can perform a query operation on the wide table to obtain the query data.
[0150] Combination of the above Figures 1 to 8 The data query method provided by this application is described in detail. Fig. 9 and Fig.10 The data query system and computing device provided by this application are introduced respectively.
[0151] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a data query system provided by this application. Fig. 9 As shown, the data query system of the present application includes: a client 210 and a data source storage device 220. The following will focus on the data source storage device 220 for a detailed introduction.
[0152] The data source storage device 220 includes an acquisition unit 221, a determination unit 222, and an execution unit 223, wherein:
[0153] An acquisition unit 221 is used to acquire a query request, wherein the query request includes a filter field and a filter value, the filter field belongs to the first attribute field of a dimension table in a data source storage device included in the data query system, the filter field is used to indicate that a value is obtained from the same field of the dimension table as prompt information, and the filter value is selected from the prompt information.
[0154] A determination unit 222 is used to determine the filter attribute field associated with the filter field according to the field mapping relationship between the dimension table and the wide table, wherein the data source storage device also stores a wide table, the wide table includes multiple second attribute fields, the filter attribute field belongs to the second attribute field of the wide table, and the field mapping relationship is used to record the mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table.
[0155] The execution unit 223 is used to execute the operation of the query request according to the filter attribute field and the filter value.
[0156] Among them, the acquisition unit 221, the determination unit 222 and the execution unit 223 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the determination unit 222 is introduced below by taking the determination unit 222 as an example. Similarly, the implementation of the acquisition unit 221 and the execution unit 223 can refer to the implementation of the determination unit 222.
[0157] As an example of a software functional unit, the determination unit 222 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the determination unit 222 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0158] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0159] As an example of a hardware functional unit, the determination unit 222 may include at least one computing device, such as a server, etc. Alternatively, the A module may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0160] The multiple computing devices included in the determination unit 222 may be distributed in the same region or in different regions. The multiple computing devices included in the determination unit 222 may be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the determination unit 222 may be distributed in the same VPC or in multiple VPCs. The multiple computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0161] It is worth noting that the determination unit 222 can be used to execute Figure 6 The method for establishing the field mapping relationship shown in Figure 7 as well as Figure 8 Similarly, the acquisition unit 221 and the execution unit 223 can be used to execute any step in the data query method shown in FIG. Figure 6 The method for establishing the field mapping relationship shown in Figure 7 as well as Figure 8 For any step in the data query method shown, the steps that the acquisition unit 221, the determination unit 222 and the execution unit 223 are responsible for implementing can be specified as needed.
[0162] See also Fig.10, Fig.10 300 is a schematic diagram of a computing device provided by the present application, and the computing device 300 may be the data query system in the aforementioned content. Further, the computing device 300 includes a processor 301, a storage unit 302, a storage medium 303, and a communication interface 304, wherein the processor 301, the storage unit 302, the storage medium 303, and the communication interface 304 communicate through a bus 305, and also communicate through other means such as wireless transmission.
[0163] The processor 301 is composed of a plurality of general-purpose processors, such as a CPU. The hardware chip is an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD is a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system on chip (SoC) or any combination thereof. The processor 301 executes various types of digital storage instructions, such as software or firmware programs stored in the storage unit 302, which enables the computing device 300 to provide a wide variety of services.
[0164] In a specific implementation, as an embodiment, the processor 301 includes one or more CPUs, such as Fig.10 CPU0 and CPU1 are shown in the figure.
[0165] In a specific implementation, as an embodiment, the computing device 300 also includes multiple processors, such as Fig.10 301 and processor 306 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor here refers to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0166] The storage unit 302 is used to store program codes, and is controlled by the processor 301 to execute the above Figure 1-Figure 8 The processing steps of the data query method in any embodiment. The program code includes one or more software units. The one or more software units are Fig. 9The acquisition unit, determination unit, and execution unit in the embodiment, wherein the acquisition unit is used to acquire a value request, a query request, etc. input by a user sent by a client, can be specifically used to implement Figure 7 S201, 205 and optional steps thereof in the embodiment, and, Figure 8 In the embodiment, S301, S305 and optional steps thereof, the determination unit is used to implement the conversion between the screening field and the screening attribute field, specifically to implement Figure 7 S206 in the embodiment and Figure 8 In S302 and its optional steps in the embodiment, the execution unit is used to query the database, specifically to implement Figure 7 S202 and S207 in the embodiment and their optional steps, Figure 8 S302 and S307 in the embodiment.
[0167] The storage unit 302 includes a read-only memory and a random access memory, and provides instructions and data to the processor 301. The storage unit 302 also includes a non-volatile random access memory. The storage unit 302 is a volatile memory or a non-volatile memory, or includes both volatile and non-volatile memories. Among them, the non-volatile memory is a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM). It can also be a hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk is a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.
[0168] The storage medium 303 is a carrier for storing data, such as a hard disk, a USB flash drive (universal serialbus), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk can be a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.
[0169] The communication interface 304 is a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface) for communicating with other servers or units.
[0170] The bus 305 is a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 305 is divided into an address bus, a data bus, a control bus, etc.
[0171] The bus 305 includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus 305 in the figure.
[0172] Need to explain, Fig.10 This is only one possible implementation of the present application. In practical applications, the computing device 300 may also include more or fewer components, which is not limited here. Figure 1-Figure 9 The relevant explanations in the embodiments will not be repeated here.
[0173] The present application also provides a computing device cluster, which may be the business management system in the foregoing content, and the computing device cluster includes at least one computing device 300. The storage unit 302 in one or more computing devices 300 in the computing device cluster may store the same or different instructions for executing the business management method.
[0174] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the service management method.
[0175] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a high-density digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the business management method.
[0176] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes a plurality of computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0177] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed by the present invention, and these repairs or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data query method, It is characterized in that The method is applied to a data query system, and the method comprises: Obtaining a query request, the query request including a filter field and a filter value, the filter field belonging to a first attribute field of a dimension table in a data source storage device included in the data query system, the filter field being used to indicate obtaining a value from the same field of the dimension table as prompt information, and the filter value being selected from the prompt information; Determining a filter attribute field associated with the filter field according to a field mapping relationship between a dimension table and a wide table, wherein the data source storage device further stores a wide table, the wide table includes a plurality of second attribute fields, the filter attribute field belongs to the second attribute field of the wide table, and the field mapping relationship is used to record a mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table; The operation of the query request is performed according to the filter attribute field and the filter value.
2. The method according to claim 1, It is characterized in that Before determining the screening attribute field associated with the screening field according to the field mapping relationship between the dimension table and the wide table, the method further includes: Respectively obtain the first attribute field in the dimension table and the second attribute field in the wide table; Comparing the first attribute field and the second attribute field to obtain a comparison result; When the first attribute field and the second attribute field are identical or fuzzy matched, a mapping relationship between the first attribute field and the second attribute field is determined according to the comparison as a field mapping relationship between the dimension table and the wide table.
3. The method according to claim 2, It is characterized in that Comparing the first attribute field and the second attribute field to obtain a comparison result includes: Compare the characters of the first attribute field with the characters of the second attribute field to determine a character comparison result of the first attribute field and the second attribute field; Generate a regular expression according to the characters of the first attribute field, wherein the regular expression includes one or more wildcards; Comparing the regular expression with characters of the second attribute field according to the wildcard rule represented by the wildcard, and generating a fuzzy matching result of the first attribute field and the second attribute field; The comparison result is generated according to the character comparison result and the fuzzy matching result.
4. The method according to any one of claims 1 to 3, It is characterized in that The dimension table and the wide table satisfy a similarity condition, wherein the similarity condition is that the number of first attribute fields of the dimension table is greater than a quantity threshold, and the ratio of the number of first attribute fields in the dimension table that are identical or fuzzy matched with any field in the wide table to the number of first attribute fields in the dimension table is greater than a ratio threshold, wherein the quantity threshold is an integer greater than zero set based on experience, and the ratio threshold is a real number greater than zero set based on experience.
5. A data query method, It is characterized in that The method is applied to a data query system, and the method comprises: Obtaining a query request, the query request including a filter attribute field and a filter value, the filter attribute field belonging to a second attribute field of a wide table in a data source storage device included in a data query system, the data source storage device also including a dimension table, the dimension table including a plurality of first attribute fields, the filter value being selected from values obtained from a first attribute field in the dimension table that is the same as the filter field, the filter field being a field associated with the filter attribute field determined according to a field mapping relationship between the dimension table and the wide table, the field mapping relationship being used to record a mapping relationship between the first attribute field of the dimension table and the second attribute field of the wide table; The operation of the query request is performed according to the filter attribute field and the filter value.
6. The method according to claim 5, It is characterized in that The method further comprises: Respectively obtain the first attribute field in the dimension table and the second attribute field in the wide table; Comparing the first attribute field and the second attribute field to obtain a comparison result; When the first attribute field and the second attribute field are identical or fuzzy matched, a mapping relationship between the first attribute field and the second attribute field is determined according to the comparison as a field mapping relationship between the dimension table and the wide table.
7. The method according to claim 6, It is characterized in that Comparing the first attribute field and the second attribute field to obtain a comparison result includes: Compare the characters of the first attribute field with the characters of the second attribute field to determine a character comparison result of the first attribute field and the second attribute field; Generate a regular expression according to the characters of the first attribute field, wherein the regular expression includes one or more wildcards; Comparing the regular expression with the characters of the second attribute field according to the wildcard rule represented by the wildcard, and generating a fuzzy matching result of the first attribute field and the second attribute field; The comparison result is generated according to the character comparison result and the fuzzy matching result.
8. The method according to any one of claims 5 to 7, It is characterized in that The dimension table and the wide table satisfy a similarity condition, wherein the similarity condition is that the number of first attribute fields of the dimension table is greater than a quantity threshold, and the ratio of the number of first attribute fields in the dimension table that are identical or fuzzy matched with any field in the wide table to the number of first attribute fields in the dimension table is greater than a ratio threshold, wherein the quantity threshold is an integer greater than zero set based on experience, and the ratio threshold is a real number greater than zero set based on experience.
9. A data query device, It is characterized in that The method comprises a unit for implementing the steps in the method according to any one of claims 1 to 4, or comprises a unit for implementing the steps in the method according to any one of claims 5 to 8.
10. A computing device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores instructions, and the processor executes the instructions in the memory to implement the method according to any one of claims 1 to 4, or implements the method according to any one of claims 5 to 8.
11. A computing cluster, It is characterized in that The method comprises a plurality of computing devices, each of which comprises a processor and a memory, wherein the memory stores instructions, and the processor executes the instructions in the memory to implement the method according to any one of claims 1 to 4, or implements the method according to any one of claims 5 to 8.
12. A computer-readable storage medium, It is characterized in that The method comprises instructions, which, when executed by a computing device, implement the method according to any one of claims 1 to 4, or implement the method according to any one of claims 5 to 8.