Data Processing Method, Apparatus and Electronic Device for Multi-Level Associated Database

Through the data processing method of multi-level related databases, automatic chain updates are achieved using event release and monitoring mechanisms, which solves the problem of complex synchronous modification of component information changes in large-scale engineering projects, and improves data update efficiency and simplification of management processes.

CN114297201BActive Publication Date: 2025-06-03SYSWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111669364.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-06-03
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The number of parts and complex correlations in large-scale engineering projects leads to the need to synchronously modify multiple modules when information changes, which consumes a lot of manpower and energy, and is prone to errors.

Method used

The data processing method of multi-level related database is adopted to realize the automatically triggered chain update method through event release and monitoring mechanisms. When the properties of any data table in the database change, the change event is broadcast, and the listener of each data table triggers the processing module to update the relevant data and automatically broadcasts the change event.

Benefits of technology

It improves data update efficiency, reduces the chance of errors and missed updates, and simplifies the information management process of large-scale projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297201B_ABST
    Figure CN114297201B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, apparatus and electronic device for a multi-level associated database, which is applied to a database including multiple library nodes. Each library node includes a data table of multiple objects that store data using the same model. The data table of each object includes the attribute values of each attribute of the object. The attributes of some objects in some data tables are associated with another data table. The method includes: when it is detected that an attribute in any data table in the database changes, broadcasting a change event of any data table; a listener corresponding to each data table triggers a processing module corresponding to each data table based on the listened change event, wherein the listened object of each listener includes the change event of the data table associated with the attribute in the corresponding data table; each triggered processing module updates the relevant data in the corresponding data table based on the listened change event, and automatically triggers the broadcast of the change event for the corresponding data table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly to a data processing method, apparatus, and electronic device for a multi-level associated database. Background Art

[0002] In order to manage engineering projects conveniently and efficiently, information on each component involved in project design and production is generally maintained through a material management system. For large projects (such as rockets, vehicles, etc.), the number of components involved is numerous. To improve management efficiency, the project is usually gradually divided into multiple hierarchical modules according to functions and managed hierarchically. For example, a vehicle can be divided into multiple modules such as an engine, tires, and chassis, and the engine can be further divided into multiple sub-modules. Each module has its own corresponding BOM (Bill of Material) to record the relevant information of the components involved. Since large projects involve a large number of components and the components affect each other, and there is even a situation where the same component is reused by multiple modules, if the information of a certain component changes, it is necessary to synchronously modify the information in the modules that may be affected. Such modification requires a large amount of manpower and energy and is prone to errors. Summary of the Invention

[0003] Embodiments of this application provide a data processing method, apparatus, electronic device, and storage medium for a multi-level associated database, which can well handle large projects with numerous components and complex association relationships and assist users in improving project management efficiency.

[0004] On the one hand, an embodiment of this application provides a data processing method for a multi-level associated database, which is applied to a database including multiple library nodes. Each library node includes a data table of multiple objects that store data using the same model. The data tables in the same library node include attributes specified by the same model. The data table of each object includes the attribute values of the attributes of the object. Part of the attributes of part of the objects in some data tables are associated with another data table, including:

[0005] When it is detected that an attribute in any data table in the database changes, broadcast a change event of the any data table;

[0006] The listener corresponding to each data table triggers the processing module corresponding to each data table based on the listened change event. Among them, the listening object of each listener includes the change event of the data table associated with the attributes in the corresponding data table;

[0007] Each triggered processing module updates the relevant data in the corresponding data table based on the listened change event and automatically triggers the broadcast of the change event for the corresponding data table.

[0008] Optionally, the change event includes change information of a changed attribute, and triggering a processing module corresponding to each data table based on the monitored change event includes:

[0009] Obtaining change information of the changed attribute from the monitored change event;

[0010] Searching for an attribute related to the changed attribute from the data table corresponding to the listener;

[0011] Updating the attribute value of the related attribute based on a preset relationship between the changed attribute and the related attribute, and the change information.

[0012] Optionally, the method further includes:

[0013] For each data table, obtaining an associated data list corresponding to each data table, where the associated data list includes a data association relationship between an attribute in each data table and a data table associated with the attribute, and adding a change event of the data table in the associated data list to a monitored object of a listener corresponding to each data table.

[0014] Optionally, when configuring an associated data list corresponding to a data table, the method further includes:

[0015] Obtaining an associated model data list between pre-configured models, where the associated model data list includes a model association relationship between an attribute in a model and a child model associated with the attribute;

[0016] Obtaining a target data association relationship configured for the data table, obtaining a first model corresponding to a library node to which a data table where a target attribute in the target data association relationship belongs, and obtaining a second model corresponding to a library node to which the target data table in the target data association relationship belongs;

[0017] If there is an association relationship between the target attribute in the first model and the second model in the associated model data list, adding the target data association relationship to the associated data list corresponding to the data table, otherwise outputting a prompt message indicating that the target data association relationship does not conform to the rule.

[0018] Optionally, when configuring the associated model data list, the method further includes:

[0019] Based on the configured associated model data list, obtaining a model association relationship between any two models, where the direction of the model association relationship is from a parent model to an associated child model, and the parent model is a model to which an attribute associated with the child model belongs;

[0020] Generating a directed graph with models as nodes and model association relationships as edges according to the direction of the model association relationship;

