CN114297201A - Data processing method and device of multistage association database and electronic equipment - Google Patents

Data processing method and device of multistage association database and electronic equipment Download PDF

Info

Publication number
CN114297201A
CN114297201A CN202111669364.5A CN202111669364A CN114297201A CN 114297201 A CN114297201 A CN 114297201A CN 202111669364 A CN202111669364 A CN 202111669364A CN 114297201 A CN114297201 A CN 114297201A
Authority
CN
China
Prior art keywords
data
data table
attribute
model
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111669364.5A
Other languages
Chinese (zh)
Inventor
徐炳耀
薛乾生
李义章
杨达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rope Is Systems Technology LLC
Original Assignee
Beijing Rope Is Systems Technology LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rope Is Systems Technology LLC filed Critical Beijing Rope Is Systems Technology LLC
Priority to CN202111669364.5A priority Critical patent/CN114297201A/en
Publication of CN114297201A publication Critical patent/CN114297201A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data processing method, a device and electronic equipment of a multilevel association database, which are applied to a database comprising a plurality of library nodes, wherein each library node comprises a data table of a plurality of objects which use the same model for data storage, the data table of each object comprises attribute values of all attributes of the object, and the attributes of part of the objects in part of the data tables are associated with another data table, and the method comprises the following steps: when detecting that the attribute in any data table in the database is changed, broadcasting a change event of any data table; triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table; each triggered processing module updates relevant data in the corresponding data table based on the monitored change event and automatically triggers a broadcast of the change event for the corresponding data table.

Description

