Dynamic data cube construction method and system, storage medium and electronic equipment

By analyzing and mapping the dimensional relationships of data forms, a dynamic data cube is constructed, which solves the problems of data scalability and insufficient dimensions of traditional databases, realizes real-time and efficient query of data cubes, and meets the needs of enterprises for real-time data analysis.

CN118733561APending Publication Date: 2024-10-01GUANGDONG KAMFU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410738585.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When building a data cube, traditional databases cannot cover all key dimensions and information due to insufficient data scalability and dimensions, affecting their actual utility and making it difficult to meet the growing data analysis needs of enterprises.

Method used

By obtaining multiple original data forms, analyzing their dimensional relationships, and mapping upper and lower hierarchical relationships and parallel hierarchical relationships to the target knowledge base, we build a dynamic data cube that supports real-time updates and queries, and uses advanced data processing technology and query algorithm optimization Data query.

Benefits of technology

It achieves the real-time and accuracy of the data cube, provides more powerful data support, improves data processing speed and response time, and meets the needs of enterprises for real-time data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733561A_ABST
    Figure CN118733561A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic data cube construction method and system, a storage medium and electronic equipment, and the method comprises the steps: obtaining a plurality of original data forms corresponding to a target knowledge base, and carrying out the data analysis of the original data forms, so as to obtain a dimension relation contained in a data structure in the original data forms according to a data analysis result, the dimension relationship comprises an up-down hierarchical relationship and a parallel hierarchical relationship; mapping the upper and lower hierarchical relationship in the data structure into upper and lower node association in the target knowledge base, and mapping the parallel hierarchical relationship in the data structure into parallel node association in the target knowledge base, so as to construct the target knowledge base according to the node association relationship; obtaining dimension information and node information input when a user queries the target knowledge base, and traversing all data in the target knowledge base according to the dimension information and the node information to obtain a query dimension set. According to the method, the efficiency and the response speed of data query can be improved, and persistence of the dynamic cube is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database construction, and in particular to a method, system, storage medium and electronic device for constructing a dynamic data cube. Background Art

[0002] In today's digital wave, digital transformation of enterprises has become a must. In this process, it is crucial to build a core data cube to support comprehensive digital decision-making. As an important part of the data warehouse, the data cube is designed to provide enterprises with a multi-dimensional data analysis perspective. Its importance lies in providing comprehensive and accurate data support for enterprise decision-making, thereby helping enterprises achieve more efficient and accurate operations.

[0003] However, in the actual construction process, due to the limitations of the information data system itself, the construction of data cubes often faces many challenges. Among them, the most prominent problem is the lack of data scalability and dimension. This leads to the inability to cover all key dimensions and information when constructing the data cube, thus affecting its actual effectiveness. With the continuous expansion and changes in corporate business, the initially constructed data cube often cannot meet the growing data analysis needs. Therefore, building a data cube based on dynamic adjustment of knowledge has become an urgent need for current technological development. Summary of the invention

[0004] Based on this, the purpose of the present invention is to propose a method, system, storage medium and electronic device for constructing a dynamic data cube, aiming to solve the problem that the database constructed in the traditional way is insufficient in data scalability and dimensionality, resulting in the inability to cover all key dimensions and information when constructing the data cube, thereby affecting its actual effectiveness.

[0005] In a first aspect, an embodiment of the present invention provides a method for constructing a dynamic data cube, the method comprising:

[0006] Acquire multiple original data forms corresponding to the target knowledge base, and perform data analysis on the original data forms to obtain dimensional relationships contained in the data structure in the original data forms according to the data analysis results, wherein the dimensional relationships include upper and lower hierarchical relationships and parallel hierarchical relationships;

[0007] Mapping the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and mapping the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships;

[0008] The dimension information and node information input by the user when querying the target knowledge base are obtained, so as to traverse all the data in the target knowledge base according to the dimension information and node information to obtain a query dimension set.

