Data access method, device and electronic equipment

By receiving and processing metadata requests, sending database and data table names to the client, abstracting data sources and performing data access, it solves the problem of high operating costs caused by different storage methods and achieves efficient access and synchronization of different data sources.

CN112115122BActive Publication Date: 2024-08-30BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010989135.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-18
Publication Date
2024-08-30
Estimated Expiration
2040-09-18

AI Technical Summary

Technical Problem

Due to the different storage methods of each data source, the operation cost for users to access data from data sources with different storage methods is high.

Method used

By receiving the metadata acquisition request sent by the client, the database name and data table name are sent to the client, so that the client abstracts the data source to be accessed into a database and data table, and performs data access based on the database and data table to achieve data synchronization and Preview.

Benefits of technology

The operating cost of data access is reduced, so that users do not need to pay attention to different storage methods, and can access and synchronize data in data sources with different storage methods through abstract databases and data tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112115122B
    Figure CN112115122B
Patent Text Reader

Abstract

The embodiment of the present invention provides a data access method, device and electronic device, including: receiving a metadata acquisition request for a data source to be accessed sent by a client, and sending the database name and data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table. Since the data in the data source can be stored based on the database name and the data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can perform data access to the data stored in the data source with different storage methods by operating the database and the data table abstracted by the client, thereby reducing the operation cost of performing data access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data access method, device and electronic equipment. Background Art

[0002] With the rapid development of the Internet and the popularization and deepening of computer technology, enterprises need to store business data in data sources with different storage methods according to factors such as the type, usage, and application scenarios of business data during the process of informatization construction.

[0003] As the enterprise develops, it often needs to access business data stored in different data sources.

[0004] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0005] Due to the different storage methods among various data sources, the data access operations performed by users on data sources with different storage methods are different, resulting in high operational costs for data access. Summary of the invention

[0006] The purpose of the embodiment of the present invention is to provide a data access method to reduce the operation cost of data access. The specific technical solution is as follows:

[0007] An embodiment of the present invention provides a data access method, which is applied to a server and includes:

[0008] receiving a metadata acquisition request for a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0009] The database name and the data table name in the metadata of the data source to be accessed are sent to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table.

[0010] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0011] Furthermore, the method further comprises:

[0012] Receive a data synchronization request sent by the client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstracted database, a data table name of a source data table selected from the abstracted data table belonging to the source database, and a data table name of a target data table selected from the abstracted data table belonging to the target database;

[0013] Determine the source data end for data synchronization according to the first storage identification information, wherein the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table;

[0014] Determine the target data end to be synchronized according to the second storage identification information, wherein the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table;

[0015] Data synchronization is performed on the source data end and the target data end.

[0016] Further, the synchronizing the data between the source data end and the target data end includes:

[0017] Determining whether the read permission of the source data end is available based on the permission information carried in the data synchronization request;

[0018] When having the read permission of the source data end, reading the data of the source data end;

[0019] Determining whether the write permission of the target data terminal is available based on the permission information;

[0020] When the write permission of the target data end is obtained, the read data is synchronized to the target data end.

[0021] Further, judging whether the read permission of the source data terminal is available based on the permission information carried in the data synchronization request includes:

[0022] Determine whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request; or, determine whether the target project has obtained the read permission granted by the source end project; wherein the source end project is the project to which the source data end belongs;

[0023] The determining whether the user has the write permission of the target data terminal includes:

[0024] Determine whether the target data end belongs to the target project associated with the permission information; or, determine whether the target project has obtained the write permission granted by the target data end; wherein the target end project is the project to which the target data end belongs.

[0025] Furthermore, the method further comprises:

[0026] Receiving a data preview request sent by the client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed;

[0027] According to the third storage identification information, the data to be previewed is acquired, wherein the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0028] The acquired data to be previewed is sent to the client, so that the client can preview the data.

[0029] An embodiment of the present invention provides a data access method, which is applied to a client and includes:

[0030] Sending a request for obtaining metadata of a data source to be accessed to a server, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0031] Receiving the database name and the data table name in the metadata of the data source to be accessed sent by the server;

[0032] Abstracting the data source to be accessed into a database and a data table according to the database name and the data table name;

[0033] Data access is performed according to the database and the data table.

[0034] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0035] Furthermore, the method further comprises:

[0036] Selecting a source database and a target database from the abstracted database, selecting a source data table from the abstracted data tables belonging to the source database, and selecting a target data table from the abstracted data tables belonging to the target database;

[0037] A data synchronization request including a database name of the source database, a database name of the destination database, a data table name of the source data table, and a data table name of the destination data table is sent to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on first storage identification information, the first storage identification information is information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on second storage identification information, the second storage identification information is information determined by the database name of the target database and the data table name of the target data table.

[0038] Furthermore, the method further comprises:

[0039] Selecting a database from the abstracted database as the database to be previewed, and selecting a data table from the data tables of the database to be previewed as the data table to be previewed;

[0040] Sending a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information, and sends the data to be previewed, wherein the data preview request includes: the database to be previewed and the data table to be previewed, and the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0041] The data to be previewed is received from the server, and data preview is performed.

[0042] An embodiment of the present invention provides a data access device, applied to a server, comprising:

[0043] a request receiving module, configured to receive a request for obtaining metadata of a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0044] A data sending module is used to send the database name and the data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and accesses data according to the database and the data table.