[0021] Detect whether there is a closed loop in the directed graph. If so, generate corresponding error prompt information.

[0022] Optionally, the method further includes:

[0023] Receive a data access request, where the data access request includes a data table identifier of a data table to be accessed and a user identifier of a querier;

[0024] Obtain a data access permission table corresponding to the data table to be accessed based on the data table identifier of the data table to be accessed. If the user identifier of the querier is in the data access permission table corresponding to the data table to be accessed, then respond to the data access request;

[0025] If the user identifier of the querier is not in the data access permission table corresponding to the data table to be accessed, then in a tree - shaped hierarchical structure representing the association relationship between data tables, traverse the nodes on the same path as the target node and above the target node up to the root node; if it is detected that the user identifier of the querier is included in the data access permission table of any node during the traversal of the nodes, then respond to the data access request; if the user identifier of the querier is not included in the data access permission tables of all the traversed nodes, then reject the data access request; where each node in the tree - shaped hierarchical structure corresponds to a data table, and the target node corresponds to the data table to be accessed.

[0026] Optionally, if it is detected that the user identifier of the querier is included in the access rejection list of any node during the traversal of the nodes, then reject the data access request and end the traversal.

[0027] Optionally, if it is detected that the accessible security level of any node is higher than the access security level of the querier during the traversal of the nodes, then reject the data access request and end the traversal.

[0028] Optionally, if it is detected that the user identifier of the querier is included in the node access permission table of the library node where the data table corresponding to any node is located during the traversal of the nodes, then respond to the data access request.

[0029] Optionally, the method further includes:

[0030] Respond to the data access request, query the data table to be accessed, and return a corresponding attribute data list page based on the data in the data table to be accessed. The attribute data list page is used to display relevant information of each attribute in the data table to be accessed, and the relevant information of the attributes of the associated data tables includes a viewing link to the associated data tables.

[0031] In response to a trigger operation for a view link in the attribute list page, query the target data table corresponding to the view link, and return a corresponding attribute data list page based on the data in the target data table.

[0032] Optionally, the method further includes:

[0033] Receiving an associated search request, where the associated search request includes at least two attribute search conditions;

[0034] Determining the model to which the attributes involved in each attribute search condition belong as the target model;

[0035] Searching for data tables that meet the corresponding attribute search conditions in the library nodes of each target model and adding them to the candidate result sets corresponding to each target model;

[0036] Based on the association relationships between the data tables, filtering out combinations of search results with association relationships, where each combination of search results includes one data table from each candidate result set.

[0037] On the one hand, an embodiment of the present application provides a data processing device for a multi-level associated database, which is applied to a database including multiple library nodes. Each library node includes data tables of multiple objects that store data using the same model. The data tables in the same library node include attributes specified by the same model. The data tables of each object include the attribute values of the attributes of the object. The attributes of some objects in some data tables are associated with another data table. The device includes:

[0038] A broadcast module for broadcasting a change event of any data table in the database when it detects a change in the attributes of any data table in the database;

[0039] A listening module for each data table's listener to trigger the processing module corresponding to each data table based on the listened change event. Among them, the listening object of each listener includes the change events of the data tables associated with the attributes in the corresponding data table;

[0040] An update module for each triggered processing module to update the relevant data in the corresponding data table based on the listened change event and automatically trigger the broadcast of the change event for the corresponding data table.

[0041] On the one hand, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of any of the above methods are implemented.

[0042] On the one hand, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of any of the above methods are implemented.

[0043] On the one hand, an embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various alternative implementations of controlling any of the above TCP transmission performances.

[0044] The data processing method, device, electronic device and storage medium of the multi-level associated database provided by the embodiments of the present application, based on the pre-configured data association relationship, combined with the event publishing and listening functions, realizes an automatically triggered chain update method that recursively goes layer by layer from the underlying data table to the upper-layer data table. As long as there is a change in one place of the data, the automatic update of all associated data can be triggered, improving the data update efficiency and at the same time reducing the probability of errors and missed updates. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0046] Figure 1 It is a schematic diagram of the application scenario of the data processing method of the multi-level associated database provided by the embodiment of the present application;

[0047] Figure 2 It is a schematic flowchart of the data processing method of the multi-level associated database provided by the embodiment of the present application;

[0048] Figure 3 It is a schematic flowchart of verifying user permissions provided by the embodiment of the present application;

[0049] Figure 4 It is a schematic structural diagram of the data processing device of the multi-level associated database provided by the embodiment of the present application;

[0050] Figure 5 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] The embodiments of the present invention will be described in detail below with reference to the drawings.

[0052] It should be noted that, without conflict, the following embodiments and the features in the embodiments may be combined with each other; and, based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present disclosure.

[0053] It should be noted that the following describes various aspects of embodiments within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is illustrative only. Based on the present disclosure, those skilled in the art should understand that one aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of the aspects described herein may be used to implement an apparatus and / or practice a method. Additionally, this apparatus and / or method may be implemented using other structures and / or functionality in addition to one or more of the aspects described herein.

[0054] For ease of understanding, the following explains the terms involved in the embodiments of the present application:

[0055] Model: It is a list template for storing data configured for the same type of objects, and multiple attributes related to this type of objects are defined in the model. For example, an engine model is configured for the engine in a vehicle, and the attributes involved in the engine model may include the components used in the engine (such as intake ducts, tail nozzles, combustion chambers, etc.) and the characteristic parameters of the engine (fuel supply conditions, fuel, flight attitude, etc.) and other information.

