Query method, device, storage medium and program product of hierarchical data

CN121412288BActive Publication Date: 2026-10-20KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511577323.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-10-20
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

如此可能存在忽略版本问题导致最终确定的高层级成员对应的数值发生错误的情况

Benefits of technology

[0018]第五方面,本申请还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述方法中所描述的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121412288B_ABST
    Figure CN121412288B_ABST
Patent Text Reader

Abstract

The application relates to a hierarchical data query method, device, storage medium and program product. The method comprises the following steps: acquiring query information, determining a query member combination in hierarchical data based on the query information; acquiring member version information corresponding to the hierarchical data; determining a query sub-member combination corresponding to the query member combination based on the member version information; obtaining target data corresponding to the query sub-member combination from the hierarchical data, and determining a target proxy member corresponding to the query sub-member combination from the member version information; and determining aggregated data corresponding to a target query member combination corresponding to the target data based on the target proxy member, so as to obtain a query result corresponding to the query member combination. The method can improve the efficiency of the aggregation query of the multi-hierarchical data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for querying hierarchical data. Background Technology

[0002] With the development of data storage technology, data stored in data warehouses can be multi-dimensional and multi-level. In a data warehouse, the dimension tree corresponding to the data may undergo architectural changes over time, resulting in multiple versions of the dimension tree. Traditionally, to query the value corresponding to a high-level member in the data, it is necessary to accumulate the values ​​of the child members corresponding to the high-level member from the data warehouse to obtain the value corresponding to the high-level member. This approach may overlook version issues, leading to errors in the final determined value corresponding to the high-level member. Summary of the Invention

[0003] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for querying hierarchical data, which can improve the accuracy and efficiency of the values ​​of high-level members in a given multi-level data set, in order to address the aforementioned technical problems.

[0004] Firstly, this application provides a method for querying hierarchical data, including:

[0005] Obtain query information, and determine a combination of query members in the hierarchical data based on the query information, wherein the query members in the combination of query members have at least one sub-member in the hierarchical data;

[0006] Obtain member version information corresponding to the hierarchical data, wherein the member version information includes information about members whose hierarchical data has undergone architectural changes;

[0007] Based on the member version information, determine the query sub-member combination corresponding to the query member combination;

[0008] Obtain the target data corresponding to the query sub-member combination from the hierarchical data, and determine the target proxy member corresponding to the query sub-member combination from the member version information;

[0009] Based on the target agent members, aggregated data corresponding to the target query member combination corresponding to the target data is determined to obtain the query results corresponding to the query member combination.

[0010] Secondly, this application also provides a hierarchical data query device, comprising:

[0011] The query module is used to obtain query information and determine a combination of query members in the hierarchical data based on the query information, wherein the query members in the combination of query members have at least one sub-member in the hierarchical data.

[0012] The acquisition module is used to acquire member version information corresponding to the hierarchical data, wherein the member version information includes information on members whose hierarchical data has undergone architectural changes;

[0013] The sub-member determination module is used to determine the query sub-member combination corresponding to the query member combination based on the member version information;

[0014] The proxy member determination module is used to obtain target data corresponding to the query sub-member combination from the hierarchical data, and determine the target proxy member corresponding to the query sub-member combination from the member version information;

[0015] The aggregation module is used to determine the aggregated data corresponding to the target query member combination corresponding to the target data based on the target agent member, so as to obtain the query result corresponding to the query member combination.

[0016] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described in the above method.

[0017] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps described in the above method.

[0018] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps described in the above method.

[0019] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for querying hierarchical data obtain query information, determine the combination of query members in the hierarchical data based on the query information, and obtain member version information corresponding to the hierarchical data. Member version information includes information about members whose hierarchical data has undergone architectural changes, as well as information about members whose hierarchical data has not undergone architectural changes. Therefore, based on the member version information, the corresponding data version for each member in the hierarchical data can be determined. Then, based on the member information, the query sub-member combinations corresponding to the query members in the query member combinations are determined. This allows the determination of the specific query information corresponding to the query information. Finally, based on the specific query information, the corresponding query information is derived in reverse, thereby obtaining the query results corresponding to the query information. In other words, after determining the query sub-member combination, the target data corresponding to the query sub-member combination can be obtained from the hierarchical data. Then, the target proxy member corresponding to the query sub-member combination can be determined from the member version information to clarify the data version corresponding to the query sub-member combination. Based on the target proxy member, the aggregated data corresponding to the target query member combination corresponding to the target data can be determined. Finally, based on the aggregated data corresponding to each target query member combination, the query results corresponding to the query member combination are obtained. This approach clarifies the data version corresponding to the query sub-member combination through the target proxy member, thereby improving the completeness of the data to be aggregated and thus improving the accuracy of the query results obtained from the aggregated data corresponding to each target query member combination. Furthermore, determining the data version and corresponding sub-members of the query member combination corresponding to the query information through member version information also improves the efficiency of aggregation queries. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is an application environment diagram of a hierarchical data query method in one embodiment;

[0022] Figure 2 This is a flowchart illustrating a hierarchical data query method in one embodiment;

[0023] Figure 3 This is a schematic diagram illustrating the architectural changes of hierarchical data in one embodiment;

[0024] Figure 4 This is a schematic diagram of member version information in one embodiment;

[0025] Figure 5 This is a structural block diagram of a hierarchical data query device in one embodiment;

[0026] Figure 6 This is an internal structural diagram of a computer device in one embodiment;

