CN102214214A - Method and device for processing data relationship and mobile communication terminal - Google Patents

Method and device for processing data relationship and mobile communication terminal Download PDF

Info

Publication number
CN102214214A
CN102214214A CN2011101479005A CN201110147900A CN102214214A CN 102214214 A CN102214214 A CN 102214214A CN 2011101479005 A CN2011101479005 A CN 2011101479005A CN 201110147900 A CN201110147900 A CN 201110147900A CN 102214214 A CN102214214 A CN 102214214A
Authority
CN
China
Prior art keywords
attribute data
relation
attributes
attribute
data
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.)
Granted
Application number
CN2011101479005A
Other languages
Chinese (zh)
Other versions
CN102214214B (en
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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Dongjing Computer Technology Co Ltd
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 Guangzhou Dongjing Computer Technology Co Ltd filed Critical Guangzhou Dongjing Computer Technology Co Ltd
Priority to CN 201110147900 priority Critical patent/CN102214214B/en
Publication of CN102214214A publication Critical patent/CN102214214A/en
Application granted granted Critical
Publication of CN102214214B publication Critical patent/CN102214214B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention discloses a method and a device for processing data relationship and a mobile communication terminal. The method comprises the following steps: setting first attribute data as a major key; calling an attribute relationship database; according to the major key, searching second attribute data in the attribute relationship database to obtain a route between the first attribute data and the second attribute data; judging whether the route is the shortest route; and when the route is not the shortest route, building a direct attribute relationship between the first attribute data and the second attribute data, and storing the direct attribute relationship in the attribute relationship database, wherein the direct attribute relationship is the corresponding attribute relationship when the route between the first attribute data and the second attribute data is the shortest route. According to the method and the device, attribute data can be updated and imported at a high speed while the attribute data is inquired at a high speed.

Description

The disposal route of data relationship, device and communication terminal
Technical field
The present invention relates to software field, in particular to a kind of disposal route, device and communication terminal of data relationship.
Background technology
For a lot of dependence every day by not suspending the collection mass data, the service of setting up the attribute corresponding relation then and providing real time high-speed to inquire about, a large amount of importings and query manipulation, because the problem of lock, the equal poor efficiency very of performance that can make the importing of data and inquiry.
Fig. 1 is the relation on attributes structural representation based on bivariate table according to correlation technique.Embodiment as shown in Figure 1 comes the things attribute is carried out modeling with artificial example, and based on this modeling personage's attribute is searched fast.
In the relational database as shown in Figure 1, set up the model of a two-dimentional tabular form, as major key, other associate fields have army's testimony of a witness, driver's license, social security number, industrial and commercial bank's account, Construction Bank's account etc. with people's identification card number.After the user provides social security number, if think to find fast his army's testimony of a witness, need find out this user's major key (being identification card number) earlier, begin to travel through this bivariate table then, because this bivariate table model adopts major key and other associate field to concern one to one, so search efficiency is low.If all fields are set up index, can cause the bivariate table complex structure, simultaneously, in the process that imports, upgrades at attribute data,, caused the low problem of search efficiency and update efficiency owing to need to import the data of all properties relation.If certain two field is stored with independent table, related efficient is also lower.
At present low at the attribute data relational model search efficiency of related art, data importing, the problem that update efficiency is low do not propose effective solution as yet.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of disposal route, device and communication terminal of data relationship, attribute data relational model search efficiency with the solution related art is low, data importing, the problem that update efficiency is low can improve attribute data and import and updating efficiency.
To achieve these goals, according to an aspect of the present invention, provide a kind of disposal route of data relationship, the disposal route of this data relationship comprises: it is major key that first attribute data is set; Call the relation on attributes database, in the relation on attributes database, search for second attribute data, to obtain the path between first attribute data and second attribute data according to major key; Judge whether the path is shortest path; When the path is non-shortest path, set up the direct relation on attributes between first attribute data and second attribute data, and direct relation on attributes is saved in the relation on attributes database, wherein, directly relation on attributes be first attribute data with second attribute data between corresponding relation on attributes when being shortest path.
Further, be provided with before first attribute data is major key, method also comprises: make up the relation on attributes database, the relation on attributes database comprises one or more groups relation on attributes, and relation on attributes is the corresponding relation between any two attribute datas.
Further, call the relation on attributes database, in the relation on attributes database, search for second attribute data according to major key, comprise: call the relation on attributes database, and set up digraph according to the relation on attributes database with the step of obtaining the path between first attribute data and second attribute data; With the major key is starting point, inquires about second attribute data by the width searches algorithm in digraph, and obtains the value of second attribute data; Obtain and write down one or more path between first attribute data and second attribute data.
Further, in the direct relation on attributes of setting up between first attribute data and second attribute data, and direct relation on attributes is saved to after the relation on attributes database, method also comprises: the 3rd attribute data that obtains the path process between first attribute data and second attribute data; Set up the direct relation on attributes between first attribute data and the 3rd attribute data, set up the direct relation on attributes between second attribute data and the 3rd attribute data simultaneously.
Further, relation on attributes is a bidirectional relationship, direct relation on attributes is saved in the relation on attributes database comprise: bidirectional relationship is saved in the relation on attributes database with the data tableau format.
To achieve these goals, according to a further aspect in the invention, provide a kind for the treatment of apparatus of data relationship, the treating apparatus of this data relationship comprises: module is set, and being used to be provided with first attribute data is major key; Search module is used to call the relation on attributes database, searches for second attribute data according to major key in the relation on attributes database, to obtain the path between first attribute data and second attribute data; Judge module is used to judge whether the path is shortest path; Repair module, be used for when the path is non-shortest path, set up the direct relation on attributes between first attribute data and second attribute data, and direct relation on attributes is saved in the relation on attributes database, wherein, directly relation on attributes be first attribute data with second attribute data between corresponding relation on attributes when being shortest path.
Further, device also comprises: make up module, be used to make up the relation on attributes database, the relation on attributes database comprises one or more groups relation on attributes, and relation on attributes is the corresponding relation between any two attribute datas.
Further, search module comprises: calling module is used to call the relation on attributes database, and sets up digraph according to the relation on attributes database; Enquiry module, being used for the major key is starting point, inquires about second attribute data by the width searches algorithm in digraph, and obtains the value of second attribute data; Preserve module, be used to obtain and write down one or more path between first attribute data and second attribute data.
Further, device also comprises: acquisition module is used to obtain the 3rd attribute data of the path process between first attribute data and second attribute data; Creation module is used to set up the direct relation on attributes between first attribute data and the 3rd attribute data, sets up the direct relation on attributes between second attribute data and the 3rd attribute data simultaneously.
To achieve these goals, according to another aspect of the invention, provide a kind of communication terminal, comprised the treating apparatus of above-mentioned any one data relationship.
By the present invention, adopting first attribute data is set is major key; Call the relation on attributes database, in the relation on attributes database, search for second attribute data, to obtain the path between first attribute data and second attribute data according to major key; Judge whether the path is shortest path; When the path is non-shortest path, set up the direct relation on attributes between first attribute data and second attribute data, and direct relation on attributes is saved in the relation on attributes database, wherein, directly relation on attributes be first attribute data with second attribute data between corresponding relation on attributes when being shortest path, above-mentioned processing procedure, whether by inquiring about two query paths between the attribute data is that shortest path is determined, if the needs between two attribute datas just can inquire through other relations on attributes, then create the relation on attributes between these two attribute datas, promptly obtain two shortest paths between the attribute data, make in inquiry next time, can directly find the another one attribute data by this shortest path from an attribute data, and the value of getattr data, and the two relation on attributes after will creating is preserved, promptly constantly improve original relation on attributes database, make the attribute data relation be tending towards perfect, thereby it is low to have solved attribute data relational model search efficiency, data importing, the problem that update efficiency is low, and then be implemented in when high speed querying attributes data are provided, also provide at a high speed attribute data to upgrade and the effect of the performance that imports.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is the relation on attributes structural representation based on bivariate table according to correlation technique;
Fig. 2 is the treating apparatus structural representation according to the data relationship of the embodiment of the invention;
Fig. 3 is the attribute data relational structure synoptic diagram according to the oriented complete graph of the embodiment of the invention;
Fig. 4 is the process flow diagram according to the disposal route of the data relationship of the embodiment of the invention;
Fig. 5-the 6th is according to the structural representation based on the attribute data of digraph relation of first embodiment of the invention;
Fig. 7-the 8th is according to the structural representation based on the attribute data of digraph relation of second embodiment of the invention.
Embodiment
Need to prove that under the situation of not conflicting, embodiment and the feature among the embodiment among the application can make up mutually.Describe the present invention below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
Fig. 2 is the treating apparatus structural representation according to the data relationship of the embodiment of the invention.As shown in Figure 2, this device comprises: module 10 is set, and being used to be provided with first attribute data is major key; Search module 30 is used to call the relation on attributes database, searches for second attribute data according to major key in the relation on attributes database, to obtain the path between first attribute data and second attribute data; Judge module 50 is used to judge whether the path is shortest path; Repair module 70, be used for when the path is non-shortest path, set up the direct relation on attributes between first attribute data and second attribute data, and direct relation on attributes is saved in the relation on attributes database, wherein, directly relation on attributes be first attribute data with second attribute data between corresponding relation on attributes when being shortest path.
The above embodiment of the present invention is by the corresponding relation between two attribute datas of inquiry, and judge whether two query paths between the attribute data are shortest paths, if the needs between two attribute datas just can inquire through other relations on attributes, then create the relation on attributes between these two attribute datas, promptly obtain two shortest paths between the attribute data, in inquiry next time, can utilize shortest path to realize just can directly finding the another one attribute data by one of them attribute data, and the value of getattr data, and the two relation on attributes after will creating is preserved, promptly constantly improve original relation on attributes database, make the attribute data relation be tending towards perfect, the performance that also provides attribute data at a high speed to upgrade and import when having realized high speed querying attributes data.
In the above embodiment of the present invention, this device can also comprise: make up module 90, be used to make up the relation on attributes database, the relation on attributes database comprises one or more groups relation on attributes, and relation on attributes is the corresponding relation between any two attribute datas.Can adopt key-value to store among this embodiment and make up relation on attributes as the relation between certain two attribute data, a plurality of such relations on attributes constitute the relation on attributes database, concrete, with certain attribute data X as starting point, point to the data of the relation of another one attribute data, be stored in the corresponding Key-Value storage.
The search module 30 of the above embodiment of the present invention can comprise: calling module 301 is used to call the relation on attributes database, and sets up digraph according to the relation on attributes database; Enquiry module 303, being used for the major key is starting point, inquires about second attribute data by the width searches algorithm in digraph, and obtains the value of second attribute data; Preserve module 305, be used to obtain and write down one or more path between first attribute data and second attribute data.Among this embodiment the relation between all properties data is adopted above-mentioned a plurality of key-value storage mode storage, and set up digraph according to the relation between each attribute data, when wanting by certain attribute data X inquiry another one attribute data Y, only need be with X as starting point, use the BFS width searches to calculate, search out the shortest path of Y, find out the value of Y.If the path that finds not is shortest path (that is: X points to the path that concerns of Y), then use relation to repair algorithm and repair path between X and the Y attribute, make when search next time, can be directly obtain data to the path of Y by X.
Concrete, as shown in Figure 3, when the corresponding relation that obtains certain two data, with driver's license and industrial and commercial bank's account is example: be respectively major key key with the driver's license, industrial and commercial bank's account is that value imports the corresponding key-value storage of " driver's license-industrial and commercial bank's account " relation, be key with industrial and commercial bank's account again, driver's license is that value imports in the corresponding key-value storage of " industrial and commercial bank's account-driver's license " relation, also can import by said method " account of industrial and commercial bank<-the Construction Bank account ", " driver's license<-establish and protect number " and " account of industrial and commercial bank<-establish and protect number " corresponding key-value storage of relation.When with the driver's license being major key when searching the Construction Bank account, can obtain three paths in the digraph of this embodiment, but not be shortest path.
Preferably, this device can also comprise: acquisition module 110 is used to obtain one or more the 3rd attribute datas of the path process between first attribute data and second attribute data; Creation module 130 is used to set up the direct relation on attributes between first attribute data and the 3rd attribute data, sets up the direct relation on attributes between second attribute data and the 3rd attribute data simultaneously.The above embodiment of the present invention realizes filling up the attribute data of disappearance and the relation between the attribute data.
The foregoing description realize to use the key-value storage to combine with searching algorithm and realizes this technical scheme of attribute fast query, has data importing function efficiently when real-time efficiently query function can be provided.
Fig. 4 is the process flow diagram according to the disposal route of the data relationship of the embodiment of the invention.This method comprises the steps: as shown in Figure 4
Step S102, by the definition module among Fig. 2 10 first attribute data being set is major key.
Step S104 realizes calling the relation on attributes database by the search module among Fig. 2 30, searches for second attribute data according to major key in the relation on attributes database, to obtain the path between first attribute data and second attribute data.
Step S106 judges by the judge module among Fig. 2 50 whether the path is shortest path.
Step S108, realize by the reparation module 70 among Fig. 2, when the path is non-shortest path, set up the direct relation on attributes between first attribute data and second attribute data, and direct relation on attributes is saved in the relation on attributes database, wherein, directly relation on attributes be first attribute data with second attribute data between corresponding relation on attributes when being shortest path.
The above embodiment of the present invention is by the corresponding relation between two attribute datas of inquiry, and judge two relations between the attribute data, be whether query path is shortest path, if the needs between two attribute datas just can inquire through other relations on attributes, then create the direct relation on attributes between these two attribute datas, promptly obtain two shortest paths between the attribute data, in inquiry next time, just can directly find the another one attribute data by one of them attribute data, and the value of getattr data, and the two relation on attributes after will creating is preserved, promptly constantly improve original relation on attributes database, make the attribute data relation be tending towards perfect, the performance that also provides attribute data at a high speed to upgrade and import when having realized high speed querying attributes data.Concrete, if user's inquiry can't be arrived by shortest path searching, can only pass through non-shortest path searching, in this case, it is complete to use the data relationship reparation to make that data relationship trends towards.
Concrete, above-mentioned steps S106 and step S108 can realize, in the time need searching the value of Y attribute for the X attribute of value according to value, if X can directly obtain the data of Y attribute to the relation of Y, then directly return the data of this attribute Y, otherwise, can be with X as starting point, use the width searches algorithm, search out the path of Y attribute, if there is a paths to reach, then for any two attribute of middle process, set up key-mutually〉relation on attributes of value, obtaining on digraph, the increasing shortest path of X attribute, thereby return the value of Y attribute to the Y attribute.Therefore, the use key-value storage of the present invention's proposition goes to store the relation between any two attributes.Can use BFS width searches algorithm according to some attributes that provides, find out the another one attribute fast, can fill up the relation on attributes of some disappearances then, make that follow-up attribute data search efficiency is more efficient.
In the above embodiment of the present invention, after above-mentioned determining step S106, can also comprise step S109, this step realizes when the path is shortest path, system can return the value of second attribute data and give the user, obtains required data to realize the user by the shortest path inquiry.
Being provided with before first attribute data is major key in the above embodiment of the present invention, method can also comprise the steps: to make up the relation on attributes database, the relation on attributes database comprises one or more groups relation on attributes, and relation on attributes is the corresponding relation between any two attribute datas.
Preferably, call the relation on attributes database, in the relation on attributes database, search for second attribute data according to major key, can comprise the steps: to call the relation on attributes database with the step S104 that obtains the path between first attribute data and second attribute data, and set up digraph according to the relation on attributes database; With the major key is starting point, inquires about second attribute data by the width searches algorithm in digraph, and obtains the value of second attribute data; Obtain and write down one or more path between first attribute data and second attribute data.Concrete, this embodiment of the invention can use key-value storage to go to store relation between any two attributes to constitute the relation on attributes database, then can be according to some attributes that provides, use BFS width searches algorithm, find out the another one attribute fast, in order to fill up the attribute of some disappearances.More efficient on the efficient of searching.
Preferably, in the direct relation on attributes of setting up between first attribute data and second attribute data, and direct relation on attributes is saved to after the relation on attributes database, method also comprises: the 3rd attribute data that obtains the path process between first attribute data and second attribute data; Set up the direct relation on attributes between first attribute data and the 3rd attribute data, set up the direct relation on attributes between second attribute data and the 3rd attribute data simultaneously.
Relation on attributes among above-mentioned each embodiment of the present invention is the bidirectional relationship in the digraph, and with the data tableau format bidirectional relationship is saved in the relation on attributes database.
Fig. 5-the 6th is according to the structural representation based on the attribute data of digraph relation of first embodiment of the invention.
As shown in Figure 5, in the process that attribute data imports, imported respectively " driver's license<-social security number " among this embodiment, " social security number<-industrial and commercial bank's account ", the relation on attributes of " Construction Bank's account<-industrial and commercial bank's account ", therefore, this user has only possessed the data relationship among Fig. 5.
Among this embodiment, when if the user wants to search Construction Bank's account by driver's license, because the user lacks the corresponding relation of " driver's license-Construction Bank's account ", so can't find the data of Construction Bank's account comes out at once, need just to find by " driver's license → social security number → industrial and commercial bank's account → Construction Bank's account " so non-shortest path, in the data that obtain Construction Bank's account, because " driver's license " arranged, " social security number ", the data and the corresponding relation of " industrial and commercial bank's account " and " Construction Bank's account " these 4 attributes, so can be these 4 attribute datas according to being major key key with the driver's license, industrial and commercial bank's account is that value imports the corresponding key-value storage of " driver's license-industrial and commercial bank's account " relation, be key with industrial and commercial bank's account again, driver's license is that value imports in the corresponding key-value storage of " industrial and commercial bank's account-driver's license " relation, realize respectively the corresponding relation of certain two attribute being imported in the Key-value storage, make its data relationship reparation become digraph as shown in Figure 6.
As shown in Figure 6, when the user inquires about Construction Bank's account by driver's license next time, can obtain Construction Bank account's data value by the shortest path among Fig. 6 " driver's license → Construction Bank's account ".
Concrete, the code snippet that the foregoing description is realized is as follows:
Figure BDA0000066026650000071
Above-mentioned steps realizes when user's inquiry can't be arrived by shortest path searching, come the repair data relation by the bidirectional relationship of setting up between them, make in the process of inquiry next time, can inquire the value of corresponding attribute data with the highest efficient, make data relationship be tending towards complete.
Figure BDA0000066026650000091
Above-mentioned steps can realize that the user based on some already provided attributes, finds the process of another one attribute fast by BFS width searches algorithm.
The specific embodiments that can use the parameter of following example to come specific implementation Fig. 5 of the present invention-6:
Figure BDA0000066026650000092
In this code instance, with " driver's license " starting point as user inquiring, the attribute data that " Construction Bank account " need will inquire about by " driver's license " as the user, the Major key of " driver's license " is " 64628847262 ", need obtain the value of " driver's license " by three indirect paths by the digraph that Fig. 5 provided, after the property value that obtains this " driver's license ", the relation on attributes database of the bi-directional nature relation preservation of system between will " driver's license<-Construction Bank account ", and the incidence relation between two attribute datas in the generation digraph, therefore, the shortest path between " driver's license " and " Construction Bank account " in the digraph has been repaired in realization, has improved the efficient of next query script.
Preferably, after the shortest path that obtains between " driver's license " and " Construction Bank account ", can set up the bi-directional nature relation for any two attribute datas of middle process, concrete, as illustrated in Figures 5 and 6, owing in process, passed through attribute data " establish guarantor number " and " account of industrial and commercial bank " by " driver's license " inquiry " Construction Bank account ", therefore, set up and preserve the key-between " driver's license<-account of industrial and commercial bank " and " establish protect number<-Construction Bank account " simultaneously〉the bi-directional nature relation of value, realize more perfect digraph searching route, improved search efficiency greatly.
Fig. 7-the 8th is according to the structural representation based on the attribute data of digraph relation of second embodiment of the invention.
During mobile Internet was used, user data can use and search technology fast.Specifically, when some mobile Internet softwares are installed on the user mobile phone, can distribute an installation series number " INST " usually; and can collect user's part attribute; include but not limited to following attribute: mobile phone sequence number, telephone number, the ID of user's registration.These attributes all are that the user collects when using the softward interview server, because installation series number all assigning in each the installation again, and the user also not necessarily can register certain ID, so data are not complete.Complete for service data relation safeguarded the complete of relation so the UAD of returning has just been collected in the importing that need not stop, if what run into is the user accesses data of magnanimity, so to inquiry and the performance that imports all can be very harshness.
As shown in Figure 7, the storage relation between the attribute data that present embodiment is set up is also imperfect, such as certain user just reinstalled his software, obtained a new installation series number, and this time, service end is only collected the mobile phone sequence number that obtains this user.
Utilize relation on attributes restorative procedure of the present invention to realize, when the user uses certain function on the software, but when the data routing that this function connects is not shortest path, can revise the path of calling between this function and its calling function, promptly obtain two shortest paths between the attribute data, improved the search efficiency of data relationship.Concrete, as shown in Figure 8, when the user need use the user to register ID, need to search " user ID " and obtain original user ID by " installation series number ", can finish this moment by path " installation series number-mobile phone sequence number-phone number-user ID ", but the obvious search efficiency in this path is low, therefore, system can set up the direct relation on attributes between " installation series number " and " user ID " this moment, promptly at the shortest path that increases on Fig. 8 between " installation series number " and " user ID ", make " installation series number " directly bind the ID of the original registration in reuse family, the repair function that concerns of above algorithm can be so that data trend towards complete.
Preferably, embodiment shown in Fig. 7 and 8, in the shortest path of repairing between " installation series number " and " user ID ", repaired the relation on attributes between any two attribute datas of process between these two attributes by concerning the reparation algorithm, " installation series number " and " phone number " have promptly been repaired, and the shortest path between " user ID " and " mobile phone sequence number ", make in the process of this mobile Internet user's magnanimity visit data in using, optimized the inquiry of attribute data greatly and imported performance.
Need to prove, can in computer system, carry out in the step shown in the process flow diagram of accompanying drawing such as a set of computer-executable instructions, and, though there is shown logical order in flow process, but in some cases, can carry out step shown or that describe with the order that is different from herein.
The present invention also provides a kind of communication terminal, and this communication terminal comprises the embodiment of the treating apparatus of above-mentioned any one data relationship.This communication terminal can be a mobile phone, and concrete concern repair function and algorithm are to be used in the middle of the application of user's magnanimity access attribute data such as web page browsing, medium (audio frequency, video) broadcast, file download, user interactions, instant messaging and recreation.
As can be seen from the above description, the present invention has realized following technique effect: in the key-value storage, set up the corresponding relation between the attribute data.Owing to the invention provides the function that relation is repaired, when making data importing, do not need to import simultaneously the data of all properties relation, and do not have traditional database that all properties is all set up the problem of locking behind the index yet, provide data importing performance at a high speed when inquiring about at a high speed yet so can provide.For inquiry with import performance and deposit, this is the general data importing of using on the traditional relational, search technical scheme is beyond one's reach.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with the general calculation device, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the memory storage and carry out by calculation element, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the disposal route of a data relationship is characterized in that, comprising:
It is major key that first attribute data is set;
Call the relation on attributes database, in described relation on attributes database, search for second attribute data, to obtain the path between described first attribute data and described second attribute data according to described major key;
Judge whether described path is shortest path;
When described path is non-shortest path, set up the direct relation on attributes between described first attribute data and described second attribute data, and described direct relation on attributes is saved in the described relation on attributes database, wherein, described direct relation on attributes be described first attribute data with described second attribute data between corresponding relation on attributes during for shortest path.
2. method according to claim 1 is characterized in that, is being provided with before first attribute data is major key, and described method also comprises:
Make up described relation on attributes database, described relation on attributes database comprises one or more groups relation on attributes, and described relation on attributes is the corresponding relation between any two attribute datas.
3. method according to claim 2, it is characterized in that, call the relation on attributes database, in described relation on attributes database, search for second attribute data, comprise with the step of obtaining the path between described first attribute data and described second attribute data according to described major key:
Call described relation on attributes database, and set up digraph according to described relation on attributes database;
With described major key is starting point, inquires about described second attribute data by the width searches algorithm in described digraph, and obtains the value of described second attribute data;
Obtain and write down one or more path between described first attribute data and described second attribute data.
4. method according to claim 3, it is characterized in that, in the direct relation on attributes of setting up between described first attribute data and described second attribute data, and described direct relation on attributes is saved to after the described relation on attributes database, described method also comprises:
Obtain the 3rd attribute data of the path process between described first attribute data and described second attribute data;
Set up the direct relation on attributes between described first attribute data and described the 3rd attribute data, set up the direct relation on attributes between described second attribute data and described the 3rd attribute data simultaneously.
5. according to each described method among the claim 1-4, it is characterized in that described relation on attributes is a bidirectional relationship, described direct relation on attributes is saved in the described relation on attributes database comprises:
Described bidirectional relationship is saved in the described relation on attributes database with the data tableau format.
6. the treating apparatus of a data relationship is characterized in that, comprising:
Module is set, and being used to be provided with first attribute data is major key;
Search module is used to call the relation on attributes database, searches for second attribute data according to described major key in described relation on attributes database, to obtain the path between described first attribute data and described second attribute data;
Judge module is used to judge whether described path is shortest path;
Repair module, be used for when described path is non-shortest path, set up the direct relation on attributes between described first attribute data and described second attribute data, and described direct relation on attributes is saved in the described relation on attributes database, wherein, described direct relation on attributes be described first attribute data with described second attribute data between corresponding relation on attributes during for shortest path.
7. device according to claim 6 is characterized in that, described device also comprises:
Make up module, be used to make up described relation on attributes database, described relation on attributes database comprises one or more groups relation on attributes, and described relation on attributes is the corresponding relation between any two attribute datas.
8. device according to claim 7 is characterized in that, described search module comprises:
Calling module is used to call described relation on attributes database, and sets up digraph according to described relation on attributes database;
Enquiry module, being used for described major key is starting point, inquires about described second attribute data by the width searches algorithm in described digraph, and obtains the value of described second attribute data;
Preserve module, be used to obtain and write down one or more path between described first attribute data and described second attribute data.
9. device according to claim 6 is characterized in that, described device also comprises:
Acquisition module is used to obtain the 3rd attribute data of the path process between described first attribute data and described second attribute data;
Creation module is used to set up the direct relation on attributes between described first attribute data and described the 3rd attribute data, sets up the direct relation on attributes between described second attribute data and described the 3rd attribute data simultaneously.
10. a communication terminal is characterized in that, comprises the treating apparatus of any described data relationship among the claim 6-9.
CN 201110147900 2011-06-02 2011-06-02 Method and device for processing data relationship and mobile communication terminal Active CN102214214B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110147900 CN102214214B (en) 2011-06-02 2011-06-02 Method and device for processing data relationship and mobile communication terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110147900 CN102214214B (en) 2011-06-02 2011-06-02 Method and device for processing data relationship and mobile communication terminal

Publications (2)

Publication Number Publication Date
CN102214214A true CN102214214A (en) 2011-10-12
CN102214214B CN102214214B (en) 2013-09-04

Family

ID=44745522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110147900 Active CN102214214B (en) 2011-06-02 2011-06-02 Method and device for processing data relationship and mobile communication terminal

Country Status (1)

Country Link
CN (1) CN102214214B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722546A (en) * 2012-05-25 2012-10-10 北京大学 Method for inquiring shortest path in graph in relational database environment
CN105740274A (en) * 2014-12-10 2016-07-06 阿里巴巴集团控股有限公司 Undirected graph-based user account searching method and device
CN107741936A (en) * 2016-09-06 2018-02-27 腾讯科技(深圳)有限公司 The update method and device of a kind of data relationship
WO2018233680A1 (en) * 2017-06-22 2018-12-27 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for querying a database

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1647076A (en) * 2002-03-28 2005-07-27 莱恩生物科学有限公司 Method and apparatus for querying relational databases
CN101276348A (en) * 2007-03-30 2008-10-01 上海众恒信息产业有限公司 Data processing system and method based on data property
CN101453472A (en) * 2005-11-09 2009-06-10 华为技术有限公司 Relation information disclosing, acquiring method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1647076A (en) * 2002-03-28 2005-07-27 莱恩生物科学有限公司 Method and apparatus for querying relational databases
CN101453472A (en) * 2005-11-09 2009-06-10 华为技术有限公司 Relation information disclosing, acquiring method and system
CN101276348A (en) * 2007-03-30 2008-10-01 上海众恒信息产业有限公司 Data processing system and method based on data property

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722546A (en) * 2012-05-25 2012-10-10 北京大学 Method for inquiring shortest path in graph in relational database environment
CN102722546B (en) * 2012-05-25 2015-07-29 北京大学 The querying method of shortest path in relational database environment figure below
CN105740274A (en) * 2014-12-10 2016-07-06 阿里巴巴集团控股有限公司 Undirected graph-based user account searching method and device
CN105740274B (en) * 2014-12-10 2019-06-18 阿里巴巴集团控股有限公司 User account lookup method and device based on non-directed graph
CN107741936A (en) * 2016-09-06 2018-02-27 腾讯科技(深圳)有限公司 The update method and device of a kind of data relationship
CN107741936B (en) * 2016-09-06 2020-12-01 腾讯科技(深圳)有限公司 Data relationship updating method and device
WO2018233680A1 (en) * 2017-06-22 2018-12-27 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for querying a database
CN109117429A (en) * 2017-06-22 2019-01-01 北京嘀嘀无限科技发展有限公司 Data base query method, device and electronic equipment
CN109117429B (en) * 2017-06-22 2020-09-22 北京嘀嘀无限科技发展有限公司 Database query method and device and electronic equipment
US10885046B2 (en) 2017-06-22 2021-01-05 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for querying a database

Also Published As

Publication number Publication date
CN102214214B (en) 2013-09-04

Similar Documents

Publication Publication Date Title
CN102193917B (en) Method and device for processing and querying data
Armenatzoglou et al. A general framework for geo-social query processing
CN102164186B (en) Method and system for realizing cloud search service
CN110245470A (en) Intelligent data desensitization method, device, computer equipment and storage medium
CN102915382A (en) Method and device for carrying out data query on database based on indexes
CN104412266A (en) Method and apparatus for multidimensional data storage and file system with a dynamic ordered tree structure
CN106407303A (en) Data storage method and apparatus, and data query method and apparatus
CN106407302B (en) It supports to call the special functional method of middleware database by Simple SQL
CN101334792A (en) Personalized service recommendation system and method
CN104346345B (en) The storage method and device of data
CN102761627A (en) Cloud website recommending method and system based on terminal access statistics as well as related equipment
CN103853714A (en) Data processing method and device
CN102214214B (en) Method and device for processing data relationship and mobile communication terminal
CN102710795A (en) Hotspot collecting method and device
CN104794146A (en) Method and device for real-time screening and ranking of commodities
CN103778251A (en) SPARQL parallel query method facing large-scale RDF graph data
CN109241159A (en) A kind of subregion querying method, system and the terminal device of data cube
CN106202254A (en) A kind of querying method and data query system
CN106471501A (en) The method of data query, the storage method data system of data object
CN102937905A (en) Method and device for trying out application software and supporting trying out application software
CN111258978A (en) Data storage method
CN108319608A (en) The method, apparatus and system of access log storage inquiry
CN103440249A (en) System and method for rapidly searching unstructured data
CN108154024B (en) Data retrieval method and device and electronic equipment
CN101963993B (en) Method for fast searching database sheet table record

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200612

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: Room 301, building 2, No. 16 Keyun Road, Tianhe District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.