[0045] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0046] Furthermore, the device also includes:

[0047] A synchronization request receiving module, used to receive a data synchronization request sent by the client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstract database, a data table name of a source data table selected from the abstract data table belonging to the source database, and a data table name of a target data table selected from the abstract data table belonging to the target database;

[0048] A source data end determination module, used to determine a source data end for data synchronization according to first storage identification information, wherein the first storage identification information is information determined by a database name of the source database and a data table name of the source data table;

[0049] A target data end determination module, used to determine the target data end to be synchronized according to the second storage identification information, wherein the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table;

[0050] A data synchronization module is used to synchronize data between the source data end and the target data end.

[0051] Furthermore, the data synchronization module includes:

[0052] A read permission judgment submodule, used to judge whether the read permission of the source data end is possessed based on the permission information carried in the data synchronization request;

[0053] A data reading submodule, used for reading data from the source data end when having the read permission of the source data end;

[0054] A write permission judgment submodule, used to judge whether the write permission of the target data terminal is possessed based on the permission information;

[0055] The data writing submodule is used to synchronize the read data to the target data end when the write permission of the target data end is obtained.

[0056] Further, the read permission judgment submodule specifically judges whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request; or, judges whether the target project has obtained the read permission granted by the source end project; wherein the source end project is the project to which the source data end belongs;

[0057] The write permission judgment submodule is specifically used to judge whether the target data terminal belongs to the target project associated with the permission information; or, to judge whether the target project has obtained the write permission granted by the target data terminal; wherein the target terminal project is the project to which the target data terminal belongs.

[0058] Furthermore, the device also includes:

[0059] A preview request receiving module, configured to receive a data preview request sent by the client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, wherein the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed;

[0060] A preview data acquisition module, used to acquire the data to be previewed according to the third storage identification information, wherein the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0061] The preview data sending module is used to send the acquired data to be previewed to the client so that the client can preview the data.

[0062] An embodiment of the present invention provides a data access device, applied to a client, comprising:

[0063] a request sending module, configured to send a request for obtaining metadata of a data source to be accessed to a server, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0064] A data receiving module, used for receiving the database name and the data table name in the metadata of the data source to be accessed sent by the server;

[0065] A database table abstraction module, used for abstracting the data source to be accessed into a database and a data table according to the database name and the data table name;

[0066] A data access module is used to access data according to the database and the data table.

[0067] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0068] Furthermore, the device also includes:

[0069] A synchronization database table selection module is used to select a source database and a target database from the abstracted database, select a source data table from the abstracted data table belonging to the source database, and select a target data table from the abstracted data table belonging to the target database;

[0070] A synchronization request sending module is used to send a data synchronization request including the database name of the source database, the database name of the destination database, the data table name of the source data table and the data table name of the destination data table to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on first storage identification information, the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on second storage identification information, the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table.

[0071] Furthermore, the device also includes:

[0072] A preview database table selection module is used to select a database from the abstracted database as the database to be previewed, and select a data table from the data tables of the database to be previewed as the data table to be previewed;

[0073] a preview request sending module, configured to send a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information, and sends the data to be previewed, wherein the data preview request includes: the database to be previewed and the data table to be previewed, and the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0074] The preview data receiving module is used to receive the preview data sent by the server and perform data preview.

[0075] An embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0076] Memory, used to store computer programs;

[0077] The processor is used to implement the steps of any of the above data access methods when executing the program stored in the memory.

[0078] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned data access methods are implemented.

[0079] An embodiment of the present invention also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above data access methods.

[0080] A data access method, device and electronic device provided by an embodiment of the present invention can store data in a data source based on a database name and a data table name configured in metadata of the data source, and a client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, so that a user can access data stored in data sources with different storage methods by operating the database and the data table abstracted by the client, thereby reducing the operating cost of data access.

[0081] Of course, it is not necessary to achieve all of the above advantages at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0083] Figure 1 A flow chart of a data access method applied to a server provided by an embodiment of the present invention;

[0084] Figure 2 A flow chart of a data access method applied to a client provided by an embodiment of the present invention;

[0085] Figure 3 A flow chart of a data synchronization method applied to a server provided by an embodiment of the present invention;

[0086] Figure 4 A flow chart of a data synchronization method applied to a server provided by another embodiment of the present invention;

[0087] Figure 5 A flow chart of a data preview method applied to a server provided by an embodiment of the present invention;

[0088] Figure 6 A flow chart of a data synchronization method applied to a client provided by an embodiment of the present invention;

[0089] Figure 7 A flowchart of a data preview method applied to a client provided by an embodiment of the present invention;

[0090] Figure 8 A schematic diagram of the structure of a data access device applied to a server provided by an embodiment of the present invention;

[0091] Fig. 9 A schematic diagram of the structure of a data synchronization device applied to a server provided by an embodiment of the present invention;

[0092] Fig.10A schematic diagram of the structure of a data synchronization device applied to a server provided by another embodiment of the present invention;

[0093] Fig.11 A schematic diagram of the structure of a data preview device applied to a server provided by an embodiment of the present invention;

[0094] Fig.12 A schematic diagram of the structure of a data access device applied to a client provided by an embodiment of the present invention;

[0095] Fig.13 A schematic diagram of the structure of a data synchronization device applied to a client provided by an embodiment of the present invention;