[0027] Figure 7 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] The hierarchical data query method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. In response to a user-input query, terminal 102 sends the query information to server 104. Server 104 then obtains the query information, determines a combination of query members in the hierarchical data based on the query information, where each query member in the combination has at least one sub-member in the hierarchical data; obtains member version information corresponding to the hierarchical data, including information about members whose hierarchical data has undergone architectural changes; determines a combination of query sub-members corresponding to the query member combination based on the member version information; obtains the target data corresponding to the query sub-member combination from the hierarchical data; determines the target proxy member corresponding to the query sub-member combination from the member version information; and determines the aggregated data corresponding to the target query member combination based on the target proxy member, to obtain the query results corresponding to the query member combination. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0030] In one exemplary embodiment, such as Figure 2 As shown, a method for querying hierarchical data is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 210. Wherein:

[0031] Step 202: Obtain query information and determine the first member combination in the hierarchical data based on the query information. The query member in the query member combination has at least one child member in the hierarchical data.

[0032] In this context, query information refers to a query targeting at least one member of the hierarchical data. For example, a member might include an organization. The query information could be the profit of organization 1. Another example is a member that includes a year and an organization. The query information could be the sales revenue of organization 1 from 2023 to 2025. Yet another example is a member that includes a year, an organization, and a product. The query information could be the total sales revenue of product A across all regions under organization 1 from 2023 to 2025. In other words, query information can include dimensions, measures, and aggregation methods. A dimension refers to the perspective or classification of hierarchical data, such as "time," "region," or "product." In some embodiments, dimensions can be determined based on business information. A measure is numerical data, such as "sales revenue," "profit," or "order quantity." An aggregation method is how the data is summarized and calculated, such as summation, averaging, or counting. In this embodiment, the members (including the first type of members and sub-members) belong to the dimensions.

[0033] Hierarchical data refers to data organization with a clear parent-child relationship and hierarchical structure. The data is organized into a tree structure, where each node (except the root node) has a parent node and can have zero or more child nodes. Hierarchical data allows for analysis at different granularities (levels of detail). For example, one can summarize the total sales revenue of province A, and also summarize the total sales revenue of region B under province A.

[0034] The query member combination is a combination of members corresponding to the parent node of the hierarchical data selected based on the query information. That is, since hierarchical data is organized with a hierarchical structure, at least one dimension has a corresponding dimension tree. The dimension tree organizes and structures all members under that dimension according to their corresponding subordinate and hierarchical relationships using a tree structure. The query members in the query member combination can be first-class members, which correspond to the parent node in the dimension tree, representing a broad category. If data corresponding to the leaf node of the dimension tree needs to be queried, it can be obtained by directly querying the corresponding data table (e.g., a detailed data table). Further, the query information is information queried for non-detailed data (e.g., all regions, all products). Since non-detailed data may be obtained by aggregating multiple detailed data (e.g., data corresponding to the most specific region 'a', which does not include other regions), directly querying the data table stored in the database may not yield the results. It is necessary to query the corresponding multiple detailed data from the database table and then obtain the query results for non-detailed data based on these detailed data.

[0035] In some embodiments, a query member combination can refer to at least one member targeting the same dimension. For example, based on query information, the query member combination is determined to be {[Region 1, Region 2]}, where [Region 1, Region 2] represents at least one member targeting the same dimension. In other embodiments, a query member combination can refer to multiple members targeting different dimensions. Each dimension corresponds to at least one member. For example, based on query information, the query member combination is determined to be {[Region 1, Region 2], [Product A]}, where [Region 1, Region 2] and [Product A] represent multiple members targeting different dimensions. [Region 1, Region 2] corresponds to the region dimension, and [Product A] corresponds to the product dimension. That is, a query member combination can include at least one set of subquery combinations. One set of subquery combinations corresponds to one dimension, and different sets of subquery combinations correspond to different dimensions. The subquery combination can include at least one member of the first type.

[0036] In this context, sub-members are members included in the first category, representing a more specific subcategory. Sub-members correspond to leaf nodes in the dimension tree. (See reference) Figure 3 In the dimension tree corresponding to the organizational dimension in 2023, the parent nodes (including the root node) e1, e2, e3, e6, and e7 all belong to the first type of members, while the leaf nodes e4, e5, e8, e9, e10, and e11 all belong to the second type of members (child members).

[0037] For example, after obtaining the query information, the query information is parsed to obtain the keywords. The keywords are then categorized based on the dimensional information corresponding to the hierarchical data, resulting in at least one set of keywords. Each set of keywords corresponds to a different dimension. For each set of keywords, members matching each keyword are determined based on the hierarchical data's architectural information (e.g., the corresponding dimension tree). In this way, the members matching each set of keywords can be determined, and thus the combination of query members can be determined. It can be understood that at least one member matching a set of keywords corresponds to the same dimension, while multiple members matching different sets of keywords correspond to different dimensions.

[0038] Alternatively, the query information can also directly include the query members. In this way, the query members can be extracted directly from the query information, and then the query members can be classified to obtain the query member combination.

[0039] Step 204: Obtain the member version information corresponding to the hierarchical data. The member version information includes information about members whose hierarchical data has undergone architectural changes.

[0040] Here, architectural change refers to a change in the architecture corresponding to hierarchical data. Specifically, it means that the hierarchical relationships or parent-child relationships between members in at least one dimension of the hierarchical data change. For example, refer to... Figure 3 The organizational dimension data structure in the 2024 and 2025 hierarchical data differs from that in 2023. In 2024, member e6, previously belonging to member e3, became member e2. In 2025, member e10, previously belonging to member e7, became member e6. For example, if members e2 and e3 represent the East China and South China companies respectively, members e6 and e7 represent the Guangdong and Fujian companies respectively, and member e10 represents the Shenzhen branch, then after the 2024 adjustment, the Guangdong region is now managed by the East China company. After the 2025 adjustment, the Shenzhen branch is now managed by the Guangdong company.