[0056] Attribute: It can be parameter information related to an object, for example, it may include the components included in the object and the characteristic parameters of the object, etc.

[0057] Library node: It refers to a database that stores data tables instantiated based on the same model.

[0058] The Application of Spring has the ability to publish events and register event listeners, and has a complete event publishing and listening mechanism. In Java, events are described by java.util.EventObject, and event listeners are described by java.util.EventListener. In many frameworks and components, establishing an event mechanism is usually extended based on these two interfaces.

[0059] Event source: The producer of the event object, and any EventObject has a source.

[0060] Event Listener Registry: When an event framework or component receives an event, it needs to notify all relevant event listeners for processing. At this time, a place to store the listeners is required, which is the event listener registry.

[0061] Event Broadcaster: The event broadcaster plays an intermediary role in the entire event mechanism. When an event publisher publishes an event, it needs to notify all relevant listeners to process the event through the broadcaster.

[0062] The number of any elements in the attached drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any restrictive meaning.

[0063] Reference Figure 1 , which is a schematic diagram of the application scenario of the data processing method for the multi-level associated database provided by the embodiments of the present application. This application scenario includes a terminal device 101 and a server 102. A client corresponding to the material management system is installed in the terminal device 101, and the user can create projects and manage the BOM involved in the projects through this client. The server 102 is used to run the background data processing of the entire material management system. The terminal device 101 and the server 102 are connected through a wireless or wired network. The terminal device 101 includes, but is not limited to, electronic devices such as desktop computers, mobile phones, mobile computers, and tablets. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0064] Of course, the method provided by the embodiments of the present application is not limited to Figure 1 the application scenario shown in Figure 1 and can also be used in other possible application scenarios, which are not limited by the embodiments of the present application. The functions that can be realized by each device in the application scenario shown in

[0065] will be described together in the subsequent method embodiments, and will not be elaborated here too much.

[0066] Next, in combination with Figure 1The application scenarios shown are used to illustrate the technical solutions provided in the embodiments of the present application.

[0067] Users can create a new model through the client and configure information such as the name of the model and the attributes involved in the model. Each model has a unique model identifier, which is convenient for users to call the required model when creating a project. In addition, users can also configure the association relationships between models. To distinguish them from other association relationships, in this application, the association relationships at the model level are called model association relationships, which mainly refer to the association relationship between an attribute of one model and another model. A model association relationship can be expressed as A.a→B, where A represents the attribute of model A, B represents the model associated with attribute a, and → represents the direction of the association line. For the convenience of description, the model to which the attribute in the model association relationship belongs can be called the parent model, and the model associated with the attribute in the model association relationship can be called the child model, that is, model A is the parent model of model B, and model B is the child model of model A. The server can store and manage the configured model association relationships through the associated model data list. The associated model data list includes the attributes in the model and the model association relationships of the child models associated with the attributes.

[0068] The server can preset the basic configuration rules for model association relationships, for example:

[0069] (1) One attribute of a model can only be associated with one model. For example, attribute a of model A is associated with model B, and attribute b of model B is associated with model C;

[0070] (2) Multiple attributes of a model can be associated with one model at the same time. For example, attributes a, b, and c of A can be associated with model B at the same time;

[0071] (3) A model can have multiple attributes associated with other models. For example, attribute b of A is associated with model B, and attribute c of A is associated with model C;

[0072] (4) In the configuration of multi-layer association relationships, the situation of closed-loop association or model self-association cannot occur. For example, model A is associated with model B, and model B is associated with model C. At this time, model C cannot be configured to be associated with model A.

[0073] The model association relationships configured by users need to meet the above basic configuration rules. The server can automatically verify and detect the model association relationships configured by users based on the above basic configuration rules. When the model association relationships configured by users do not meet the above basic configuration rules, corresponding error prompt messages can be generated and displayed to users through the client to prompt users to modify the incorrect model association relationships.

[0074] To this end, when a user configures an associated model data list, a data processing method for a multi-level associated database provided by an embodiment of the present application may include the following steps: obtaining a model association relationship between any two models based on the configured associated model data list; generating a directed graph with models as nodes and model association relationships as edges according to the direction of the model association relationship; detecting whether there is a closed loop in the directed graph, and if so, generating a corresponding error prompt message. The direction of the model association relationship is from the parent model to the associated child model, and the parent model is the model to which the attribute associated with the child model belongs. Nodes in the above-mentioned directed graph represent models, and the edge between two nodes represents an association relationship between two models. The node at the starting end of an edge is the parent model, and the node at the ending end of an edge is the child model. Starting from a node in the directed graph and moving forward along the direction of the edge in the directed graph, if it is possible to return to the node, it proves that there is a closed loop.

[0075] In addition, the server can also detect whether an attribute of a model is associated with multiple models at the same time. If the above situation exists, a corresponding error prompt message is generated.