[0096] Fig.14 A schematic diagram of the structure of a data preview device applied to a client provided by an embodiment of the present invention;

[0097] Fig.15 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0098] Fig.16 A schematic structural diagram of an electronic device provided in another embodiment of the present invention. DETAILED DESCRIPTION

[0099] In order to provide an implementation scheme for reducing the operating cost of data access, the embodiments of the present invention provide a data access method, device and electronic device, and the embodiments of the present invention are described below in conjunction with the accompanying drawings of the specification. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.

[0100] In order to clearly explain the technical solution of the embodiment of the present invention, the embodiment of the present invention is briefly introduced as a whole.

[0101] As is well known to those skilled in the art, data sources can be divided into relational databases (such as MySQL, Oracle, etc.), HDFS (Hadoop Distributed File System), Hive, Hbase, etc. according to different storage methods.

[0102] The above-mentioned relational databases include: Oracle, MySQL and other data sources. For relational databases, the data stored therein mainly exists in tables with specific structures, as shown in Table 1:

[0103] Table 1

[0104] Student ID Name Title Borrowing time 1 Zhang San How to Plant Trees 2020-02-01

[0105] For data sources with different storage methods, due to the different storage methods between each data source, the user's data access operations for data sources with different storage methods are different. For example, for a data source belonging to a relational database, when accessing data, it is necessary to use SQL query statements to find the data to be accessed, while for other data sources, it may be necessary to access the data through indexes, resulting in high operational costs for data access when facing different data sources.

[0106] In an embodiment of the present invention, data in each data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, so that the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0107] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0108] In one embodiment of the present invention, a data access method applied to a server is provided. Figure 1 As shown, the method comprises the following steps:

[0109] S101: receiving a metadata acquisition request for a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name.

[0110] S102: Sending the database name and data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table.

[0111] The above-mentioned embodiment of the present invention provides Figure 1In the data access method applied to the server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0112] Accordingly, in one embodiment of the present invention, a data access method applied to a client is also provided, such as Figure 2 As shown, the method comprises the following steps:

[0113] S201: Sending a request for obtaining metadata of a data source to be accessed to a server, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name.

[0114] S202: Receive the database name and data table name in the metadata of the data source to be accessed sent by the server.

[0115] S203: Abstracting the data source to be accessed into a database and a data table according to the database name and the data table name.

[0116] S204: Access data according to the database and data table.

[0117] The above-mentioned embodiment of the present invention provides Figure 2 In the data access method applied to the client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0118] The above data source is a description of the data volume from the perspective of data transmission, that is, the source of the data. In the embodiment of the present invention, a data source can represent a data source with the same storage method, such as multiple MYSQL databases can be used as a data source.

[0119] In one embodiment, the data source to be accessed may be a data source that needs to be accessed and is selected by a user from multiple data sources. For example, there are data sources A, B, and C. When the client receives the user's information acquisition operation on data source A, data source A is the data source to be accessed. When data access to data source A is required, the client may send a metadata acquisition request for data source A to the server.

[0120] Optionally, the metadata acquisition request for the data source to be accessed may include the identifier of the data source to be accessed. After receiving the identifier of the data source to be accessed, the server may search for the metadata of the data source to be accessed through the identifier of the data source to be accessed, and then obtain the database name and data table name from the searched metadata. Optionally, each data table name in the metadata of the data source has a database name associated with it. In this case, the metadata includes data in the format of (database name.data table name). Exemplarily, the metadata of data source A includes: (database name 1.data table name 1), (database name 1.data table name 2) and (database name 2.data table name 3). Then, data table name 1 and data table name 2 are respectively associated with database name 1, and data table name 3 is associated with database name 2.

[0121] In one embodiment, data in a data source is stored according to storage identification information, wherein the storage identification information is information determined by a database name and a data table name. Optionally, the storage identification information may be expressed in different forms depending on the database storage method. When the data source is stored in a relational database manner, each data that needs to be stored is stored in a data table that matches the data table name and is contained in a database that matches the database name. For data sources such as HDFS, data can be stored in a manner that generates a data index based on the database name and the data table, i.e., the data in the data source to be accessed is stored using the storage identification information as an index.

[0122] After receiving the metadata acquisition request for the data source to be accessed sent by the client, the server may send the database name and data table name in the metadata of the data source to be stored to the client.

[0123] The client receives the database name and data table name in the metadata sent by the server to the client, and can abstract the data source to be accessed into a database and a data table based on the database name and the data table name, and access the data based on the database and the data table.

[0124] For example, the metadata of data source A includes three data: (database name 1.data table name 1), (database name 1.data table name 2) and (database name 2.data table name 3). When the client receives (database name 1.data table name 1), (database name 1.data table name 2) and (database name 2.data table name 3), it can abstract based on the database name and data table name. Database name 1 is abstracted into database 1, database name 2 is abstracted into database 2, data table name 1 is abstracted into data table 1 contained in database 1, data table name 2 is abstracted into data table 2 contained in database 1, and data table name 3 is abstracted into data table 3 contained in database 2.

[0125] Through the above-mentioned abstraction process, the client finally displays to the user the abstracted database and data table, that is, the user can only see and operate the database and data table, and does not need to care about the specific storage form of the data source. When the user operates the database and data table abstracted by the client, it is equivalent to operating the data stored in the data source according to the database name of the database and the data table name of the data table operated by the user. As a result, the user can access the data stored in the data sources with different storage methods by operating the database and data tables abstracted by the client. Therefore, the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0126] Based on the above data access method applied to the server, in one embodiment of the present invention, a data synchronization method applied to the server is also provided. Figure 3 As shown, the method comprises the following steps:

[0127] S301: Receive a data synchronization request sent by a client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstract database, a data table name of a source data table selected from a data table belonging to the source database obtained from the abstract, and a data table name of a target data table selected from a data table belonging to the target database obtained from the abstract.

[0128] In this step, the data synchronization request received by the server may be generated after the user performs synchronization configuration operations on the abstracted database and data table, wherein the synchronization configuration operation is used to select the source database and the target database from the abstracted database, and to select the source data table from the abstracted data table belonging to the source database, and to select the target data table from the abstracted data table belonging to the target database. Optionally, the user may first select the source database from each database, and then select the source data table from the data table belonging to the source database. Furthermore, the target database may be selected from each database, and then the target data table may be selected from the data table belonging to the target database.

[0129] After the client determines the source database, source data table, target database and target data table, it can send a data synchronization request including the source database, source data table, target database and target data table to the server.

[0130] S302: Determine a source data end for data synchronization according to first storage identification information, wherein the first storage identification information is information determined by a database name of a source database and a data table name of a source data table.

[0131] In this step, after receiving the data synchronization request sent by the client, the server can determine the first storage identification information based on the database name of the source database and the data table name of the source data table, and then determine the source data end to be synchronized based on the determined first storage identification information, wherein the source data end can be the starting address for data synchronization, or it can be the data itself to be synchronized.

[0132] Exemplarily, when the data source is a relational database type, when the database name of the source database is database 3 and the data table name of the source data table is data table 4, the source data end can be determined to be data table 4 contained in database 3 in the data source. When the data source is index storage, the source data end can be data stored according to the first storage identification information as the index.

[0133] S303: Determine the target data end for data synchronization according to the second storage identification information, wherein the second storage identification information is information determined by a database name of the target database and a data table name of the target data table.

[0134] This step is similar to determining the source data end, and will not be described in detail here. It should be noted that the embodiment of the present invention does not limit the execution order of step S302 and step S304. Step S302 can be executed first, or step S303 can be executed first, or S302 and S303 can be executed simultaneously. For convenience, Figure 3 Only the case where step S302 is executed first and then step S303 is given.

[0135] S304: Synchronize data between the source data end and the target data end.

[0136] In this step, after the source data end and the target data end are determined, data synchronization can be performed on the source data end and the target data end. Optionally, the data of the source data end can be read first and then written to the target data end, or the difference data between the target data end and the source data end can be synchronized.

[0137] The above-mentioned embodiment of the present invention provides Figure 3In the data synchronization method for a server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed as a database and a data table according to the database name and the data table name, the user can synchronize the data stored in data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data synchronization between different data sources.

[0138] In one embodiment of the present invention, another data synchronization method applied to a server is provided to implement the above step S304, such as Figure 4 As shown, the method comprises the following steps:

[0139] S401: Determine whether the read permission of the source data end is available based on the permission information carried in the data synchronization request.

[0140] In this step, before reading the data on the source data end, it is necessary to first determine whether the user has the read permission on the source data end. The permission information may include the account information of the registered user.

[0141] In one embodiment, it can be implemented by any of the following first and second methods:

[0142] The first method: determine whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request.

[0143] In this method, the source project is the project to which the source data end belongs.

[0144] When the source data end belongs to the target project associated with the permission information carried in the data synchronization request, it means that the target project has all permissions of the source data end, including adding, deleting, modifying and querying permissions, among which the query permission corresponds to the read permission, and the adding permission and modifying permission correspond to the write permission. Therefore, when the source data end belongs to the target project, it means that it has the read permission of the source data end.

[0145] The second method: Determine whether the target project has obtained the read permission granted by the source project, where the source project is the project to which the source data end belongs.

[0146] In this method, when the source data end does not belong to the target project, it can be determined whether the target project has obtained the read permission granted by the source end project.

[0147] As is well known to those skilled in the art, each project can authorize different projects, or apply for different permissions from other projects. After a project applies to other projects, it needs to be approved before it has the permissions it applied for. Therefore, when the target project has obtained the read permission granted by the source project, it means that the target project has the read permission of the source data end. Otherwise, it means that the target project does not have the read permission of the source data end.

[0148] When the user has the read permission of the source data terminal, step S402 may be executed. When the user does not have the read permission of the source data terminal, the user is prompted that the permission verification has not passed.

[0149] S402: Read data from the source data end.

[0150] In this step, when the source data end belongs to the project currently operated by the user, the reading plug-in can be called to read data from the source data end.

[0151] S403: Determine whether the write permission of the target data end is available based on the permission information.

[0152] This step can be implemented by any of the following methods:

[0153] The first method: determine whether the target data end belongs to the target project associated with the permission information.

[0154] The first method: determine whether the target project has obtained the write permission granted by the target data end; wherein the target end project is the project to which the target data end belongs.

[0155] Specifically, its implementation method is substantially the same as or similar to step S401 and will not be described in detail herein.