[0041] The member version information includes the hierarchical relationships (i.e., subordinate relationships) between different members determined based on architectural changes. It includes the subordinate relationships of each member across different versions. In other words, the member version information includes both the subordinate relationships of members whose architecture has changed across different versions and the subordinate relationships of members whose architecture has not changed across different versions. It can be understood that members whose architecture has not changed will have only one hierarchical relationship in their member version information because their hierarchical relationships remain unchanged. Members whose architecture has changed will have multiple hierarchical relationships in their member version information because their hierarchical relationships have changed. (Reference) Figure 4In the member version table (corresponding to member version information), member e4, which has not undergone architectural changes, belongs to members e1 and e2, and e11 belongs to members e1, e3, and e7. Member e8, which has undergone architectural changes, belongs to members e1, e3, and e6 in one version and to members e1, e2, and e6 in another version.

[0042] Because members whose architecture has changed exist in multiple hierarchical relationships within the member version information, proxy members can be set up for different versions of the member to facilitate differentiation. At least one proxy member corresponding to a member whose architecture has changed is used to record at least one version of that member. (Reference) Figure 4 In the member version table, member e8_1 represents one version of member e8, and member e8_2 represents another version of member e8.

[0043] To determine the specific data version corresponding to each proxy member, it's also necessary to store the mapping relationship between members and their corresponding proxy members. Therefore, member version information also includes the mapping relationship between proxy members and the original member. If the architecture of the original member changes, its corresponding proxy member is used to describe the different data versions corresponding to that original member. (Reference) Figure 4 The proxy member table in the database, because the organizational structure changes year by year, can use the year as the basis for distinguishing different data versions. Figure 4 Prior to 2023, member information (such as subordinate relationships) for member e8 was determined based on the member information for proxy member e8_1. After 2023, member information for member e8 was determined based on the member information for proxy member e8_2.

[0044] It is understandable that in this step, if the query member combination includes members with multiple dimensions, then the member version information corresponding to each dimension needs to be obtained.

[0045] For example, before obtaining member version information, when there is an architectural change in the hierarchical data, corresponding member version information is generated. Optionally, when there is an architectural change in the hierarchical data, the target dimension corresponding to the architectural change is determined. Based on the architectural change information, the original members corresponding to the changed target dimension are determined. At least two proxy members are set for the original members to generate a portion of the member version information. Among them, one proxy member corresponds to the original member before the architectural change, and the remaining proxy members correspond to the original members after the architectural change. In addition, another portion of member version information is generated based on the hierarchical relationship of each original member. In this process, if the original member has not undergone architectural change, the corresponding member version information is generated based on the hierarchical relationship of the original member; if the original member has undergone architectural change, the corresponding member version information is generated based on the hierarchical relationship of the proxy members corresponding to the original member.

[0046] Alternatively, member version information can also be uploaded by backend personnel to obtain member version information corresponding to the hierarchical data.

[0047] Step 206: Determine the query sub-member combination corresponding to the query member combination based on the member version information.

[0048] In this context, a query sub-member combination is a combination of sub-members corresponding to the query member in a query member combination. For example, if the query member is e2, its corresponding sub-member combination is {e4, e5, e8_2, e9_2, e10_2}. Therefore, its corresponding query sub-member combination is {e4, e5, e8, e9, e10}. As another example, if the query members are e2 and e3, their corresponding sub-member combinations are {e4, e5, e8_2, e9_2, e10_2} and {e11, e8_1, e9_1, e10_1}, respectively. Therefore, the query sub-member combinations corresponding to query members e2 and e3 are {e4, e5, e8, e9, e10} and {e11, e8, e9, e10}, respectively. The query sub-member combination corresponding to the query member combination {e2, e3} is {e4, e5, e8, e9, e11, e10}. In other words, based on the member version information, determine the sub-member combination corresponding to each query member in the query member combination, then determine the query sub-member combination corresponding to the query member based on the sub-member combination, and finally determine the query sub-member combination corresponding to the query member combination based on the query sub-member combination corresponding to each query member.

[0049] For example, member version information includes the hierarchical relationship between each original member and each proxy member. Therefore, the subordinate members (e.g., child members) corresponding to each first-type member can be determined using the member version information. This also allows us to determine the subordinate members corresponding to each queried member, thus obtaining the corresponding queried sub-member combination. It's important to note that if a sub-member combination includes both original child members and proxy members, the corresponding queried sub-member combination will replace the proxy members with the corresponding original child members.

[0050] Optionally, member version information is a member version table (see reference). Figure 4 (As shown). Assume the horizontal axis of the member version table corresponds to all first-class members, and the vertical axis corresponds to all original child members and all proxy members. For a cell in this member version table, if the cell's value is 1, it indicates a hierarchical relationship between the member on the horizontal axis and the member on the vertical axis corresponding to that cell. Therefore, by looking up the table, we can quickly determine each original child member and each proxy member corresponding to each first-class member, thus quickly determining the corresponding combination of query child members.

[0051] In this step, the query sub-member combination stores the corresponding original sub-members. This is because in actual queries, the query member combination might be used for union queries, i.e., including multiple first-type members. Different combinations of first-type members might correspond to different data versions, i.e., different surrogate members. If the query sub-member combination records surrogate members, subsequent reverse derivation based on the query sub-member combination might miss the data of another version in the final query result because only one version is recorded in the query sub-member combination. For example, combining... Figure 4 If the query sub-member combination is {e4, e5, e8_2, e9_2, e10_2}, and the query member combination is {[2023, 2024], [e2, e3]}, then the query result is obtained by aggregating the data corresponding to e2 in 2023, e2 in 2024, e3 in 2023, and e3 in 2024. If the query sub-member combination only records the surrogate member e8_2, then when performing reverse derivation based on the query sub-member combination, it will be impossible to find that the data corresponding to e3 in 2023 is determined based on the surrogate member e8_1. Therefore, in this step, the query sub-member combination is composed of the original sub-members, so that when performing a joint query, the version information of the query members can be used to completely determine the data to be queried.