[0076] The user can create a project through the client of the terminal device, select appropriate models to create data according to the project requirements. The data of each object is stored in the form of a data table. Each data table has a unique data table identifier for distinction. The data table of each object includes the attributes specified by the model and the attribute values of each attribute of the object. For example, when creating a vehicle project, the user can select a vehicle model, and the client displays a corresponding template according to the vehicle model. The user fills in the attribute values of relevant attributes in the template, such as the engine model used, tire model, etc., and stores the vehicle data in the form of a data table to complete the preliminary establishment of the vehicle project. Then, the data of each part can be further refined. For example, if the engine and tires are designed by different departments, the engine model can be selected to create a data table for the engine to store relevant information of the engine, and the tire model can be selected to create a data table for the tires to store relevant information of the tires. If the engine and tires can also be divided into multiple components, data tables for each component can be created based on the models corresponding to each component.

[0077] When a user creates a data table for each object, the user can configure an associated data table for the attributes in the object data table. For example, an association relationship can be established between the engine attribute in the vehicle data table and the engine data table, so that the user can view the engine data table through the vehicle data table. In this application, the association relationship at the data level is called a data association relationship, which refers to the association relationship between a certain attribute in a data table and another data table. A data association relationship can be expressed as X.x→Y, where x represents an attribute in the data table X, Y represents the data table associated with the attribute x, and → represents the direction of the data association line. For ease of description, the data table to which the attribute in the data association relationship belongs can be called the parent data table, and the data table associated with the attribute in the data association relationship can be called the child data table. That is, the data table X is the parent data table of the data table Y, and the data table Y is the child data table of the data table X. The server can store and manage the configured data association relationships through an associated data list, and the associated data list includes the data association relationships between the attributes in the data table and the data tables associated with these attributes.

[0078] For ease of management, the data tables of multiple objects that use the same model for data storage can be stored in the same library node. A library node refers to a database used to store the data tables of multiple objects. Each node library has a unique library node identifier, and each library node corresponds to a unique model. Of course, multiple library nodes can also be created for a model to perform more refined classified storage management on the data tables instantiated based on this model.

[0079] In specific implementation, the data association relationship configured for the data table cannot violate the model association relationship. For this reason, the data association relationship can be verified through the model association relationship. Specifically, when the user configures the associated data list corresponding to the data table, the server can obtain the pre-configured associated model data list between the models; obtain the target data association relationship to be verified, obtain the first model corresponding to the library node to which the data table where the target attribute in the target data association relationship belongs, and obtain the second model corresponding to the library node to which the target data table in the target data association relationship belongs; if there is an association relationship between the target attribute in the first model and the second model in the associated model data list, the target data association relationship is added to the associated data list corresponding to the data table, otherwise a prompt message indicating that the target data association relationship does not conform to the rules is output to prompt the user to modify the target data association relationship.

[0080] For example, the data association relationship to be verified is X.x→Y, where the model corresponding to the library node to which the data table X belongs is A, and the model corresponding to the library node to which the data table Y belongs is B. If the

[0081] associated model data list contains the association relationship: A.x→B, it means that X.x→Y passes the verification, otherwise it means that X.x→Y fails

[0082] Verify and output a prompt message indicating that X.x → Y does not conform to the rules.

[0083] The data processing method for a multi-level associated database provided by an embodiment of the present application can be applied to a database constructed by the foregoing method. The database includes databases with multiple cascaded library nodes. Each library node includes a data table of multiple objects that store data using the same model. The data tables in the same library node include attributes specified by the same model. The data table of each object includes the attribute values of the attributes of the object. The attributes of some objects in some data tables are associated with another data table.

[0084] Reference Figure 2 , the data processing method for a multi-level associated database provided by an embodiment of the present application can be applied to Figure 1 the server shown in the figure, and specifically includes the following steps:

[0085] S201. When it is detected that an attribute in any data table in the database changes, broadcast the change event of any data table.

[0086] In specific implementation, the broadcast and listening of events can be implemented in a manner similar to the Spring architecture. A listener can be set for each data table in the database in advance to listen for events related to itself. The server will detect in real time whether the information of the data table changes. When it is detected that an attribute in a certain data table changes, the change event of the data table can be published, and all relevant listeners will be notified through a broadcaster to process the event.

[0087] S202. The listener corresponding to each data table triggers the processing module corresponding to each data table based on the listened change event. Among them, the listening object of each listener includes the change event of the data table associated with the attribute in the corresponding data table.

[0088] In specific implementation, the user can manually configure the listening object of each listener. To improve the configuration efficiency, the server can automatically configure the listening object of the listener based on the associated data list. Specifically, for each data table, obtain the associated data list corresponding to the data table, extract the child data tables associated with the data table from the associated data list, and add the change events of these child data tables to the listening object of the listener corresponding to the data table.

[0089] Each listener only listens to the change events of the listening objects it is concerned about, and only when the change events of the listening objects are listened to will the corresponding processing model be triggered to process the change events.

[0090] In specific implementation, a processing module can be configured for each data table to execute a series of operations on the data table. Each processing model is independent of each other and does not interfere with each other, so that data change operations on each data table can be executed in parallel, improving the processing efficiency.

[0091] S203. Each triggered processing module updates the relevant data in the corresponding data table based on the monitored change event, and automatically triggers the broadcast of the change event for the corresponding data table.