[0156] In one embodiment, when the user has the write permission for the target data terminal, step S404 may be executed. When the user does not have the write permission for the target data terminal, the user is prompted that the permission verification has failed.

[0157] S404: Synchronize the read data to the target data end.

[0158] In this step, when the user has the write permission of the target data end, the read plug-in can be called to read data from the source data end.

[0159] The above-mentioned embodiment of the present invention provides Figure 4 In the data synchronization method shown, since permission judgment is required before reading and writing data, the data stored in the data source can be made safe.

[0160] Corresponding to the above embodiments of the present invention Figure 3The data synchronization method applied to the server shown in the figure is based on the data access method applied to the client provided in the embodiment of the present invention. In one embodiment of the present invention, a data synchronization method applied to the client is also provided, such as Figure 5 As shown, the method comprises the following steps:

[0161] S501: Select a source database and a target database from the abstracted database, select a source data table from the abstracted data tables belonging to the source database, and select a target data table from the abstracted data tables belonging to the target database.

[0162] S502: Send a data synchronization request including the database name of the source database, the database name of the target database, the data table name of the source data table, and the data table name of the target data table to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on first storage identification information, the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on second storage identification information, the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table.

[0163] Since the implementation of step S501 and step S502 is similar to that of Figure 3 The data synchronization method applied to the server shown is basically the same or similar and will not be described in detail here.

[0164] The above-mentioned embodiment of the present invention provides Figure 5 In the data synchronization method for the client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed as a database and a data table according to the database name and the data table name, the user can synchronize the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data synchronization between different data sources.

[0165] Based on the above data access method applied to the server, in one embodiment of the present invention, a data preview method applied to the server is also provided. Figure 6 As shown, the method comprises the following steps:

[0166] S601: Receive a data preview request sent by a client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed.

[0167] In this step, the data preview request received by the server may be generated after the user performs a preview configuration operation on the abstracted database and data table, wherein the preview configuration operation is used to select a database to be previewed from the abstracted database and a data table to be previewed from the abstracted data table belonging to the database to be previewed. Optionally, the user may first select a database to be previewed from each database, and then select a data table to be previewed from the data table belonging to the database to be previewed.

[0168] The client determines the database to be previewed and the end data table to be previewed, and can send a data preview request including the database to be previewed and the end data table to be previewed to the server.

[0169] S602: Acquire the data to be previewed according to the third storage identification information, wherein the third storage identification information is information determined by the database name of the database to be previewed and the data table name of the data table to be previewed.

[0170] In this step, after receiving the data preview request sent by the client, the server can determine the third storage identification information according to the database name of the database to be previewed and the data table name of the data table to be previewed, and then obtain the data to be previewed according to the determined third storage identification information.

[0171] Exemplarily, when the data to be previewed is of a relational database type, when the database name of the database to be previewed is database 4 and the data table name of the data table to be previewed is data to be previewed 5, the data to be previewed can be obtained from data table 5 contained in database 4. When the data source is index storage, the data to be previewed end can obtain the data to be previewed from the data source through the third storage identification information serving as an index.

[0172] S603: Send the acquired data to be previewed to the client, so that the client can preview the data.

[0173] In this step, the client may first send the acquired data to be previewed, and after receiving the data to be previewed, the client may display the data to be previewed in the form of a data table to complete the data preview.

[0174] The above-mentioned embodiment of the present invention provides Figure 6In the data preview method for the server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can preview the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data preview between different data sources.

[0175] Corresponding to the above embodiments of the present invention Figure 6 The data preview method applied to the server shown in the figure is based on the data access method applied to the client provided in the embodiment of the present invention. In one embodiment of the present invention, a data preview method applied to the client is also provided, such as Figure 7 As shown, the method comprises the following steps:

[0176] S701: Select a database to be previewed from the abstracted database and select a data table to be previewed from the abstracted data tables belonging to the database to be previewed.

[0177] S702: Send a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information and sends the data to be previewed, wherein the data preview request includes: a database to be previewed and a data table to be previewed, and the third storage identification information is: information determined by a database name of the database to be previewed and a data table name of the data table to be previewed.

[0178] S703: Receive the data to be previewed sent by the server and perform data preview.

[0179] Since the implementation of step S701, step S702 and step S703 is similar to the Figure 6 The data preview method applied to the server shown is basically the same or similar and will not be described in detail here.

[0180] The above-mentioned embodiment of the present invention provides Figure 7 In the data preview method for the client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can preview the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data preview between different data sources.

[0181] Based on the same inventive concept, according to the data access method applied to the server provided by the embodiment of the present invention, the embodiment of the present invention also provides a data access device applied to the server, such as Figure 8 As shown, the device comprises:

[0182] The request receiving module 801 is used to receive a request for obtaining metadata of a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0183] The data sending module 802 is used to send the database name and data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and accesses data according to the database and the data table.

[0184] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0185] The above-mentioned embodiment of the present invention provides Figure 8 In the data access device applied to the server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0186] Based on the same inventive concept, according to the data synchronization method applied to the server provided by the embodiment of the present invention, the embodiment of the present invention also provides a data synchronization device applied to the server, such as Fig. 9 As shown, the device comprises:

[0187] The synchronization request receiving module 901 is used to receive a data synchronization request sent by a client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstract database, a data table name of a source data table selected from a data table belonging to the source database obtained from the abstract, and a data table name of a target data table selected from a data table belonging to the target database obtained from the abstract;

[0188] The source data end determination module 902 is used to determine the source data end to be synchronized according to the first storage identification information, wherein the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table;

[0189] The target data end determination module 903 is used to determine the target data end to be synchronized according to the second storage identification information, wherein the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table;

[0190] The data synchronization module 904 is used to synchronize data between the source data terminal and the target data terminal.

[0191] The above-mentioned embodiment of the present invention provides Fig. 9 In the data synchronization device for the server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed as a database and a data table according to the database name and the data table name, the user can synchronize the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data synchronization between different data sources.

[0192] Based on the same inventive concept, according to another data synchronization method applied to a server provided by an embodiment of the present invention, the embodiment of the present invention also provides another data synchronization device applied to a server, such as Fig.10 As shown, the device comprises:

[0193] The read permission judgment submodule 1001 is used to judge whether the read permission of the source data end is possessed based on the permission information carried in the data synchronization request;

[0194] The data reading submodule 1002 is used to read the data of the source data end when the read permission of the source data end is obtained;

[0195] A write permission determination submodule 1003 is used to determine whether the write permission of the target data terminal is available based on the permission information;

[0196] The data writing submodule 1004 is used to synchronize the read data to the target data terminal when the write permission of the target data terminal is obtained.

[0197] Further, the read permission judgment submodule 1001 is specifically used to judge whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request; or, to judge whether the target project has obtained the read permission granted by the source end project; wherein the source end project is the project to which the source data end belongs;

[0198] The write permission judgment submodule 1003 is specifically used to judge whether the target data end belongs to the target project associated with the permission information; or, to judge whether the target project has obtained the write permission granted by the target data end; wherein the target end project is the project to which the target data end belongs.

[0199] The above-mentioned embodiment of the present invention provides Fig.10 In the data synchronization device shown, since permission judgment is required before reading and writing data, the data stored in the data source can be made safe.

[0200] Based on the same inventive concept, according to a data preview method applied to a server provided by an embodiment of the present invention, an embodiment of the present invention also provides a data preview device applied to a server, such as Fig.11 As shown, the device comprises:

[0201] The preview request receiving module 1101 is used to receive a data preview request sent by a client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, wherein the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed;

[0202] The preview data acquisition module 1102 is used to acquire the data to be previewed according to the third storage identification information, wherein the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0203] The preview data sending module 1103 is used to send the acquired data to be previewed to the client so that the client can preview the data.

[0204] The above-mentioned embodiment of the present invention provides Fig.11 In the data preview device for the server shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed as a database and a data table according to the database name and the data table name, the user can preview the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data preview between different data sources.

[0205] Based on the same inventive concept, according to a data access method applied to a client provided by an embodiment of the present invention, an embodiment of the present invention also provides a data access device applied to a client, such as Fig.12 As shown, the device comprises:

[0206] The request sending module 1201 is used to send a metadata acquisition request for a data source to be accessed to a server, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0207] The data receiving module 1202 is used to receive the database name and data table name in the metadata of the data source to be accessed sent by the server;

[0208] The database table abstraction module 1203 is used to abstract the data source to be accessed into a database and a data table according to the database name and the data table name;

[0209] The data access module 1204 is used to access data according to the database and data table.

[0210] Furthermore, the data in the to-be-accessed data source is stored using the storage identification information as an index.

[0211] The above-mentioned embodiment of the present invention provides Fig.12 In the data access device applied to the client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0212] Based on the same inventive concept, according to a data synchronization method applied to a client provided by an embodiment of the present invention, an embodiment of the present invention also provides a data synchronization device applied to a client, such as Fig.13 As shown, the device comprises:

[0213] The synchronization database table selection module 1301 is used to select a source database and a target database from the abstracted database, select a source data table from the abstracted data table belonging to the source database, and select a target data table from the abstracted data table belonging to the target database;

[0214] The synchronization request sending module 1302 is used to send a data synchronization request including the database name of the source database, the database name of the target database, the data table name of the source data table and the data table name of the target data table to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on the first storage identification information, the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on the second storage identification information, the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table.

[0215] The above-mentioned embodiment of the present invention provides Fig.13 In the data synchronization device for the client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed as a database and a data table according to the database name and the data table name, the user can synchronize the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data synchronization between different data sources.

[0216] Based on the same inventive concept, according to a data preview method applied to a client provided by an embodiment of the present invention, an embodiment of the present invention also provides a data preview device applied to a client, such as Fig.14 As shown, the device comprises:

[0217] The preview database table selection module 1401 is used to select a database from the abstracted database as the database to be previewed, and select a data table from the data tables of the database to be previewed as the data table to be previewed;

[0218] The preview request sending module 1402 is used to send a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information and sends the data to be previewed, wherein the data preview request includes: a database to be previewed and a data table to be previewed, and the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed;

[0219] The preview data receiving module 1403 is used to receive the data to be previewed sent by the server and perform data preview.

[0220] The above-mentioned embodiment of the present invention provides Fig.14In the data preview device using a client shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can preview the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data preview between different data sources.

[0221] The embodiment of the present invention further provides an electronic device, such as Fig.15 As shown, it includes a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.

[0222] Memory 1503, used for storing computer programs;

[0223] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:

[0224] receiving a metadata acquisition request for a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0225] The database name and the data table name in the metadata of the data source to be accessed are sent to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table.

[0226] It should be noted that other embodiments of the data access method applied to the server implemented by the above electronic device are the same as the data access method applied to the server mentioned in the aforementioned method embodiment part, and will not be repeated here.

[0227] The above embodiment of the present invention provides Fig.15In the electronic device shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0228] The embodiment of the present invention further provides an electronic device, such as Fig.16 As shown, it includes a processor 1601, a communication interface 1602, a memory 1603 and a communication bus 1604, wherein the processor 1601, the communication interface 1602, and the memory 1603 communicate with each other through the communication bus 1604.

[0229] Memory 1603, used for storing computer programs;

[0230] The processor 1601 is used to implement the following steps when executing the program stored in the memory 1603:

[0231] Sending a request for obtaining metadata of a data source to be accessed to a server, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name;

[0232] Receiving the database name and the data table name in the metadata of the data source to be accessed sent by the server;

[0233] The data source to be accessed is abstracted into a database and a data table according to the database name and the data table name.

[0234] It should be noted that other embodiments of the data access method applied to the client implemented by the above electronic device are the same as the data access method applied to the client mentioned in the aforementioned method embodiment part, and will not be repeated here.

[0235] The above embodiment of the present invention provides Fig.16In the electronic device shown, since the data in the data source can be stored based on the database name and data table name configured in the metadata of the data source, and the client can abstract the data source to be accessed into a database and a data table according to the database name and the data table name, the user can access the data stored in the data sources with different storage methods by operating the database and data table abstracted by the client, so that the user does not need to pay attention to how the data sources with different storage methods store data, thereby reducing the operating cost of data access.

[0236] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0237] The communication interface is used for communication between the above electronic device and other devices.

[0238] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0239] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0240] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above data access methods are implemented.

[0241] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes any one of the data access methods in the above embodiments.

[0242] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0243] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0244] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0245] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A data access method, characterized in that: Applicable to servers, including: receiving a metadata acquisition request for a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name; and the metadata acquisition request includes an identification of the data source to be accessed; Searching metadata of the data source to be accessed through the identifier of the data source to be accessed, and obtaining a database name and a data table name in the metadata of the data source to be accessed; each data table name in the metadata of the data source has a database name associated therewith; Sending the database name and the data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table; Receive a data synchronization request sent by the client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstracted database, a data table name of a source data table selected from the abstracted data table belonging to the source database, and a data table name of a target data table selected from the abstracted data table belonging to the target database; Determine the source data end for data synchronization according to the first storage identification information, wherein the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table; Determine the target data end to be synchronized according to the second storage identification information, wherein the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table; Data synchronization is performed on the source data end and the target data end.

2. The method according to claim 1, characterized in that: The data in the to-be-accessed data source is stored using the storage identification information as an index.

3. The method according to claim 1, characterized in that The synchronizing the data between the source data end and the target data end includes: Determining whether the read permission of the source data end is available based on the permission information carried in the data synchronization request; When having the read permission of the source data end, reading the data of the source data end; Determining whether the write permission of the target data terminal is available based on the permission information; When the write permission of the target data end is obtained, the read data is synchronized to the target data end.

4. The method according to claim 3, characterized in that The determining whether the read permission of the source data terminal is present based on the permission information carried in the data synchronization request includes: Determine whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request; or, determine whether the target project has obtained the read permission granted by the source end project, wherein the source end project is the project to which the source data end belongs; The determining whether the write permission of the target data terminal is present based on the permission information includes: Determine whether the target data end belongs to the target project associated with the permission information; or, determine whether the target project has obtained the write permission granted by the target data end, wherein the target project is the project to which the target data end belongs.

5. The method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a data preview request sent by the client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed; According to the third storage identification information, the data to be previewed is acquired, wherein the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed; The acquired data to be previewed is sent to the client, so that the client can preview the data.

6. A data access method, characterized in that: Applied to the client, including: Sending a metadata acquisition request for a data source to be accessed, including an identifier of the data source to be accessed, to a server, so that the server searches for the metadata of the data source to be accessed through the identifier of the data source to be accessed, and obtains a database name and a data table name in the metadata of the data source to be accessed; wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name; each data table name in the metadata of the data source has a database name associated therewith; Receiving the database name and the data table name in the metadata of the data source to be accessed sent by the server; Abstracting the data source to be accessed into a database and a data table according to the database name and the data table name; Access data according to the database and the data table; Selecting a source database and a target database from the abstracted database, selecting a source data table from the abstracted data tables belonging to the source database, and selecting a target data table from the abstracted data tables belonging to the target database; A data synchronization request including a database name of the source database, a database name of the destination database, a data table name of the source data table, and a data table name of the destination data table is sent to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on first storage identification information, the first storage identification information is information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on second storage identification information, the second storage identification information is information determined by the database name of the target database and the data table name of the target data table.

7. The method according to claim 6, characterized in that The data in the to-be-accessed data source is stored using the storage identification information as an index.

8. The method according to claim 6 or 7, characterized in that: The method further comprises: Select a database to be previewed from the abstracted database and select a data table to be previewed from the abstracted data tables belonging to the database to be previewed; Sending a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information, and sends the data to be previewed, wherein the data preview request includes: the database to be previewed and the data table to be previewed, and the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed; The data to be previewed is received from the server, and data preview is performed.