[0052] Step 208: Obtain the target data corresponding to the combination of queried sub-members from the hierarchical data, and determine the target proxy member corresponding to the target data from the member version information.

[0053] The target data is data that can be retrieved from the detail table. The target data corresponding to the query sub-member combination is the data corresponding to various element combinations obtained by combining elements from query sub-member combinations of different dimensions. For example, if the query sub-member combination is {2023, 2024}{e4, e5}, the elements in the query sub-member combination corresponding to the time dimension and the query sub-member combination corresponding to the organization dimension are combined to obtain the element combinations {2023, e4}{2024, e5}{2023, e5}{2024, e4}. Then, the data corresponding to {2023, e4}{2024, e5}{2023, e5}{2024, e4} are retrieved from the detail table for subsequent aggregation calculations.

[0054] For example, if multiple query sub-member combinations exist, the query sub-members in different combinations are arranged and combined to obtain the corresponding target query sub-member combination (e.g., {2023, e4}{2024, e5}{2023, e5}{2024, e4} above). The target data corresponding to the target query sub-member combination is retrieved from the detail table. Then, the target proxy member corresponding to each query sub-member in the target query sub-member combination is determined from the member version information.

[0055] Step 210: Based on the target agent members, determine the data to be aggregated and calculated corresponding to the target query member combination corresponding to the target data, so as to obtain the query results corresponding to the query member combination.

[0056] During the aggregation calculation, for ease of computation, step 206 summarizes the sub-members corresponding to the query members of each dimension, i.e., a single query sub-member combination represents all sub-member combinations corresponding to the query members under a dimension. However, the obtained target data may involve multiple data versions. To determine which target query member combination the target data corresponds to, the target proxy member corresponding to the target data can be determined from the member version information. Then, based on the target proxy member, the data to be aggregated for the target query member combination corresponding to the target data can be determined.

[0057] The aggregation result corresponding to a query member combination can be composed of the aggregation results corresponding to multiple target query member combinations. For example, if the query member combination is {all years}{e2, e3}{a2, a3}, then the target query member combinations can include {all years, e2, a3}{all years, e2, a2}{all years, e2, a3}{all years, e3, a2}. By using member version information, the sub-members in the target query sub-member combinations corresponding to the target data are extrapolated upwards to determine the target query member combinations corresponding to each sub-member, thus dividing the target data into the aggregation dataset corresponding to that target query member combination. After all target data has been divided, the data in the aggregation datasets corresponding to each target query member are summarized to obtain the aggregation result corresponding to each target query member.

[0058] In the above-described hierarchical data aggregation calculation method, query information is obtained, and based on this information, the first member combination in the hierarchical data is determined. Member information corresponding to the hierarchical data is then obtained. This member information includes information about members whose hierarchical data has undergone structural changes, as well as information about members whose hierarchical data has not undergone structural changes. Therefore, based on the member information, the data versions corresponding to each member in the hierarchical data can be determined. Then, based on the member information, the sub-member combinations corresponding to the first member in the first member combination are determined. This allows the determination of the specific query factors corresponding to the query information. Based on these specific query factors, the corresponding query information is then derived in reverse, thus obtaining the query results. In other words, after determining the sub-member combinations, the target data corresponding to the sub-member combinations can be obtained from the hierarchical data. Then, the target proxy members corresponding to the sub-member combinations are determined from the member information to clarify the data versions corresponding to the sub-member combinations. Finally, based on the target proxy members, the data to be aggregated corresponding to the target first member combination corresponding to the target data is determined. This allows the data versions corresponding to the sub-member combinations to be clarified through the target proxy members, thereby improving the completeness of the data to be aggregated and thus improving the accuracy of the aggregated data corresponding to the first member combinations obtained based on the data to be aggregated for each target first member combination. Furthermore, by using member information, the data version and corresponding sub-members of the first member combination corresponding to the query information can be determined, which can also improve the efficiency of aggregation calculation.

[0059] In some embodiments, obtaining target data corresponding to the query sub-member combination from hierarchical data includes: combining the query sub-members in the query sub-member combination corresponding to different dimensions to obtain multiple query combination factors corresponding to the query sub-member combination; and obtaining target data corresponding to each query combination factor from hierarchical data.

[0060] Specifically, if the query sub-member combination includes only one dimension of data, then the multiple query combination factors corresponding to the query sub-member combination are the query sub-member combination itself. For example, if the query sub-member combination is {(Organization 1, Organization 2, Organization 3)}, then the corresponding query combination factors are {Organization 1}, {Organization 2}, and {Organization 3}. If the query sub-member combination includes data from multiple dimensions, then the multiple query combination factors corresponding to the query sub-member combination are the result of permutations and combinations of elements in the target query sub-member combination corresponding to different dimensions. For example, if the query sub-member combination is {(Organization 1, Organization 2, Organization 3)}{(2024, 2025)}, then there are 6 corresponding query combination factors, namely {(Organization 1, 2024), (Organization 1, 2025), (Organization 2, 2024), (Organization 2, 2025), (Organization 3, 2025), (Organization 3, 2024)}.

[0061] Subsequently, since the hierarchical data stores the data corresponding to each lowest-level member, the target data corresponding to each query combination factor can be retrieved from the hierarchical data.

[0062] In this embodiment, by arranging and combining the elements in the previously obtained query sub-member combination according to the dimensions, all possible sub-query information corresponding to the mixed query information can be listed, thereby ensuring the integrity of the data used for the final aggregation calculation and ensuring the correctness of the final query result.

[0063] In some embodiments, since the query sub-member combination records the original sub-members, but some original sub-members may correspond to different data versions under different conditions due to architectural changes, it is necessary to analyze the data version corresponding to each element in the query combination factor after obtaining the query combination factor. For example, determining the target proxy member corresponding to the query sub-member combination from the member version information includes: obtaining a first mapping relationship based on the member version information; the first mapping relationship is used to characterize the mapping relationship between the proxy member and the original sub-members; and determining the target proxy member corresponding to the target query sub-member in the query combination factor based on the first mapping relationship.

[0064] The query combination factor may include multiple target query sub-members, or it may include only one target query sub-member. The mapping relationship between the proxy member and the original sub-member can be determined based on a time range.

[0065] Specifically, each query sub-member in the query combination factor is matched with the original sub-members in the first mapping relation to determine the query sub-members existing in the first mapping relation as target query sub-members. Then, target proxy members corresponding to the target query sub-member can be determined based on other query sub-members in the query combination factor containing the target query sub-member. For example, refer to... Figure 4As shown, assuming the current query combination factor is {2024, e8, a7}, based on the first mapping relationship, the query sub-members with proxy members include {e8, e9, e10, a6, a7, a3}. Therefore, the target query combination factors are determined to be e8 and a7. The target proxy members corresponding to each target query sub-member are then queried. For e8, combined with the other query sub-members {2024, a7} in the query combination factor, the corresponding target proxy member is determined to be e8_2. It should be noted that since the first mapping relationship distinguishes each proxy member according to a time range, in this example, the target proxy member (e8_2) corresponding to the target query sub-member (e8) can be determined based on the year (2024). For a7, its corresponding target proxy member is determined to be a7_2. If the first mapping relationship also includes other distinguishing criteria, these criteria can be extracted from the query combination factor, and the target proxy members corresponding to each target query sub-member can be determined according to these criteria.

[0066] If no target proxy member corresponding to the current query sub-member can be found based on the first mapping relationship, it means that when determining the first type of member combination corresponding to the current query sub-member in the subsequent process, the current query sub-member will be directly used to query in the second mapping relationship.

[0067] In this embodiment, by using the first mapping relationship and combining query combination factors, the target proxy members corresponding to each target query factor are determined first. This allows for accurate identification of the target data corresponding to the query combination factor, thereby improving the accuracy of the query results. Furthermore, the corresponding target proxy members can be determined by looking up a table, clarifying the scope of version changes and thus improving the efficiency of obtaining query results.

[0068] In some embodiments, if the query information involves multiple query members, since the query sub-members corresponding to the same dimension are deduplicated and summarized when obtaining the query sub-member combination, it is necessary to determine which target query member combination each of the multiple query combination factors obtained based on the multiple query sub-member combinations belongs to. In this embodiment, the user only needs to input the query members they want to query. This embodiment can automatically list the target query member combinations and output the corresponding metric values ​​of these target query member combinations. For example, the query member combination {(2023, 2024)(e2, e3)} can have corresponding target query member combinations that include {(2024)(e2)}, {(2024)(e3)}, {(2023)(e2)}, and {(2023)(e3)}. In other words, if the query information is directly input as multiple years and multiple organizations to be queried, the query results output in this embodiment can include the metric values ​​corresponding to each organization under each year. For example, determining the aggregated data corresponding to the target query member combination corresponding to the target data based on the target proxy members includes: obtaining a second mapping relationship based on member version information; the second mapping relationship is used to characterize the mapping relationship between each original sub-member and the first type of member in the hierarchical data and the mapping relationship between each proxy member and the first type of member; for each query sub-member in the query combination factor, determining the first type of member combination corresponding to the query sub-member based on the second mapping relationship and / or the target proxy member corresponding to the query sub-member; for each query combination factor, determining the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination; and determining the aggregated data corresponding to the target query member combination based on the target data corresponding to each query combination factor.

[0069] Here, the first type of member combination corresponding to the query child member refers to the combination of the parent members of the query child member. For example, see reference. Figure 4 As shown, the parent members of e4 include e1 and e2.

[0070] Specifically, for each query sub-member in the query combination factor, if the query sub-member is not the target query sub-member (i.e., a query sub-member with a proxy member), the first type of member combination corresponding to the query sub-member can be directly determined based on the second mapping relationship. If the query sub-member is the target query sub-member, the target proxy member corresponding to the target query sub-member is obtained, and the first type of member combination corresponding to the target proxy member is determined from the second mapping relationship. For example, refer to... Figure 4 As shown, the first type of member combination corresponding to e10_1 includes e1, e2, and e6.

[0071] Next, for each query combination factor, based on the first-type member combination and query member combination corresponding to each query sub-member in the query combination factor, the target query member combination corresponding to the query combination factor is determined; based on the target data corresponding to each query combination factor, the aggregated data corresponding to the target query member combination is determined. This step is a reverse derivation of which specific target query member combination the query combination factor corresponds to. In this way, it can be determined which query combination factors' target data are used to obtain the query results for each target query member combination. That is, the query results for each target query member combination are obtained by aggregation calculation based on the target data corresponding to the corresponding query combination factors.

[0072] Specifically, for each query combination factor, the first type of member combination corresponding to each query sub-member in the query combination factor is matched with the query member combination. This identifies the common members in the first type of member combination and the query member combination, and the target query member combination is determined based on these common members. In this way, it can be determined which part of the query member combination the query combination factor corresponds to.

