Data query methods, devices, media and electronic equipment
By separating and merging query sub-requests for specified indicators in the database of the Cartesian product data model, the problem of accurately querying indicators at different levels on a general query platform is solved, thereby improving the accuracy of indicator values and query efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING VOLCANO ENGINE TECH CO LTD
- Filing Date
- 2022-10-20
- Publication Date
- 2026-05-26
AI Technical Summary
In databases based on the Cartesian product data model, existing technologies struggle to accurately query the results data corresponding to specified indicators at different levels on a general query platform.
By obtaining the query request input by the user, the specified indicators at different levels are separated, corresponding query sub-requests are generated, and each query sub-request is responded to concurrently. The dataset is filtered from the database based on the Cartesian product data model, the indicator values of each specified indicator are determined, and the indicator values are merged based on the positional relationship to obtain accurate query results.
It enables accurate querying of specified indicators at different levels on a general query platform, ensuring the accuracy of indicator values and improving query efficiency, without requiring users to be aware of the level of each specified indicator.
Smart Images

Figure CN115630093B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a data query method, apparatus, medium, and electronic device. Background Technology
[0002] With the development of electronic information technology, databases can be used to maintain various types of data, providing a foundation for data analysis and data querying.
[0003] Currently, for databases with the same Cartesian product data model, how to accurately retrieve the result data corresponding to different indicators based on a general query platform is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] Firstly, this disclosure provides a data query method, including:
[0006] Obtain a query request input by the user, the query request carrying specified query conditions, the specified query conditions being used to describe specified indicators at different levels with positional relationships;
[0007] Separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0008] Concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0009] Based on the dataset corresponding to each query sub-request, determine the metric value of the specified metric queried by each query sub-request;
[0010] Based on the positional relationship of each specified indicator in the specified query conditions, the indicator values corresponding to each specified indicator are merged to obtain a merged result, which is used to represent the query result requested by the query request.
[0011] Secondly, this disclosure provides a data query device, comprising:
[0012] The acquisition module is used to acquire a query request input by the user, wherein the query request carries specified query conditions, and the specified query conditions are used to describe specified indicators at different levels with positional relationships.
[0013] The splitting module is used to separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0014] The filtering module is used to concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0015] The determination module is used to determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request;
[0016] The merging module is used to merge the indicator values corresponding to each specified indicator based on their positional relationship in the specified query conditions, and obtain a merging result. The merging result is used to represent the query result requested by the query request.
[0017] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of this disclosure.
[0018] Fourthly, this disclosure provides an electronic device, comprising:
[0019] A storage device on which computer programs are stored;
[0020] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect of this disclosure.
[0021] The above technical solution separates the specified indicators at different levels from the specified query conditions carried in the query request, generates corresponding query sub-requests for each specified indicator, and responds concurrently to the query sub-requests corresponding to each specified indicator. Based on the level corresponding to each query sub-request, data is filtered from the database to obtain the dataset corresponding to each query sub-request. Based on the filtered datasets corresponding to each query sub-request, the indicator value of the specified indicator queried by each query sub-request is determined, ensuring the accuracy of the indicator values. Furthermore, for users, there is no need to be aware of the level of each specified indicator; the query for specified indicators at different levels is implemented at the underlying level, enabling accurate querying of the same database with the same Cartesian product data model on a generalized query platform.
[0022] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0023] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0024] Figure 1 This is a flowchart illustrating a data query method according to an exemplary embodiment of the present disclosure.
[0025] Figure 2 This is a schematic diagram illustrating an interactive interface of a query platform according to an exemplary embodiment of the present disclosure.
[0026] Figure 3 This is another flowchart illustrating a data query method according to an exemplary embodiment of the present disclosure.
[0027] Figure 4 This is a block diagram illustrating a data query apparatus according to an exemplary embodiment of the present disclosure.
[0028] Figure 5 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0035] First, the Cartesian product is the product of the distinct rows of two sets. For example, for set A1 = {1, 2, 3} and set A2 = {4, 5, 6}, the Cartesian product of A1 and A2 is {(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5), (3, 6)}. In practical applications, most scenarios combine the Cartesian product to build data models, and then build databases based on these Cartesian data models and corresponding data. The following explanation illustrates the database built using the Cartesian product data model in a project development application scenario.
[0036] In project development application scenarios, requirement A and requirement B can be understood as one set, and the server side and the front-end (FE) side can be understood as another set. Based on these two sets and the corresponding data, a database as shown in Table 1 can be constructed. Specifically, Table 1 is a database constructed using a Cartesian product data model where requirement A is developed according to both the server side and the FE side, and requirement B is also developed according to both the server side and the FE side. Requirement A and requirement B represent requirement levels, while the server side and the FE side represent front-end levels, with the requirement level above the front-end level. Taking requirement A as an example, there are 6 developers on the server side and 2 developers on the FE side. In Table 1, requirement A has 8 records in the database, 6 of which represent data related to the server side, and the remaining 2 represent data related to the FE side. Each record corresponds to one person. In this data, the attribute levels of the requirement level are the same on both the server side and the FE side. These attributes refer to fields related to the requirement, such as requirement ID, requirement development start time, and requirement development end time. In addition, some attributes at the terminal level are the same in the data corresponding to the server side of requirement A, such as terminal ID, terminal development start time and terminal development end time. Similarly, in the data corresponding to the FE side of requirement A, terminal ID, terminal development start time and terminal development end time are also the same.
[0037] Requirement B is similar to Requirement A. You can refer to the relevant explanation of Requirement A to understand Requirement B, so I will not go into details here.
[0038]
[0039] Table 1
[0040] For a database like Table 1 above, since the data corresponding to a requirement is split into multiple records, the start and end times of requirement development are the same in these multiple records, but the start and end times of requirement development are different for different requirements. Therefore, when querying certain specific indicators, it is necessary to filter the data. If no filtering is performed, for example, when calculating the indicator value corresponding to the requirement level, if multiple records of the same requirement participate in the calculation, the calculated indicator value of the specified indicator will be inaccurate.
[0041] Taking the average development time of requirements A and B as an example, if the data in Table 1 is not filtered, the average development time of requirements A and B is calculated as sum(development completion time - development start time) / 13. The sum() function calculates the sum of the differences between the development completion time and development start time for each of the 13 data points in Table 1. Clearly, this result is incorrect. For the average development time of requirements A and B, only one record is needed for each requirement, i.e., sum(development completion time - development start time) / 2. Here, sum() calculates the sum of the differences between the development completion time and development start time for one data point in requirement A and one data point in requirement B.
[0042] Taking the average server-side development time as an example, if the data in Table 1 is not filtered, the average server-side development time will involve 5 records related to the server-side of requirement A and 4 records related to the server-side of requirement B in the calculation, i.e., sum(server-side development end time - server-side development start time) / 9. This sum is the sum of the differences between the server-side development end time and the server-side development start time for the 9 server-side records in Table 1, which is clearly incorrect. For the average server-side development time, only one data point from each requirement needs to be included in the calculation, i.e., sum(server-side development end time - server-side development start time) / 2. Here, sum() is the sum of the difference between the server-side development end time and the server-side development start time in one server-side record for requirement A and the difference between the server-side development end time and the server-side development start time in one server-side record for requirement B.
[0043] Therefore, for databases built using the Cartesian product data model, determining the value of a specified indicator requires filtering the data within the database. Furthermore, the filtering rules differ depending on the level of the specified indicator. Thus, for databases with the same Cartesian product data model, a pressing technical problem is how to retrieve different indicators using a common query platform while obtaining the correct values for those indicators. Here, "level" can refer to the requirement level corresponding to the demand or the endpoint level corresponding to the endpoint.
[0044] In view of this, the present disclosure provides a data query method, apparatus, medium and electronic device. For users, there is no need to be aware of the hierarchy of each specified indicator. The query of specified indicators at different levels is realized through the underlying layer. It can support accurate querying of the same database with the same Cartesian product data model on a general query platform, and at the same time, it can accurately query the indicator value corresponding to the specified indicator.
[0045] The following explanation, in conjunction with the accompanying drawings, illustrates the application scenarios of this disclosure in project development.
[0046] Figure 1 This is a flowchart illustrating a data query method according to an exemplary embodiment of the present disclosure. This data query method can be applied to mobile terminal electronic devices such as smartphones and tablets, as well as fixed terminal electronic devices such as servers. (Refer to...) Figure 1 The data query method may include the following steps.
[0047] Step S101: Obtain the query request input by the user. The query request carries specified query conditions, which are used to describe specified indicators at different levels with positional relationships.
[0048] Reference Figure 2 The image shows an interactive interface for a query platform, through which users can perform data queries. (Targeting...) Figure 2 The interactive interface shown does not require users to be aware of the hierarchy of various specified indicators. Users can select controls on the interface, which are generally used to select specified indicators, filtering conditions, data sources, grouping conditions, etc. For example, for Figure 2 The "Data Source" control allows you to select a database based on the Cartesian product data model as the data source. Figure 2 The "Specify Metrics" control allows you to select parameters such as development time for requirements and development time for client-side applications. Based on the selected control and the confirmation query control provided in the interactive interface, a corresponding query request is generated.
[0049] It's worth noting that query requests can be represented using SQL (Structured Query Language). For example, the SQL statement "select average development time of requirements and average development time of end-users from Cartesian product database where project to which requirements belong = project X groupby time having specified metric n" means querying the Cartesian product database for the two specified metrics: average development time of requirements and average development time of end-users for project X, while filtering out the specified metric n. The filtered result is then returned to the interactive interface for display, where the average development time of requirements is at a higher level than the average development time of end-users.
[0050] Taking the above SQL as an example, the average time for demand development and the average time for end-user development are the specified indicators at different levels in the specified query conditions carried by the query request. The average time for demand development is located before the average time for end-user development. Correspondingly, in the merged result, the indicator value corresponding to the average time for demand development is also located before the indicator value corresponding to the average time for end-user development.
[0051] It is worth noting that select represents the order in which the user selects the specified indicators. This order also reflects the degree of attention the user pays to each indicator. The specified indicators selected earlier have a higher degree of attention than those selected later. Therefore, the positional relationship of the specified indicators described in the specified query conditions can be consistent with the order in which the user selects the specified indicators.
[0052] In some embodiments, there is a voice command in SQL to set the sorting, namely the orderby command, which allows users to set the orderby command to determine the positional relationship of each specified indicator. The specific process can be referred to in related technologies, and will not be elaborated here.
[0053] Step S102: Separate the specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0054] As can be seen from the above, the logic for filtering data in the Cartesian product database differs depending on the specified indicators at different levels. Therefore, it is necessary to separate the specified indicators at different levels from the specified query conditions so that the database can be filtered according to different data filtering logics.
[0055] Following the example of the query request above, since the average time for requirement development and the average time for client development belong to different levels of specified indicators, corresponding query sub-requests can be generated for the specified indicators at different levels, which can be used to query the average time for requirement development and the average time for client development, respectively.
[0056] For example, if a query request carries specified query conditions including the average development time of the requirement, the total development time of the requirement, and the average development time of the end-user, since the average development time of the requirement and the total development time of the requirement belong to the same level, a corresponding query sub-request can be generated based on the average development time of the requirement and the total development time of the requirement. This query sub-request is used to query the average development time of the requirement and the total development time of the requirement corresponding to the requirement level.
[0057] Step S103: Concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0058] It is worth noting that the database here can be the database shown in Table 1.
[0059] As can be seen from the above, the logic for filtering data in the database differs depending on the specified indicator at different levels. Therefore, data can be filtered in the database according to the level corresponding to each query sub-request, and the dataset corresponding to the indicator value for calculating the specified indicator of each query sub-request can be obtained.
[0060] For example, taking the database shown in Table 1 as an example, if a query sub-request is used to query the average development time of a requirement as a specified metric, the dataset corresponding to this query sub-request can be shown in Table 2 below:
[0061]
[0062] Table 2
[0063] Step S104: Determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request.
[0064] It is worth noting that different specified indicators have different calculation logics for their values. The calculation logics for the values of different specified indicators can be stored in advance, and in practical applications, the corresponding calculation logic can be called to calculate the indicator values.
[0065] Step S105: Based on the positional relationship of each specified indicator in the specified query conditions, merge the indicator values corresponding to each specified indicator to obtain the merged result. The merged result is used to represent the query result requested by the query request.
[0066] Continuing with the example above, if the specified metrics include the average time for demand development and the average time for edge development, query sub-requests will be generated to query the average time for demand development and the average time for edge development, respectively, and two metric values will be obtained. The two metric values will be merged to obtain the merged result. Since the average time for demand development is located before the average time for edge development in the specified query conditions, the metric value of the average time for demand development is also located before the metric value of the average time for edge development in the merged result.
[0067] By separating the specified indicators at different levels from the query conditions carried in the query request, and generating corresponding query sub-requests for each specified indicator, the system concurrently responds to the query sub-requests corresponding to each specified indicator. Based on the level of each query sub-request, data is filtered from the database to obtain the dataset corresponding to each query sub-request. The indicator value of the specified indicator queried by each query sub-request is determined based on the filtered dataset, ensuring the accuracy of the indicator values. Furthermore, users do not need to be aware of the level of each specified indicator; the system implements queries for specified indicators at different levels through underlying mechanisms, enabling accurate queries on a generalized query platform using the same database as the Cartesian product data model. The concurrent response to each query sub-request also improves query efficiency.
[0068] In some embodiments, the specified metric carries hierarchical identification information, which can be used to separate specified metrics at different levels. The hierarchical identification information can be represented by characters, such as numbers and letters. For example, for the specified metric of average development time for requirements, its level can be represented by the number 1; for the specified metric of average development time for endpoints, its level can be represented by the number 2. By identifying the number 1 or the number 2, the level of the specified metric can be determined.
[0069] By using the above method, the specified indicators at different levels are separated from the specified query conditions by identifying the hierarchical identification information carried by the specified indicators, thereby generating a query sub-request for querying the specified indicators at the corresponding level.
[0070] In some embodiments, Figure 1 S103 shown can be implemented in the following way: For the specified indicator of the first level, according to the target requirement field corresponding to the specified indicator of the first level, the required data is filtered from the database to obtain the dataset corresponding to the specified indicator of the first level; For the specified indicators of other levels below the first level, according to the target requirement field corresponding to the specified indicator of the other level and the field corresponding to the level above the other level, the required data is filtered from the database to obtain the dataset corresponding to the specified indicator of the other level.
[0071] It is worth noting that the dataset corresponding to the specified metric is the same dataset corresponding to the query sub-request for that specified metric.
[0072] It is worth noting that in the application scenario of this public example, the first level can be the requirement level, and the other levels under the first level can be the end level.
[0073] It's worth noting that a database can contain multiple types of requirements, and these requirements can be combined in various ways to query specific metrics under different combinations. For example, when requirements include requirements A, B, and C, you can query the average development time for requirements A and B; similarly, you can query the average development time for requirements A and C; and so on.
[0074] When metrics can be queried under different combinations of requirements, specifically for the first level, the dataset corresponding to a given metric can be determined based on the target requirement field representing the first level within that metric. For example, for the requirement level, the average development time of a requirement is a given metric. In this metric, the target requirement field includes all requirement fields (i.e., requirement IDs) involved in all requirements in the database, such as requirement A and requirement B in Table 1. Then, by filtering the required data from the database based on requirement A and requirement B, the dataset corresponding to the average development time of requirement A at the requirement level can be obtained. As another example, for the requirement level, the total development time of requirement A is a given metric. In this metric, the target requirement field only includes requirement A. Then, by filtering the required data from the database based on requirement A, the dataset corresponding to the total development time of requirement A at the requirement level can be obtained.
[0075] For example, the above method of filtering the required data from the database using the target requirement field of the first-level specified indicator to obtain the dataset corresponding to the first-level specified indicator can be implemented in the following way: determine the first target dataset corresponding to the target requirement field based on the target requirement field of the first-level specified indicator. The data in the first target dataset is all the data in the database that has the target requirement field; retain any one data in the first target dataset, and determine the retained data as the data in the dataset corresponding to the first-level specified indicator, so as to obtain the dataset corresponding to the first-level specified indicator.
[0076] For example, taking the database shown in Table 1 above as an example, with the specified metric being the average development time of a requirement, the target requirement fields for this specified metric are Requirement A and Requirement B. In this case, the first target dataset corresponding to Requirement A is all the data in the database that contains Requirement A, as shown in Table 3 below:
[0077]
[0078] Table 3 shows the first target dataset corresponding to requirement B, which consists of all data in the database containing requirement B, as shown in Table 4 below:
[0079]
[0080] Table 4
[0081] It is worth noting that in the first target dataset, data corresponding to the target requirement field can be understood as a single data point, and a single data point can be understood as a row of data in Table 1.
[0082] For any one data point retained from Tables 3 and 4 above, the retained data is determined as the data in the dataset corresponding to the average time of demand development, as shown in Table 5 below:
[0083]
[0084] Table 5
[0085] It is worth noting that the time data involved in the average development time of requirements is only related to the time data of the requirement dimension. Therefore, the metadata in Table 5 can be further filtered to retain only the metadata related to requirements, resulting in Table 6 below:
[0086]
[0087] Table 6
[0088] Here, metadata is used to characterize the data represented by each cell in a row of data.
[0089] Based on Table 5 or Table 6, the determination of the specified metric value for each query sub-request, according to the dataset corresponding to each query sub-request, can be implemented in the following way: Determine the metric value of the average development time of the requirements based on the start and end times of the development of different requirements in the dataset corresponding to the average development time of the requirements. It is worth noting that "different requirements" here refers to all requirements in Table 5 or Table 6, i.e., requirements A and requirements B. Based on Table 5 or Table 6, read the time data required to calculate the average development time of the requirements, and call the calculation logic "sum(development end time - development start time) / 2" to determine the metric value of the average development time of the requirements. Here, the average development time of the requirements refers to the average development time of requirements A and requirements B.
[0090] For example, taking the database shown in Table 1 above, and using the specified metric as the development time of Requirement A, the target requirement field for this specified metric is Requirement A. In this case, the first target dataset corresponding to Requirement A is all the data in the database containing Requirement A, as shown in Table 3 above. Then, by retaining any one piece of data from Table 3, the dataset corresponding to the development time of Requirement A can be obtained. Based on Table 3, the above method of determining the metric value of the specified metric queried by each query sub-request according to the dataset corresponding to each query sub-request can be implemented in the following way: Based on the start time and end time of the development of the target requirement in the dataset corresponding to the average development time of the target requirement, the metric value of the development time of the target requirement is determined. Here, the target requirement in this example refers to Requirement A. The time data required to calculate the development time of Requirement A is read, and the calculation logic of "development end time - development start time" is called to determine the metric value of the development time of Requirement A.
[0091] Similar to the previous example, in a database, there can be multiple types of requirements, and the types of terminals under each requirement can also be multiple. Any combination of terminals under any requirement can be used to query the metrics of any combination of terminals under different requirement combinations.
[0092] When it is possible to query metrics with different combinations of needs and different end combinations, that is, for other levels under the first level, the required data can be obtained by filtering the database based on the target requirement field corresponding to the specified metric of other levels and the field corresponding to the level above that other level.
[0093] It is worth noting that the target requirement fields and the fields corresponding to other levels can be determined based on specified metrics. Taking the database shown in Table 1 as an example, the average development time of the client is a specified metric. This specified metric corresponds to the client level, and the target requirement fields corresponding to this specified metric include all client fields (i.e., client IDs) involved in all clients in the database, such as the server client and FE client in Table 1. The levels above other levels are the requirement levels, and the fields corresponding to other levels are all fields of requirements in the database (i.e., requirement IDs), such as requirement A and requirement B in Table 1.
[0094] Taking the database shown in Table 1 as an example, the development time of the server side of requirement A is a specified indicator. This specified indicator corresponds to the terminal level. The target requirement field corresponding to this specified indicator is only the server side. The fields corresponding to other levels and above are only requirement A.
[0095] It is worth noting that, for the average development time of the client and the development time of the server side of requirement A, the former does not limit the type of requirement and client, while the latter limits the type of requirement and client. Therefore, the target requirement field and the fields corresponding to the levels above other levels can be determined based on whether the types of requirements and clients are limited in the specified indicators. The dataset corresponding to the specified indicators can be determined based on the determined target requirement field and the fields corresponding to the levels above other levels.
[0096] For example, the above method of filtering data from the database to obtain the dataset corresponding to the specified indicator at the first level by using the target requirement fields of the specified indicators at other levels and the corresponding fields of the levels above those other levels can be implemented as follows: Determine different field chain relationships based on the target requirement fields of the specified indicators at other levels below the first level and the corresponding fields of the levels above those other levels; search the database for data that satisfies each field chain relationship based on each field chain relationship, and determine the second target dataset corresponding to each field chain relationship based on the data that satisfies each field chain relationship; retain any one data point in each second target dataset; and determine all the retained data as data in the datasets corresponding to the specified indicators at other levels to obtain the datasets corresponding to the specified indicators at other levels.
[0097] For example, in the database shown in Table 1 above, the specified metric is the average development time of the server-side application. This specified metric is at the client-side level, and the target requirement field for this specified metric is the server-side. The fields corresponding to the levels above this are requirement A and requirement B. Therefore, the constructed field chain relationships include server-side-requirement A and server-side-requirement B. In these two chain relationships, the requirement IDs other than those for the server-side are different.
[0098] For the chained relationship of the field "server-requirement A", the data that satisfies this chained relationship in Table 1 is shown in Table 7 below:
[0099]
[0100] Table 7
[0101] The data shown in Table 7 above represents the data of the second target dataset corresponding to the chain relationship of the field "requirement A" on the server side.
[0102] For the chain relationship between server-requirement B, the data that satisfies this chain relationship in Table 1 is shown in Table 8 below:
[0103]
[0104] Table 8
[0105] The data shown in Table 8 above represents the data of the second target dataset corresponding to the chain relationship of the field "server-requirement B".
[0106] It is worth noting that in the second target dataset, data with a chain relationship of fields is understood as a single data point, and a single data point can be understood as a row of data in Table 1.
[0107] For Tables 7 and 8 above, retain one data point from each table, and determine the retained data as the data in the dataset corresponding to the query sub-request used to query the average development time of the server side. This dataset can be shown in Table 9 below:
[0108]
[0109] Table 9
[0110] It is worth noting that the time data related to the average development time of the server side is only related to the time data of the server side. Therefore, the metadata in Table 9 can be further filtered to retain metadata that is only related to the server side, resulting in Table 10 below:
[0111]
[0112] Table 10
[0113] Here, metadata is used to characterize the data represented by each cell in a row.
[0114] Based on Table 9 or Table 10, the above method of determining the value of the specified indicator for each query sub-request according to the dataset corresponding to each query sub-request can be implemented in the following way: Based on the start time and end time of the target end under different requirements in the dataset corresponding to the average development time of the target end, determine the average development time of the target end. Here, the target end is the server end in this example, and the different requirements are requirement A and requirement B. Read the time data required to calculate the average development time of the server end, that is, the start time and end time of the end development, and call the calculation logic of "sum(end development end time - end development start time) / 2" to determine the indicator value of the average development time of the server end.
[0115] For example, still using the database provided in Table 1 above, and taking the average development time of the specified metric as an example, this specified metric is at the end level. The target requirement fields of this specified metric are the server end and the FE end. The fields corresponding to the other levels above this are requirement A and requirement B. Among them, the chain relationship of the fields on the server side and the second target dataset can refer to the relevant embodiments mentioned above, which will not be repeated here.
[0116] For the FE side, the corresponding field chain relationship includes FE side-requirement A and FE side-requirement B. In these two chain relationships, the requirement IDs are different except for the FE side.
[0117] For the chain relationship of the field "FE side - demand A", the data that satisfies this chain relationship in Table 1 is shown in Table 11 below:
[0118]
[0119] Table 11
[0120] The data shown in Table 11 above is the data in the second target dataset corresponding to the chain relationship of the FE-requirement A field.
[0121] For the chain relationship of the FE side - demand B, the data that satisfies this chain relationship in Table 1 is shown in Table 12 below:
[0122]
[0123] Table 12
[0124] The data shown in Table 12 above is the data in the second target dataset corresponding to the chain relationship of the FE-requirement B field.
[0125] For Tables 11 and 12 above, retain one data point from each table, and determine the retained data as the dataset corresponding to the query sub-request for the average development time of the query terminal. This dataset can be shown in Table 13 below:
[0126]
[0127] Table 13
[0128] It's worth noting that the time data related to the average development time for mobile devices is only relevant to the time data at the mobile device level. Therefore, it's possible to...
[0129] The metadata in Table 13 is further filtered to retain only the metadata relevant to the endpoint, resulting in Table 14 below:
[0130]
[0131] Table 14
[0132] Based on Table 13 or Table 14, the determination of the specified metric value for each query sub-request, according to the dataset corresponding to each query sub-request, can be implemented in the following way: Determine the metric value of the average terminal development time based on the start and end times of terminal development under different requirements in the dataset corresponding to the average terminal development time. It is worth noting that "different requirements" here refers to all requirements in Table 13 or Table 14, i.e., requirement A and requirement B. Based on Table 13 or Table 14, read the time data required for the average terminal development time and call the calculation logic "sum(terminal development end time - terminal development start time) / 4" to determine the metric value of the average terminal development time.
[0133] In some embodiments, the query request carries grouping conditions. The above-mentioned merging of indicator values corresponding to each specified indicator based on the positional relationship of each specified indicator in the specified query conditions can be implemented in the following way: the indicator values corresponding to each specified indicator are divided according to the grouping conditions to obtain multiple first group results, wherein the indicator values corresponding to the specified indicators in one group are divided into the same first group result; for each first group result, the indicator values in the first group result are sorted according to the positional relationship of each indicator value in the first group result in the specified query conditions to obtain a second group result corresponding to the first group result; all second group results are concatenated to obtain the merged result.
[0134] In actual queries, a grouping display function can be provided for users. That is, users can set grouping conditions, and when the query results are displayed on the display terminal, the indicator values of the same group can be displayed adjacently in the display terminal according to the set grouping conditions, which makes it convenient for users to analyze the indicator values of the same group.
[0135] It is worth noting that the sequential positional relationship of each indicator value in each second group result is consistent with the sequential positional relationship of the specified indicator corresponding to each indicator value described in the specified query conditions.
[0136] In some embodiments, when concatenating the second group results, the concatenation can be based on the positional relationship of the specified indicator corresponding to the first indicator value in each second group result within the specified query conditions. For example, among the first indicator values in each second group result, the higher the ranking of the specified indicator corresponding to the indicator value in the specified query conditions, the higher the ranking of its corresponding second group result in the merged result.
[0137] By using the above method, the indicators are merged according to the grouping conditions and the positional relationship of each indicator value in the specified query conditions. This makes it easier for users to see the indicator values of the specified indicators they are more interested in first, and also makes it easier for users to analyze the indicator values in the same group, thus improving the user query experience.
[0138] In some embodiments, the query request carries filtering conditions, and the method may further include: filtering the data in the merged result according to the filtering conditions to obtain the filtered query result, and returning the filtered query result.
[0139] By using the above method, the merged results are filtered according to the filtering conditions selected by the user, further improving the query experience.
[0140] Figure 3 This is another flowchart illustrating a data query according to an exemplary embodiment of the present disclosure. (Refer to...) Figure 3 Taking a query request that includes two levels of query metrics as an example, the steps are as follows:
[0141] Step S301: Obtain the query request input by the user. The query request carries specified query conditions, which are used to describe specified indicators at different levels with positional relationships.
[0142] Step S302: Separate the specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0143] Step S303: Query the query sub-request of the first-level query indicator to obtain the first query result.
[0144] Step S304: Query the query sub-requests of the second-level query indicators to obtain the second query result.
[0145] Step S305: Merge the first query result and the second query result to obtain the merged result.
[0146] Step S306: Filter the data in the merged result according to the filtering conditions to obtain the filtered merged result, and return the filtered merged result.
[0147] The implementation methods of steps S301 and S302 can refer to the above-mentioned related embodiments, and will not be repeated here.
[0148] It is worth noting that the above-mentioned query sub-requests for query indicators at different levels include the process of filtering data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request, and determining the indicator value of the specified indicator queried by each query sub-request according to the dataset corresponding to each query sub-request. For specific implementation methods, please refer to the above-mentioned related embodiments, which will not be repeated here.
[0149] The implementation of step S305 can refer to the implementation of merging according to grouping conditions and the positional relationship of each specified indicator in the specified query conditions, which will not be described in detail in this embodiment.
[0150] The implementation of step S306 can be referred to the above-mentioned related embodiments, and will not be repeated here.
[0151] The filtered and merged results here are used to represent the query results of the query request. The query results can be directly returned to the interactive interface for display, making it easy for users to intuitively browse the various query indicators.
[0152] As one implementation method, users can also choose how the query results are displayed, such as a table display, a bar chart display, etc. These can be selected by the controls provided by the interactive interface. By displaying the query results according to the user's needs, the query experience can be further improved.
[0153] Figure 4 This is a block diagram illustrating a data query apparatus according to an exemplary embodiment of the present disclosure. (Refer to...) Figure 4 The data query device 400 may include:
[0154] The acquisition module 401 is used to acquire a query request input by the user, wherein the query request carries specified query conditions, and the specified query conditions are used to describe specified indicators at different levels with positional relationships.
[0155] The splitting module 402 is used to separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0156] The filtering module 403 is used to concurrently respond to the query sub-requests corresponding to each specified indicator, and to filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0157] The determination module 404 is used to determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request;
[0158] The merging module 405 is used to merge the indicator values corresponding to each specified indicator based on the positional relationship of each specified indicator in the specified query conditions, and obtain a merging result. The merging result is used to represent the query result requested by the query request.
[0159] In some embodiments, the filtering module 403 includes:
[0160] The first filtering submodule is used to filter the required data from the database to obtain the dataset corresponding to the specified indicators at the first level, based on the target requirement fields corresponding to the specified indicators at the first level.
[0161] The second filtering submodule is used to filter the required data from the database for specified indicators at other levels below the first level, based on the target requirement fields corresponding to the specified indicators at other levels and the fields corresponding to the levels above those other levels, to obtain the dataset corresponding to the specified indicators at those other levels.
[0162] In some embodiments, the first filtering submodule is specifically used to: determine the first target dataset corresponding to the target requirement field based on the target requirement field corresponding to the specified indicator of the first level, wherein the data in the first target dataset is all the data in the database that has the target requirement field; retain any one data in the first target dataset, and determine the retained data as the data in the dataset corresponding to the specified indicator of the first level, so as to obtain the dataset corresponding to the specified indicator of the first level.
[0163] In some embodiments, the second filtering submodule is specifically used to: determine different field chain relationships based on the target requirement fields corresponding to the specified indicators of other levels below the first level and the fields corresponding to the levels above the other levels; search for data that satisfies each field chain relationship in the database based on each field chain relationship, and determine the second target dataset corresponding to each field chain relationship based on the data that satisfies each field chain relationship; retain any one piece of data in each of the second target datasets; and determine all the retained data as data in the dataset corresponding to the specified indicators of the other levels, so as to obtain the dataset corresponding to the specified indicators of the other levels.
[0164] In some embodiments, the query request carries grouping conditions, and the merging module 405 includes:
[0165] The partitioning submodule is used to partition the indicator values corresponding to each specified indicator according to the grouping conditions to obtain multiple first grouping results, wherein the indicator values corresponding to the specified indicators in one group are partitioned into the same first grouping result.
[0166] The sorting submodule is used to sort the indicator values of each first grouping result according to the positional relationship of the specified indicator corresponding to each indicator value in the specified query conditions, so as to obtain the second grouping result corresponding to the first grouping result.
[0167] The splicing submodule is used to splice all the results of the second grouping to obtain the merged result.
[0168] In some embodiments, the first level includes a requirement level, and the specified indicator belonging to the requirement level includes the average requirement development time. The dataset corresponding to the average requirement development time includes the requirement development start time and requirement development end time for different requirements. The determining module 404 includes:
[0169] The first determining submodule is used to determine the index value of the average development time of the requirement based on the start time and end time of the requirement development of different requirements in the dataset corresponding to the average development time of the requirement.
[0170] In some embodiments, other levels below the first level include the endpoint level, and the specified indicators belonging to the endpoint level include the average endpoint development time. The dataset corresponding to the average endpoint development time includes the endpoint development start time and endpoint development end time for different endpoints under different requirements. The determining module 404 includes:
[0171] The second determining submodule is used to determine the index value of the average terminal development time based on the terminal development start time and terminal development end time of different terminals under different requirements in the dataset corresponding to the average terminal development time.
[0172] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0173] This disclosure also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the data query method provided in this disclosure.
[0174] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device 500 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0175] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0176] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0177] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0178] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0179] In some implementations, electronic devices can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0180] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0181] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following actions: to acquire a query request input by a user, the query request carrying specified query conditions, the specified query conditions being used to describe specified indicators at different levels with positional relationships; to separate the specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator, the query sub-requests being used to query the specified indicators at the corresponding level; to concurrently respond to the query sub-requests corresponding to each specified indicator, and to filter data from a database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request, the database being a database constructed based on a Cartesian product data model; to determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request; and to merge the indicator values corresponding to each specified indicator based on the positional relationship of each specified indicator in the specified query conditions, obtaining a merged result, the merged result being used to characterize the query result requested by the query request.
[0182] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0183] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0184] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0185] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0186] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0187] According to one or more embodiments of this disclosure, Example 1 provides a data query method, including:
[0188] Obtain a query request input by the user, the query request carrying specified query conditions, the specified query conditions being used to describe specified indicators at different levels with positional relationships;
[0189] Separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0190] Concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0191] Based on the dataset corresponding to each query sub-request, determine the metric value of the specified metric queried by each query sub-request;
[0192] Based on the positional relationship of each specified indicator in the specified query conditions, the indicator values corresponding to each specified indicator are merged to obtain a merged result, which is used to represent the query result requested by the query request.
[0193] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein the concurrent response to query sub-requests corresponding to each specified indicator, and the data filtering from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request, includes:
[0194] For the specified indicators at the first level, based on the target requirement fields corresponding to the specified indicators at the first level, the required data is filtered from the database to obtain the dataset corresponding to the specified indicators at the first level.
[0195] For specified indicators at other levels below the first level, the required data is filtered from the database based on the target requirement field corresponding to the specified indicator at that other level and the field corresponding to the level above that other level to obtain the dataset corresponding to the specified indicator at that other level.
[0196] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein, for a specified indicator at the first level, the method of filtering required data from the database to obtain the dataset corresponding to the specified indicator at the first level based on the target requirement field corresponding to the specified indicator at the first level includes:
[0197] The first target dataset corresponding to the target requirement field is determined based on the specified indicator of the first level. The data in the first target dataset is all the data in the database that has the target requirement field.
[0198] Retain any one data point from the first target dataset, and determine the retained data as the data in the dataset corresponding to the specified indicator of the first level, so as to obtain the dataset corresponding to the specified indicator of the first level.
[0199] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, wherein the step of obtaining the dataset corresponding to the specified indicators of other levels below the first level by filtering the required data from the database according to the target requirement field corresponding to the specified indicator of the other level and the field corresponding to the level above the other level includes:
[0200] Based on the target requirement fields corresponding to the specified indicators of other levels below the first level and the fields corresponding to the levels above those other levels, determine different field chain relationships;
[0201] Based on the chain relationship of each field, search the database for data that satisfies the chain relationship of each field, and determine the second target dataset corresponding to the chain relationship of each field based on the data that satisfies the chain relationship of each field.
[0202] Retain any one data point from each of the second target datasets;
[0203] All retained data are identified as data in the dataset corresponding to the specified indicators of the other levels, so as to obtain the dataset corresponding to the specified indicators of the other levels.
[0204] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein the query request carries grouping conditions, and the step of merging the indicator values corresponding to each specified indicator based on the positional relationship of each specified indicator in the specified query conditions to obtain a merged result includes:
[0205] According to the grouping conditions, the index values corresponding to each specified index are divided to obtain multiple first grouping results. Among them, the index values corresponding to the specified index in a group are divided into the same first grouping result.
[0206] For each of the first grouping results, sort the indicator values of the first grouping result according to the positional relationship of the specified indicator corresponding to each indicator value in the specified query condition, and obtain the second grouping result corresponding to the first grouping result;
[0207] The results of the second group are concatenated to obtain the merged result.
[0208] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 3, wherein the first level includes a requirement level, the specified indicator belonging to the requirement level includes the average requirement development time, the dataset corresponding to the average requirement development time includes the requirement development start time and requirement development end time for different requirements, and the step of determining the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request includes:
[0209] The index value of the average development time of the requirement is determined based on the start time and end time of the requirement development for different requirements in the dataset corresponding to the average development time of the requirement.
[0210] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 4, wherein other levels below the first level include the terminal level, and the specified indicators belonging to the terminal level include the average terminal development time. The dataset corresponding to the average terminal development time includes the terminal development start time and terminal development end time for different terminals under different requirements. The step of determining the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request includes:
[0211] The index value of the average terminal development time is determined based on the start and end times of terminal development for different terminals under different requirements in the dataset corresponding to the average terminal development time.
[0212] According to one or more embodiments of this disclosure, Example 8 provides a data query apparatus, including:
[0213] The acquisition module is used to acquire a query request input by the user, wherein the query request carries specified query conditions, and the specified query conditions are used to describe specified indicators at different levels with positional relationships.
[0214] The splitting module is used to separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level.
[0215] The filtering module is used to concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model.
[0216] The determination module is used to determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request;
[0217] The merging module is used to merge the indicator values corresponding to each specified indicator based on their positional relationship in the specified query conditions, and obtain a merging result. The merging result is used to represent the query result requested by the query request.
[0218] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-7.
[0219] According to one or more embodiments of this disclosure, Example 10 provides an electronic device, including:
[0220] A storage device on which computer programs are stored;
[0221] A processing device for executing the computer program in the storage device to implement the steps of any one of the methods in Examples 1-7.
[0222] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0223] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0224] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A data query method, characterized in that, include: Obtain a query request input by the user, the query request carrying specified query conditions, the specified query conditions being used to describe specified indicators at different levels with positional relationships; Separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level. Concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model. Based on the dataset corresponding to each query sub-request, determine the metric value of the specified metric queried by each query sub-request; Based on the positional relationship of each specified indicator in the specified query conditions, the indicator values corresponding to each specified indicator are merged to obtain a merged result. The merged result is used to represent the query result requested by the query request. The positional relationship of each specified indicator value in the merged result is the same as the positional relationship of each specified indicator described in the specified query conditions.
2. The method according to claim 1, characterized in that, The concurrent response to each specified metric corresponds to a query sub-request. Based on the hierarchy of each query sub-request, data is filtered from the database to obtain the dataset corresponding to each query sub-request, including: For the specified indicators at the first level, based on the target requirement fields corresponding to the specified indicators at the first level, the required data is filtered from the database to obtain the dataset corresponding to the specified indicators at the first level. For specified indicators at other levels below the first level, the required data is filtered from the database based on the target requirement field corresponding to the specified indicator at that other level and the field corresponding to the level above that other level to obtain the dataset corresponding to the specified indicator at that other level.
3. The method according to claim 2, characterized in that, The process for specifying a first-level indicator involves filtering the required data from the database based on the target requirement field corresponding to that first-level indicator to obtain the dataset corresponding to that first-level indicator. This includes: The first target dataset corresponding to the target requirement field is determined based on the specified indicator of the first level. The data in the first target dataset is all the data in the database that has the target requirement field. Retain any one data point from the first target dataset, and determine the retained data as the data in the dataset corresponding to the specified indicator of the first level, so as to obtain the dataset corresponding to the specified indicator of the first level.
4. The method according to claim 2, characterized in that, The process for specifying indicators for levels below the first level involves filtering data from the database based on the target requirement fields corresponding to the specified indicators at those levels and the fields corresponding to the levels above those levels to obtain the dataset corresponding to the specified indicators at those levels. This includes: Based on the target requirement fields corresponding to the specified indicators of other levels below the first level and the fields corresponding to the levels above those other levels, determine different field chain relationships; Based on the chain relationship of each field, search the database for data that satisfies the chain relationship of each field, and determine the second target dataset corresponding to the chain relationship of each field based on the data that satisfies the chain relationship of each field. Retain any one data point from each of the second target datasets; All retained data are identified as data in the dataset corresponding to the specified indicators of the other levels, so as to obtain the dataset corresponding to the specified indicators of the other levels.
5. The method according to claim 1, characterized in that, The query request carries grouping conditions. Based on the positional relationship of each specified indicator within the specified query conditions, the indicator values corresponding to each specified indicator are merged to obtain a merged result, including: According to the grouping conditions, the index values corresponding to each specified index are divided to obtain multiple first grouping results. Among them, the index values corresponding to the specified index in a group are divided into the same first grouping result. For each of the first grouping results, sort the indicator values of the first grouping result according to the positional relationship of the specified indicator corresponding to each indicator value in the specified query condition, and obtain the second grouping result corresponding to the first grouping result; The results of the second group are concatenated to obtain the merged result.
6. The method according to claim 3, characterized in that, The first level includes a requirement level, and the specified indicators belonging to the requirement level include the average development time of the requirement. The dataset corresponding to the average development time of the requirement includes the start time and end time of the development of different requirements. The step of determining the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request includes: The index value of the average development time of the requirement is determined based on the start time and end time of the requirement development for different requirements in the dataset corresponding to the average development time of the requirement.
7. The method according to claim 4, characterized in that, Other levels below the first level include the endpoint level. Specific metrics belonging to the endpoint level include the average endpoint development time. The dataset corresponding to the average endpoint development time includes the endpoint development start time and endpoint development end time for different endpoints under different requirements. Determining the metric value of the specified metric queried by each query sub-request based on the dataset corresponding to each query sub-request includes: The index value of the average terminal development time is determined based on the start and end times of terminal development for different terminals under different requirements in the dataset corresponding to the average terminal development time.
8. A data query device, characterized in that, include: The acquisition module is used to acquire a query request input by the user, wherein the query request carries specified query conditions, and the specified query conditions are used to describe specified indicators at different levels with positional relationships. The splitting module is used to separate specified indicators at different levels from the specified query conditions, and generate corresponding query sub-requests for each specified indicator. The query sub-requests are used to query the specified indicators at the corresponding level. The filtering module is used to concurrently respond to the query sub-requests corresponding to each specified indicator, and filter data from the database according to the level corresponding to each query sub-request to obtain the dataset corresponding to each query sub-request. The database is a database built based on the Cartesian product data model. The determination module is used to determine the indicator value of the specified indicator queried by each query sub-request based on the dataset corresponding to each query sub-request; The merging module is used to merge the indicator values corresponding to each specified indicator based on the positional relationship of each specified indicator in the specified query conditions, and obtain a merging result. The merging result is used to represent the query result requested by the query request, wherein the positional relationship of the indicator values of each specified indicator in the merging result is the same as the positional relationship of each specified indicator described in the specified query conditions.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by the processing device, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.