[0092] In specific implementation, the change event can be the addition, deletion, or modification of an attribute, where the modification of an attribute includes modifying information such as the attribute name and attribute value of the attribute. The change event can include the change information of the changed attribute, such as the modified attribute and the modified attribute value, etc. Therefore, after the processing module is triggered, it will obtain the change information of the changed attribute from the monitored change event, and then find the attributes related to the changed attribute from the data table corresponding to the processing module, and update the attribute values of the relevant attributes based on the preset relationship between the changed attribute and the relevant attributes, as well as the change information.

[0093] The preset relationship between each attribute can be pre-configured according to the actual application scenario. For example, components affect each other. For instance, after the screws used in a part change, it may cause a change in the quality of the part. At this time, it is necessary to update the weight of the part using the screw according to the quality of the changed screw.

[0094] After the user changes the data in a certain data table, the server will automatically generate a change event for the data table and broadcast the change event through the event broadcaster; after the listeners of each data table monitor the change event related to themselves, they will automatically trigger the corresponding processing module to update the data in the data table accordingly. After the update is completed, the processing module will generate and broadcast its own change event, thereby continuing to trigger the update of the data table related to the change event until the data update of all relevant data tables in the database is completed. Based on the pre-configured data association relationship, combined with the event publishing and listening functions, an automatically triggered chain update method that recursively goes from the underlying data tables to the upper-layer data tables is realized. As long as there is a change in one place of the data, it can trigger the automatic update of all associated data, improving the data update efficiency and at the same time reducing the probability of errors and missed updates. The data processing method of the multi-level associated database in the embodiments of the present application can well handle large projects with many components and complex association relationships, and assist users in improving project management efficiency.

[0095] On the basis of any of the above implementation manners, in order to ensure data security, access permissions can be set for the data tables. Specifically, a data access permission table is configured for each data table, and the user identifiers of the users who have the right to access the data table are recorded in the data access permission table.

[0096] In specific implementation, when a user needs to view a certain data table, a data access request can be sent to the server through the client. The data access request includes the data table identifier of the data table to be accessed and the user identifier of the querier. After receiving the data access request sent by the client, the server obtains the data access permission table corresponding to the data table to be accessed based on the data table identifier of the data table to be accessed. If the user identifier of the querier is in the data access permission table corresponding to the data table to be accessed, the data access request is responded to; if the user identifier of the querier is not in the data access permission table corresponding to the data table to be accessed, in the tree - level structure representing the association relationship between data tables, the nodes on the same path as the target node and above the target node up to the root node are traversed; if it is detected that the user identifier of the querier is included in the data access permission table of any node during the process of traversing the nodes, the data access request is responded to; if the user identifier of the querier is not included in the data access permission tables of all the traversed nodes, the data access request is rejected. Among them, each node in the tree - level structure corresponds to a data table, the target node corresponds to the data table to be accessed, and the process of traversing the nodes is to start from the parent node of the target node and detect one by one from bottom to top whether the user identifier of the querier is included in the data access permission table corresponding to the nodes on the same path as the target node.

[0097] Reference Figure 3 , after receiving the data access request sent by the client, the server performs the following steps:

[0098] S301. Extract the data table identifier of the data table to be accessed and the user identifier of the querier from the data access request.

[0099] S302. Obtain the data access permission table corresponding to the data table to be accessed based on the data table identifier of the data table to be accessed.

[0100] S303. Determine whether the user identifier of the querier is included in the data access permission table corresponding to the data table to be accessed. If so, execute step S304; otherwise, execute step S305.

[0101] S304. Respond to the data access request and return the data table to be accessed to the client.

[0102] S305. Determine whether there is a previous - level node associated with the current node in the tree - level structure of the data tables. If so, execute step S306; otherwise, execute step S308.

[0103] Among them, the initial value of the current node is the node corresponding to the data table to be accessed in the tree - level structure. The previous - level node associated with the current node is: the node corresponding to the data table to which the attribute associated with the data table corresponding to the current node belongs.

[0104] S306. Obtain the upper-level node associated with the current node.

[0105] S307. Determine whether the user identifier of the querier is included in the data access permission table corresponding to the upper-level node. If so, execute step S304; otherwise, use the upper-level node as the current node and return to execute step S305.

[0106] S308. Reject the data access request.

[0107] Furthermore, a deny access list can be configured for each data table, and the user identifiers of the users prohibited from accessing the data table are recorded in the deny access list. During the process of traversing the nodes, if it is detected that the user identifier of the querier is included in the deny access list of any node, the data access request is rejected and the traversal ends.

[0108] Furthermore, a node access permission table can be configured for each library node, and the user identifiers of the users who have the right to access the library node are recorded in the node access permission table, so that users can access all the data tables under the library node. During the process of traversing the nodes, if it is detected that the user identifier of the querier is included in the node access permission table of the library node where the data table corresponding to any node is located, the data access request is responded to.

[0109] The client can also display the library nodes in the form of a tree structure in the library node navigation area, which is convenient for users to find relevant data tables through the library node navigation area. The library node navigation area can hide the library nodes that the user does not have permission to view.

[0110] Furthermore, in projects with high confidentiality requirements, a corresponding confidentiality level can be configured for each user, and a corresponding accessible confidentiality level can be configured for each data table. During the process of traversing the nodes, it is also necessary to simultaneously detect whether the user's confidentiality level is not lower than the accessible confidentiality level corresponding to the data table. If it is detected that the accessible confidentiality level of the data table corresponding to the node is higher than the access confidentiality level of the querier, the data access request is rejected and the traversal ends; if the accessible confidentiality level of the data table corresponding to the node is not higher than the access confidentiality level of the querier, it is possible to verify whether the querier meets other permission requirements of the node.