[0073] For example, the query combination factor is (2024, e8, a7), and the query member combination is {(all years), (e2, e1, e3)(a2, a3)}. The first type of member combination corresponding to the query combination factor is {(e1, e2, e6)(a1, a2)}. Upon comparison, the same member is {(e1, e2)(a2)}. Therefore, the target query member combination corresponding to this query combination factor can be determined as {(all years, e1, a2)}{(all years, e2, a2)}. In practical applications, the query combination factor could represent the sales revenue of Shenzhen in 2024. The query member combination would be {(all years), (South China, Guangdong, Fujian) (sales revenue, production)}. Then, the target data for this query combination factor should be the sales revenue of South China in all years (corresponding to the target query member combination) and the sales revenue of Guangdong in all years.

[0074] In this embodiment, by starting from the lowest-level target data stored in the hierarchical data, the target query member combination to which the target data belongs is derived in reverse. In this way, the result of the non-detailed data to be queried can be derived from the actual stored data, which can reduce unnecessary queries (for example, the target data corresponding to the query combination factor derived from the non-detailed data does not actually exist in the detailed data, and such queries will waste time and some computer resources), thereby improving the query efficiency of multi-level queries.

[0075] In some embodiments, for each query sub-member in the query combination factor, based on the second mapping relationship and / or the target proxy member corresponding to the query sub-member, a first type of member combination corresponding to the query sub-member is determined, including: for each query sub-member in the query combination factor, if the query sub-member does not have a corresponding target proxy member, then the first type of member combination corresponding to the query sub-member is determined based on the second mapping relationship; if the query sub-member has a corresponding target proxy member, then the first type of member combination corresponding to the target proxy member is determined based on the second mapping relationship.

[0076] Specifically, the second mapping relationship can be a mapping relationship table or a mapping relationship matrix. Assuming the second mapping relationship is a mapping relationship matrix, the value of each element stored in the matrix represents the dependency relationship between the proxy member or original sub-member and the first-class members. If the value of the element is 1, it means that the proxy member or original sub-member corresponding to the element belongs to the corresponding first-class member. If the value of the element is 0 or null, it means that the proxy member or original sub-member corresponding to the element does not belong to the corresponding first-class member. If a target proxy member exists for a queried sub-member, then the mapping relationship matrix is ​​searched for each first-class member corresponding to that target proxy member, thus obtaining the combination of first-class members.

[0077] In this embodiment, the first type of member corresponding to the current query combination factor can be quickly determined by querying through the first mapping relationship and the second mapping relationship. Since the first mapping relationship and the second mapping relationship explicitly store the data version information of each member, the determined first type of member corresponds correctly with the actual query combination factor, thereby ensuring the correctness of the final query result.

[0078] In some embodiments, determining the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination includes: determining the target query member combination based on the same members in the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination.

[0079] Specifically, after identifying the same members, the same members corresponding to each query sub-member are combined to obtain the target query member combination.

[0080] In this embodiment, the target query member combination corresponding to the target query member is determined by the data in the hierarchical data. Compared with the top-down approach of deriving the target query member combination from the target query member, the bottom-up reverse derivation in this embodiment can save a lot of unnecessary queries, thereby achieving efficient calculation.

[0081] In some embodiments, when the architecture of hierarchical data changes, a process for updating member version information can be triggered. For example, obtaining member version information corresponding to hierarchical data includes: obtaining architecture change information corresponding to hierarchical data; determining target changed sub-members based on the architecture change information; determining corresponding proxy members based on the target changed sub-members; determining the first type of members corresponding to each proxy member based on the hierarchical data of each data version; and obtaining member version information based on the mapping relationship between the target changed sub-members and the corresponding proxy members, and the mapping relationship between each proxy member and the corresponding first type of member.

[0082] Specifically, if the hierarchical data undergoes its first architectural change, after identifying the target changed sub-members, proxy members corresponding to these sub-members are generated. Two proxy members are used: one to map the hierarchical relationships before the architectural change, and the other to map the hierarchical relationships after the change. Next, the first type of member corresponding to each proxy member is determined. Then, a first mapping relationship is obtained based on the mapping relationship between the target changed sub-member and its corresponding proxy member. A second mapping relationship is obtained based on the mapping relationships between each proxy member and its corresponding first type of member, and between the unchanged sub-member and its corresponding first type of member. Finally, member version information is obtained based on the first and second mapping relationships.

[0083] If the hierarchical data represents the nth architecture change, after determining the target changed sub-member, a new proxy member is generated based on the proxy member information corresponding to that target changed sub-member in the current member version information. At this point, only one new proxy member can be generated, used to map the first type of member corresponding to that target changed sub-member after the architecture changes again. Finally, the updated member version information is obtained based on the updated first mapping relationship and the updated second mapping relationship.

[0084] In this embodiment, the corresponding member version information is first constructed using the acquired architecture change information. Subsequently, during aggregation queries, this member version information can be used to accurately determine which target query member combination the target data in the hierarchical data (detailed data table) corresponds to. This allows for rapid determination of the data version corresponding to the target data during aggregation calculations, thereby improving the efficiency of aggregation calculations.

[0085] In one exemplary embodiment, the method for querying hierarchical data includes:

[0086] Obtain query information and determine the combination of query members for the hierarchical data based on the query information. The query member combination can include at least one first-class member from at least one dimension (e.g., a non-detailed member, whose data is determined by the data of at least one detailed member). That is, the query member combination can be a single query member under one dimension, a combination of query members under multiple dimensions (one query member per dimension), or multiple combinations of query members under multiple dimensions (corresponding to the target query member combination mentioned above, i.e., multiple query members per dimension). To obtain the query results corresponding to the query member combination corresponding to the query information, the following steps can be performed:

[0087] First, analyze at least one query sub-member combination corresponding to each query member combination. Each query sub-member combination corresponds to a dimension, and each query sub-member combination summarizes the query sub-members corresponding to all query members of one dimension in the query member combination. For example, combining... Figure 3 and Figure 4 The query members include e2 and e3 under the organization dimension and a2 and a3 under the subject dimension. The corresponding sub-member combinations include e4, e5, e8, e9, e10, and e11 under the organization dimension and a3, a4, a5, a6, and a7 under the subject dimension. These sub-member combinations can be determined based on member version information. For example, combining... Figure 4 As shown, the horizontal axis member corresponding to the cell with a value of 1 in column e2 is the corresponding query sub-member.

[0088] Next, the query sub-member combinations are arranged and combined according to dimensions to obtain various query combination factors. That is, each query combination factor that may be related to a query member combination is retrieved. Since the obtained query sub-member combinations do not carry version information, after obtaining the query combination factors, the first type of member corresponding to each query sub-member in the query combination factor is determined based on the data in the query combination factor. This allows us to determine which target query member combination the query combination factor should be classified into based on this first type of member. When determining the first type of member corresponding to each query sub-member in the query combination factor, if the query sub-member has not undergone architectural changes, its corresponding first type of member combination can be directly determined based on the second mapping relationship. If the query sub-member has undergone architectural changes, based on determining the actual data version corresponding to the query combination factor, it is necessary to determine the target proxy member corresponding to the query sub-member, and then retrieve the first type of member combination corresponding to the target proxy member in the second mapping relationship.

[0089] Next, the first type of member combination is matched with the query member combination to determine the target query member combination corresponding to each query combination factor. This is because the first type of member combination may include multiple first type members, but not all first type members need to be considered; only the first type members in the query member combination need to be considered. In other words, the target data corresponding to the query combination factor can be categorized as data from Guangdong or data from South China. If the query information does not include data from South China, then only data from Guangdong needs to be obtained.

[0090] Finally, the target data for each query combination factor is categorized into the aggregated data of the corresponding target query member combination. The target data corresponding to each query combination factor is then aggregated (e.g., summarized, averaged), yielding the aggregated data for the corresponding target query member combination. This completes the query results corresponding to the query information.

[0091] In this embodiment, through the above steps, detailed members that have undergone architectural changes can be converted into versioned proxy members to achieve versioning, thereby enabling efficient aggregation computing.

[0092] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0093] Based on the same inventive concept, this application also provides a hierarchical data querying device for implementing the hierarchical data querying method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more hierarchical data querying device embodiments provided below can be found in the limitations of the hierarchical data querying method described above, and will not be repeated here.

[0094] In one exemplary embodiment, such as Figure 5 As shown, a hierarchical data query device 500 is provided, including: a query module 501, an acquisition module 502, a sub-member determination module 503, a proxy member determination module 504, and an aggregation module 505, wherein:

[0095] The query module 501 is used to obtain query information and determine the combination of query members in the hierarchical data based on the query information. The query members in the combination of query members have at least one child member in the hierarchical data.

[0096] The acquisition module 502 is used to acquire member version information corresponding to the hierarchical data. The member version information includes information about members whose hierarchical data has undergone architectural changes.

[0097] The sub-member determination module 503 is used to determine the query sub-member combination corresponding to the query member combination based on the member version information.

[0098] The proxy member determination module 504 is used to obtain the target data corresponding to the query sub-member combination from the hierarchical data, and determine the target proxy member corresponding to the query sub-member combination from the member version information;

[0099] The aggregation module 505 is used to determine the aggregated data corresponding to the target query member combination based on the target proxy member, so as to obtain the query results corresponding to the query member combination.

[0100] In some embodiments, in obtaining target data corresponding to the query sub-member combination from hierarchical data, the proxy member determination module 504 is specifically used to: combine the query sub-members in the query sub-member combination corresponding to different dimensions to obtain multiple query combination factors corresponding to the query sub-member combination; and obtain the target data corresponding to each query combination factor from the hierarchical data.

[0101] In some embodiments, in determining the target proxy member corresponding to the combination of query sub-members from the member version information, the proxy member determination module 504 is specifically used to: obtain a first mapping relationship based on the member version information; the first mapping relationship is used to characterize the mapping relationship between the proxy member and the original sub-member; and determine the target proxy member corresponding to each query sub-member in each query combination factor based on the first mapping relationship.

[0102] In some embodiments, in determining the aggregated data corresponding to the target query member combination corresponding to the target data based on the target proxy members, the aggregation module 505 is specifically used to: obtain a second mapping relationship based on member version information; the second mapping relationship is used to characterize the mapping relationship between each original sub-member and the first type of member in the hierarchical data and the mapping relationship between each proxy member and the first type of member; for each query sub-member in the query combination factor, determine the first type of member combination corresponding to the query sub-member based on the second mapping relationship and the target proxy member corresponding to the query sub-member; for each query combination factor, determine the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination; and determine the aggregated data corresponding to the target query member combination based on the target data corresponding to each query combination factor.

[0103] In some embodiments, regarding determining the first type of member combination corresponding to each query sub-member in the query combination factor based on the second mapping relationship and the target proxy member corresponding to the query sub-member, the aggregation module 505 is specifically used to: for each query sub-member in the query combination factor, if the query sub-member does not have a corresponding target proxy member, then determine the first type of member combination corresponding to the query sub-member based on the second mapping relationship; if the query sub-member has a corresponding target proxy member, then determine the first type of member combination corresponding to the target proxy member based on the second mapping relationship.

