CN103902565A - Method and device for determining data access relation - Google Patents

Method and device for determining data access relation Download PDF

Info

Publication number
CN103902565A
CN103902565A CN201210576424.3A CN201210576424A CN103902565A CN 103902565 A CN103902565 A CN 103902565A CN 201210576424 A CN201210576424 A CN 201210576424A CN 103902565 A CN103902565 A CN 103902565A
Authority
CN
China
Prior art keywords
sql statement
app
mark
sqlmap
relation
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
CN201210576424.3A
Other languages
Chinese (zh)
Other versions
CN103902565B (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.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210576424.3A priority Critical patent/CN103902565B/en
Publication of CN103902565A publication Critical patent/CN103902565A/en
Application granted granted Critical
Publication of CN103902565B publication Critical patent/CN103902565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and device for determining a data access relation. The method and device are used for solving the problem that the efficiency and accuracy of determining the data access relation in the prior art are low. The method comprises the steps that a server scans the codes of APPs, an sql statement called by the APPs is determined and analyzed, the table identifier of a table accessed by the sql statement and the application identifiers of the APPs are determined, the database identifier of a database which the table belongs to is determined according to pre-stored metadata, and the corresponding relation among the application identifiers of the APPs, the table identifier of the table and the database identifier of the database which the table belongs to is built and stored. Through the method, the server can automatically determine the data access relation of the APPs, the codes of the APPs do not need to be analyzed manually, human errors cannot be introduced, and therefore the efficiency and accuracy of determining the data access relation can be effectively improved.

Description

A kind of definite method and device of data access relation
Technical field
The application relates to communication technical field, relates in particular to a kind of definite method and device of data access relation.
Background technology
Database in early days and application (Application, APP) in framework, for the fast development of business is provided, often to meet the soonest business demand as object, therefore in early stage design, the data of multiple APP all can be stored together, that is, by the deposit data of a large amount of APP in a small amount of several databases.
But along with the high speed development of business, business also increases gradually to the demand of database volume.In the time will carrying out dilatation to database by the mode of split database, just need to split the access relation of the data in each database according to each APP, to avoid split database to affect the normal operation of APP afterwards.
In the prior art, determine that the method for the access relation of APP to the data in database is: by the code in the each APP of manual analysis, determine an APP need to conduct interviews to which table (table) in which database.
Obviously, in prior art, the efficiency of specified data access relation is lower, especially in the time that APP is larger, need to expend the data access relation of definite these APP of a large amount of manpowers and time, and manually specified data access relation is also introduced mistake possibly, causes the accuracy of established data access relation lower.
Summary of the invention
The embodiment of the present application provides a kind of definite method and device of data access relation, in order to solve efficiency and the lower problem of accuracy of specified data access relation in prior art.
Definite method of a kind of data access relation that the embodiment of the present application provides, comprising:
The code of server scanning application APP, according to the code of described APP, determines the Structured Query Language (SQL) sql statement that described APP calls; And
Definite sql statement is resolved, determine the table mark of the table table that described sql statement accesses and the application identities of described APP; And
According to the each table comprising in the metadata of preserving in advance and the subordinate relation of database, determine the affiliated wide area information server mark of table that described sql statement is accessed;
The corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access is set up and stored to described server.
The determining device of a kind of data access relation that the embodiment of the present application provides, comprising:
Statement determination module, for scanning the code of application APP, according to the code of described APP, determines the Structured Query Language (SQL) sql statement that described APP calls;
Parsing module, resolves for the sql statement to definite, determines the table mark of the table table that described sql statement accesses and the application identities of described APP;
Database determination module, each table that the metadata of preserving in advance for basis comprises and the subordinate relation of database, determine the affiliated wide area information server mark of table that described sql statement is accessed;
Relation is set up module, for setting up and store the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access.
The embodiment of the present application provides a kind of definite method and device of data access relation, the code of the method server scan A PP, determine the sql statement that APP calls and resolve, determine the table mark of the table that this sql statement accesses and the application identities of this APP, according to the metadata of preserving in advance, determine the wide area information server mark under this table, set up and store the corresponding relation of the wide area information server mark under table mark, this table of application identities, this table of this APP.By said method, server can be determined the data access relation of each APP automatically, without the code of manual analysis APP, can not introduce mistake, therefore can effectively improve efficiency and the accuracy of specified data access relation.
Accompanying drawing explanation
The deterministic process of the data access relation that Fig. 1 provides for the embodiment of the present application;
The corresponding relation schematic diagram of application identities that Fig. 2 provides for the embodiment of the present application, sqlmap, sql statement, table mark, schema, Database Identification;
The mark of the table according to table to be checked that Fig. 3 provides for the embodiment of the present application, the schematic diagram of inquiry sqlmap;
Definite apparatus structure schematic diagram of the data access relation that Fig. 4 provides for the embodiment of the present application.
Embodiment
The embodiment of the present application is in order to improve efficiency and the accuracy of specified data access relation, by the code of server scan A PP, determine Structured Query Language (SQL) (the Structured Query Language that APP calls, sql) statement parsing, determine the table mark of the table (table) that this sql statement accesses and the application identities of this APP, again according to the metadata of preserving in advance, determine that the wide area information server under this table identifies, set up and store the application identities of this APP, the table mark of this table, the corresponding relation of the wide area information server mark under this table.
Below in conjunction with Figure of description, the embodiment of the present application is described in detail.
The deterministic process of the data access relation that Fig. 1 provides for the embodiment of the present application, specifically comprises the following steps:
S101: the code of server scan A PP, according to the code of this APP, determine the sql statement that this APP calls.
In the embodiment of the present application, by server, the code of the each APP in system is scanned.Concrete, server, for the each APP in system, can scan by the script based on shell language the code of this APP, and determines the sql statement that this APP calls accordingly.
Wherein, due under Ibatis framework, the sql statement that APP calls is generally included in the sqlmap that this APP is corresponding, and sqlmap is generally with extend markup language (Extensible Markup Language, XML) form is organized, therefore, server has scanned after the code of an APP, can be according to the code of this APP, determine the XML file that this APP is corresponding, determine the sqlmap comprising in this XML file, and the sql statement comprising in this sqlmap is defined as to the sql statement that this APP calls.
When server is determined the sql statement comprising in this sqlmap, can determine by the regular expression based on perl language.If comprise multiple sqlmap in XML file corresponding to this APP, in sqlmap, also comprise multiple sql statements, server, for each sqlmap, is all defined as by all sql statements that comprise in this sqlmap the sql statement that this APP calls.
S102: definite sql statement is resolved, determine the table mark of the table that this sql statement accesses and the application identities of this APP.
Server is for the each APP in system, determined after the sql statement that this APP calls, and can resolve this sql statement, to determine the table mark of the table that this sql statement accessed and to call the application identities of the APP of this sql statement.
Concrete, server can first be determined the type of this sql statement, again according to default analytic method corresponding to the type with this sql statement, this sql statement is resolved, and determine the table mark of the table that this sql statement accesses and call the application identities of the APP of this sql statement by the regular expression based on perl language.
S103: according to the each table comprising in the metadata of preserving in advance and the subordinate relation of database, determine the affiliated wide area information server mark of table that this sql statement is accessed.
In the embodiment of the present application, server has been preserved metadata in advance, the subordinate relation that has comprised each table and each database in this metadata, and also, by this metadata, server can know in which database, to have comprised which table.Therefore, server determined by step S102 after the table mark of the table that this sql statement accesses, can determine the wide area information server mark under the table that this sql statement accesses according to this metadata.
S104: the corresponding relation of the wide area information server mark under table mark, the table that this sql statement is accessed of the application identities of this APP, table that this sql statement is accessed is set up and stored to server.
By above-mentioned steps S101 ~ S103, server has been determined the wide area information server mark under table mark, the table that this sql language is accessed of sql language that this APP calls, table that this sql language is accessed, therefore, server is set up above-mentioned three's corresponding relation storage.In the time of follow-up split database, can, by the above-mentioned three's that preserves in this server corresponding relation, know fast which table which APP has accessed, and which database these table belong to again, with thinking that split database provides foundation.
Pass through said method, server can be determined the data access relation of each APP in system automatically, without the code of manual analysis APP, can not introduce mistake, therefore effectively raise efficiency and the accuracy of specified data access relation, especially in the time that APP is larger in system, adopt said method to determine that the data access relation of each APP can save a large amount of manpowers and time.
Preferably, due in above-mentioned steps S102, server is in the time determining the sql statement that an APP calls, it is the XML file of first determining that this APP is corresponding, determine again the sqlmap comprising in this XML file, finally the sql statement comprising in this sqlmap is defined as to sql statement that this APP calls, therefore, in above-mentioned steps S104, server also can be set up the application identities of this APP, the sqlmap comprising in XML file corresponding to this APP, the sql statement comprising in this sqlmap, the table mark of the table that this sql statement is accessed, the corresponding relation of the wide area information server mark under the table that this sql statement is accessed, and storage.
In addition, in above-mentioned steps S102, server is after resolving sql statement, except determining the table mark of this sql table that statement is accessed and the application identities of this APP, can also determine the store path of the affiliated sqlmap of this sql statement, and preserve the store path of the sqlmap under this sql statement.
Pass through said method, if the sql statement that APP calls goes wrong, can be according to this corresponding relation of the application identities of preserving in server, sqlmap, sql statement, table mark, Database Identification, navigate to fast sqlmap under the sql statement that goes wrong, call the APP of this sql statement, the table that this sql statement is accessed and affiliated database thereof, solve so that contact the developer of corresponding APP the problem that this sql statement occurs.Can also be according to the sqlmap under this sql statement of going wrong, and the store path of this sqlmap preserving, navigate to fast the memory location of this sql.
Further, in the metadata that server is preserved in advance, specifically comprise the subordinate relation of each table and each schema, and the subordinate relation of each schema and each database, wherein, the user name that schema in a database is equivalent to register in this database, a table belongs to a schema and represents that this user name (schema) has the access rights to this table.Also be, an APP is in the time of the table accessing in certain database, first in the XML file of this APP self correspondence, search sqlmap, call in this sqlmap corresponding sql statement, then conduct interviews by this sql statement of calling and a user name (schema) that register in this database and that there are the access rights to this table.
Therefore, in the step S103 shown in Fig. 1, server determines that the method for the wide area information server mark under the table that sql statement accesses is specifically as follows: server is first according to the each table comprising in the metadata of preserving in advance and the subordinate relation of schema, determine the affiliated schema of table that this sql statement is accessed, again according to the each schema comprising in this metadata and the subordinate relation of database, determine the wide area information server mark that includes the schema under the table that this sql statement accesses.Wherein, server can travel through the schema and the each schema that in each database, register in advance can access the table of (having access rights), determines accordingly and Preservation Metadata.
Accordingly, in step S104, server can be set up schema under table mark, the table that this sql statement is accessed of the sql statement that comprises in the application identities, this sqlmap, this sqlmap of this APP, table that this sql statement is accessed, include the corresponding relation of the wide area information server mark of the schema under the table that this sql statement accesses, and this corresponding relation is stored in relational database.
Definite method of above-mentioned data access relation is described, as shown in Figure 2 below with an instantiation.
The corresponding relation schematic diagram of application identities that Fig. 2 provides for the embodiment of the present application, sqlmap, sql statement, table mark, schema, Database Identification.
In Fig. 2, the APP that is APP_A for application identities, server first scans the code of this APP, determines the XML file that this APP is corresponding, determines that the sqlmap comprising in this XML file is respectively: sqlmap1, sqlmap2, sqlmap3.
Then, server is determined and in sqlmap1, is comprised sql statement 1, in sqlmap2, comprise sql statement 2 and sql statement 3, in sqlmap3, comprise sql statement 4, determine the sql statement that sql statement 1, sql statement 2, sql statement 3, sql statement 4 these four sql statements call for this APP.
Next, server is resolved these four sql statements respectively, determines following information:
The table of the table that sql statement 1 is accessed is designated table1, and the application identities of calling the APP of sql statement 1 is APP_A, the store path of the sqlmap1 at sql statement 1 place;
The table of the table that sql statement 2 is accessed is designated table2, and the application identities of calling the APP of sql statement 2 is APP_A, the store path of the sqlmap2 at sql statement 2 places;
The table of the table that sql statement 3 is accessed is designated table3, and the application identities of calling the APP of sql statement 3 is APP_A, the store path of the sqlmap2 at sql statement 3 places;
The table of the table that sql statement 4 is accessed is designated table4, and the application identities of calling the APP of sql statement 4 is APP_A, the store path of the sqlmap3 at sql statement 4 places.
Determine after above-mentioned information, server, according to the metadata of preserving in advance, determines that table1, table2, table3 all belong to schema1, and the wide area information server under schema1 is designated DB_A, table4 belongs to schema5, and the wide area information server under schema5 is designated DB_B.
Finally, the corresponding foundation of server is also stored above-mentioned application identities (APP_A), sqlmap(sqlmap1, sqlmap2, sqlmap3), sql statement (sql statement 1, sql statement 2, sql statement 3, sql statement 4), table mark (table1, table2, table3, table4), schema(schema1, schema5), the corresponding relation of Database Identification (DB_A, DB_B), and preserve the store path of sqlmap1, sqlmap2, sqlmap3.
When setting up and storing above-mentioned corresponding relation, can set up and store by method as shown in table 1.
Database Identification schema Table mark Sql statement sqlmap Application identities
DB_A schema1 table1 Sql statement 1 sqlmap1 APP_A
DB_A schema1 table2 Sql statement 2 sqlmap2 APP_A
DB_A schema1 table3 Sql statement 3 sqlmap2 APP_A
DB_B schema5 table4 Sql statement 4 sqlmap3 APP_A
Table 1
As shown in table 1, server, for every a line in table 1, is set up corresponding relation the storage of 6 information in this row, the data access relation that can store APP_A.
Similarly, the APP that is APP_B for application identities in Fig. 2, server also carries out above-mentioned processing, finally sets up and store the data access relation of APP_B, just repeats no longer one by one here.
In addition, in the embodiment of the present application, after server is stored in relational database by above-mentioned corresponding relation, can also inquire about and show corresponding corresponding relation.Concrete, in the time that server receives inquiry request, according to the information to be checked of carrying in this inquiry request, in this relational database, inquiry has other information of corresponding relation and shows with this information to be checked, wherein, this information to be checked comprises: at least one in application identities to be checked, sqlmap, sql statement, table mark, schema, Database Identification; Other information with this information to be checked with corresponding relation comprise: have at least one in application identities, sqlmap, sql statement, table mark, schema, the Database Identification of corresponding relation with this information to be checked.
In said process, server can be by being related to that the fuzzy matching algorithm of server inquires about other information with information to be checked with corresponding relation, in the time that other information that inquire comprise sqlmap, can also inquire about store path the displaying of this sqlmap of preservation.When other information that server inquires in displaying, can show other information that inquire by the web page based on java language.
Can be found out by above-mentioned Fig. 2, be similar to this APP each link to each database from the data access relation object of an APP, have 6 nodes that interlink on every link, these 6 nodes are exactly the information that in table 1,6 in every a line have corresponding relation.For example, have 3 links from APP_A to database A, these 3 articles of links are exactly respectively 2nd ~ 4 row in table 1, and APP_A has 1 link to database B, and this article of link is exactly the 5th row in table 1.Thus, server is in the time receiving inquiry request, can be using information to be checked as a node to be checked, and determine all links that comprise this node to be checked, finally there are other information of corresponding relation using other nodes except this node to be checked in all links of determining as what inquire with this information to be checked.
Certainly, also only inquiry and this information to be checked have other information corresponding relation and specified type to server.
The table that for example: the application identities that information to be checked is APP to be checked, only inquiry and this application identities to be checked have the sqlmap that this APP of sqlmap(of corresponding relation calls), sql statement (the sql statement that this APP calls), this APP of table(access), when this APP access of schema(table based on schema);
Information to be checked is sql statement to be checked, and only inquiry and this sql statement to be checked have the affiliated sqlmap of this sql statement of sqlmap(of corresponding relation) and application identities (calling the application identities of the APP of this sql statement);
Information to be checked is the table mark of table, and only inquiry and this table mark have the application identities (accessing the application identities of the APP of this table) of corresponding relation and sqlmap(and access the affiliated sqlmap of sql statement of this table);
Information to be checked is schema to be checked, and only inquiry and this schema to be checked have the application identities (application identities of the APP based on this schema access table) of corresponding relation.
The mark of the table according to table to be checked that Fig. 3 provides for the embodiment of the present application, the schematic diagram of inquiry sqlmap, in Fig. 3, in the query interface that user can provide at server, input the table mark of table to be checked, and click is for inquiring about the function button of sqlmap, i.e. " query_file " button, server lookup displaying identify sqlmap and the store path thereof with corresponding relation with the table of this table to be checked.
Definite method of the data access relation providing for the embodiment of the present application above, based on same thinking, the embodiment of the present application also provides a kind of determining device of data access relation, as shown in Figure 4.
Definite apparatus structure schematic diagram of the data access relation that Fig. 4 provides for the embodiment of the present application, specifically comprises:
Statement determination module 401, for scanning the code of application APP, according to the code of described APP, determines the Structured Query Language (SQL) sql statement that described APP calls;
Parsing module 402, resolves for the sql statement to definite, determines the table mark of the table table that described sql statement accesses and the application identities of described APP;
Database determination module 403, each table that the metadata of preserving in advance for basis comprises and the subordinate relation of database, determine the affiliated wide area information server mark of table that described sql statement is accessed;
Relation is set up module 404, for setting up and store the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access.
Described statement determination module 401 specifically for, according to described APP code, determine the expandable mark language XML file that described APP is corresponding, determine the sqlmap comprising in described XML file, the sql statement comprising in described sqlmap is defined as to the sql statement that described APP calls;
Described relation set up module 404 specifically for, set up and store the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access.
Described parsing module 402 specifically for, definite sql statement is resolved, determine the store path of the sqlmap under application identities and the described sql statement of the table mark of the table that described sql statement accesses, described APP;
Described relation set up module 404 also for, preserve the store path of the sqlmap under described sql statement.
Described database determination module 403 specifically for, according to the each table comprising in the metadata of preserving in advance and the subordinate relation of schema, determine the affiliated schema of table that described sql statement is accessed, and according to each schema of comprising and the subordinate relation of database in the metadata of preserving in advance, determine the wide area information server mark that includes the schema under the table that described sql statement accesses.
Described relation set up module 404 specifically for, set up schema under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access, include the corresponding relation of the wide area information server mark of the schema under the table that described sql statement accesses, and described corresponding relation is stored in relational database.
Described device also comprises:
Enquiry module 405, in the time receiving inquiry request, according to the information to be checked of carrying in described inquiry request, in described relational database, inquiry has other information of corresponding relation and shows with described information to be checked; Wherein, described information to be checked comprises: at least one in application identities to be checked, sqlmap, sql statement, table mark, schema, Database Identification; Other information with described information to be checked with corresponding relation comprise: have at least one in application identities, sqlmap, sql statement, table mark, schema, the Database Identification of corresponding relation with described information to be checked.
The determining device of concrete above-mentioned data access relation can be arranged in server.
The embodiment of the present application provides a kind of definite method and device of data access relation, the code of the method server scan A PP, determine the sql statement that APP calls and resolve, determine the table mark of the table that this sql statement accesses and the application identities of this APP, according to the metadata of preserving in advance, determine the wide area information server mark under this table, set up and store the corresponding relation of the wide area information server mark under table mark, this table of application identities, this table of this APP.By said method, server can be determined the data access relation of each APP automatically, without the code of manual analysis APP, can not introduce mistake, therefore can effectively improve efficiency and the accuracy of specified data access relation.
Those skilled in the art should understand, the application's embodiment can be provided as method, system or computer program.Therefore, the application can adopt complete hardware implementation example, completely implement software example or the form in conjunction with the embodiment of software and hardware aspect.And the application can adopt the form at one or more upper computer programs of implementing of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) that wherein include computer usable program code.
The application is with reference to describing according to process flow diagram and/or the block scheme of the method for the embodiment of the present application, equipment (system) and computer program.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, the instruction that makes to carry out by the processor of computing machine or other programmable data processing device produces the device for realizing the function of specifying at flow process of process flow diagram or multiple flow process and/or square frame of block scheme or multiple square frame.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function of specifying in flow process of process flow diagram or multiple flow process and/or square frame of block scheme or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computing machine or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function of specifying in flow process of process flow diagram or multiple flow process and/or square frame of block scheme or multiple square frame on computing machine or other programmable devices.
Although described the application's preferred embodiment, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to be interpreted as comprising preferred embodiment and fall into all changes and the modification of the application's scope.
Obviously, those skilled in the art can carry out various changes and modification and the spirit and scope that do not depart from the application to the application.Like this, if within these of the application are revised and modification belongs to the scope of the application's claim and equivalent technologies thereof, the application is also intended to comprise these changes and modification interior.

Claims (12)

1. a definite method for data access relation, is characterized in that, comprising:
The code of server scanning application APP, according to the code of described APP, determines the Structured Query Language (SQL) sql statement that described APP calls; And
Definite sql statement is resolved, determine the table mark of the table table that described sql statement accesses and the application identities of described APP; And
According to the each table comprising in the metadata of preserving in advance and the subordinate relation of database, determine the affiliated wide area information server mark of table that described sql statement is accessed;
The corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access is set up and stored to described server.
2. the method for claim 1, is characterized in that, according to the code of described APP, determines the sql statement that described APP calls, and specifically comprises:
According to described APP code, determine the expandable mark language XML file that described APP is corresponding;
Determine the sqlmap comprising in described XML file, the sql statement comprising in described sqlmap is defined as to the sql statement that described APP calls;
The corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access is set up and stored to described server, specifically comprises:
The corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access is set up and stored to described server.
3. method as claimed in claim 2, is characterized in that, definite sql statement is resolved, and determines the table mark of the table that described sql statement accesses and the application identities of described APP, specifically comprises:
Definite sql statement is resolved, determine the store path of the sqlmap under application identities and the described sql statement of the table mark of the table that described sql statement accesses, described APP;
Described method also comprises:
Described server is preserved the store path of the sqlmap under described sql statement.
4. method as claimed in claim 2, is characterized in that, according to the each table comprising in the metadata of preserving in advance and the subordinate relation of database, determines the affiliated wide area information server mark of table that described sql statement is accessed, and specifically comprises:
According to the each table comprising in the metadata of preserving in advance and the subordinate relation of schema, determine the affiliated schema of table that described sql statement is accessed; And
According to each schema of comprising and the subordinate relation of database in the metadata of preserving in advance, determine the wide area information server mark that includes the schema under the table that described sql statement accesses.
5. method as claimed in claim 4, it is characterized in that, the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access is set up and stored to described server, specifically comprises:
Described server sets up schema under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access, include the corresponding relation of the wide area information server mark of the schema under the table that described sql statement accesses; And
Described corresponding relation is stored in relational database.
6. method as claimed in claim 5, is characterized in that, described method also comprises:
In the time that described server receives inquiry request, according to the information to be checked of carrying in described inquiry request, in described relational database, inquiry has other information of corresponding relation and shows with described information to be checked, wherein, described information to be checked comprises: at least one in application identities to be checked, sqlmap, sql statement, table mark, schema, Database Identification; Other information with described information to be checked with corresponding relation comprise: have at least one in application identities, sqlmap, sql statement, table mark, schema, the Database Identification of corresponding relation with described information to be checked.
7. a determining device for data access relation, is characterized in that, comprising:
Statement determination module, for scanning the code of application APP, according to the code of described APP, determines the Structured Query Language (SQL) sql statement that described APP calls;
Parsing module, resolves for the sql statement to definite, determines the table mark of the table table that described sql statement accesses and the application identities of described APP;
Database determination module, each table that the metadata of preserving in advance for basis comprises and the subordinate relation of database, determine the affiliated wide area information server mark of table that described sql statement is accessed;
Relation is set up module, for setting up and store the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the application identities of described APP, described sql statement access.
8. device as claimed in claim 7, it is characterized in that, described statement determination module specifically for, according to described APP code, determine the expandable mark language XML file that described APP is corresponding, determine the sqlmap comprising in described XML file, the sql statement comprising in described sqlmap is defined as to the sql statement that described APP calls;
Described relation set up module specifically for, set up and store the corresponding relation of the wide area information server mark under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access.
9. device as claimed in claim 8, it is characterized in that, described parsing module specifically for, definite sql statement is resolved, determine the store path of the sqlmap under application identities and the described sql statement of the table mark of the table that described sql statement accesses, described APP;
Described relation set up module also for, preserve the store path of the sqlmap under described sql statement.
10. device as claimed in claim 8, it is characterized in that, described database determination module specifically for, according to the each table comprising in the metadata of preserving in advance and the subordinate relation of schema, determine the affiliated schema of table that described sql statement is accessed, and according to each schema of comprising and the subordinate relation of database in the metadata of preserving in advance, determine the wide area information server mark that includes the schema under the table that described sql statement accesses.
11. devices as claimed in claim 10, it is characterized in that, described relation set up module specifically for, set up schema under table mark, the table that described sql statement is accessed of the table that the sql statement comprising in the application identities of described APP, described sqlmap, described sqlmap, described sql statement access, include the corresponding relation of the wide area information server mark of the schema under the table that described sql statement accesses, and described corresponding relation is stored in relational database.
12. devices as claimed in claim 11, is characterized in that, described device also comprises:
Enquiry module, in the time receiving inquiry request, according to the information to be checked of carrying in described inquiry request, in described relational database, inquiry has other information of corresponding relation and shows with described information to be checked; Wherein, described information to be checked comprises: at least one in application identities to be checked, sqlmap, sql statement, table mark, schema, Database Identification; Other information with described information to be checked with corresponding relation comprise: have at least one in application identities, sqlmap, sql statement, table mark, schema, the Database Identification of corresponding relation with described information to be checked.
CN201210576424.3A 2012-12-26 2012-12-26 A kind of determination method and device of data access relation Active CN103902565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210576424.3A CN103902565B (en) 2012-12-26 2012-12-26 A kind of determination method and device of data access relation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210576424.3A CN103902565B (en) 2012-12-26 2012-12-26 A kind of determination method and device of data access relation

Publications (2)

Publication Number Publication Date
CN103902565A true CN103902565A (en) 2014-07-02
CN103902565B CN103902565B (en) 2017-11-24

Family

ID=50993893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210576424.3A Active CN103902565B (en) 2012-12-26 2012-12-26 A kind of determination method and device of data access relation

Country Status (1)

Country Link
CN (1) CN103902565B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445795A (en) * 2016-09-26 2017-02-22 中国工商银行股份有限公司 Method and device for detecting efficiency of database SQL
CN107633016A (en) * 2017-08-23 2018-01-26 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN112883048A (en) * 2019-11-29 2021-06-01 阿里巴巴集团控股有限公司 Data access method, device, server and readable storage medium
CN113806575A (en) * 2021-08-05 2021-12-17 北京房江湖科技有限公司 Method and device for obtaining picture information in warehouse splitting
CN115618342A (en) * 2022-12-19 2023-01-17 深圳昂楷科技有限公司 Method, device, equipment and storage medium for identifying tool name of access database
CN110110150B (en) * 2018-01-04 2023-07-07 北大医疗信息技术有限公司 XML data reading method, reading device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567301A (en) * 2003-06-23 2005-01-19 华为技术有限公司 Method and apparatus for accessing database
US20080281802A1 (en) * 2006-03-03 2008-11-13 International Business Machines Corporation Building A Unified Query That Spans Heterogeneous Environments
CN101727459A (en) * 2008-10-16 2010-06-09 上海宝信软件股份有限公司 WEB-based data exchange system and method applicable to distributed database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567301A (en) * 2003-06-23 2005-01-19 华为技术有限公司 Method and apparatus for accessing database
US20080281802A1 (en) * 2006-03-03 2008-11-13 International Business Machines Corporation Building A Unified Query That Spans Heterogeneous Environments
CN101727459A (en) * 2008-10-16 2010-06-09 上海宝信软件股份有限公司 WEB-based data exchange system and method applicable to distributed database

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445795A (en) * 2016-09-26 2017-02-22 中国工商银行股份有限公司 Method and device for detecting efficiency of database SQL
CN106445795B (en) * 2016-09-26 2019-03-22 中国工商银行股份有限公司 A kind of database SQL Efficiency testing method and device
CN107633016A (en) * 2017-08-23 2018-01-26 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN107633016B (en) * 2017-08-23 2020-11-24 创新先进技术有限公司 Data processing method and device and electronic equipment
CN110110150B (en) * 2018-01-04 2023-07-07 北大医疗信息技术有限公司 XML data reading method, reading device, computer equipment and storage medium
CN112883048A (en) * 2019-11-29 2021-06-01 阿里巴巴集团控股有限公司 Data access method, device, server and readable storage medium
CN112883048B (en) * 2019-11-29 2024-06-04 阿里巴巴集团控股有限公司 Data access method, device, server and readable storage medium
CN113806575A (en) * 2021-08-05 2021-12-17 北京房江湖科技有限公司 Method and device for obtaining picture information in warehouse splitting
CN113806575B (en) * 2021-08-05 2024-02-20 贝壳找房(北京)科技有限公司 Picture information acquisition method and device in warehouse splitting
CN115618342A (en) * 2022-12-19 2023-01-17 深圳昂楷科技有限公司 Method, device, equipment and storage medium for identifying tool name of access database
CN115618342B (en) * 2022-12-19 2023-03-28 深圳昂楷科技有限公司 Method, device, equipment and storage medium for identifying tool name of access database

Also Published As

Publication number Publication date
CN103902565B (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN107480198B (en) Distributed NewSQL database system and full-text retrieval method
CN110908997B (en) Data blood relationship construction method and device, server and readable storage medium
CN103902565A (en) Method and device for determining data access relation
US8935575B2 (en) Test data generation
EP3254191B1 (en) Apparatus and method for using parameterized intermediate representation for just-in-time compilation in database query execution engine
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
CN105022739B (en) The storage method and device of data
CN103810224A (en) Information persistence and query method and device
CN102985922A (en) Method and apparatus for managing distributed computations within a computation space
CN110866029B (en) sql statement construction method, device, server and readable storage medium
CN114691786A (en) Method and device for determining data blood relationship, storage medium and electronic device
CN110019111B (en) Data processing method, data processing device, storage medium and processor
CN103605848A (en) Method and device for analyzing paths
CN102999600A (en) Method and system for automatically generating embedded database
CN104462429A (en) Method and device for generating database query sentences
CN102915344A (en) SQL (structured query language) statement processing method and device
US10324933B2 (en) Technique for processing query in database management system
CN104243565A (en) Method and device for obtaining configuration data
CN108549688B (en) Data operation optimization method, device, equipment and storage medium
CN102004633A (en) Method and device for processing control property
CN111046066A (en) Method, device and equipment for optimizing remote database object and storage medium
CN116414898A (en) Database access method and device, electronic equipment and storage medium
CN116049232A (en) Sub-query extraction method, sub-query extraction device, electronic equipment and storage medium
CN115357606A (en) Data source query method, system, computer equipment and storage medium
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data

Legal Events

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

Effective date of registration: 20191211

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox

Patentee before: Alibaba Group Holding Co., Ltd.