[0009] In some embodiments, after the step of mapping the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and mapping the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships, the step further includes:

[0010] When the target knowledge base is updated, the update items of the database are obtained, and corresponding update operation rules are executed according to the update items, wherein the update items include dimension insertion, dimension deletion, and dimension modification.

[0011] In some embodiments, when the target knowledge base is updated, the steps of obtaining the update items of the current database and executing the corresponding update operation rules according to the update items include:

[0012] When the update item is dimension insertion, the dimension information to be inserted is obtained, and two nodes in a hierarchical relationship with the dimension information to be inserted are obtained;

[0013] Verifying the newly inserted data according to the dimension information to be inserted;

[0014] If the verification is successful, a new relationship is created between two nodes that are in a hierarchical relationship with the dimension information to be inserted, so as to represent the dimension information to be inserted.

[0015] In some embodiments, when the target knowledge base is updated, the steps of obtaining the update items of the current database and executing the corresponding update operation rules according to the update items include:

[0016] When the update item is dimension deletion, the dimension node information to be deleted is obtained;

[0017] Determine whether the dimension node information to be deleted meets the preset deletion conditions, and the preset deletion conditions include whether the node can be safely removed and whether the removal will cause data loss or inconsistency;

[0018] If the dimension node information to be deleted meets the preset deletion condition, two nodes in a hierarchical relationship with the dimension node information to be deleted are obtained, and the two nodes in a hierarchical relationship with the dimension node information to be deleted are directly associated as upper and lower hierarchies;

[0019] Acquire at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted, and delete the dimension node information to be deleted and the association relationship between the at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted;

[0020] Delete the dimension node information to be deleted.

[0021] In some embodiments, when the target knowledge base is updated, the steps of obtaining the update items of the current database and executing the corresponding update operation rules according to the update items include:

[0022] When the update item is a dimension change, the dimension node information to be changed is obtained, and it is verified whether the change destroys the integrity of the data;

[0023] If the verification is successful, the node attributes are updated according to the dimension node information to be changed.

[0024] In some embodiments, the step of obtaining dimension information and node information input by a user when querying the target knowledge base, and traversing all data in the target knowledge base according to the dimension information and node information to obtain a query dimension set includes:

[0025] Obtaining dimension information that the user wants to query through the query interface, and recording the dimension information as a dimension node set A;

[0026] Locate at least one node corresponding to the dimension information, find the parallel hierarchical relationship of each node corresponding to the dimension information, and add the nodes with parallel hierarchical relationship to the dimension node set B;

[0027] Find the upper and lower hierarchical relationship of each node corresponding to the dimension information, and add the nodes with upper and lower hierarchical relationship to the dimension node set C;

[0028] Integrate the dimension node set A, the dimension node set B and the dimension node set C together to obtain a query dimension set D;

[0029] Generate a corresponding SQL query according to the query dimension set D.

[0030] In a second aspect, an embodiment of the present invention further provides a system for constructing a dynamic data cube, the system comprising:

[0031] A dimension relationship acquisition module, used to acquire multiple original data forms corresponding to the target knowledge base, and perform data analysis on the original data forms to acquire the dimension relationships contained in the data structure in the original data forms according to the data analysis results, wherein the dimension relationships include upper and lower hierarchical relationships and parallel hierarchical relationships;

[0032] A knowledge base construction module, used to map the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and map the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships;

[0033] The data query module is used to obtain the dimension information and node information input by the user when querying the target knowledge base, so as to traverse all the data in the target knowledge base according to the dimension information and node information to obtain the query dimension set.

[0034] In some embodiments, the system further comprises:

[0035] The knowledge base update module is used to obtain the update items of the current database when updating the target knowledge base, and execute corresponding update operation rules according to the update items, and the update items include dimension insertion, dimension deletion, and dimension change.