Data processing method and device of multistage association database and electronic equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data processing method and apparatus for a multi-level relational database, and an electronic device.
Background
In order to manage a project conveniently and efficiently, information of each part involved in the project design and production process is generally maintained by a material management system. For large projects (such as rockets, vehicles, etc.), the number of parts involved is large, and in order to improve the management efficiency, the projects are generally divided into a plurality of hierarchical modules step by step according to functions, and the management is performed hierarchically, for example, a vehicle may be divided into a plurality of modules such as an engine, a tire, a chassis, etc., and the engine may be further divided into a plurality of sub-modules, each module having its own corresponding BOM (Bill of material) to record the relevant information of the respective involved parts. The large project involves many parts and all parts influence each other, even there is a situation that the same part is reused by a plurality of modules, if the information of a certain part changes, the information in the possibly influenced modules needs to be modified synchronously, and the modification needs to consume a lot of manpower and energy and is easy to make mistakes.
Disclosure of Invention
The embodiment of the application provides a data processing method and device for a multilevel association database, electronic equipment and a storage medium, which can well deal with large projects with many parts and complex association relations and assist users in improving project management efficiency.
In one aspect, an embodiment of the present application provides a data processing method for a multi-level relational database, which is applied to a database including a plurality of library nodes, where each library node includes data tables of a plurality of objects that use a same model for data storage, the data tables in the same library node include attributes specified by the same model, the data table of each object includes attribute values of the attributes of the object, and the attributes of some objects in some data tables are related to another data table, and the method includes:
when detecting that the attribute in any data table in the database is changed, broadcasting a change event of the any data table;
triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table;
each triggered processing module updates relevant data in the corresponding data table based on the monitored change event and automatically triggers a broadcast of the change event for the corresponding data table.
Optionally, the change event includes change information of the change attribute, and the triggering of the processing module corresponding to each data table based on the monitored change event includes:
acquiring change information of the change attribute from the monitored change event;
searching the attribute related to the change attribute from a data table corresponding to the listener;
updating the attribute value of the related attribute based on the preset relationship between the changed attribute and the related attribute and the change information.
Optionally, the method further comprises:
and aiming at each data table, acquiring an associated data list corresponding to each data table, wherein the associated data list comprises the attribute in each data table and the data association relation between the data tables associated with the attribute, and adding the change event of the data table in the associated data list into the monitored object of the monitor corresponding to each data table.
Optionally, when configuring the associated data list corresponding to the data table, the method further includes:
acquiring an association model data list among pre-configured models, wherein the association model data list comprises attributes in the models and model association relations of sub-models associated with the attributes;
acquiring a target data association relation configured for a data table, acquiring a first model corresponding to a library node to which a data table to which a target attribute belongs in the target data association relation, and acquiring a second model corresponding to the library node to which the target data table belongs in the target data association relation;
and if the incidence relation between the target attribute in the first model and the second model exists in the incidence model data list, adding the target data incidence relation into the incidence data list corresponding to the data table, otherwise, outputting prompt information that the target data incidence relation does not accord with the rule.
Optionally, when configuring the association model data list, the method further includes:
obtaining a model incidence relation between any two models based on the configured incidence model data list, wherein the direction of the model incidence relation is that a parent model points to an associated child model, and the parent model is a model to which attributes associated with the child model belong;
generating a directed graph with the model as a node and the model association as an edge according to the direction of the model association;
and detecting whether the directed graph has a closed loop or not, and if so, generating corresponding error-reporting prompt information.
Optionally, the method further comprises:
receiving a data access request, wherein the data access request comprises a data table identifier of a data table to be accessed and a user identifier of an inquirer;
acquiring a data access authority table corresponding to the data table to be accessed based on the data table identification of the data table to be accessed, and responding to the data access request if the user identification of the inquirer is in the data access authority table corresponding to the data table to be accessed;
if the user identification of the inquirer is not in the data access authority table corresponding to the data table to be accessed, traversing nodes which are on the same path with the target node and are positioned above the target node to the root node in a tree-shaped hierarchical structure representing the incidence relation among the data tables; if the data access authority table of any node is detected to contain the user identification of the inquirer in the process of traversing the nodes, responding to the data access request; if the data access authority tables of all traversed nodes do not contain the user identification of the inquirer, rejecting the data access request; 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.
Optionally, if it is detected in the process of traversing the nodes that the access rejection list of any node includes the user identifier of the querier, the data access request is rejected, and the traversal is ended.
Optionally, if it is detected in the process of traversing the nodes that the access security level of any node is higher than that of the inquirer, the data access request is rejected, and the traversal is ended.
Optionally, if it is detected in the process of traversing the nodes that the node access authority table of the library node where the data table corresponding to any node is located includes the user identifier of the querier, the data access request is responded.
Optionally, the method further comprises:
responding to a data access request, inquiring a data table to be accessed, and returning a corresponding attribute data list page based on data in the data table to be accessed, wherein the attribute data list page is used for displaying relevant information of each attribute in the data table to be accessed, and the relevant information of the attribute of the associated data table comprises a viewing link of the associated data table;
and responding to the trigger operation aiming at the viewing link in the attribute list page, inquiring a target data table corresponding to the viewing link, and returning the corresponding attribute data list page based on the data in the target data table.
Optionally, the method further comprises:
receiving an association search request, wherein the association search request comprises at least two attribute search conditions;
determining a model to which the attribute related to each attribute search condition belongs as a target model;
searching a data table which accords with corresponding attribute searching conditions in a library node of each target model, and adding the data table into a candidate result set corresponding to each target model;
and filtering out search result combinations with the association relation based on the association relation among the data tables, wherein each search result combination comprises one data table in each candidate result set.
In one aspect, an embodiment of the present application provides a data processing apparatus for a multi-level relational database, which is applied to a database including a plurality of library nodes, where each library node includes data tables of a plurality of objects that use a same model for data storage, the data tables in the same library node include attributes specified by the same model, the data table of each object includes attribute values of the attributes of the object, and the attributes of some objects in some data tables are related to another data table, and the apparatus includes:
the broadcast module is used for broadcasting a change event of any data table when detecting that the attribute in any data table in the database is changed;
the monitoring module is used for triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table;
and the updating module is used for updating the related data in the corresponding data table by each triggered processing module based on the monitored change event and automatically triggering the broadcast of the change event aiming at the corresponding data table.
In one aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods when executing the computer program.
In one aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the steps of any of the above-described methods.
In one aspect, an embodiment of the present application provides a computer program product or a computer program comprising computer instructions 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 to cause the computer device to perform the method provided in any of the various alternative implementations of control of TCP transmission performance described above.
The data processing method, the data processing device, the electronic equipment and the storage medium of the multilevel association database provided by the embodiment of the application are based on the pre-configured data association relationship and are combined with the event issuing and monitoring functions, so that an automatic triggered chain updating mode that a bottom data table recurses to a top data table layer by layer is realized, the automatic updating of all associated data can be triggered as long as one data is changed, the data updating efficiency is improved, and meanwhile, the probability of errors and missing updating is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic application scenario diagram of a data processing method for a multi-level relational database according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method for a multi-level relational database according to an embodiment of the present application;
fig. 3 is a schematic flowchart of checking user permissions according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data processing apparatus of a multi-level relational database according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be noted that, in the case of no conflict, the features in the following embodiments and examples may be combined with each other; moreover, all other embodiments that can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort fall within the scope of the present disclosure.
It is noted that various aspects of the embodiments are described below 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 that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
For convenience of understanding, terms referred to in the embodiments of the present application are explained below:
model: is a list template configured for storing data for the same class of objects, and a plurality of attributes involved by such objects are specified in the model. For example, an engine model is configured for an engine in a vehicle, and the attributes involved in the engine model may include information about components used by the engine (e.g., an intake duct, a nozzle, a combustion chamber, etc.) and characteristic parameters of the engine (e.g., fuel supply conditions, fuel, flight attitude, etc.).
The attributes are as follows: the parameter information related to the object may be, for example, part contained in the object, characteristic parameters of the object, and the like.
Library node: refers to a database that stores data tables instantiated based on the same model.
The Application of Spring has the ability to publish events and register event listeners, and has a complete set of event publishing and listening mechanisms. In Java, events are described by java.util.eventoject, event listeners are described by java.util.eventlistener, and among numerous frameworks and components, a set of event mechanisms is established, which is generally extended based on the two interfaces.
Event sources: the producer of the event object has a source for any EventObject.
Event listener registry: when an event is received by an event framework or component, all associated event listeners need to be notified for processing, which requires a place to store the listeners, i.e., an event listener registry.
An event broadcaster: the event broadcaster acts as an intermediary throughout the event mechanism, and when an event is published by an event publisher, it needs to inform all the associated listeners via the broadcaster to handle the event.
Any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
Fig. 1 is a schematic view of an application scenario of a data processing method for a multi-level relational database according to an embodiment of the present application. The application scenario includes a terminal device 101 and a server 102. The terminal device 101 is installed with a client corresponding to the material management system, a user can create a project and manage a BOM related to the project through the client, and the server 102 is used for operating background data processing of the whole 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 a desktop computer, a mobile phone, a mobile computer, a tablet computer, and the like, and the server 102 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.
Of course, the method provided in the embodiment of the present application is not limited to be used in the application scenario shown in fig. 1, and may also be used in other possible application scenarios, and the embodiment of the present application is not limited. The functions that can be implemented by each device in the application scenario shown in fig. 1 will be described in the following method embodiments, and will not be described in detail herein.
To further illustrate the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide the method operation steps as shown in the following embodiments or figures, more or less operation steps may be included in the method based on the conventional or non-inventive labor. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application.
The following describes the technical solution provided in the embodiment of the present application with reference to the application scenario shown in fig. 1.
A user can establish a model through a client, configure information such as the name of the model and the attribute related to the model, and each model has a unique model identification, so that the user can call the required model conveniently when creating a project. In addition, the user can also configure the association relationship between the models, in order to distinguish from other association relationships, the association relationship at the model level is referred to as a model association relationship in this application, and mainly refers to the association relationship between some attribute of one model and another model, and one model association relationship can be represented as a.a → B, where a represents the attribute of the model a, and B represents the model associated with the attribute a, → represents the direction of the association line. For the purpose of aspect description, the model to which the attribute in the model association relationship belongs may be referred to as a parent model, and the model associated with the attribute in the model association relationship may be referred to as a child model, that is, model a is a parent model of model B, and model B is a child model of model a. The server can store and manage the configured model incidence relation through an incidence model data list, and the incidence model data list comprises the attributes in the model and the model incidence relation of the sub-level model associated with the attributes.
Basic configuration rules of the model association relationship can be preset in the server, for example:
(1) one attribute of a model can only be associated with one model, such as: the attribute a of the model A is associated with the model B, and the attribute B of the model B is associated with the model C;
(2) multiple attributes of a model may be associated with a model simultaneously, such as: the attributes a, B and c of A can be simultaneously associated with the model B;
(3) there may be multiple attributes of a model that are associated with other models, such as: the attribute B of A is associated with the model B, and the attribute C of A is associated with the model C;
(4) in configuring a multi-layer association relationship, a closed-loop association or a model association itself cannot occur, such as: model A is associated with model B, model B is associated with model C, and model C cannot be configured to be associated with model A.
The server can automatically check and detect the model incidence relation configured by the user based on the basic configuration rule, and when the model incidence relation configured by the user does not meet the basic configuration rule, corresponding error-reporting prompt information can be generated and displayed to the user through the client to prompt the user to modify the wrong model incidence relation.
Therefore, when a user configures an association model data list, the data processing method of the multi-level association database provided by the embodiment of the application may include the following steps: obtaining a model incidence relation between any two models based on the configured incidence model data list; generating a directed graph with the model as a node and the model association as an edge according to the direction of the model association; and detecting whether a closed loop exists in the directed graph, and if so, generating corresponding error-reporting prompt information. The direction of the model incidence relation is that a parent model points to an associated child model, and the parent model is a model to which the attribute associated with the child model belongs. The nodes in the directed graph represent models, edges between two nodes represent that the two models have an incidence relation, a node at the starting end of one edge is a parent model, and a node at the ending end of one edge is a child model. Starting from a node in the directed graph, proceeding in the direction of an edge in the directed graph, if it can go back to the node, it is proved that a closed loop exists.
In addition, the server can also detect whether one attribute of the model is associated with a plurality of models simultaneously, and if the condition exists, corresponding error notification prompt information is generated.
A user can create a project through a client of a terminal device, a proper model is selected according to project requirements to create data, the data of each object are stored in a data table mode, each data table has a unique data table identification for distinguishing, and the data table of each object comprises attributes specified by the model and attribute values of the attributes of the object. For example, when a vehicle item needs to be created, a user may select a vehicle model, the client displays a corresponding template according to the vehicle model, the user fills attribute values of relevant attributes, such as a used engine model, a used tire model, and the like, in the template, the data of the vehicle is stored in a data table, and the initial establishment of the vehicle item is completed. Then, the data of each part, for example, the engine and the tire are designed in different departments, the engine model can be selected to create a data table of the engine to store the relevant information of the engine, and the tire model can be selected to create a data table of the tire to store the relevant information of the tire. If the engine and the tire can also be cut into a plurality of components, respective data tables of the components can also be created based on the models corresponding to the components.
When creating the data table of each object, the user can configure the associated data table for the attributes in the object data table. For example, an association between an engine attribute in a vehicle data table and an engine data table may be established such that a user may view the engine data table through the vehicle data table. In this application, the association relationship of the data layer is referred to as a data association relationship, and refers to an association relationship between a certain attribute in one data table and another data table, and a data association relationship may be represented as X.x → Y, where X represents an attribute in the data table X, Y represents a data table associated with the attribute X, and → represents a data association line direction. For the purpose of aspect description, the data table to which the attribute in the data association relationship belongs may be referred to as a parent data table, and the data table associated with the attribute in the data association relationship may be referred to as a child data table, that is, data table X is a parent data table of data table Y, and data table Y is a child data table of data table X. The server can store and manage the configured data association relationship through an associated data list, and the associated data list comprises the data association relationship between the attribute in the data table and the data table associated with the attribute.
For convenience of management, data tables of multiple objects, which are stored in data using the same model, may be stored in the same library node, where a library node refers to a database for storing 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 may be created for a model for more granular sorted storage management of data tables instantiated based on the model.
In specific implementation, the data association configured for the data table cannot violate the model association, and therefore, the data association can be verified through the model association. Specifically, when a user configures an associated data list corresponding to a data table, the server may obtain an associated model data list between pre-configured models; acquiring a target data association relation to be verified, acquiring a first model corresponding to a library node to which a data table to which a target attribute belongs in the target data association relation, and acquiring a second model corresponding to the library node to which the target data table belongs in the target data association relation; and if the incidence relation between the target attribute in the first model and the second model exists in the incidence model data list, adding the incidence relation of the target data into the incidence data list corresponding to the data table, otherwise, outputting prompt information that the incidence relation of the target data does not accord with the rules so as to prompt a user to modify the incidence relation of the target data.
For example, the data association relationship to be verified is X.x → Y, wherein the model corresponding to the library node to which data table X belongs is A, the model corresponding to the library node to which data table Y belongs is B, if the data list of the association model is
There is an association relationship: a.x → B, then X.x → Y passes the check, otherwise X.x → Y fails
Checking and outputting X.x → Y prompt information not conforming to the rule.
The data processing method of the multi-level association database provided by the embodiment of the application can be applied to a database constructed by the method, the database comprises a database of a plurality of cascaded database nodes, each database node comprises a data table of a plurality of objects for data storage by using the same model, the data table in the same database node comprises attributes specified by the same model, the data table of each object comprises attribute values of the attributes of the object, and the attributes of some objects in some data tables are associated with another data table.
Referring to fig. 2, the data processing method for the multi-level association database provided in the embodiment of the present application may be applied to the server shown in fig. 1, and specifically includes the following steps:
s201, when detecting that the attribute in any data table in the database is changed, broadcasting a change event of any data table.
In specific implementation, the broadcasting and monitoring of the event can be realized by adopting a similar Spring architecture. A listener may be set up in advance for each data table in the database to listen for events related to itself. The server can detect whether the information of the data table changes in real time, and when detecting that the attribute in a certain data table changes, the server can issue the change event of the data table and inform all related listeners of processing the event through the broadcaster.
S202, triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table.
In particular, a user may manually configure the listener object for each listener. In order to improve configuration efficiency, the server may automatically configure the monitored objects of the listeners based on the associated data list, specifically, for each data table, obtain the associated data list corresponding to the data table, extract the sub-level data tables associated with the data table from the associated data list, and add the change events of the sub-level data tables to the monitored objects of the listeners corresponding to the data table.
Each listener only monitors the change event of the monitored object concerned by the listener, and only after the change event of the monitored object is monitored, the corresponding processing model is triggered to process the change event.
In particular, each data table may be configured with a processing module for performing a series of operations on the data table. The processing models are independent and do not interfere with each other, so that data change operation on each data table can be executed in parallel, and the processing efficiency is improved.
S203, each triggered processing module updates related data in the corresponding data table based on the monitored change events and automatically triggers the broadcast of the change events aiming at the corresponding data table.
In specific implementation, the change event may be addition, deletion, or modification of an attribute, where the modification of an attribute includes modification of information such as an attribute name and an attribute value of the attribute. The change event may include change information for changing the property, such as the modified property, the modified property value, and the like. Therefore, after the processing module is triggered, the change information of the changed attribute is acquired from the monitored change event, then the attribute related to the changed attribute is searched from the data table corresponding to the processing module, and the attribute value of the related attribute is updated based on the preset relationship between the changed attribute and the related attribute and the change information.
The preset relationship among the attributes can be preset according to the actual application scene. For example, the parts may be affected by each other, for example, the quality of the part may change after the screw used by the part changes, and at this time, the weight of the part using the screw needs to be updated according to the changed quality of the screw.
When a user changes data in a certain data table, the server automatically generates a change event of the data table and broadcasts the change event through the event broadcaster; after monitoring the change events related to the listener, the listener of each data table automatically triggers the corresponding processing module to correspondingly update the data in the data table, and after the update is completed, the processing module generates the change events of the listener and broadcasts the change events, so that the update of the data table related to the change events is continuously triggered until the update of all the related data tables in the database is completed. Based on the pre-configured data association relationship, the method realizes an automatic-triggered chain updating mode of recursion layer by layer from a bottom data table to a top data table by combining the event issuing and monitoring functions, can trigger the automatic updating of all associated data as long as one data changes, improves the data updating efficiency, and simultaneously reduces the probability of errors and missing updating. The data processing method of the multilevel association database can well deal with large projects with multiple parts and complex association relation, and assist users in improving project management efficiency.
On the basis of any of the above embodiments, in order to ensure data security, access rights can be set for the data table. Specifically, a data access authority table is configured for each data table, and the user identification of a user who has access to the data table is recorded in the data access authority table.
In specific implementation, when a user needs to check a certain data table, a data access request can be sent to the server through the client, and the data access request comprises a data table identifier of the data table to be accessed and a user identifier of an inquirer. After receiving a data access request sent by a client, a server acquires a data access authority table corresponding to the data table to be accessed based on a data table identifier of the data table to be accessed, and responds to the data access request if a user identifier of an inquirer is in the data access authority table corresponding to the data table to be accessed; if the user identification of the inquirer is not in the data access authority table corresponding to the data table to be accessed, traversing nodes which are on the same path with the target node and are positioned above the target node to the root node in a tree-shaped hierarchical structure representing the incidence relation among the data tables; if the data access authority table of any node is detected to contain the user identification of the querier in the process of traversing the nodes, responding to the data access request; and if the data access authority tables of all the traversed nodes do not contain the user identification of the inquirer, rejecting the data access request. Each node in the tree-shaped hierarchical structure corresponds to a data table, the target node corresponds to a data table to be accessed, and the process of traversing the nodes is to detect whether the data access authority tables corresponding to the nodes on the same path with the target node contain the user identification of the querier one by one from bottom to top from the father node of the target node.
Referring to fig. 3, after receiving a data access request sent by a client, a server performs the following steps:
s301, extracting the data table identification of the data table to be accessed and the user identification of the inquirer from the data access request.
S302, acquiring a data access authority table corresponding to the data table to be accessed based on the data table identification of the data table to be accessed.
S303, judging whether the data access authority table corresponding to the data table to be accessed contains the user identification of the inquirer, if so, executing a step S304, otherwise, executing a step S305.
S304, responding to the data access request, and returning the data table to be accessed to the client.
S305, judging whether a previous-level node related to the current node exists in the tree-shaped hierarchical structure of the data table, if so, executing a step S306, otherwise, executing a step S308.
And the initial value of the current node is the node corresponding to the data table to be accessed in the tree hierarchy structure. The previous level node associated with the current node is: and the node corresponding to the data table to which the attribute associated with the data table corresponding to the current node belongs.
S306, acquiring the upper level node associated with the current node.
S307, judging whether the data access authority table corresponding to the previous node contains the user identification of the inquirer, if so, executing the step S304, otherwise, taking the previous node as the current node, and returning to execute the step S305.
And S308, rejecting the data access request.
Furthermore, a denial of access list can be configured for each data table, and the user identification of the user who is prohibited from accessing the data table is recorded in the denial of access list. In the process of traversing the nodes, if the fact that the user identification of the inquirer is contained in the access rejection list of any node is detected, the data access request is rejected, and traversing is finished.
Furthermore, a node access authority table can be configured for each library node, and the user identification of the user who has the right to access the library node is recorded in the node access authority table, so that the user can access all the data tables under the library node. In the process of traversing the nodes, if the node access authority table of the library node where the data table corresponding to any node is located is detected to contain the user identification of the inquirer, the data access request is responded.
The client can also display the library nodes in the library node navigation area in a tree structure mode, so that a user can conveniently search the relevant data table through the library node navigation area, and the library node navigation area can hide the library nodes which are not viewed by the user in the right.
Further, in items with higher security requirements, each user may be configured with a corresponding security level, and each data table may be configured with a corresponding accessible security level. In the process of traversing the nodes, whether the security level of the user is not lower than the accessible security level corresponding to the data table or not needs to be detected, if the accessible security level of the data table corresponding to the node is higher than the access security level of the inquirer, the data access request is rejected, and traversing is finished; if the access security level of the data table corresponding to the node is not higher than that of the inquirer, whether the inquirer meets other permission requirements of the node can be verified.
On the basis of any one of the foregoing embodiments, the data processing method for the multi-level relational database provided in the embodiment of the present application further includes the following steps: responding to a data access request, inquiring a data table to be accessed, and returning a corresponding attribute data list page based on data in the data table to be accessed, wherein the attribute data list page is used for displaying relevant information of each attribute in the data table to be accessed, and the relevant information of the attribute of the associated data table comprises a viewing link of the associated data table; and responding to the trigger operation aiming at the viewing link in the attribute list page, inquiring a target data table corresponding to the viewing link, and returning the corresponding attribute data list page based on the data in the target data table.
The attribute data list page may be in accordance with "attribute name: the attribute value format displays the attributes and corresponding attribute values in the data table, and may also display other related information. In order to facilitate a user to view next-level associated data directly through the attribute data list page, a viewing link for viewing an associated data table may be displayed in the attribute data list page, and the user may open the associated data table by clicking the viewing link. For example, attribute a in data table A is associated with data table B, attribute B in data table B is associated with data table C, and attribute data list page P of data table A is openedAClickable Page PAThe attribute data list page P of the data table B can be opened by looking at the link of the data table BBPage PBThe link for viewing the data table C is arranged in the data table, and the specific content of the data table C can be viewed by clicking the link, so that the multi-level associated data viewing is realized.
On the basis of any one of the foregoing embodiments, the data processing method for the multi-level relational database provided in the embodiment of the present application further includes the following steps: receiving an associated search request, wherein the associated search request comprises at least two attribute search conditions; determining a model to which the attribute related to each attribute search condition belongs as a target model; searching a data table which accords with corresponding attribute searching conditions in a library node of each target model, and adding the data table into a candidate result set corresponding to each target model; and filtering out search result combinations with the association relation based on the association relation among the data tables, wherein each search result combination comprises one data table in each candidate result set.
When a user wants to search data meeting a plurality of attribute conditions, the attribute search conditions can be input through the client, and an associated search request carrying the attribute search conditions is sent to the server. Each attribute search condition includes an attribute for search and a corresponding attribute value, for example, an SUV vehicle that wants to retrieve a tire using brand XX, the input attribute search condition includes: "tire brand XX" and "vehicle type SUV".
After receiving the association search request, the server extracts a plurality of attribute search conditions from the association search request, determines a model to which an attribute related to each attribute search condition belongs, and uses the model as a target model, wherein the plurality of attribute search conditions may correspond to the same model, for example, attributes related to the attribute search condition one and the attribute search condition two belong to a model a, and attributes related to the attribute search condition three belong to a model B, and the target model includes the model a and the model B. Then, searching a data table meeting the corresponding attribute search condition in the determined library node of each target model, adding the searched data table into a candidate result set corresponding to each target model, for example, searching data tables meeting the attribute search condition one and the attribute search condition two in the library node corresponding to the model A, and obtaining a candidate result set U corresponding to the model AASearching a data table meeting the attribute search condition three in the library node corresponding to the model B to obtain a candidate result set U corresponding to the model BB. Next, from the candidate result set UAOptionally selecting a data table T1, and selecting from candidate result set UBThe data table T2 related to the data table T1 is selected, the data table T1 and the data table T2 are used as a search result combination, all the search result combinations with the association relation are filtered out based on the method, and all the search result combinations are fed back to the client. Data meeting part of attribute search conditions are retrieved from the library nodes of each model, and then the data meeting all the attribute search conditions are filtered out based on the incidence relation among the data tables, so that incidence search is realized in the library nodes of a plurality of models, and the search efficiency is improved.
As shown in fig. 4, based on the same inventive concept as the data processing method of the multi-level relational database, an embodiment of the present application further provides a data processing apparatus 40 of the multi-level relational database, which is applied to a database including a plurality of cascaded library nodes, each library node includes data tables of a plurality of objects for data storage using the same model, the data tables in the same library node include attributes defined by the same model, the data table of each object includes attribute values of the attributes of the object, and the attributes of some objects in some data tables are associated with another data table, where the apparatus 40 includes:
a broadcasting module 401, configured to broadcast a change event of any data table in the database when detecting that an attribute in the any data table is changed;
a monitoring module 402, configured to trigger, by a listener corresponding to each data table, a processing module corresponding to each data table based on a monitored change event, where a monitored object of each listener includes a change event of a data table associated with an attribute in a corresponding data table;
an update module 402 for each triggered processing module to update the relevant data in the corresponding data table based on the monitored change event and automatically trigger the broadcast of the change event for the corresponding data table.
Optionally, the change event includes change information of the change attribute, and the triggering of the processing module corresponding to each data table based on the monitored change event includes:
acquiring change information of the change attribute from the monitored change event;
searching the attribute related to the change attribute from a data table corresponding to the listener;
updating the attribute value of the related attribute based on the preset relationship between the changed attribute and the related attribute and the change information.
Optionally, the apparatus 40 further comprises a listening object configuration module configured to: and aiming at each data table, acquiring an associated data list corresponding to each data table, wherein the associated data list comprises the attribute in each data table and the data association relation between the data tables associated with the attribute, and adding the change event of the data table in the associated data list into the monitored object of the monitor corresponding to each data table.
Optionally, the apparatus 40 further includes an associated data checking module, configured to, when configuring an associated data list corresponding to the data table, obtain an associated model data list among the pre-configured models, where the associated model data list includes attributes in the models and model association relationships of sub-level models associated with the attributes; acquiring a target data association relation configured for a data table, acquiring a first model corresponding to a library node to which a data table to which a target attribute belongs in the target data association relation, and acquiring a second model corresponding to the library node to which the target data table belongs in the target data association relation; and if the incidence relation between the target attribute in the first model and the second model exists in the incidence model data list, adding the target data incidence relation into the incidence data list corresponding to the data table, otherwise, outputting prompt information that the target data incidence relation does not accord with the rule.
Optionally, when configuring the association model data list, the apparatus 40 further includes an association model checking module, configured to: when the association model data list is configured, obtaining a model association relation between any two models based on the configured association model data list, wherein the direction of the model association relation is that a parent model points to an associated child model, and the parent model is a model to which an attribute associated with the child model belongs; generating a directed graph with the model as a node and the model association as an edge according to the direction of the model association; and detecting whether the directed graph has a closed loop or not, and if so, generating corresponding error-reporting prompt information.
Optionally, the apparatus 40 further comprises an access right verification module for: receiving a data access request, wherein the data access request comprises a data table identifier of a data table to be accessed and a user identifier of an inquirer; acquiring a data access authority table corresponding to the data table to be accessed based on the data table identification of the data table to be accessed, and responding to the data access request if the user identification of the inquirer is in the data access authority table corresponding to the data table to be accessed; if the user identification of the inquirer is not in the data access authority table corresponding to the data table to be accessed, traversing nodes which are on the same path with the target node and are positioned above the target node to the root node in a tree-shaped hierarchical structure representing the incidence relation among the data tables; if the data access authority table of any node is detected to contain the user identification of the inquirer in the process of traversing the nodes, responding to the data access request; if the data access authority tables of all traversed nodes do not contain the user identification of the inquirer, rejecting the data access request; 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.
Optionally, the access right verifying module is further configured to: and if the user identification of the inquirer is detected to be contained in the access rejection list of any node in the process of traversing the nodes, rejecting the data access request and finishing the traversal.
Optionally, the access right verifying module is further configured to: and if the access security level of any node is higher than that of the inquirer in the process of traversing the nodes, rejecting the data access request and finishing the traversal.
Optionally, the access right verifying module is further configured to: and responding the data access request if the node access authority list of the library node where the data list corresponding to any node is located contains the user identification of the inquirer in the process of traversing the nodes.
Optionally, the apparatus 40 further comprises a data query module configured to: responding to a data access request, inquiring a data table to be accessed, and returning a corresponding attribute data list page based on data in the data table to be accessed, wherein the attribute data list page is used for displaying relevant information of each attribute in the data table to be accessed, and the relevant information of the attribute of the associated data table comprises a viewing link of the associated data table; and responding to the trigger operation aiming at the viewing link in the attribute list page, inquiring a target data table corresponding to the viewing link, and returning the corresponding attribute data list page based on the data in the target data table.
Optionally, the apparatus 40 further comprises a searching module for: receiving an association search request, wherein the association search request comprises at least two attribute search conditions; determining a model to which the attribute related to each attribute search condition belongs as a target model; searching a data table which accords with corresponding attribute searching conditions in a library node of each target model, and adding the data table into a candidate result set corresponding to each target model; and filtering out search result combinations with the association relation based on the association relation among the data tables, wherein each search result combination comprises one data table in each candidate result set.
The data processing device of the multilevel relational database and the data processing method of the multilevel relational database provided by the embodiment of the application adopt the same inventive concept, can obtain the same beneficial effects, and are not repeated herein.
Based on the same inventive concept as the data processing method of the multi-level association database, the embodiment of the present application further provides an electronic device, which may be specifically a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), a server, and the like. As shown in fig. 5, the electronic device 50 may include a processor 501 and a memory 502.
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 device, a discrete gate or transistor logic device, or a discrete hardware component, which may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present Application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
Memory 502, which is a non-volatile computer-readable storage medium, may 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, and may include, for example, a 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), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 502 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; the computer storage media may be any available media or data storage device that can be accessed by a computer, including but not limited to: various media that can store program codes, such as a removable Memory device, a Random Access Memory (RAM), a magnetic Memory (e.g., a flexible disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical Memory (e.g., a CD, a DVD, a BD, an HVD, etc.), and a semiconductor Memory (e.g., a ROM, an EPROM, an EEPROM, a nonvolatile Memory (NAND FLASH), a Solid State Disk (SSD)).
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Random Access Memory (RAM), a magnetic Memory (e.g., a flexible disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical Memory (e.g., a CD, a DVD, a BD, an HVD, etc.), and a semiconductor Memory (e.g., a ROM, an EPROM, an EEPROM, a nonvolatile Memory (NAND FLASH), a Solid State Disk (SSD)).
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A data processing method of a multi-level association database is applied to a database comprising a plurality of library nodes, each library node comprises data tables of a plurality of objects which use the same model for data storage, the data tables in the same library node comprise attributes specified by the same model, the data table of each object comprises attribute values of the attributes of the object, and the attributes of a part of the objects in the part of the data tables are associated with another data table, the method comprises the following steps:
when detecting that the attribute in any data table in the database is changed, broadcasting a change event of the any data table;
triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table;
each triggered processing module updates relevant data in the corresponding data table based on the monitored change event and automatically triggers a broadcast of the change event for the corresponding data table.
2. The method of claim 1, wherein the change event includes change information of the change attribute, and the triggering of the processing module corresponding to each data table based on the monitored change event includes:
acquiring change information of the change attribute from the monitored change event;
searching the attribute related to the change attribute from a data table corresponding to the listener;
updating the attribute value of the related attribute based on the preset relationship between the changed attribute and the related attribute and the change information.
3. The method of claim 1, further comprising:
and aiming at each data table, acquiring an associated data list corresponding to each data table, wherein the associated data list comprises the attribute in each data table and the data association relation between the data tables associated with the attribute, and adding the change event of the data table in the associated data list into the monitored object of the monitor corresponding to each data table.
4. The method according to claim 1, wherein when configuring the associated data list corresponding to the data table, the method further comprises:
acquiring an association model data list among pre-configured models, wherein the association model data list comprises attributes in the models and model association relations of sub-models associated with the attributes;
acquiring a target data association relation configured for a data table, acquiring a first model corresponding to a library node to which a data table to which a target attribute belongs in the target data association relation, and acquiring a second model corresponding to the library node to which the target data table belongs in the target data association relation;
and if the incidence relation between the target attribute in the first model and the second model exists in the incidence model data list, adding the target data incidence relation into the incidence data list corresponding to the data table, otherwise, outputting prompt information that the target data incidence relation does not accord with the rule.
5. The method according to any one of claims 1 to 4, further comprising:
receiving a data access request, wherein the data access request comprises a data table identifier of a data table to be accessed and a user identifier of an inquirer;
acquiring a data access authority table corresponding to the data table to be accessed based on the data table identification of the data table to be accessed, and responding to the data access request if the user identification of the inquirer is in the data access authority table corresponding to the data table to be accessed;
if the user identification of the inquirer is not in the data access authority table corresponding to the data table to be accessed, traversing nodes which are on the same path with the target node and are positioned above the target node to the root node in a tree-shaped hierarchical structure representing the incidence relation among the data tables; if the data access authority table of any node is detected to contain the user identification of the inquirer in the process of traversing the nodes, responding to the data access request; if the data access authority tables of all traversed nodes do not contain the user identification of the inquirer, rejecting the data access request; 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.
6. The method according to any one of claims 1 to 4, further comprising:
responding to a data access request, inquiring a data table to be accessed, and returning a corresponding attribute data list page based on data in the data table to be accessed, wherein the attribute data list page is used for displaying relevant information of each attribute in the data table to be accessed, and the relevant information of the attribute of the associated data table comprises a viewing link of the associated data table;
and responding to the trigger operation aiming at the viewing link in the attribute list page, inquiring a target data table corresponding to the viewing link, and returning the corresponding attribute data list page based on the data in the target data table.
7. The method according to any one of claims 1 to 4, further comprising:
receiving an association search request, wherein the association search request comprises at least two attribute search conditions;
determining a model to which the attribute related to each attribute search condition belongs as a target model;
searching a data table which accords with corresponding attribute searching conditions in a library node of each target model, and adding the data table into a candidate result set corresponding to each target model;
and filtering out search result combinations with the association relation based on the association relation among the data tables, wherein each search result combination comprises one data table in each candidate result set.
8. A data processing apparatus for a multi-level relational database, applied to a database including a plurality of library nodes, each library node including data tables of a plurality of objects for data storage using a same model, the data tables in the same library node including attributes defined by the same model, the data table of each object including attribute values of the attributes of the object, the attributes of a part of the objects in the part of the data tables being related to another data table, the apparatus comprising:
the broadcast module is used for broadcasting a change event of any data table when detecting that the attribute in any data table in the database is changed;
the monitoring module is used for triggering the processing module corresponding to each data table by the corresponding monitor of each data table based on the monitored change event, wherein the monitored object of each monitor comprises the change event of the data table associated with the attribute in the corresponding data table;
and the updating module is used for updating the related data in the corresponding data table by each triggered processing module based on the monitored change event and automatically triggering the broadcast of the change event aiming at the corresponding data table.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method of any one of claims 1 to 7.
CN202111669364.5A 2021-12-31 2021-12-31 Data processing method and device of multistage association database and electronic equipment Pending CN114297201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111669364.5A CN114297201A (en) 2021-12-31 2021-12-31 Data processing method and device of multistage association database and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111669364.5A CN114297201A (en) 2021-12-31 2021-12-31 Data processing method and device of multistage association database and electronic equipment

Publications (1)

Publication Number Publication Date
CN114297201A true CN114297201A (en) 2022-04-08

Family

ID=80973236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111669364.5A Pending CN114297201A (en) 2021-12-31 2021-12-31 Data processing method and device of multistage association database and electronic equipment

Country Status (1)

Country Link
CN (1) CN114297201A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840763A (en) * 2023-02-20 2023-03-24 中航信移动科技有限公司 Data storage method based on multiple databases, storage medium and electronic equipment
CN116303458A (en) * 2023-03-17 2023-06-23 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN117389984A (en) * 2023-09-06 2024-01-12 苏州数设科技有限公司 Construction method and device of industrial software object model, medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840763A (en) * 2023-02-20 2023-03-24 中航信移动科技有限公司 Data storage method based on multiple databases, storage medium and electronic equipment
CN116303458A (en) * 2023-03-17 2023-06-23 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN116303458B (en) * 2023-03-17 2023-10-13 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN117389984A (en) * 2023-09-06 2024-01-12 苏州数设科技有限公司 Construction method and device of industrial software object model, medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN114297201A (en) Data processing method and device of multistage association database and electronic equipment
CN115129736B (en) Rule event dynamic loading and updating method based on rule engine and related equipment
US20220237315A1 (en) Metadata storage architecture and data aggregation
CN111177214A (en) Event linkage processing method, device and system, electronic equipment and storage medium
CN105488223A (en) Analyzing and subscribing method and system of business data events
WO2022012327A1 (en) Code analysis method and system, and computing device
CN110704924A (en) BIM preset model creation system and BIM preset model creation method
US11704114B2 (en) Data structures for managing configuration versions of cloud-based applications
CN111784468A (en) Account association method and device and electronic equipment
CN116541372A (en) Data asset management method and system
US11966732B2 (en) Data structures for managing configuration versions of cloud-based applications
CN111475511A (en) Data storage method, data access method, data storage device, data access device and data access equipment based on tree structure
US20170344627A1 (en) System for lightweight objects
CN111427863A (en) Data migration method, device and equipment based on domain model
CN116070049A (en) Method, device and equipment for backtracking page data and readable storage medium
CN115658794A (en) Data query method and device, computer equipment and storage medium
US20140189715A1 (en) Conversion of lightweight object to a heavyweight object
CN112685474A (en) Application management method, device, equipment and storage medium
CN114124977A (en) Cross-tenant data sharing method and device and electronic equipment
CN111143322A (en) Data standard treatment system and method
US7987470B1 (en) Converting heavyweight objects to lightwight objects
US11846969B1 (en) UI state identification, navigation and crawling
CN117331642B (en) Node management method, device, equipment and medium based on hierarchical organization
CN116166613A (en) JSON-based vehicle attribute management method and device and terminal equipment
CN117743190A (en) Verification method and device for interface data flow playback and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination