Background technology
Graphic data base be utilize computing machine with point, line, picture thunderclap figure fundamental element by the data acquisition of given data knot with the capable storage of kitchen range, with the pattern description in the planimetric map of map and other type is fundamental elements such as point, line, surface, and the data acquisition that these graphic elements are set up by certain data structure (being generally the topological data structure).
The framework of graphic data base can be divided into three layers from top to bottom, and the superiors are the tissue and the realization of various conceptual objects in the graph data; The middle layer is abstract data physical store interface, is some DataSet with the data abstraction of physical store; Bottom is that physical store realizes layer, realizes by present storage engines by program, such as: traditional relational database, XML file etc.
DataSet in graphic data base (data set) is the logic storage unit of data, the logical definition of data in the graphic data base and database self all is stored among the DataSet, DataSet is an abstract interface, and the realization procedure stores that real data can be by following the DataSet interface is in the file of relational database, XML or user-defined format.Each DataSet is made up of unique title and several row of the overall situation.
Node in graphic data base (node) is the logical block of storage data, in graphic data base, each record entity can abstractly be Node all, such as when explaining an applications of computer network system, port in the switch, the network interface card of PC server, CPU, produce the manufacturer of accessory, we provide the client of service for it, user in the system, authority or the like, each Node has title and some its distinctive attributes that the overall situation is unique, be used for recording configuration information, for example: with respect to the client of our service, we are with its called after Customer, and it has following attribute: contractedAmount (contract total value), industry (affiliated industry), name (customer name), description (description) etc.
In graphic data base, also there are simultaneously RID (Record ID, Record ID), Relation (relation) and Reference particular attributes such as (quoting); Link up similar netted topological structure by concerning, quoting mutually between node in the graphic data base and the node.In a lot of scenes that the node in the graphic data base is inquired about, we not only need to inquire about the data in the individual node, also need to obtain the data of other node that is associated with it; The inventor is through discovering, also do not have effective method directly to obtain node in the graphic data base in the prior art and the method for the data of other node that is associated with described node.
Summary of the invention
For solving the problems of the technologies described above, the embodiment of the present application provides a kind of search method and system of graphic data base node data, in the inquiry graphic data base, during the individual node data, also can obtain the node data of other node that is associated with described individual node simultaneously.
Technical scheme is as follows:
A kind of search method of graphic data base node data comprises:
Define the relation of the path description between the node in the described graphic data base;
Obtain source node that need carry out data retrieval and the destination node that is associated with described source node;
Determine the path expression in described source node and path, described destination node place according to described path description relation;
Successively the associated nodes between the described source node in the described path expression, destination node and described source node and the destination node is carried out data retrieval.
Above-mentioned method, preferred, described path description relation comprises:
Positive relationship, expression is by the direction relations of source node to destination node;
Inverse relationship, expression is by the direction relations of destination node to source node;
Forward reference, the title of reference type attribute on the expression source node;
Backward reference, the title of reference type attribute on the expression source node, described name is called the source node title.
Above-mentioned method, preferred, the detailed process that the associated nodes between the described source node in the described path expression, destination node and described source node and the destination node is carried out data retrieval is successively:
Determine the relation of the path description between the adjacent two data node in the described path expression;
Concern the record data of searching in the described back end according to described path description;
Successively the record data in the back end in the described path expression are retrieved.
A kind of searching system of graphic data base node data comprises:
Definition unit, acquiring unit, determining unit and retrieval unit;
Wherein:
Described definition unit is used for defining the path description relation between the described graphic data base node;
Described acquiring unit is used to obtain source node that need carry out data retrieval and the destination node that is associated with described source node;
The source node that the definite described acquiring unit of path description relation that described determining unit is used for defining according to described definition unit obtains and the path expression in path, destination node place;
Described retrieval unit is used for successively the associated nodes between source node, destination node and the described source node and the destination node of the definite path expression of described determining unit being carried out data retrieval.
Above-mentioned system, preferred, described definition unit comprises the contextual definition subelement and quotes the definition subelement;
Described contextual definition subelement is used for the incidence relation between the defined node;
The described definition subelement of quoting is used for adduction relationship between the defined node.
Above-mentioned system, preferred, be provided with record data in the described retrieval unit and search the unit;
Described record data are searched the record data that the unit is used for searching according to the relation of the path description between the adjacent data node described back end.
The technical scheme that is provided by above the embodiment of the present application as seen, the search method of graphic data base node data provided by the invention and system, path description relation in the definition graphic data base between the node, when needs carry out data retrieval to a certain source node, obtain the source node and the relevant destination node that connects of user's input with described source node, determine the path expression in described source node and path, destination node place according to the path description relation, thereby determine the relation of record data in the node, successively the node in the described path expression is carried out data retrieval, thereby the node data of the source node that acquisition need be retrieved reaches the reference data of other node that is associated with described source node.The search method of graph data piece node data provided by the invention, by establishment to the path expression that needs to retrieve path, node place in the graphic data base, successively all nodes that comprise in the described path expression are carried out data retrieval, thereby directly obtain the data message that source node reaches other node that is associated with described source node.
Embodiment
In order to make those skilled in the art person understand the application's scheme better.Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment only is the application's part embodiment, rather than whole embodiment.Based on the embodiment among the application, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all should belong to the scope of the application's protection.
The search method process flow diagram of the graphic data base node data that the embodiment of the present application provides comprises as shown in Figure 1:
Step S101: define the relation of the path description between the node in the described graphic data base;
Step S102: obtain source node that need carry out data retrieval and the destination node that is associated with described source node;
Step S103: the path expression of determining described source node and path, described destination node place according to described path description relation;
Step S104: successively the associated nodes between the described source node in the described path expression, destination node and described source node and the destination node is carried out data retrieval.
Since in graphic data base, link up by concerning, quoting mutually between node and the node, similar netted topological structure, in the sensing or invocation procedure between adjacent two nodes, start node is a source node, terminal node is a destination node.
Wherein: in the said method, the path description relation comprises:
Positive relationship, expression is by the direction relations of source node to destination node;
Inverse relationship, expression is by the direction relations of destination node to source node;
Forward reference, the title of reference type attribute on the expression source node;
Backward reference, the title of reference type attribute on the expression source node, described name is called the source node title.
The relation table of foregoing description relation is as shown in table 1:
Table 1
In the said method, successively the associated nodes between the source node in the described path expression, destination node and described source node and the destination node is carried out the specific implementation process of data retrieval, as shown in Figure 2, comprising:
Step S201: determine the relation of the path description between the adjacent two data node in the described path expression;
Step S202: concern the record data of searching in the described back end according to described path description;
Step S203: successively the record data in the back end in the described path expression are retrieved.
For clear more detailed said method is described, the embodiment of the present application is an example with a concrete retrieving, and the search method of a kind of graphic data base node data that the embodiment of the present application is provided is described, and is specific as follows:
At first the attribute of the Node node among the present invention is simply introduced, the data type of Node node among the present invention, as shown in table 2:
Table 2
The definition information of each Node all is kept at name and is called among the DataSet of graphic_db_node_def, and the data structure of this DataSet is as shown in table 3:
The row title |
Data type |
Explanation |
node_id |
Number |
The ID that the overall situation is unique |
name |
String |
Be used to preserve the title of Node |
Table 3
Among each Node defined attribute information be kept at the name be called among the DataSet of graphic_db_node_attr_def, the data structure of this DataSet is as shown in table 4:
Table 4
Be directed to the definition of Node, the DataSet of physical store is similar to following table 5 and two tables of table 6:
Table 5
Table 6
The data message of each Node is kept among the DataSet of the same name with it, supposes that we have a name to be called the Node of Customer, and this Node has following attribute, and is as shown in table 7:
Property Name |
Data type |
Explanation |
RID |
String |
Database is built-in |
name |
String |
Customer name |
contractedAmount |
Number |
Contract value |
industry |
Reference |
Affiliated industry |
description |
String |
Client's descriptor |
Table 7
Then the DataSet structure of this Node correspondence is as shown in table 8:
Table 8
The similar table 9 of the DataSet of physical store:
Table 9
Data structure synoptic diagram in the graphic data base that the embodiment of the present application provides comprises node N1, N2, N3, N4, N5, N6, N7 as shown in Figure 3 in this data structure,
There are following data among the corresponding DataSet of each node in above-mentioned 7 nodes, shown in table 10~table 16:
Table 10
Table 11
Table 12
Table 13
Table 14
Table 15
Table 16
The definition of each node in node definition DataSet is shown in table 17 among Fig. 3:
Table 17
The definition that each pass ties up among the contextual definition DataSet among Fig. 3 is shown in table 18:
Table 18
Data in the DataSet that preserves data relationship are shown in table 19:
Table 19
The data storage of each node in having understood the data structure described in Fig. 3, and after the mutual path description relation between the node, suppose that we are start node with N4, promptly source node determines that destination node is N5; Then the path at node N4 to N5 place is followed successively by N4, N3, N1, N2 and N5 as shown in Figure 4, according to the path description relation of each node in above-mentioned each tabulation, determines that the path expression of path, N4 to N5 place correspondence is:
.R5[N3]<-R2->R1->R3
Data retrieval process starts the back:
Suppose that we are that the data of N4_1 are starting point with RID in the N4 node, retrieve relevant data, then implementation method is:
By backward reference expression formula .R5[N3] as can be known, the data recording of N4_1 is by the data referencing in the N3 node, identifying its Property Name of quoting is R5, all data among the inquiry N3, the value of filtering data row R5 is the data of N4_1, data list by the front as can be known, these two data referencing N4_1 of N3_1, N3_2;
By the inverse relationship expression formula<-R2, the inquiry graphic_db_relation_def as can be known the source node of R2 be N1, destination node is N3, the inquiry graphic_db_relation_record_def, it is related with N1_1 obtaining N3_1, N3_2 is related with N1_2;
By the positive relationship expression formula->R1, the inquiry graphic_db_relation_def as can be known the source node of R1 be N1, destination node is N2, the inquiry graphic_db_relation_record_def, it is related with N2_1 to obtain N1_1, N1_2 is related with N2_2;
By the positive relationship expression formula->R3, the inquiry graphic_db_relation_def source node of R3 as can be known is N2, and destination node is N5, inquiry graphic_db_relation_record_def, it is related with N5_1 to obtain N2_1, and N2_2 does not have data to be associated with it.
By above retrieval, we can directly obtain the result for retrieval of each nodes records data in the critical path of N4 to N5 place, and it is shown in Figure 5 that its concrete outcome synoptic diagram such as the embodiment of the present application provide.
The method embodiment that above-mentioned the embodiment of the present application provides, pass through this method, carrying out the node data retrieving of graphic data base, path expression according to source node and destination node place thereof, the data retrieval that can directly be correlated with to all nodes in this path expression, thus carry out the data retrieval work of graphic data base more comprehensively and effectively.
For aforesaid method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
At above method embodiment, the embodiment of the present application also provides a kind of structural representation of searching system of graphic data base node data, as shown in Figure 6, comprising:
Definition unit 301, acquiring unit 302, determining unit 303 and retrieval unit 304;
Wherein:
Definition unit 301 is used for defining the path description relation between the described graphic data base node;
Acquiring unit 302 is used to obtain source node that need carry out data retrieval and the destination node that is associated with described source node;
The source node that the definite described acquiring unit 302 of path description relation that determining unit 303 is used for defining according to described definition unit 301 obtains and the path expression in path, destination node place;
The associated nodes that retrieval unit 304 is used for successively between source node, destination node and the described source node and the destination node of path expression that described determining unit 303 is determined is carried out data retrieval.
The embodiment of the present application also provides a detailed structure synoptic diagram of graphic data base node data searching system, and as shown in Figure 7, definition unit 301 comprises contextual definition subelement 305 and quotes definition subelement 306;
Contextual definition subelement 305 is used for the incidence relation between the defined node, comprises positive relationship and inverse relationship between the defined node;
Quote definition subelement 306 and be used for adduction relationship between the defined node, comprise forward reference and backward reference between the defined node.
A detailed structure synoptic diagram again of the graphic data base node data searching system that the embodiment of the present application provides is provided with record data and searches unit 307 as shown in Figure 8 in the retrieval unit 304;
Record data are searched the record data that unit 307 is used for searching according to the relation of the path description between the adjacent data node described back end.
For system embodiment, because it is substantially corresponding to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses all is difference with other embodiment.The above only is the application's a embodiment; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the application's principle; can also make some improvements and modifications, these improvements and modifications also should be considered as the application's protection domain.