[0036] In a third aspect, an embodiment of the present invention further provides a storage medium, including one or more programs stored in the storage medium, which, when executed, implement the method for constructing a dynamic data cube as described above.

[0037] In a fourth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, wherein:

[0038] The memory is used to store computer programs;

[0039] When the processor is used to execute the computer program stored in the memory, the method for constructing a dynamic data cube as described above is implemented.

[0040] Compared with the prior art, this application has the following advantages:

[0041] 1. The data cube (knowledge base) constructed by this application can not only capture and integrate new dimensions and knowledge in real time, but also make corresponding adjustments and optimizations according to the needs of enterprise development. This not only ensures the real-time and accuracy of the data cube, but also provides enterprises with more powerful data support, helping enterprises go further and more steadily on the road of digital transformation.

[0042] 2. This application builds a virtual data cube (target knowledge base) by associating a multidimensional knowledge base with the original data form. This process involves in-depth analysis of the multidimensional knowledge base and careful combing of the actual data form to ensure accurate correspondence between the two. Secondly, advanced data processing technology is used to update and associate the multidimensional knowledge base and the original data form, thereby ensuring the real-time and accuracy of the dynamic cube.

[0043] 3. This application also proposes a new query method for data cubes. By introducing advanced query algorithms and optimization techniques, the new data queryer can query dynamic cubes more efficiently and quickly. This greatly improves the speed and response time of data processing and meets the needs of enterprises for real-time data analysis.

[0044] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of a method for constructing a dynamic data cube according to a first embodiment of the present invention;

[0046] Figure 2 is a flow chart of a method for constructing a dynamic data cube in a second embodiment of the present invention;

[0047] Figure 3 It is a schematic diagram of the structure of a system for constructing a dynamic data cube in the third embodiment of the present invention.

[0048] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0049] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0051] See also Figure 1 , which is a flow chart of a method for constructing a dynamic data cube in a first embodiment of the present invention, the method comprises steps S101 to S103, wherein:

[0052] Step S101: obtaining a plurality of original data forms corresponding to a target knowledge base, and performing data analysis on the original data forms to obtain dimensional relationships contained in the data structure in the original data forms according to the data analysis results, wherein the dimensional relationships include upper and lower hierarchical relationships and parallel hierarchical relationships;

[0053] It should be pointed out that in this step, the upper and lower hierarchical relationship may also be referred to as an upper and lower drill-down relationship, and the parallel hierarchical relationship may also be referred to as a left and right node relationship or a parallel node relationship.

[0054] In addition, by mapping the up-down and down-drilling relationships in the data structure to the up-down and down-down node associations in the graph database, it means that in the knowledge graph, the parent-child nodes or hierarchical relationships will reflect the up-down and down-drilling relationships in the data structure, such as from the overall to the details or from the classification to the subclass.

[0055] In addition, corresponding to the association relationship in the data structure, in the graph database, the association between the left and right nodes or the parallel nodes will be mapped to the association relationship in the data structure, which may involve the association primary key in the same table or the foreign primary key across tables.

[0056] For example, for a certain geographic database, the upper and lower hierarchical relationships are provinces, cities, districts, etc. The multiple nodes under the city dimension correspond to multiple cities, such as City A, City B, etc. The same is true for other dimensions, and the nodes under the two city dimensions of City A and City B are in a parallel hierarchical relationship.

[0057] Step S102: Mapping the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and mapping the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships;

[0058] It should be pointed out that a virtual data cube is constructed by associating the multidimensional knowledge base (target knowledge base) with the actual data form (original data form). This process involves in-depth analysis of the multidimensional knowledge base and careful sorting of the actual data form to ensure accurate correspondence between the two. Secondly, advanced data processing technology is used to update and associate the multidimensional knowledge base and the actual data form, thereby ensuring the real-time and accuracy of the dynamic cube.

[0059] Step S103: Acquire dimension information and node information input by the user when querying the target knowledge base, and traverse all data in the target knowledge base according to the dimension information and node information to obtain a query dimension set.

[0060] It should be noted that in this step, the traditional data query engine is also reconstructed. By introducing advanced query algorithms and optimization techniques, the new data query engine can query dynamic cubes more efficiently and quickly. This greatly improves the speed and response time of data processing and meets the needs of enterprises for real-time data analysis. The specific process is as follows:

[0061] Obtaining dimension information that the user wants to query through the query interface, and recording the dimension information as a dimension node set A;

[0062] Locate at least one node corresponding to the dimension information, find the parallel hierarchical relationship of each node corresponding to the dimension information, and add the nodes with parallel hierarchical relationship to the dimension node set B; in some embodiments, the node corresponding to the input dimension can be located by Cypher query, which may involve matching labels and attributes;

[0063] Find the upper and lower hierarchical relationships of each node corresponding to the dimension information, and add the nodes with upper and lower hierarchical relationships to the dimension node set C; this step is mainly to exhaust the left and right relationships: for each located node, it is necessary to find all its left and right relationships (that is, other nodes at the same level), and add these nodes to the dimension node set B.

[0064] The dimension node set A, the dimension node set B and the dimension node set C are integrated together to obtain the query dimension set D; specifically, this step is mainly to exhaustively enumerate the upper and lower inheritance relationships: for each located node, it is also necessary to penetrate and find all its parent nodes and child nodes, that is, to exhaustively enumerate the upper and lower inheritance relationships. This can be achieved through recursive query, and the found nodes are added to the new query dimension C, and then the original input dimension node set A, the exhaustive left and right relationship node set B and the upper and lower inheritance relationship node set C are integrated together to form the final query dimension set D.

[0065] A corresponding SQL query is generated according to the query dimension set D. The SQL query may need to include aggregate functions (such as SUM, AVG, COUNT, etc.) to perform OLAP operations.

[0066] This is an example but not a limitation. / / Assume that we have a dimension label Dimension, and the type relationships LEFT_OF, RIGHT_OF, HAS_PARENT, and HAS_CHILD of the left-right relationship and the top-bottom inheritance relationship;

[0067] / / The first step: locate the node corresponding to the input dimension

[0068] MATCH(d:Dimension{inputProperty:'inputValue'})

[0069] WHERE d.dimensionType IN['Dimension1','Dimension2',...] / /

[0070] Input dimension type

[0071] WITH COLLECT(d)AS dimensionNodesA

[0072] / / Step 2: Exhaust left-right relationships

[0073] MATCH(d:Dimension)-[:LEFT_OF|RIGHT_OF]->(relatedDimension)

[0074] WHERE d IN dimensionNodesA

[0075] WITH COLLECT(relatedDimension)AS dimensionNodesB,

[0076] dimensionNodesA

[0077] / / Step 3: Exhaust the inheritance relationship (penetrate and search for parent and child nodes)

[0078] CALL apoc.path.subgraphNodes(dimensionNodesA,

[0079] {relationshipFilter:'HAS_PARENT|HAS_CHILD',maxLevel:5})

[0080] YIELD nodes

[0081] WITH COLLECT(nodes)AS dimensionNodesC,dimensionNodesA,

[0082] dimensionNodesB

[0083] / / Step 4: Integrate query dimensions

[0084] UNWIND dimensionNodesA AS nodeA

[0085] UNWIND dimensionNodesB AS nodeB

[0086] UNWIND dimensionNodesC AS nodeC

[0087] WITH COLLECT(DISTINCT nodeA)+COLLECT(DISTINCT nodeB)+COLLECT(DISTINCTnodeC)AS finalDimensionNodes.

[0088] Through a new query method for data cubes and the introduction of advanced query algorithms and optimization technologies, the new data query engine can query dynamic cubes more efficiently and quickly. This greatly improves the speed and response time of data processing and meets the needs of enterprises for real-time data analysis.

[0089] In summary, according to the above-mentioned method for constructing a dynamic data cube, not only the efficiency and response speed of data query are improved, but also the persistence of the dynamic cube is ensured. Through the reconstructed data query, enterprises can more conveniently obtain real-time and accurate data analysis results, thereby better supporting decision-making and business development.

[0090] See also Figure 2 , which is a flow chart of a method for constructing a dynamic data cube in a second embodiment of the present application. This embodiment is substantially the same as the first embodiment, except that after step S102, it further includes:

[0091] Step S201: when updating the target knowledge base, the update items of the database are obtained, and corresponding update operation rules are executed according to the update items, wherein the update items include dimension insertion, dimension deletion, and dimension modification.

[0092] It should be noted that, in the case of a system update or a data form change, it is difficult to maintain the integrity and consistency of the data cube constructed in the traditional way. Based on this, the present application proposes a dynamic database update method, which is as follows:

[0093] When the update item is dimension insertion, the dimension information to be inserted is obtained, and two nodes in a hierarchical relationship with the dimension information to be inserted are obtained;

[0094] Verifying the newly inserted data according to the dimension information to be inserted;

[0095] If the verification is successful, a new relationship is created between two nodes that are in a hierarchical relationship with the dimension information to be inserted, so as to represent the dimension information to be inserted.

[0096] Specifically, for dimension insertion rules: First select the upper and lower dimension nodes: Before inserting a dimension, the user or system needs to first select two nodes as the upper and lower relationships. This usually involves finding an appropriate location in the knowledge graph to insert the new dimension information. The selected upper and lower nodes should be valid nodes that already exist in the knowledge graph, and the association between them should conform to the hierarchical relationship of the data structure. Then verify the dimension information: Before inserting new dimension information, data verification is required to ensure the integrity and accuracy of the new data. Verification may include checking data types, ranges, uniqueness constraints, etc. to ensure that the new data conforms to the data model and business rules of the knowledge graph. Then insert the dimension information: Once the upper and lower dimension nodes are selected and the new data passes verification, the system will create a new relationship between the two nodes to represent the new dimension information. This new relationship will contain the necessary attributes that describe the details of the new dimension.

[0097] When the update item is dimension deletion, the dimension node information to be deleted is obtained;

[0098] Determine whether the dimension node information to be deleted meets the preset deletion conditions, and the preset deletion conditions include whether the node can be safely removed and whether the removal will cause data loss or inconsistency;

[0099] If the dimension node information to be deleted meets the preset deletion condition, two nodes in a hierarchical relationship with the dimension node information to be deleted are obtained, and the two nodes in a hierarchical relationship with the dimension node information to be deleted are directly associated as upper and lower hierarchies;

[0100] Acquire at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted, and delete the dimension node information to be deleted and the association relationship between the at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted;

[0101] Delete the dimension node information to be deleted.

[0102] Specifically, for dimension deletion rules: First select the dimension node: Before deleting a dimension, the user or system needs to first select the dimension node to be deleted. This usually involves finding and determining the node to be removed in the knowledge graph. The selected node should be a valid node that already exists in the knowledge graph, and its deletion will not have a destructive effect on the overall structure or business logic of the knowledge base. Then verify the deletion operation: Before deleting a node, the system should verify whether the deletion operation is legal, that is, whether the deletion conditions are met, such as whether the node can be safely removed, and whether the removal will cause data loss or inconsistency. Verification may include checking whether the node has dependencies, whether it is the only medium for other node relationships, etc. Then reconnect the upper and lower nodes: Once it is determined that the dimension node can be deleted, the system needs to find the upper and lower nodes of the node and re-establish the direct relationship between them. This may involve creating a new relationship or updating an existing relationship to ensure that the upper and lower nodes remain effectively connected after the dimension node is deleted. Then block the left and right node relationship: For the left and right nodes associated with the dimension node (that is, the associated primary key or outer primary key relationship in the same table), the system needs to block the direct relationship between them. This may involve deleting or modifying existing relationships to ensure that after deleting the dimension node, the left and right nodes are no longer related through the dimension node. Finally, delete the dimension node: After completing the above steps, the system can safely delete the selected dimension node. The deletion operation should be reversible, that is, if it is found that the deletion operation has caused data loss or inconsistency, it should be possible to restore to the state before the deletion.