9. A data access device, characterized in that: Applicable to servers, including: a request receiving module, configured to receive a metadata acquisition request for a data source to be accessed, sent by a client, wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name; and the metadata acquisition request includes an identification of the data source to be accessed; The request receiving module is further used to search the metadata of the data source to be accessed through the identifier of the data source to be accessed, and obtain the database name and data table name in the metadata of the data source to be accessed; each data table name in the metadata of the data source has a database name associated therewith; A data sending module, used for sending the database name and the data table name in the metadata of the data source to be accessed to the client, so that the client abstracts the data source to be accessed into a database and a data table according to the database name and the data table name, and performs data access according to the database and the data table; A synchronization request receiving module, used to receive a data synchronization request sent by the client, wherein the data synchronization request includes: a database name of a source database and a database name of a target database selected by the client from the abstract database, a data table name of a source data table selected from the abstract data table belonging to the source database, and a data table name of a target data table selected from the abstract data table belonging to the target database; A source data end determination module, used to determine a source data end for data synchronization according to first storage identification information, wherein the first storage identification information is information determined by a database name of the source database and a data table name of the source data table; A target data end determination module, used to determine the target data end to be synchronized according to the second storage identification information, wherein the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table; A data synchronization module is used to synchronize data between the source data end and the target data end.

10. The device according to claim 9, characterized in that The data in the to-be-accessed data source is stored using the storage identification information as an index.

11. The device according to claim 9, characterized in that The data synchronization module comprises: A read permission judgment submodule, used to judge whether the read permission of the source data end is possessed based on the permission information carried in the data synchronization request; A data reading submodule, used for reading data from the source data end when having the read permission of the source data end; A write permission judgment submodule, used to judge whether the write permission of the target data terminal is possessed based on the permission information; The data writing submodule is used to synchronize the read data to the target data end when the write permission of the target data end is obtained.

12. The device according to claim 11, characterized in that The read permission judgment submodule specifically judges whether the source data end belongs to the target project associated with the permission information carried in the data synchronization request; or judges whether the target project has obtained the read permission granted by the source end project; wherein the source end project is the project to which the source data end belongs; The write permission judgment submodule is specifically used to judge whether the target data terminal belongs to the target project associated with the permission information; or, to judge whether the target project has obtained the write permission granted by the target data terminal; wherein the target project is the project to which the target data terminal belongs.

13. The device according to claim 9 or 10, characterized in that The device also includes: A preview request receiving module, configured to receive a data preview request sent by the client, wherein the data preview request includes: a database to be previewed and a data table to be previewed, wherein the database to be previewed is one of the abstracted databases, and the data table to be previewed is one of the data tables in the database to be previewed; A preview data acquisition module, used to acquire the data to be previewed according to the third storage identification information, wherein the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed; The preview data sending module is used to send the acquired data to be previewed to the client so that the client can preview the data.

14. A data access device, characterized in that: Applied to the client, including: a request sending module, configured to send a metadata acquisition request including an identifier of the data source to be accessed to a server, so that the server searches for the metadata of the data source to be accessed through the identifier of the data source to be accessed, and obtains a database name and a data table name in the metadata of the data source to be accessed; wherein the metadata of the data source to be accessed is configured with a database name and a data table name, and the data in the data source to be accessed is stored according to storage identification information, and the storage identification information is determined by the database name and the data table name; A data receiving module, used for receiving the database name and the data table name in the metadata of the data source to be accessed sent by the server; each data table name in the metadata of the data source has a database name associated therewith; A database table abstraction module, used for abstracting the data source to be accessed into a database and a data table according to the database name and the data table name; A data access module, used for accessing data according to the database and the data table; A synchronization database table selection module is used to select a source database and a target database from the abstracted database, select a source data table from the abstracted data table belonging to the source database, and select a target data table from the abstracted data table belonging to the target database; A synchronization request sending module is used to send a data synchronization request including the database name of the source database, the database name of the destination database, the data table name of the source data table and the data table name of the destination data table to the server, so that the server synchronizes data between the source data end and the target data end, wherein the source data end is determined based on first storage identification information, the first storage identification information is: information determined by the database name of the source database and the data table name of the source data table, and the destination data end is determined based on second storage identification information, the second storage identification information is: information determined by the database name of the target database and the data table name of the target data table.

15. The device according to claim 14, characterized in that The data in the to-be-accessed data source is stored using the storage identification information as an index.

16. The device according to claim 14 or 15, characterized in that The device also includes: A preview database table selection module is used to select a database from the abstracted database as the database to be previewed, and select a data table from the data tables of the database to be previewed as the data table to be previewed; a preview request sending module, configured to send a data preview request to the server, so that the server obtains the data to be previewed according to the third storage identification information, and sends the data to be previewed, wherein the data preview request includes: the database to be previewed and the data table to be previewed, and the third storage identification information is: information determined by the database name of the database to be previewed and the data table name of the data table to be previewed; The preview data receiving module is used to receive the preview data sent by the server and perform data preview.

17. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1-5 or 6-8 when executing a program stored in a memory.

Citation Information

Patent Citations

  • Data query method and device, equipment and storage medium

    CN110032575A

  • Processing method and device for multiple types of data sources

    CN110633281A