[0104] In some embodiments, in determining the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination, the aggregation module 505 is specifically used to: determine the target query member combination based on the same members in the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination.

[0105] In some embodiments, in obtaining member version information corresponding to hierarchical data, the obtaining module 502 is specifically used to: obtain architecture change information corresponding to hierarchical data; determine target changed sub-members based on architecture change information, and determine corresponding proxy members based on target changed sub-members; determine the first type of member corresponding to each proxy member based on the hierarchical data of each data version; and obtain member version information based on the mapping relationship between target changed sub-members and corresponding proxy members, and the mapping relationship between each proxy member and corresponding first type of member.

[0106] Each module in the aforementioned hierarchical data query device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0107] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores hierarchical data, member version information, and other data related to hierarchical data query methods. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a hierarchical data query method.

[0108] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a hierarchical data query method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0109] Those skilled in the art will understand that Figure 6 or Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0110] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0111] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0112] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0113] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0114] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0115] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0116] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for querying hierarchical data, characterized in that, The method includes: Obtain query information, and determine a combination of query members in the hierarchical data based on the query information, wherein the query members in the combination of query members have at least one sub-member in the hierarchical data; Obtain member version information corresponding to the hierarchical data, wherein the member version information includes information about members whose hierarchical data has undergone architectural changes; Based on the member version information, determine the query sub-member combination corresponding to the query member combination; The query sub-members in the query sub-member combinations corresponding to different dimensions are combined to obtain multiple query combination factors corresponding to the query sub-member combinations; the target data corresponding to each query combination factor is obtained from the hierarchical data; a first mapping relationship is obtained based on the member version information; the first mapping relationship is used to characterize the mapping relationship between the proxy member and the original sub-member; based on the first mapping relationship, the target proxy member corresponding to each query sub-member in each query combination factor is determined; Based on the target agent members, aggregated data corresponding to the target query member combination corresponding to the target data is determined to obtain the query results corresponding to the query member combination.

2. The method according to claim 1, characterized in that, The step of determining the aggregated data corresponding to the target query member combination corresponding to the target data based on the target proxy member includes: Based on the member version information, a second mapping relationship is obtained; the second mapping relationship is used to characterize the mapping relationship between each original sub-member and the first type of member in the hierarchical data and the mapping relationship between each proxy member and the first type of member; For each query sub-member in the query combination factor, based on the second mapping relationship and / or the target proxy member corresponding to the query sub-member, determine the first type of member combination corresponding to the query sub-member; For each of the query combination factors, the target query member combination corresponding to the query combination factor is determined based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination. Based on the target data corresponding to each of the query combination factors, determine the aggregate data corresponding to the target query member combination.

3. The method according to claim 2, characterized in that, The step of determining the first type of member combination corresponding to each query sub-member in the query combination factor, based on the second mapping relationship and / or the target proxy member corresponding to the query sub-member, includes: For each query sub-member in the query combination factor, if the query sub-member does not have a corresponding target proxy member, then the first type of member combination corresponding to the query sub-member is determined based on the second mapping relationship; if the query sub-member has a corresponding target proxy member, then the first type of member combination corresponding to the target proxy member is determined based on the second mapping relationship.

4. The method according to claim 2, characterized in that, The step of determining the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination includes: The target query member combination is determined based on the first type of member combination corresponding to each query sub-member in the query combination factor and the same members in the query member combination.

5. The method according to claim 1, characterized in that, The step of obtaining the member version information corresponding to the hierarchical data includes: Obtain the architecture change information corresponding to the hierarchical data; Based on the architecture change information, target changed sub-members are determined, and corresponding proxy members are determined based on the target changed sub-members. Based on the hierarchical data of each data version, determine the first type of member corresponding to each agent member; Based on the mapping relationship between the target changed sub-member and the corresponding proxy member, and the mapping relationship between each proxy member and the corresponding first type member, the member version information is obtained.

6. A hierarchical data query device, characterized in that, include: The query module is used to obtain query information and determine the combination of query members in the hierarchical data based on the query information. The query members in the combination of query members have at least one child member in the hierarchical data. The acquisition module is used to obtain member version information corresponding to the hierarchical data. The member version information includes information about members whose hierarchical data has undergone architectural changes. The sub-member determination module is used to determine the query sub-member combination corresponding to the query member combination based on the member version information. The proxy member determination module is used to combine query sub-members in query sub-member combinations corresponding to different dimensions to obtain multiple query combination factors corresponding to the query sub-member combinations; obtain target data corresponding to each query combination factor from the hierarchical data; and obtain a first mapping relationship based on the member version information. The first mapping relationship is used to characterize the mapping relationship between the proxy member and the original sub-member; Based on the first mapping relationship, the target proxy member corresponding to each query sub-member in each of the query combination factors is determined; The aggregation module is used to determine the aggregated data corresponding to the target query member combination based on the target proxy members, so as to obtain the query results corresponding to the query member combination.

7. The apparatus according to claim 6, characterized in that, The aggregation module is specifically used for: obtaining a second mapping relationship based on member version information; the second mapping relationship is used to represent the mapping relationship between each original sub-member and the first type of member in the hierarchical data, and the mapping relationship between each proxy member and the first type of member; for each query sub-member in the query combination factor, determining the first type of member combination corresponding to the query sub-member based on the second mapping relationship and the target proxy member corresponding to the query sub-member; for each query combination factor, determining the target query member combination corresponding to the query combination factor based on the first type of member combination corresponding to each query sub-member in the query combination factor and the query member combination; and determining the aggregated data corresponding to the target query member combination based on the target data corresponding to each query combination factor.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and system for managing versioned structured documents in a database

    US8898122B1

  • System for providing structured query language access to non-relational data stores

    US9886483B1