[0103] When the update item is a dimension change, the dimension node information to be changed is obtained, and it is verified whether the change destroys the integrity of the data;

[0104] If the verification is successful, the node attributes are updated according to the dimension node information to be changed.

[0105] Establishing dimension change rules allows the graph database to automatically or manually update the corresponding nodes and relationships when the data changes, ensuring the accuracy and consistency of the data. Specifically, regarding dimension change rules: First select the dimension node: First, you need to locate the dimension node to be changed. Then verify the change: Before modifying the node, you may need to verify to ensure that the change does not destroy the integrity of the data or violate business rules. This may involve checking the validity of the new value, or ensuring that the context of the node in the knowledge graph remains consistent. Then modify the node description: Once the change is verified, the properties of the node can be updated. Then maintain the up, down, left, and right relationships: When modifying a node, it is important to maintain the existing relationships between the node and other nodes. This generally means that you should not delete or change any existing relationships unless this is part of the change. If you need to add new relationships or delete old relationships, make sure that these changes do not destroy the integrity of the data.

[0106] In summary, through the continuous updating and association mechanism between the target knowledge base and the actual data form, the dynamic cube can maintain its integrity and consistency even when the system is updated or the data form changes.

[0107] See also Figure 3 , which is a schematic diagram of the structure of a dynamic data cube construction system in the third embodiment, the system includes:

[0108] The dimension relationship acquisition module 10 is used to acquire multiple original data forms corresponding to the target knowledge base, and perform data analysis on the original data forms to acquire the dimension relationship contained in the data structure in the original data forms according to the data analysis results, wherein the dimension relationship includes a hierarchical relationship and a parallel hierarchical relationship;

[0109] A knowledge base construction module 20, used to map the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and map the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships;

[0110] The data query module 30 is used to obtain dimension information and node information input by the user when querying the target knowledge base, and traverse all data in the target knowledge base according to the dimension information and node information to obtain a query dimension set;

[0111] The knowledge base update module 40 is used to obtain the update items of the current database when updating the target knowledge base, and execute corresponding update operation rules according to the update items, and the update items include dimension insertion, dimension deletion, and dimension modification.

[0112] Another aspect of the present invention further provides a computer storage medium on which one or more programs are stored, and when the programs are executed by a processor, the above-mentioned method for constructing a dynamic data cube is implemented.

[0113] Another aspect of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned method for constructing a dynamic data cube.

[0114] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0115] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0116] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0118] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A method for constructing a dynamic data cube, characterized in that: The method comprises: Acquire multiple original data forms corresponding to the target knowledge base, and perform data analysis on the original data forms to obtain dimensional relationships contained in the data structure in the original data forms according to the data analysis results, wherein the dimensional relationships include upper and lower hierarchical relationships and parallel hierarchical relationships; Mapping the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and mapping the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships; The dimension information and node information input by the user when querying the target knowledge base are obtained, so as to traverse all the data in the target knowledge base according to the dimension information and node information to obtain a query dimension set.

2. The method for constructing a dynamic data cube according to claim 1, characterized in that: After the step of mapping the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and mapping the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationship, the step further includes: When the target knowledge base is updated, the update items of the database are obtained, and corresponding update operation rules are executed according to the update items, wherein the update items include dimension insertion, dimension deletion, and dimension modification.

3. The method for constructing a dynamic data cube according to claim 2, characterized in that: When the target knowledge base is updated, the steps of obtaining the update items of the database and executing the corresponding update operation rules according to the update items include: When the update item is dimension insertion, the dimension information to be inserted is obtained, and two nodes in a hierarchical relationship with the dimension information to be inserted are obtained; Verifying the newly inserted data according to the dimension information to be inserted; If the verification is successful, a new relationship is created between two nodes that are in a hierarchical relationship with the dimension information to be inserted, so as to represent the dimension information to be inserted.

4. The method for constructing a dynamic data cube according to claim 2, characterized in that: When the target knowledge base is updated, the steps of obtaining the update items of the database and executing the corresponding update operation rules according to the update items include: When the update item is dimension deletion, the dimension node information to be deleted is obtained; Determine whether the dimension node information to be deleted meets the preset deletion conditions, and the preset deletion conditions include whether the node can be safely removed and whether the removal will cause data loss or inconsistency; If the dimension node information to be deleted meets the preset deletion condition, two nodes in a hierarchical relationship with the dimension node information to be deleted are obtained, and the two nodes in a hierarchical relationship with the dimension node information to be deleted are directly associated as upper and lower hierarchies; Acquire at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted, and delete the dimension node information to be deleted and the association relationship between the at least one node that is in a parallel hierarchical relationship with the dimension node information to be deleted; Delete the dimension node information to be deleted.

5. The method for constructing a dynamic data cube according to claim 2, characterized in that: When the target knowledge base is updated, the steps of obtaining the update items of the database and executing the corresponding update operation rules according to the update items include: When the update item is a dimension change, the dimension node information to be changed is obtained, and it is verified whether the change destroys the integrity of the data; If the verification is successful, the node attributes are updated according to the dimension node information to be changed.

6. The method for constructing a dynamic data cube according to any one of claims 1 to 5, characterized in that: The step of obtaining dimension information and node information input by the user when querying the target knowledge base, and traversing all data in the target knowledge base according to the dimension information and node information to obtain a query dimension set includes: Obtaining dimension information that the user wants to query through the query interface, and recording the dimension information as a dimension node set A; Locate at least one node corresponding to the dimension information, find the parallel hierarchical relationship of each node corresponding to the dimension information, and add the nodes with parallel hierarchical relationship to the dimension node set B; Find the upper and lower hierarchical relationship of each node corresponding to the dimension information, and add the nodes with upper and lower hierarchical relationship to the dimension node set C; Integrate the dimension node set A, the dimension node set B and the dimension node set C together to obtain a query dimension set D; Generate a corresponding SQL query according to the query dimension set D.

7. A dynamic data cube construction system, characterized in that: The system comprises: A dimension relationship acquisition module, used to acquire multiple original data forms corresponding to the target knowledge base, and perform data analysis on the original data forms to acquire the dimension relationships contained in the data structure in the original data forms according to the data analysis results, wherein the dimension relationships include upper and lower hierarchical relationships and parallel hierarchical relationships; A knowledge base construction module, used to map the upper and lower hierarchical relationships in the data structure into upper and lower node associations in the target knowledge base, and map the parallel hierarchical relationships in the data structure into parallel node associations in the target knowledge base, so as to construct the target knowledge base according to the node association relationships; The data query module is used to obtain the dimension information and node information input by the user when querying the target knowledge base, so as to traverse all the data in the target knowledge base according to the dimension information and node information to obtain the query dimension set.

8. The dynamic data cube construction system according to claim 7, characterized in that: The system further comprises: The knowledge base update module is used to obtain the update items of the current database when updating the target knowledge base, and execute corresponding update operation rules according to the update items, and the update items include dimension insertion, dimension deletion, and dimension change.

9. A storage medium, characterized in that: include: The storage medium stores one or more programs, which, when executed by a processor, implement the method for constructing a dynamic data cube as described in any one of claims 1 to 6.

10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the method for constructing a dynamic data cube described in any one of claims 1 to 6 is implemented.