[0111] Based on any of the above embodiments, the data processing method of the multi-level associated database provided by the embodiments of the present application further includes the following steps: responding to a data access request, querying a data table to be accessed, and returning a corresponding attribute data list page based on the data in the data table to be accessed. The attribute data list page is used to display relevant information of each attribute in the data table to be accessed, and the relevant information of the attributes of the associated data table includes a viewing link to the associated data table; responding to a trigger operation on the viewing link in the attribute list page, querying the target data table corresponding to the viewing link, and returning a corresponding attribute data list page based on the data in the target data table.

[0112] The attribute data list page can display the attributes and corresponding attribute values in the display data table in the format of "attribute name: attribute value", and can also display other relevant information. To facilitate users to directly view the next-level associated data through the attribute data list page, a viewing link for viewing the associated data table can be displayed in the attribute data list page. Users can open the associated data table by clicking the viewing link. Specifically, the attribute value of the attribute of the associated data table can be set in the format of a hyperlink, and the associated data table can be opened by clicking the attribute value in the format of a hyperlink. For example, attribute a in data table A is associated with data table B, and attribute b in data table B is associated with data table C. Open the attribute data list page P of data table A A , the link to view data table B on page P can be clicked A to open the attribute data list page P of data table B B , and there is a link to view data table C on page P B . Clicking this link can view the specific content of data table C, thus realizing the viewing of multi-level associated data.

[0113] Based on any of the above embodiments, the data processing method of the multi-level associated database provided by the embodiments of the present application further includes the following steps: receiving an associated search request, where the associated search request includes at least two attribute search conditions; determining the model to which the attribute involved in each attribute search condition belongs as the target model; searching for data tables that meet the corresponding attribute search conditions in the library nodes of each target model and adding them to the candidate result set corresponding to each target model; filtering out combinations of search results with an associated relationship based on the associated relationship between the data tables, and each combination of search results includes one data table from each candidate result set.

[0114] When a user wants to search for data that meets multiple attribute conditions, the user can input attribute search conditions through the client and send an associated search request carrying the attribute search conditions to the server. Each attribute search condition includes the attribute for searching and the corresponding attribute value. For example, if you want to retrieve SUV vehicles using tires of brand XX, the input attribute search conditions include: "tire brand = XX", "vehicle type = SUV".

[0115] After receiving an associated search request, the server extracts multiple attribute search conditions from it, and determines the models to which the attributes involved in each attribute search condition belong as target models. Among them, multiple attribute search conditions can correspond to the same model. For example, if the attributes involved in attribute search condition one and attribute search condition two both belong to model A, and the attribute involved in attribute search condition three belongs to model B, then the target models include model A and model B. Then, it searches for data tables that meet the corresponding attribute search conditions in the library nodes of each determined target model, and adds the searched data tables to the candidate result sets corresponding to each target model. For example, it searches for data tables that meet attribute search condition one and attribute search condition two in the library node corresponding to model A, and obtains the candidate result set U corresponding to model A A , and searches for data tables that meet attribute search condition three in the library node corresponding to model B, and obtains the candidate result set U corresponding to model B B . Then, it randomly selects a data table T1 from the candidate result set U A , and then selects a data table T2 associated with the data table T1 from the candidate result set U B . It takes the data table T1 and the data table T2 as a search result combination, filters out all search result combinations with an associated relationship based on the above method, and feeds back all the search result combinations to the client. First, it retrieves data that meets some attribute search conditions in the library nodes of each model, and then filters out data that meets all attribute search conditions simultaneously based on the associated relationship between the data tables, realizing an associated search in the library nodes of multiple models and improving the search efficiency.

[0116] As Figure 4 shown, based on the same inventive concept as the data processing method of the above multi-level associated database, the embodiment of the present application also provides a data processing device 40 for a multi-level associated database, which is applied to a database including a cascade of multiple library nodes. Each library node includes data tables of multiple objects that store data using the same model. The data tables in the same library node include the attributes specified by the same model. The data table of each object includes the attribute values of the various attributes of the object. The attributes of some objects in some data tables are associated with another data table. The device 40 includes:

[0117] A broadcast module 401, configured to broadcast a change event of any data table when it detects that an attribute in any data table in the database has changed;

[0118] A listening module 402, configured to trigger a processing module corresponding to each data table based on a change event listened to by a listener corresponding to each data table, where the listening object of each listener includes a change event of a data table associated with the attribute in the corresponding data table;

[0119] An update module 402 is configured to update relevant data in a corresponding data table for each triggered processing module based on a monitored change event, and automatically trigger a broadcast of the change event for the corresponding data table.

[0120] Optionally, the change event includes change information of a changed attribute. Triggering each processing module corresponding to a data table based on the monitored change event includes:

[0121] Obtaining the change information of the changed attribute from the monitored change event;

[0122] Searching for an attribute related to the changed attribute from the data table corresponding to the listener;

[0123] Updating the attribute value of the related attribute based on a preset relationship between the changed attribute and the related attribute, and the change information.

[0124] Optionally, the apparatus 40 further includes a monitoring object configuration module, configured to: for each data table, obtain an associated data list corresponding to the each data table, where the associated data list includes a data association relationship between an attribute in the each data table and a data table associated with the attribute, and add a change event of the data table in the associated data list to a monitoring object of a listener corresponding to the each data table.

[0125] Optionally, the apparatus 40 further includes an associated data verification module, configured to, when configuring an associated data list corresponding to a data table, obtain an associated model data list between preconfigured models, where the associated model data list includes a model association relationship between an attribute in a model and a sub-model associated with the attribute; obtain a target data association relationship configured for the data table, obtain a first model corresponding to a library node to which a data table where a target attribute in the target data association relationship belongs, and obtain a second model corresponding to a library node to which the target data table in the target data association relationship belongs; if there is an association relationship between the target attribute in the first model and the second model in the associated model data list, add the target data association relationship to the associated data list corresponding to the data table, otherwise output a prompt message indicating that the target data association relationship does not conform to the rule.

[0126] Optionally, when configuring the associated model data list, the device 40 further includes an associated model verification module, which is used to: when configuring the associated model data list, obtain the model association relationship between any two models based on the configured associated model data list, where the direction of the model association relationship is from the parent model to the associated child model, and the parent model is the model to which the attribute associated with the child model belongs; generate a directed graph with models as nodes and model association relationships as edges according to the direction of the model association relationship; detect whether there is a closed loop in the directed graph, and if so, generate a corresponding error prompt message.

[0127] Optionally, the device 40 further includes an access permission verification module, which is used to: receive a data access request, where the data access request includes the data table identifier of the data table to be accessed and the user identifier of the querier; obtain the data access permission table corresponding to the data table to be accessed based on the data table identifier of the data table to be accessed, and if the user identifier of the querier is in the data access permission table corresponding to the data table to be accessed, respond to the data access request; if the user identifier of the querier is not in the data access permission table corresponding to the data table to be accessed, traverse the nodes on the same path as the target node and above the target node to the root node in the tree - shaped hierarchical structure representing the association relationship between data tables; if it is detected that the user identifier of the querier is included in the data access permission table of any node during the traversal of the nodes, respond to the data access request; if the user identifier of the querier is not included in the data access permission tables of all the traversed nodes, reject the data access request; where each node in the tree - shaped hierarchical structure corresponds to a data table, and the target node corresponds to the data table to be accessed.

[0128] Optionally, the access permission verification module is further used to: if it is detected that the user identifier of the querier is included in the access rejection list of any node during the traversal of the nodes, reject the data access request and end the traversal.

[0129] Optionally, the access permission verification module is further used to: if it is detected that the accessible security level of any node is higher than the access security level of the querier during the traversal of the nodes, reject the data access request and end the traversal.

[0130] Optionally, the access permission verification module is further used to: if it is detected that the user identifier of the querier is included in the node access permission table of the library node where the data table corresponding to any node is located during the traversal of the nodes, respond to the data access request.

[0131] Optionally, the device 40 further includes a data query module, configured to: in response to a data access request, query the data table to be accessed, and return a corresponding attribute data list page based on the data in the data table to be accessed, where the attribute data list page is used to display the relevant information of each attribute in the data table to be accessed, and the relevant information of the attributes of the associated data table includes a viewing link to the associated data table; in response to a trigger operation on the viewing link in the attribute list page, query the target data table corresponding to the viewing link, and return a corresponding attribute data list page based on the data in the target data table.

[0132] Optionally, the device 40 further includes a search module, configured to: receive an associated search request, where the associated search request includes at least two attribute search conditions; determine the model to which the attribute involved in each attribute search condition belongs as the target model; search for data tables that meet the corresponding attribute search conditions in the library nodes of each target model, and add them to the candidate result set corresponding to each target model; based on the association relationship between the data tables, filter out the combinations of search results with an association relationship, and each combination of search results includes one data table from each candidate result set.

[0133] The data processing device for a multi-level associated database provided in the embodiments of the present application and the above-mentioned data processing method for a multi-level associated database adopt the same inventive concept and can achieve the same beneficial effects, which will not be elaborated here.

[0134] Based on the same inventive concept as the above-mentioned data processing method for a multi-level associated database, the embodiments of the present application further provide an electronic device, which may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), a server, etc. As Figure 5 shown, the electronic device 50 may include a processor 501 and a memory 502.

[0135] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0136] The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory may include at least one type of storage medium, for example, it may include flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disc, and so on. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.

[0137] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments; the above computer storage medium can be any available medium or data storage device accessible by a computer, including but not limited to: removable storage devices, random access memory (RAM), magnetic memories (such as floppy disks, hard disks, magnetic tapes, magneto-optical discs (MO), etc.), optical memories (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor memories (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drives (SSD)), etc., various media that can store program codes.

[0138] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. And the foregoing storage medium includes: removable storage devices, random access memory (RAM), magnetic memories (such as floppy disks, hard disks, magnetic tapes, magneto-optical discs (MO), etc.), optical memories (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor memories (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drives (SSD)), etc., various media that can store program codes.

[0139] As described above, the above are only the specific implementation manners of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A data processing method for a multi-level associated database, characterized in that, it is applied to a database including multiple library nodes, each library node includes a data table of multiple objects that store data using the same model, the data tables in the same library node include the attributes specified by the same model, the data table of each object includes the attribute values of the attributes of the object, and the attributes of some objects in some data tables are associated with another data table. The method includes: When it is detected that an attribute in any data table in the database changes, broadcasting a change event of the any data table; The listener corresponding to each data table triggers the processing module corresponding to each data table based on the listened change event. Among them, the listened object of each listener includes the change event of the data table associated with the attribute in the corresponding data table; Each triggered processing module updates the relevant data in the corresponding data table based on the listened change event, and automatically triggers the broadcast of the change event for the corresponding data table; The change event includes the change information of the changed attribute. The triggering of the processing module corresponding to each data table based on the listened change event includes: obtaining the change information of the changed attribute from the listened change event; finding out the attribute related to the changed attribute from the data table corresponding to the listener; updating the attribute value of the relevant attribute based on the preset relationship between the changed attribute and the relevant attribute and the change information; The method further includes: for each data table, obtaining the associated data list corresponding to the each data table, the associated data list includes the data association relationship between the attributes in the each data table and the data tables associated with the attributes, and adding the change events of the data tables in the associated data list to the listened objects of the listeners corresponding to the each data table.

2. The method according to claim 1, characterized in that, when configuring the associated data list corresponding to the data table, the method further includes: obtaining the pre-configured associated model data list between models, the associated model data list includes the model association relationship between the attributes in the model and the sub-models associated with the attributes; obtaining the target data association relationship configured for the data table, obtaining the first model corresponding to the library node where the data table where the target attribute in the target data association relationship is located, and obtaining the second model corresponding to the library node where the target data table in the target data association relationship is located; If there is an association relationship between the target attribute in the first model and the second model in the associated model data list, adding the target data association relationship to the associated data list corresponding to the data table, otherwise outputting a prompt message indicating that the target data association relationship does not conform to the rules.

3. The method according to claim 1 or 2, characterized in that, the method further includes: receiving a data access request, the data access request includes the data table identifier of the data table to be accessed and the user identifier of the querier; Obtain the data access privilege table corresponding to the to-be-accessed data table based on the data table identifier of the to-be-accessed data table. If the user identifier of the querier is in the data access privilege table corresponding to the to-be-accessed data table, then respond to the data access request; If the user identifier of the querier is not in the data access privilege table corresponding to the to-be-accessed data table, then in the tree-level hierarchy structure representing the association relationship between data tables, traverse the nodes that are on the same path as the target node and are above the target node up to the root node; if it is detected that the user identifier of the querier is included in the data access privilege table of any node during the traversal of the nodes, then respond to the data access request; if the user identifier of the querier is not included in the data access privilege tables of all the traversed nodes, then reject the data access request; wherein, each node in the tree-level hierarchy structure corresponds to a data table, and the target node corresponds to the to-be-accessed data table.

4. The method according to claim 1 or 2, characterized in that, the method further includes: Respond to the data access request, query the to-be-accessed data table, and return a corresponding attribute data list page based on the data in the to-be-accessed data table. The attribute data list page is used to display the relevant information of each attribute in the to-be-accessed data table, and the relevant information of the attributes of the associated data tables includes the viewing links of the associated data tables; Respond to the trigger operation on the viewing link in the attribute list page, query the target data table corresponding to the viewing link, and return a corresponding attribute data list page based on the data in the target data table.

5. The method according to claim 1 or 2, characterized in that, the method further includes: Receive an associated search request, where the associated search request includes at least two attribute search conditions; Determine the model to which the attribute involved in each attribute search condition belongs as the target model; Search for the data tables that meet the corresponding attribute search conditions in the library nodes of each target model and add them to the candidate result sets corresponding to each target model; Based on the association relationship between data tables, filter out the combinations of search results with an association relationship. Each combination of search results includes one data table from each candidate result set.

6. A data processing device for a multi-level associated database, characterized in that, It is applied to a database including multiple library nodes. Each library node includes data tables of multiple objects that store data using the same model. The data tables in the same library node include the attributes specified by the same model. The data table of each object includes the attribute values of each attribute of the object. The attributes of some objects in some data tables are associated with another data table. The device includes: A broadcast module, configured to broadcast a change event of any data table when it is detected that an attribute in any data table in the database changes; A listening module, configured to trigger the processing module corresponding to each data table based on the change event listened to by the listener corresponding to each data table. Wherein, the listening object of each listener includes the change event of the data table associated with the attribute in the corresponding data table; An update module, configured to update relevant data in a corresponding data table for each triggered processing module based on the monitored change event, and automatically trigger a broadcast of the change event for the corresponding data table; The change event includes change information of a changed attribute. Triggering each processing module corresponding to a data table based on the monitored change event includes: obtaining the change information of the changed attribute from the monitored change event; finding out the attribute related to the changed attribute from the data table corresponding to the listener; updating the attribute value of the related attribute based on a preset relationship between the changed attribute and the related attribute, and the change information; The device further includes a monitoring object configuration module, configured to: for each data table, obtain an associated data list corresponding to each data table, where the associated data list includes a data association relationship between an attribute in each data table and a data table associated with the attribute, and add the change event of the data table in the associated data list to a monitoring object of a listener corresponding to each data table.

7. An electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, on which computer program instructions are stored, wherein, when the computer program instructions are executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data management method and device, equipment and medium

    CN111008192A

  • Data generation method for mine holographic one-map spatial database

    CN111966741A