Data download method and device, electronic device and storage medium
By splitting the data table into multiple subtables and storing it in multiple databases, and using the method of multi-threaded parallel down-down, the problem of poor applicability and inefficiency of data down-down mode in the prior art is solved, and a more efficient and widely applicable data down-down process is achieved.
Patent Information
- Application Number
- CN202110349445.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In the prior art, the data down-down method has poor applicability, cannot be compatible with databases with different performances, and is inefficient.
By determining the target data table to be batched, split it into multiple target data subtables, and store it in multiple databases, multi-threaded parallel download method is used to obtain the target data table.
It improves the applicability of data downgrade, reduces the hardware demand for databases, and improves the efficiency of data downgrade.
Smart Images

Figure CN112948477B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data downloading method and device, an electronic device and a storage medium. Background Art
[0002] Batch processing is the daily core business of banks. After the end of each day's business, banks can start batch processing to calculate the day's funds in and out and give statistical reports. After completing the batch processing daily cut, data downloading is the first processing link of the batch processing job, that is, the data preparation link. Batch downloading means extracting data from the database and storing it on disk or distributed storage system or third-party database according to certain data output rules, so as to provide data calculation for subsequent batch processing jobs.
[0003] At present, banks generally use databases such as Oracle (a relational database management system) RAC (Real Application Clusters) based on large / minicomputers and DB2 (Database 2, a relational database management system) based on mainframes. Data can be exported based on the data export tool provided by the database or directly extracted using SQL (Structured Query Language) commands and stored in disks or distributed storage systems.
[0004] However, the above-mentioned data downsizing method requires the use of a specific type of database (e.g., Oracle RAC, DB2, etc.), which has high requirements on the hardware of the database and cannot be applied to other types of quota databases. Even if it can be applied to other types of databases, there will be the problem of low efficiency of data downsizing. Therefore, the data downsizing method in the related art has the problem of poor applicability. Summary of the invention
[0005] The present application provides a data downloading method and device, an electronic device and a storage medium, so as to at least solve the problem of poor applicability of the data downloading method in the related art.
[0006] According to one aspect of an embodiment of the present application, a data downloading method is provided, comprising: determining a target data table to be batch processed and downloaded, wherein the target data table includes multiple target data sub-tables; determining multiple databases corresponding to the target data table, wherein one target data sub-table of the multiple target data sub-tables is stored in one of the multiple databases; and downloading, from each database of the multiple databases, data in the target data sub-table stored in each database to obtain the target data table.
[0007] Optionally, determining the multiple databases corresponding to the target data table includes: obtaining target data sub-table distribution information corresponding to the target data table from a target database agent, wherein the target data sub-table distribution information is used to indicate an association relationship between each data sub-table in the multiple data sub-tables contained in the target data table and the database where each data sub-table is located; and determining the multiple databases corresponding to the target data table based on the target data sub-table distribution information.
[0008] Optionally, downloading the data in the target data subtable stored in each database from each of the multiple databases respectively includes: downloading the data in the target data subtable stored in each database in parallel from each database through multiple threads, wherein the multiple threads correspond one-to-one to the multiple databases.
[0009] Optionally, respectively downloading from each of the multiple databases the data in the target data subtable stored in each database, comprising: respectively sending a target download request to each database, wherein the target download request is used to request to download the data in the target data subtable stored in each database according to a target download condition; and receiving a target response message returned by each database in response to the target download request, wherein the target response message carries the data obtained from the target data subtable stored in each database according to the target download condition.
[0010] Optionally, after sending the target download request to each of the databases respectively, the method further includes: receiving the target download request sent by the target server through the target database, wherein the target download condition includes at least one of the following: the corresponding value of the first designated column is within the target range, the format of the corresponding value of the second designated column is converted to a specific format, and the target database is one of the multiple databases; in response to the target download request, obtaining target business data from a target data subtable stored in the target database through the target database, wherein the corresponding value of the first designated column of the target business data is within the target range and / or the format of the corresponding value of the second designated column is converted to the specific format; sending the target response message to the target server through the target database, wherein the target response message carries the target business data.
[0011] Optionally, after downloading the data in the target data subtable stored in each of the multiple databases respectively, the method further includes: merging the data in the target data subtable stored in each of the databases downloaded from each of the databases to obtain the target data table; performing a target processing operation on the data in the target data table to obtain an updated target data table, wherein the target processing operation includes at least one of the following: filtering incomplete data and removing duplicate data.
[0012] Optionally, before determining the target data table to be downloaded, the method further includes: receiving a target processing request sent by a target object, wherein the target processing request is used to request execution of a target processing operation; determining the target data table to be downloaded includes: determining multiple associated data tables associated with the target processing operation, wherein the multiple associated data tables include the target data table; after respectively downloading the data in the target data subtable stored in each of the multiple databases from each of the multiple databases, the method further includes: when the multiple associated data tables are acquired, executing the target processing operation on the data in the multiple associated data tables to obtain a target processing result of the target processing operation; storing the target processing result in a target storage device; and sending an access path of the target processing result to the target object.
[0013] According to another aspect of an embodiment of the present application, a data downloading device is also provided, including: a first determination unit, used to determine a target data table to be batch processed and downloaded, wherein the target data table includes multiple target data sub-tables; a second determination unit, used to determine multiple databases corresponding to the target data table, wherein one target data sub-table among the multiple target data sub-tables is stored in one of the multiple databases; and a downloading unit, used to download the data in the target data sub-table stored in each database from each of the multiple databases respectively to obtain the target data table.
[0014] Optionally, the second determination unit includes: an acquisition module, used to obtain target data sub-table distribution information corresponding to the target data table from a target database agent, wherein the target data sub-table distribution information is used to indicate an association relationship between each data sub-table in a plurality of data sub-tables contained in the target data table and a database where each data sub-table is located; and a first determination module, used to determine the plurality of databases corresponding to the target data table based on the target data sub-table distribution information.
[0015] Optionally, the download unit comprises: a download module, configured to download data in the target data sub-table stored in each database in parallel from each database through a plurality of threads, wherein the plurality of threads correspond one-to-one to the plurality of databases.
[0016] Optionally, the downshift unit includes: a sending module, used to send a target downshift request to each of the databases respectively, wherein the target downshift request is used to request to downshift the data in the target data subtable stored in each database according to the target downshift condition; a receiving module, used to receive a target response message returned by each database in response to the target downshift request, wherein the target response message carries data obtained from the target data subtable stored in each database according to the target downshift condition.
[0017] Optionally, the device also includes: a first receiving unit, used to receive the target download request sent by the target server through the target database after sending the target download request to each of the databases respectively, wherein the target download condition includes at least one of the following: the corresponding value of the first designated column is within the target range, the format of the corresponding value of the second designated column is converted to a specific format, and the target database is one of the multiple databases; an acquisition unit, used to respond to the target download request, and acquire target business data from a target data subtable stored in the target database through the target database, wherein the corresponding value of the first designated column of the target business data is within the target range and / or the format of the corresponding value of the second designated column is converted to the specific format; a first sending unit, used to send the target response message to the target server through the target database, wherein the target response message carries the target business data.
[0018] Optionally, the device also includes: a merging unit, which is used to merge the data in the target data sub-table stored in each database after downloading the data from each database of the multiple databases respectively, to obtain the target data table; a first execution unit, which is used to perform a target processing operation on the data in the target data table to obtain the updated target data table, wherein the target processing operation includes at least one of the following: filtering incomplete data and removing duplicate data.
[0019] Optionally, the device further includes: a second receiving unit, a second execution unit, a storage unit, and a second sending unit, wherein the first determination unit includes: a second determination module, wherein the second receiving unit is used to receive a target processing request sent by a target object before determining the target data table to be downloaded, wherein the target processing request is used to request execution of a target processing operation; the second determination module is used to determine a plurality of associated data tables associated with the target processing operation, wherein the plurality of associated data tables include the target data table; a second execution unit is used to, after downloading the data in the target data sub-table stored in each of the plurality of databases respectively, execute the target processing operation on the data in the plurality of associated data tables when the plurality of associated data tables are acquired, to obtain a target processing result of the target processing operation; a storage unit is used to store the target processing result in a target storage device; and a second sending unit is used to send an access path of the target processing result to the target object.
[0020] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including 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; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0021] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0022] In an embodiment of the present application, a method of backing up a data table with a sub-table as a dimension is adopted, by determining a target data table to be backed up in batches, wherein the target data table includes multiple target data sub-tables; determining multiple databases corresponding to the target data table, wherein a target data sub-table in the multiple target data sub-tables is stored in one of the multiple databases; and backing up the data in the target data sub-table stored in each database from each of the multiple databases to obtain the target data table. Since the data table is split into multiple sub-tables and stored in multiple databases, the software and hardware requirements of the database for data backing up can be reduced, thereby achieving the purpose of being compatible with databases of different performances, achieving the technical effect of improving the applicability of data backing up, and further solving the problem of poor applicability of the data backing up method in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 is a schematic diagram of a hardware environment of an optional data download method according to an embodiment of the present application;
[0026] Figure 2 is a flow chart of an optional method for downloading data according to an embodiment of the present application;
[0027] Figure 3 is a schematic diagram of an optional architecture of a distributed database system according to an embodiment of the present application;
[0028] Figure 4 is a flowchart of another optional method for downloading data according to an embodiment of the present application;
[0029] Figure 5 is a structural block diagram of an optional data downloading device according to an embodiment of the present application;
[0030] Figure 6 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] According to one aspect of an embodiment of the present application, a data downsizing method is provided. Optionally, in this embodiment, the data downsizing method can be applied to Figure 1 In the hardware environment composed of the terminal 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal 102 via a network, and can be used to provide services (such as data storage services, application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104.
[0034] The network may include but is not limited to at least one of the following: a wired network, a wireless network. The wired network may include but is not limited to at least one of the following: a wide area network, a metropolitan area network, a local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal 102 may not be limited to a PC, a mobile phone, a tablet computer, etc.
[0035] The data download method of the embodiment of the present application can be executed by the server 104, or by the terminal 102, or by both the server 104 and the terminal 102. The terminal 102 can also execute the data download method of the embodiment of the present application by a client installed thereon.
[0036] Taking the data download method in this embodiment executed by the server 104 as an example, Figure 2 is a flow chart of an optional data downloading method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:
[0037] Step S202, determining a target data table to be batch processed, wherein the target data table includes a plurality of target data sub-tables.
[0038] The data downloading method in this embodiment can be applied to the scenario of batch downloading data tables in a distributed database system, and these scenarios may have the needs of periodic data storage and data aggregation. For example, database users such as banks perform batch processing after completing batch daily cutting, and batch downloading is the first processing link of the batch processing, that is, the data preparation link. In this embodiment, the batch downloading in the process of batch processing by the database user is used as an example for explanation.
[0039] The data downloading method in the present embodiment can be performed by downloading service, or can be performed jointly by downloading service and database proxy (Proxy). Downloading service can be a downloading module (software program for batch downloading, batch downloading tool) running in terminal equipment or terminal equipment, or can be a downloading module running in an independent server or server (database server). Database proxy can be a network proxy service between the database service end and the application service end, and it can be an agent software running in an independent proxy server or server (database server). Downloading service and database proxy are not limited in the present embodiment.
[0040] Optionally, in this embodiment, the down-level service and the database agent may be different servers, that is, the down-level service may be a down-level server on which a batch down-level tool may run, and the database agent may be a database agent server on which a database agent program may run.
[0041] In a period of time, different types of data of a database user can be stored in different data tables. For distributed databases, the method of extracting data through the database's own data export tools or directly using SQL commands is not applicable, resulting in low efficiency of batch processing and difficulty in meeting the timeliness requirements of batch processing.
[0042] Optionally, in this embodiment, a data table can be split into different sub-tables, and there can be multiple conditions for splitting the sub-tables. For example, it can be split according to the amount of business data stored in the sub-table, or it can be split according to the time of the business data, or it can be split according to the type of business data, etc., which is not limited in this embodiment.
[0043] When there is a demand for batch processing, the target download service (target download server, target server) can determine the target data table to be batch processed, and the target data table can contain multiple target data sub-tables. The number of target data sub-tables can be one or more. For a data table, the data table can be used to store business data of a certain business type, and the number of sub-tables to be split can be specified when creating the table.
[0044] Optionally, when creating a table, you can also specify a split key (for example, id) and a split method. The split method may include, but is not limited to, one of the following: HASH, RANGE, LIST. The HASH split method means: when creating a table, define the number of sub-tables, select the value of a column (split key) to perform HASH calculation to obtain an integer value, and map it to the corresponding sub-table; the RANGE split method means: when creating a table, define the upper and lower limits of the RANGE, and define the number of sub-tables, and then use the value of a certain integer column of the table to map to the corresponding sub-table; the LIST split method means: when creating a table, define the number of LIST segments and the upper and lower limits of each segment, and then take the value of a certain integer column of the table and map it to the corresponding sub-table. The segment here can be a continuous integer segment or a set.
[0045] There may be multiple ways to determine the data table to be batch processed, including but not limited to at least one of the following: based on the data table carried in the received processing request, based on the operation type of the processing operation in the received processing request, based on the data table identifier in the pre-configured batch processing file, etc., which is not limited in this embodiment.
[0046] Step S204 , determining a plurality of databases corresponding to the target data table, wherein a target data sub-table of the plurality of target data sub-tables is stored in a database of the plurality of databases.
[0047] For a data table, each data subtable of the data table can be stored in one database, and different subtables can be stored in different databases or in the same database. The target downlink service can determine multiple databases corresponding to the target data table, and each target data subtable of the target data table can be stored in one of the multiple databases.
[0048] There may be various relationships between the multiple target data sub-tables and the multiple databases. For example, the multiple databases are databases corresponding to the same database user, and each database may store one or more target data sub-tables, or may not have a target data sub-table. For another example, each of the multiple databases may store at least one target data sub-table among the multiple target data sub-tables.
[0049] Step S206, downloading the data in the target data sub-table stored in each database from each of the multiple databases to obtain a target data table.
[0050] After determining a plurality of databases, the target downloading service can download the data in the target data subtable stored in each database from each database respectively. For a database, if at least one target data subtable is stored thereon, the data in at least one stored target data subtable can be sent to the target downloading service. If no target data subtable is stored thereon, it may not return any message to the target downloading service.
[0051] The target download service can determine that the data in all the target data subtables has been received, for example, based on the pre-acquired subtable information, it is determined that the data in all the target data subtables has been received, and for another example, based on the subtable identifiers of the target data subtables, it is determined that the data in all the target data subtables has been received. If the data in all the target data subtables has been received, it can be determined that the target data table has been successfully downloaded.
[0052] The target down-stream service may store the data in all target data sub-tables obtained (for example, stored in the target storage system), or perform secondary calculations based on the data in all target data sub-tables (for example, merging sub-table data, filtering and deduplication of data table content, connecting multiple data tables in series, etc.), and store the obtained processing results (for example, stored in the target storage system). The processing flow of the down-stream data is not limited in this embodiment.
[0053] Through the above steps S202 to S206, a target data table to be batch processed is determined, wherein the target data table includes multiple target data sub-tables; multiple databases corresponding to the target data table are determined, wherein one target data sub-table among the multiple target data sub-tables is stored in one of the multiple databases; data in the target data sub-table stored in each database is downloaded from each database in the multiple databases to obtain the target data table, which solves the problem of poor applicability of the data downloading method in the related art and improves the applicability of data downloading.
[0054] As an optional embodiment, determining a plurality of target databases corresponding to the target data table includes:
[0055] S11, acquiring target data sub-table distribution information corresponding to the target data table from the target database agent, wherein the target data sub-table distribution information is used to indicate an association relationship between each data sub-table in a plurality of data sub-tables included in the target data table and a database where each data sub-table is located;
[0056] S12, determining a plurality of databases corresponding to the target data table according to the target data sub-table distribution information.
[0057] In order to reduce the occupation of network resources by batch processing and improve the efficiency of batch processing, the database agent can be responsible for the sub-table splitting and sub-table distribution statistics of the database table without the need for business concern. For the target data table, the target database agent can be responsible for its sub-table splitting and sub-table distribution statistics, and the target database agent can be a target proxy server running a distributed database agent program.
[0058] The target database agent can save multiple distribution information, each distribution information is the distribution information of a sub-table of a data table, which can be used to indicate the association relationship between each data sub-table in the multiple data sub-tables contained in a data table and the database where each data sub-table is located, that is, each distribution information can be used to indicate: which data sub-tables a data table contains, and the database where each data sub-table is stored.
[0059] When downloading data, the target downloading service can obtain distribution information corresponding to the target data table from the target database agent, that is, the target data sub-table distribution information, which can be used to indicate the association relationship between each data sub-table in the multiple data sub-tables (multiple target data sub-tables) contained in the target data table and the database where each data sub-table is located.
[0060] The target download service can determine multiple target data sub-tables contained in the target data table according to the target data sub-table distribution information, and can also determine the database in which each target data sub-table is stored, thereby determining multiple databases. Optionally, the target download service can also determine at least one target data sub-table stored in each database, so that the data of all target data sub-tables stored in each database can be obtained from each database at once, thereby reducing the number of interactions and improving data acquisition efficiency.
[0061] Through this embodiment, the database agent performs sub-table distribution statistics, and the distributed database topology is transparent to the batch processing download tool, thereby avoiding the impact of changes in the cluster topology on the batch processing download; at the same time, it can reduce the occupation of network resources by the batch processing download (reduce data pulling from databases that have never stored sub-tables), thereby improving the efficiency of the batch processing download.
[0062] As an optional embodiment, downloading data from each of the multiple databases, respectively, the target data sub-table stored in each database includes:
[0063] S21, downloading data in a target data sub-table stored in each database from each database in parallel through multiple threads, wherein the multiple threads correspond to the multiple databases one by one.
[0064] In order to improve the downloading efficiency, multiple sub-tables can be downloaded concurrently, that is, the data in the target data sub-table stored in each database can be downloaded from multiple databases in parallel. The operation of concurrent downloading can be executed concurrently by multiple threads. The target downloading service can trigger multiple threads to be executed concurrently, and the multiple threads correspond to multiple databases one by one, and each thread is used to download the data in the target data sub-table stored in one database from one database.
[0065] In addition, each thread among the multiple threads may also be responsible for downloading data in the target data sub-table stored in it from at least one database. Compared with this method, the method in which each thread is responsible for downloading data in the target data sub-table stored in it from one database has a higher download efficiency.
[0066] According to this embodiment, the data stored in the sub-tables of different databases are downloaded concurrently by multiple threads, so that the efficiency of data downloading can be improved.
[0067] As an optional embodiment, downloading data from each of the multiple databases, respectively, the target data sub-table stored in each database includes:
[0068] S31, sending a target download request to each database respectively, wherein the target download request is used to request to download the data in the target data sub-table stored in each database according to the target download condition;
[0069] S32, receiving a target response message returned by each database in response to the target download request, wherein the target response message carries data obtained from the target data sub-table stored in each database according to the target download condition.
[0070] In the process of downloading subtables, the target download service can directly pull all the data in the target data subtable stored on each database. In order to improve the efficiency of the download subtables and disperse the processing pressure of the download service, the distributed database system can also support downloading data according to specified rules.
[0071] The target download service can send a target download request to each database of the database. The target download request can carry the identifier of the target data subtable stored in each database to indicate the data table to be downloaded from each database (for a target data subtable, the target data subtable is a data table in the database storing the target data subtable). The target download request can also carry description information of the target download condition to indicate that the data in the target data subtable stored in the database is to be downloaded according to the target download condition. The target download request can also carry a target operation identifier to indicate that a target data operation is to be performed on the data obtained from the target data subtable.
[0072] The target down-grade conditions are conditions for the down-grade data in the target data sub-table stored in each database, and may include but are not limited to at least one of the following: data characteristics that the down-grade data needs to satisfy (conditions for filtering data), for example, characteristics that the corresponding values of a column of the down-grade data need to satisfy; data characteristics that the down-grade data needs to be adjusted to (conditions for adjusting data), for example, characteristics that the corresponding values of a column of the down-grade data need to be converted to.
[0073] The target data operation may be one or more, including but not limited to at least one of the following: filtering operation, arrangement operation, and sorting operation. The filtering operation may include at least one of the following: deduplication operation, and operation of removing abnormal data (e.g., incomplete data). The arrangement operation and the sorting operation may be used to adjust the positional relationship of the data.
[0074] For one of the multiple databases, after receiving the target downshift request, it can obtain data that meets the target downshift condition from the target data subtable stored thereon. In addition, the database can also perform target data operations on the obtained data to obtain updated data, and the updated data is still data that meets the target downshift condition, but the data is data after reducing redundant data and / or adjusting the position order. The database can send the data that meets the target downshift condition obtained from the target data subtable to the target downshift service through a target response message.
[0075] Optionally, the target data operation may also be a default operation configured in the database, that is, the target data operation is performed on the data obtained from the target data sub-table based on the default configuration to obtain updated data, which is not limited in this embodiment.
[0076] The target download service can receive a target response message returned by each database in response to the target download request, and extract from the target response message the data obtained by each database from the target data sub-table stored in each database according to the target download condition.
[0077] Through this embodiment, the database storing the sub-table obtains data satisfying the downgrade condition from the stored sub-table, thereby reducing the amount of transmitted business data and alleviating the processing pressure of the downgrade service.
[0078] As an optional embodiment, after sending the target download request to each database respectively, the method further includes:
[0079] S41, receiving, through a target database, a target download request sent by a target server, wherein a target download condition includes at least one of the following: a corresponding value of a first designated column is within a target range, a format of a corresponding value of a second designated column is converted into a specific format, and the target database is one of a plurality of databases;
[0080] S42, in response to the target download request, obtaining target business data from a target data subtable stored in the target database through the target database, wherein the corresponding value of the first designated column of the target business data is within the target range and / or the format of the corresponding value of the second designated column is converted into a specific format;
[0081] S43, sending a target response message to the target server through the target database, wherein the target response message carries target business data.
[0082] There can be multiple target downgrade conditions, for example, the corresponding value of the first designated column is within the target range, and for another example, the format of the corresponding value of the second designated column is converted to a specific format, and so on. There can be one or more first designated columns, and the corresponding values of different first designated columns can correspond to different target ranges. For example, the corresponding value of the time column can correspond to the target time range, and the corresponding value of the sequence number column corresponds to the target sequence number range. There can be one or more second designated columns, and the corresponding values of different second designated columns can correspond to different specific formats. For example, for a string type attribute column, the length of the pulled attribute value is required to be the first length, and for another time type attribute column, the format of the pulled attribute value is required to be the target time format.
[0083] Any server among multiple databases, for example, a target database, can obtain data satisfying the target down-shift condition from the target data subtable stored thereon after receiving the target down-shift request sent by the target server. For the target database, if the target down-shift condition includes: the corresponding value of the first designated column is within the target range, data whose corresponding value of the first designated column is within the target range can be read from the target data subtable stored thereon. If the target down-shift condition includes: the format of the corresponding value of the second designated column is converted to a specific format, the format of the corresponding value of the second designated column of the read data can be converted to the specific format.
[0084] For example, table A has 100 columns, one of which is of type COL1 and is of type time, and one of which is of type COL2 and is of type string. When pulling data, you can request to pull only the first 50 columns of table A, require the time range of COL1 to be after a certain time, and require COL2 to be of a fixed length (fill in spaces if it is not long enough).
[0085] The target database extracts the target data subtable stored thereon and the data that meets the target downgrade condition as the target business data. After acquiring the target business, the target database can send the target business data to the target server via a target response message.
[0086] Through this embodiment, by defining the range and format of pulling sub-table data, the amount of business data transmitted can be reduced, while reducing the processing pressure of downstream services (no need for downstream services to adjust the data format).
[0087] Optionally, the target download service may support setting data secondary calculation rules, for example, secondary calculation may be based on sub-table data files, and the secondary calculation may include but is not limited to at least one of the following: merging sub-table data, filtering and deduplication of data table content, and concatenating multiple data tables.
[0088] As an optional embodiment, after downloading the data in the target data sub-table stored in each database from each of the multiple databases, the method further includes:
[0089] S51, merging the data in the target data sub-table stored in each database from each database to obtain a target data table;
[0090] S52, performing a target processing operation on the data in the target data table to obtain an updated target data table, wherein the target processing operation includes at least one of the following: filtering incomplete data, and removing duplicate data.
[0091] The target downlink service can merge the data obtained in each target data sub-table into a complete data table. The merging method can be: merging multiple target data sub-tables into a target data table in the order of each sub-table, for example, writing the data in other target data sub-tables except the first target data sub-table into the first target data sub-table in sequence; or merging multiple target data sub-tables into a target data table in the order of reception, for example, writing the data in other target data sub-tables except the first received target data sub-table in sequence into the first received target data sub-table. There can also be other merging methods, which are not limited to this in the present embodiment.
[0092] Since there may be duplication of data within the same target data sub-table or between different target data sub-tables, and some data may be incomplete, for the merged target data table, target data operations can be performed on the data in the target data table, for example, filtering incomplete data and removing duplicate data, so as to obtain an updated data table.
[0093] In addition, the target downlink service can also perform position adjustment operations such as arrangement and sorting on the data in the target data table to control the data in the target data table to meet the position requirements.
[0094] Through this embodiment, by merging sub-table data and filtering and removing duplicates from the data table content, the legitimacy and simplicity of the data in the target data table can be guaranteed, and the flexibility of the calculation rule definition can be improved.
[0095] As an optional embodiment, before determining the target data table to be downloaded, the method further includes:
[0096] S61, receiving a target processing request sent by a target object, wherein the target processing request is used to request execution of a target processing operation;
[0097] The target data table to be downloaded includes:
[0098] S62, determining a plurality of associated data tables associated with the target processing operation, wherein the plurality of associated data tables include the target data table;
[0099] After downloading the data in the target data sub-table stored in each of the plurality of databases respectively, the method further comprises:
[0100] S63, when multiple associated data tables are obtained, executing a target processing operation on the data in the multiple associated data tables to obtain a target processing result of the target processing operation;
[0101] S64, storing the target processing result in the target storage device;
[0102] S65, sending the access path of the target processing result to the target object.
[0103] Determining the data table to be transferred can be triggered after receiving a processing request. The processing request is used to request the execution of a certain processing operation. For different business scenarios, the processing operation can take many forms. For example, if the database user is a bank, the processing operation is to calculate the user's income, calculate the user's repayment date, calculate financial statements, etc. Each processing operation can involve one or more data tables. If the processing operation involves multiple data tables, the distributed database system can support multi-data table concatenation (a form of secondary calculation) of the transferred data.
[0104] The target downlink service can receive a target processing request sent by a target object, and the target processing request is used to request the execution of a target processing operation. The target object can be a client, for example, a client logged in using a target account, and the client can be a client that matches the distributed database system, and the target account is an account that is allowed to use the distributed database system. The target object can also be a certain stage of a certain running program, that is, when the target processing program runs to a certain stage, it triggers the generation of a target processing request. In this embodiment, there is no limitation on the target object.
[0105] In response to the received target processing request, the target downlink service can determine the target processing operation to be performed, thereby determining the associated data tables associated with the target processing operation, and the number of associated data tables can be one or more. If the target processing operation needs to use data in multiple data tables, the number of associated data tables is multiple. The multiple associated data tables include the target data table and other data tables except the target data table.
[0106] The target downloading service can download each of the multiple associated data tables separately. The downloading method of other associated data tables except the target data table is similar to that of the target data table, which will not be repeated here. If multiple associated data tables have been obtained, the target downloading service can perform a target processing operation on the data in the multiple associated data tables to obtain a target processing result of the target processing operation.
[0107] For example, the target processing operation is to calculate the user's income. If the user has purchased multiple financial products (for example, wealth management products, fund products, etc.), and the product information of different financial products is stored in different data tables, then the downlink service can download the data table where the product information of each financial product is located, and perform a secondary calculation on the downloaded data to obtain the user's income.
[0108] After obtaining the target processing result, the target down-shift service can store the target processing result in the target storage system, for example, in the target storage device of the target storage system. To ensure that the target object knows the target processing result, the target down-shift service can send the target object an access path to the target processing result.
[0109] Through this embodiment, multiple data tables are downloaded and multiple data tables are connected in series based on the received processing operations, which can be applied to different business scenarios and improve the applicability of the distributed database system.
[0110] The data downsizing method in the embodiment of the present application is explained below in conjunction with optional examples. This example provides a batch downsizing solution for a distributed database, which performs parallel operations on the downsizing of distributed library tables with sub-tables as the dimension; the sub-table splitting and sub-table distribution statistics of the library table are automatically executed in the distributed database proxy service, and the business does not need to care; at the same time, in the process of downsizing the sub-tables, data filtering, arrangement and sorting operations can be supported, and the data storage and data aggregation after downsizing can also be secondary organized.
[0111] The data downscaling method in this example can be applied to Figure 3The distributed database system shown may include: multiple databases, database agents, downstream services and storage systems. The downstream services can be communicatively connected with multiple databases, database agents and storage systems, and the database agents can be communicatively connected with downstream services and multiple databases.
[0112] The following modules may be included in the downloading service: a rule management module for managing downloading rules and data secondary calculation rules; a downloading tool (batch downloading tool) for batch downloading of data tables; a storage interface for communicating with the storage system; and a calculation engine for performing secondary calculation of data.
[0113] like Figure 4 As shown, the process of the data downloading method in this optional example may include the following steps:
[0114] Step S402: The user initiates a request for batch processing of the download library table Table A to the download service.
[0115] The user here can be a target processing program, which needs to use Table A when executing at a certain stage. It can then initiate a batch processing download request to the downstream service to request the batch processing of the downstream library table Table A.
[0116] Step S404, the downstream service obtains the distribution information of the sub-tables of Table A from the distributed database agent.
[0117] The distributed database proxy stores the distribution information of the sub-tables of Table A, and the downstream service obtains the distribution information of the sub-tables of Table A from the distributed database proxy. Table A contains 8 sub-tables, of which Part_1 is stored in DB1, Part_2 is stored in DB2, Part_3 is stored in DB3, Part_4 is stored in DB1, Part_5 is stored in DB2, Part_6 is stored in DB3, Part_7 is stored in DB1, and Part_8 is stored in DB3.
[0118] Step S406, the download service downloads the sub-table data of Table A from various databases in parallel according to the distribution information of the sub-tables of Table A.
[0119] According to the distribution information of the sub-tables of Table A, the download service can download the sub-table data of Table A from various databases (DB) in parallel: download Part_1, Part_4 and Part_7 from DB1, download Part_2 and Part_5 from DB2, and download Part_3, Part_6 and Part_8 from DB3.
[0120] Step S408, the downstream service stores the downstream data of the sub-table of Table A into the storage system through the storage interface.
[0121] Step S410: the computing engine of the downstream service performs secondary calculation on the sub-table data of Table A in the storage system according to preset rules.
[0122] The computing engine of the downstream service can perform secondary calculations on the sub-table data of Table A in the storage system according to preset secondary calculation rules. For example, secondary calculations can be performed in combination with data in other data tables, or secondary calculations can be performed on the data in this table (removing duplicate data, removing accounts with transactions within a certain time range, data aggregation, etc.), so as to obtain batch downstream results, and store the batch downstream results in the storage system. The secondary calculation rules can be flexibly configured as needed.
[0123] Step S412: the download service returns the access path of the batch download result data to the user.
[0124] The download service can return the access path of the batch processing download result data to the user, thereby ensuring that the user can know the batch processing download results and obtain the batch processing download results through the access path of the batch processing download result data when there is a processing demand.
[0125] Through this example, the distributed database table is downloaded concurrently with the sub-table as the dimension, which can improve the batch download efficiency; the distributed database topology (distribution information of the sub-table) is transparent to the batch download tool, avoiding the impact of changes in the cluster topology on the batch download, and can be seamlessly compatible with conventional batch download tools; it supports downloading data according to specified rules (download rules) and setting secondary calculations for the downloaded data according to business rules (data secondary calculation rules), which can provide secondary organization capabilities for the downloaded data.
[0126] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory, read-only memory) / RAM (Random Access Memory, random access memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0128] According to another aspect of the embodiments of the present application, a data downstaging device for implementing the above-mentioned data downstaging method is also provided. Figure 5 is a structural block diagram of an optional data downloading device according to an embodiment of the present application, such as Figure 5 As shown, the device may include:
[0129] A first determining unit 502 is used to determine a target data table to be batch processed, wherein the target data table includes a plurality of target data sub-tables;
[0130] A second determining unit 504, connected to the first determining unit 502, is used to determine a plurality of databases corresponding to the target data table, wherein one of the plurality of target data sub-tables is stored in one of the plurality of databases;
[0131] The downloading unit 506 is connected to the second determining unit 504 and is used to download the data in the target data sub-table stored in each database from each of the multiple databases to obtain the target data table.
[0132] It should be noted that the first determination unit 502 in this embodiment can be used to execute the above step S202, the second determination unit 504 in this embodiment can be used to execute the above step S204, and the downshift unit 506 in this embodiment can be used to execute the above step S206.
[0133] Through the above modules, a target data table to be batch processed and downloaded is determined, wherein the target data table includes multiple target data sub-tables; multiple databases corresponding to the target data table are determined, wherein one target data sub-table among the multiple target data sub-tables is stored in one of the multiple databases; and the data in the target data sub-table stored in each database is downloaded from each database in the multiple databases to obtain the target data table, thereby solving the problem of poor applicability of the data downloading method in the related art and improving the applicability of data downloading.
[0134] As an optional embodiment, the second determining unit 504 includes:
[0135] an acquisition module, used to acquire target data sub-table distribution information corresponding to the target data table from the target database agent, wherein the target data sub-table distribution information is used to indicate the association relationship between each data sub-table in the multiple data sub-tables included in the target data table and the database where each data sub-table is located;
[0136] The first determination module is used to determine a plurality of databases corresponding to the target data table according to the target data sub-table distribution information.
[0137] As an optional embodiment, the lower gear unit 506 includes:
[0138] The download module is used to download the data in the target data sub-table stored in each database from each database in parallel through multiple threads, wherein the multiple threads correspond to the multiple databases one by one.
[0139] As an optional embodiment, the lower gear unit 506 includes:
[0140] A sending module, used for sending a target download request to each database respectively, wherein the target download request is used for requesting to download the data in the target data sub-table stored in each database according to the target download condition;
[0141] The receiving module is used to receive a target response message returned by each database in response to a target download request, wherein the target response message carries data obtained from a target data subtable stored in each database according to a target download condition.
[0142] As an optional embodiment, the above device also includes:
[0143] A first receiving unit is configured to receive a target download request sent by a target server through a target database, wherein a target download condition includes at least one of the following: a corresponding value of a first designated column is within a target range, a format of a corresponding value of a second designated column is converted into a specific format, and the target database is one of a plurality of databases;
[0144] an acquisition unit, configured to respond to a target download request and acquire target business data from a target data subtable stored in the target database through a target database, wherein a corresponding value of a first designated column of the target business data is within a target range and / or a format of a corresponding value of a second designated column is converted into a specific format;
[0145] The first sending unit is used to send a target response message to a target server through a target database, wherein the target response message carries target business data.
[0146] As an optional embodiment, the above device also includes:
[0147] A merging unit, for merging the data in the target data sub-table stored in each database downloaded from each database after downloading the data in the target data sub-table stored in each database from each database of the plurality of databases, to obtain a target data table;
[0148] The first execution unit is used to perform a target processing operation on the data in the target data table to obtain an updated target data table, wherein the target processing operation includes at least one of the following: filtering incomplete data and removing duplicate data.
[0149] As an optional embodiment, the above device further includes: a second receiving unit, a second executing unit, a storage unit, a second sending unit, and the first determining unit 502 includes: a second determining module, wherein:
[0150] A second receiving unit is used to receive a target processing request sent by a target object before determining the target data table to be downloaded, wherein the target processing request is used to request to perform a target processing operation;
[0151] A second determining module, configured to determine a plurality of associated data tables associated with the target processing operation, wherein the plurality of associated data tables include the target data table;
[0152] The second execution unit is used for, after downloading the data in the target data sub-table stored in each database from each of the multiple databases, executing a target processing operation on the data in the multiple associated data tables when multiple associated data tables are acquired, to obtain a target processing result of the target processing operation;
[0153] A storage unit, used for storing the target processing result in a target storage device;
[0154] The second sending unit is used to send the access path of the target processing result to the target object.
[0155] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0156] According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the above-mentioned data downloading method, and the electronic device may be a server, a terminal, or a combination thereof.
[0157] Figure 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, it includes a processor 602, a communication interface 604, a memory 606 and a communication bus 608, wherein the processor 602, the communication interface 604 and the memory 606 communicate with each other through the communication bus 608, wherein,
[0158] Memory 606, used to store computer programs;
[0159] The processor 602 is used to implement the following steps when executing the computer program stored in the memory 606:
[0160] S1, determining a target data table to be processed in batches, wherein the target data table includes a plurality of target data sub-tables;
[0161] S2, determining a plurality of databases corresponding to the target data table, wherein a target data sub-table among the plurality of target data sub-tables is stored in a database in the plurality of databases;
[0162] S3, downloading the data in the target data sub-table stored in each database from each of the multiple databases to obtain a target data table.
[0163] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The communication interface is used for communication between the above electronic device and other devices.
[0164] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0165] As an example, the memory 606 may include but is not limited to the first determination unit 502, the second determination unit 504 and the downsizing unit 506 in the data downsizing device. In addition, it may also include but is not limited to other module units in the data downsizing device, which will not be repeated in this example.
[0166] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0167] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0168] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only. The device for implementing the above-mentioned data downloading method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations shown.
[0169] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0170] According to another aspect of the embodiment of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the above data downloading methods in the embodiment of the present application.
[0171] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.
[0172] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:
[0173] S1, determining a target data table to be processed in batches, wherein the target data table includes a plurality of target data sub-tables;
[0174] S2, determining a plurality of databases corresponding to the target data table, wherein a target data sub-table among the plurality of target data sub-tables is stored in a database in the plurality of databases;
[0175] S3, downloading the data in the target data sub-table stored in each database from each of the multiple databases to obtain a target data table.
[0176] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.
[0177] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0178] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0179] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0180] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0181] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0183] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0184] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data downloading method, characterized in that: include: Determine a target data table to be batch processed, wherein the target data table includes a plurality of target data sub-tables; Determine a plurality of databases corresponding to the target data table, wherein a target data sub-table among the plurality of target data sub-tables is stored in a database among the plurality of databases; Downloading the data in the target data sub-table stored in each database from each database of the plurality of databases to obtain the target data table; Wherein, downloading the data in the target data subtable stored in each database of the multiple databases respectively comprises: sending a target download request to each database respectively, wherein the target download request is used to request to download the data in the target data subtable stored in each database according to the target download condition; receiving a target response message returned by each database in response to the target download request, wherein the target response message carries the data obtained from the target data subtable stored in each database according to the target download condition; After sending the target download request to each of the databases respectively, the method further includes: receiving the target download request sent by the target server through the target database, wherein the target download condition includes at least one of the following: the corresponding value of the first designated column is within the target range, the format of the corresponding value of the second designated column is converted to a specific format, and the target database is one of the multiple databases; in response to the target download request, obtaining target business data from a target data subtable stored in the target database through the target database, wherein the corresponding value of the first designated column of the target business data is within the target range and / or the format of the corresponding value of the second designated column is converted to the specific format; sending the target response message to the target server through the target database, wherein the target response message carries the target business data.
2. The method according to claim 1, characterized in that Determining the plurality of databases corresponding to the target data table comprises: Acquire target data sub-table distribution information corresponding to the target data table from a target database agent, wherein the target data sub-table distribution information is used to indicate an association relationship between each data sub-table in a plurality of data sub-tables included in the target data table and a database where each data sub-table is located; The multiple databases corresponding to the target data table are determined according to the target data sub-table distribution information.
3. The method according to claim 1, characterized in that Downloading the data in the target data sub-table stored in each of the plurality of databases from each of the databases includes: The data in the target data sub-table stored in each database is downloaded from each database in parallel through a plurality of threads, wherein the plurality of threads correspond to the plurality of databases one by one.
4. The method according to claim 1, characterized in that After downloading the data in the target data sub-table stored in each of the plurality of databases respectively from the database, the method further comprises: Merging the data in the target data sub-table stored in each database downloaded from each database to obtain the target data table; Perform a target processing operation on the data in the target data table to obtain the updated target data table, wherein the target processing operation includes at least one of the following: filtering incomplete data and removing duplicate data.
5. The method according to any one of claims 1 to 4, characterized in that Before determining the target data table to be downloaded, the method further includes: receiving a target processing request sent by a target object, wherein the target processing request is used to request execution of a target processing operation; Determining the target data table to be downloaded includes: determining a plurality of associated data tables associated with the target processing operation, wherein the plurality of associated data tables include the target data table; After downloading the data in the target data subtable stored in each of the multiple databases respectively, the method further includes: when the multiple related data tables are obtained, performing the target processing operation on the data in the multiple related data tables to obtain the target processing result of the target processing operation; storing the target processing result in the target storage device; and sending the access path of the target processing result to the target object.
6. A data downloading device, characterized in that: include: A first determining unit is used to determine a target data table to be batch processed, wherein the target data table includes a plurality of target data sub-tables; A second determining unit is used to determine a plurality of databases corresponding to the target data table, wherein a target data sub-table among the plurality of target data sub-tables is stored in a database among the plurality of databases; A downloading unit, used for downloading the data in the target data sub-table stored in each database from each of the multiple databases to obtain the target data table; Wherein, downloading the data in the target data subtable stored in each database of the multiple databases respectively comprises: sending a target download request to each database respectively, wherein the target download request is used to request to download the data in the target data subtable stored in each database according to the target download condition; receiving a target response message returned by each database in response to the target download request, wherein the target response message carries the data obtained from the target data subtable stored in each database according to the target download condition; After sending the target download request to each of the databases respectively, it also includes: receiving the target download request sent by the target server through the target database, wherein the target download condition includes at least one of the following: the corresponding value of the first designated column is within the target range, the format of the corresponding value of the second designated column is converted to a specific format, and the target database is one of the multiple databases; in response to the target download request, obtaining target business data from the target data subtable stored in the target database through the target database, wherein the corresponding value of the first designated column of the target business data is within the target range and / or the format of the corresponding value of the second designated column is converted to the specific format; sending the target response message to the target server through the target database, wherein the target response message carries the target business data.
7. 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, wherein: The memory is used to store computer programs; The processor is configured to execute the method steps of any one of claims 1 to 5 by running the computer program stored in the memory.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method steps described in any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Data batch updating method, device and system for distributed database
CN110287264A
Data migration method applied to distributed database and related device
CN110413595A