Data processing method and device, server and storage medium

By generating intermediate tables through pre-configured mapping relationships, the problem of time-consuming data migration between relational and non-relational databases is solved, and automated data synchronization is achieved.

CN116756122BActive Publication Date: 2025-12-26CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310762039.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2025-12-26
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

The lack of suitable data scheduling tools in existing technologies means that data migration between relational and non-relational databases requires manual operation, which is time-consuming.

Method used

By pre-configuring the mapping relationship between the data table identifier and the target data table identifier, as well as the mapping relationship between table fields, an intermediate table is generated and sent to the target database for data synchronization processing, thereby realizing data migration between different types of databases.

Benefits of technology

No manual operation is required, which improves data migration efficiency and saves time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116756122B_ABST
    Figure CN116756122B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device, a server and a storage medium. The application relates to the technical field of data processing, and the method comprises the following steps: extracting table data to be processed from a settlement data table in a local settlement database and placing the table data to be processed in a local to-be-synchronized database; obtaining a mapping relationship between a settlement data table identifier and a preconfigured data table identifier and a target data table identifier in a target database, determining corresponding target data table identifiers according to the settlement data table identifier and the mapping relationship; obtaining a table field mapping relationship corresponding to each target data table according to the settlement data table identifier and the target data table identifier; generating an intermediate table corresponding to each target data table in the to-be-synchronized database based on the table field mapping relationship and the table data to be processed; and sending the intermediate table in the to-be-synchronized database to the target database. The method provided by the application can realize data migration between different types of databases, does not require manual operation, and saves time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a data processing method and device, a server and a storage medium. BACKGROUND

[0002] Data migration is to transfer data stored in a set of storage systems to another set of storage systems. For example, data is migrated from a source database where an old office automation system is located to a target database where a new office automation system is located. The database where the old office automation system is located is a non-relational database (NoSQL), and the database where the new office automation system is located is a relational database (RDBMS).

[0003] The way to migrate data between databases of the same type needs to rely on a scheduling tool. However, the existing migration from a relational database to a non-relational database is generally manually operated. For example, a single table or data to be migrated is exported from a relational database to a txt file, and then the data is imported into a non-relational database through an import tool after manual comparison of data types.

[0004] Due to the lack of an adaptive data scheduling tool, data migration between a relational database and a non-relational database cannot be well performed, and data migration needs to be manually operated, which is time-consuming. SUMMARY

[0005] The present application provides a data processing method and device, a server and a storage medium to solve the problem that data migration between a relational database and a non-relational database cannot be well performed in the prior art.

[0006] In a first aspect, the present application provides a data processing method, comprising: extracting table data to be processed from a settlement data table in a local settlement database, and placing the table data to be processed in a local database to be synchronized, wherein the table data to be processed comprises a plurality of table fields and values corresponding to each table field; obtaining a mapping relationship between a settlement data table identifier and a preconfigured data table identifier and a target data table identifier in a target database, and determining each target data table identifier corresponding to the settlement data table identifier according to the settlement data table identifier and the mapping relationship; obtaining a table field mapping relationship corresponding to each target data table and a preconfigured data table according to the settlement data table identifier and the target data table identifier; generating an intermediate table corresponding to each target data table in the database to be synchronized based on the table field mapping relationship and the table data to be processed; and sending the intermediate table in the database to be synchronized to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

[0007] In a possible design, the extracting table data to be processed from the settlement data table in the local settlement database comprises:

[0008] Obtaining a table state corresponding to the settlement data table in the local settlement database;

[0009] If the table state corresponding to a settlement data table is not completed data migration, extracting at least one table data whose data state is not extracted from the settlement data table, and taking the extracted table data as the table data to be processed.

[0010] In a possible design, the determining each target data table identifier corresponding to the settlement data table identifier according to the settlement data table identifier and the mapping relationship comprises:

[0011] Matching the settlement data table identifier with a data table identifier in the mapping relationship;

[0012] Determining each target data table identifier corresponding to the settlement data table identifier as each target data table identifier corresponding to the settlement data table identifier.

[0013] In a possible design, the generating an intermediate table corresponding to each target data table in the database to be synchronized based on the table field mapping relationship and the table data to be processed comprises:

[0014] Determining a table field of each target data table in the database to be synchronized based on the table data to be processed and the table field mapping relationship corresponding to each target data table;

[0015] According to the table field of each target data table and the corresponding value of the table field of the to-be-processed table data corresponding to the table field of the target data table, an intermediate table corresponding to each target data table is generated.

[0016] In a possible design, the method further includes:

[0017] According to the data identifier of the to-be-processed table data, the attachment information corresponding to the data identifier is searched in the local settlement file library.

[0018] The searched attachment information is acquired, and the attachment information is sent to the corresponding server, so that the server stores the attachment information and feeds back a storage path of the attachment information.

[0019] The storage path is received, the storage path is associated with the to-be-processed table data, association information of the storage path and the to-be-processed table data is obtained, and the association information is sent to the target database.

[0020] In a second aspect, the application provides a data processing apparatus, including: an acquisition module, configured to extract to-be-processed table data from a settlement data table in a local settlement database and put the to-be-processed table data into a local to-be-synchronized database, the to-be-processed table data including a plurality of table fields and values corresponding to each table field; the acquisition module is further configured to acquire a mapping relationship between a settlement data table identifier and a preconfigured data table identifier and a target data table identifier in a target database; a processing module, configured to determine each target data table identifier corresponding to the settlement data table identifier according to the settlement data table identifier and the mapping relationship; the acquisition module is further configured to acquire a table field mapping relationship between a preconfigured data table and each target data table according to the settlement data table identifier and the each target data table identifier; the processing module is further configured to generate an intermediate table corresponding to each target data table in the to-be-synchronized database based on the table field mapping relationship and the to-be-processed table data; and a transceiver module, configured to send the intermediate table in the to-be-synchronized database to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

[0021] In a third aspect, an embodiment of the application provides a server, including: a processor, a memory and a transceiver;

[0022] The processor, the memory and the transceiver are interconnected;

[0023] The transceiver is configured to transceive data.

[0024] The memory stores computer execution instructions.

[0025] The processor executes computer execution instructions stored in the memory, so that the processor executes the data processing method as described in the first aspect and various possible designs of the first aspect.

[0026] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, the data processing method as described in the first aspect and various possible designs of the first aspect is implemented.

[0027] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, and when a processor executes the computer program, the data processing method as described in the first aspect and various possible designs of the first aspect is implemented.

[0028] The data processing method, device, server and storage medium provided by the present application extract table data to be processed from a settlement data table in a local settlement database, and put the table data to be processed into a local to-be-synchronized database. The table data to be processed includes a plurality of table fields and values corresponding to each table field. The settlement data table identifier and the preconfigured data table identifier are mapped to the target data table identifier in the target database, and each target data table identifier corresponding to the settlement data table identifier is determined according to the settlement data table identifier and the mapping relationship. According to the settlement data table identifier and the target data table identifier, the table field mapping relationship between the preconfigured data table and each target data table is obtained. The intermediate table corresponding to each target data table is generated in the to-be-synchronized database based on the table field mapping relationship and the table data to be processed. The intermediate table in the to-be-synchronized database is sent to the target database, so that the target database performs insertion or update processing on the corresponding target data table based on the intermediate table. The preconfigured mapping relationship is used for conversion, which can realize data migration between different types of databases, thereby realizing data synchronization, without manual operation, improving data migration efficiency, and saving time. BRIEF DESCRIPTION OF DRAWINGS

[0029] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.

[0030] Figure 1 The network architecture diagram of the data processing method provided by the present application is shown in the following figure:

[0031] Figure 2 The flowchart of the data processing method provided by the present application is shown in the following figure:

[0032] Figure 3Another data processing method provided in the present application is shown in the flowchart;

[0033] Figure 4 A structure diagram of a data processing device provided in the present application is shown in the figure;

[0034] Figure 5 A block diagram of a server for implementing the data processing method of the present application is shown in the figure.

[0035] The specific embodiments of the present application have been shown in the above figures, and will be described in more detail hereinafter. These figures and the written description are not intended to limit the scope of the present application concept in any way, but to illustrate the present application concept to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0036] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, the same numbers refer to the same or similar elements unless otherwise represented. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present application, as detailed in the appended claims.

[0037] In order to clearly understand the technical solutions of the present application, the prior art solutions will be described in detail first.

[0038] Data migration is to transfer data stored in a set of storage systems to another set of storage systems. For example, data is migrated from a source database where an old office automation system is located to a target database where a new office automation system is located. The database where the old office automation system is located is a non-relational database (Not Only Structured Query Language, NoSQL), and the database where the new office automation system is located is a relational database (Relational Database Management System, RDBMS). The way to migrate data between databases of the same type needs to use a scheduling tool. The existing migration from a relational database to a non-relational database is generally a manual operation. For example, a single table or data to be migrated is exported from a relational database to a txt (text, file format), and then manually compared with the data type and imported into a non-relational database through an import tool.

[0039] It is difficult to migrate data between different types of databases due to the lack of suitable data scheduling tools, and it is not easy to perform data migration between relational databases and non-relational databases, which requires manual operation and takes a long time.

[0040] Therefore, in order to solve the problem that the data migration between the relational database and the non-relational database cannot be well performed in the prior art, the inventor finds in research that the mapping relationship is pre-configured, such as the mapping relationship between the data table identifier and the target data table identifier in the target database and the table field mapping relationship between the data table and the corresponding target data table, the pre-configured mapping relationship is used for conversion, so as to perform the data migration, specifically, the table data to be processed is extracted from the settlement data table in the local settlement database and is put into the local to-be-synchronized database, the settlement data table identifier and the pre-configured mapping relationship between the data table identifier and the target data table identifier in the target database are acquired, the target data table identifier corresponding to the settlement data table identifier is further determined according to the settlement data table identifier and the mapping relationship, so as to acquire the pre-configured table field mapping relationship between the data table and the corresponding target data table according to the settlement data table identifier and the target data table identifier, the intermediate table corresponding to each target data table is generated in the to-be-synchronized database based on the table field mapping relationship and the table data to be processed, the intermediate table in the to-be-synchronized database is sent to the target database, the target database performs the data synchronization processing on the corresponding target data table based on the intermediate table, the pre-configured mapping relationship is used for conversion, the data migration between different types of databases can be implemented, so as to implement the data synchronization, manual operation is not needed, the data migration efficiency is improved, and time is saved.

[0041] Therefore, based on the above creative finding, the inventor proposes the technical scheme of the embodiments of the present application. The network architecture and application scenarios of the data processing method provided by the embodiments of the present application are introduced below.

[0042] As Figure 1As shown, the data processing method provided by the embodiment of the application corresponds to a network architecture including a terminal 1, a server 2, a target database 3 and a server 4. The server 2 is in communication connection with the terminal 1, the server 3 and the server 4 respectively. A user sends a data migration instruction to the server 2 by using the terminal 1. The server 2 parses the data migration instruction and obtains a migration quantity. The server 2 extracts the same quantity of table data to be processed from a settlement data table in a local settlement database and puts the table data to be processed into a local synchronization database. The table data to be processed includes a plurality of table fields and values corresponding to each table field. The server 2 obtains a mapping relationship between an identification of the settlement data table and an identification of a target data table in the target database 3, and determines each target data table identification corresponding to the identification of the settlement data table according to the identification of the settlement data table and the mapping relationship. The server 2 obtains a table field mapping relationship corresponding to each target data table from a preconfigured data table according to the identification of the settlement data table and each target data table identification. The server 2 generates an intermediate table corresponding to each target data table in the synchronization database based on the table field mapping relationship and the table data to be processed. The server 2 sends the intermediate table in the synchronization database to the target database 3. The target database 3 performs data synchronization processing on the corresponding target data table based on the intermediate table. Further, the server 2 searches for attachment information corresponding to the data identification in the local settlement database according to the data identification of the table data to be processed. The server 2 obtains the searched attachment information, sends the attachment information to the corresponding server 4, and stores the attachment information and feeds back a storage path of the attachment information. The server 2 associates the storage path fed back by the server 4 with the table data to be processed, obtains association information of the storage path and the table data to be processed, and sends the association information to the target database 3. The conversion by using the preconfigured mapping relationship can realize data migration between different types of databases, thereby realizing data synchronization, without manual operation, improving data migration efficiency, and saving time.

[0043] Based on Figure 1 the application scenario as shown, the embodiment of the application further provides a data processing method. Figure 2 The flow of the data processing method provided by the embodiment of the application Figure 1 . As shown Figure 2 , the data processing method includes:

[0044] Step 201, extracting table data to be processed from a settlement data table in a local settlement database and putting the table data to be processed into a local synchronization database. The table data to be processed includes a plurality of table fields and values corresponding to each table field.

[0045] The execution subject of the method of the embodiment can be the server as shown in Figure 2 .

[0046] In the embodiment, the office automation system includes a completed database and a to-be-synchronized database. The completed database stores a plurality of completed data tables. Each completed data table includes at least one table data. Each table data includes a plurality of table fields and values corresponding to the table fields. The completed data table refers to a type of data table that has been processed. For example, a data table of a completed expense report. At least one table data is extracted from the completed data table in the local completed database as to-be-processed table data. The to-be-processed table data includes a plurality of table fields and values corresponding to the table fields. The to-be-processed table data is moved to the to-be-synchronized database.

[0047] The database in the office automation system is a non-relational database, and the network office automation system is a relational database. In the past, the data in the non-relational database needs to be migrated to the relational database by using middleware.

[0048] In step 202, the completed data table identifier and the mapping relationship between the preconfigured data table identifier and the target data table identifier in the target database are obtained. The target data table identifiers corresponding to the completed data table identifier are determined according to the completed data table identifier and the mapping relationship.

[0049] In the embodiment, the table data in the non-relational database can be inserted into a plurality of data tables in the relational database. Therefore, the mapping relationship between the tables needs to be preconfigured for data migration. The completed data table identifier and the mapping relationship between the preconfigured data table identifier and the target data table identifier in the target database are obtained. The target data table identifiers corresponding to the completed data table identifier are determined according to the completed data table identifier and the mapping relationship.

[0050] In step 203, the table field mapping relationship between the preconfigured data table and the target data table corresponding to the completed data table identifier and the target data table identifier is obtained.

[0051] In the embodiment, there are differences between the data table in the non-relational database and the data table in the relational database in terms of fields and data formats. Therefore, the table field mapping relationship between the data table and the target data table is preconfigured to further generate an intermediate table according to the table field mapping relationship. The table field mapping relationship matching the completed data table identifier and the target data table identifier is found in the preconfigured table field mapping relationship between the data table and the target data table corresponding to the completed data table identifier and the target data table identifier. The table field mapping relationship is obtained.

[0052] In step 204, the intermediate table corresponding to the target data table is generated in the to-be-synchronized database based on the table field mapping relationship and the to-be-processed table data.

[0053] In the embodiment, the intermediate table corresponding to each target table is generated based on the table field mapping relationship between the preconfigured data table and each target data table and the table data to be processed in the database to be synchronized. The target table and the corresponding intermediate table have the same table field format, and the table data to be processed is included in each intermediate table.

[0054] In step 205, the intermediate table in the database to be synchronized is sent to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

[0055] In the embodiment, the intermediate table in the database to be synchronized is sent to the target database, and the target database performs data synchronization processing on the corresponding target data table based on the intermediate table. Specifically, the target database obtains the data identifier of the table data to be processed, determines whether the table data to be processed has been stored according to the data identifier, inserts the value corresponding to the table field in the intermediate table into the target data table corresponding to the table at the same table field if it is determined that the table data to be processed has been stored, and updates the value corresponding to the table field in the target data table corresponding to the table at the same table field if it is determined that the table data to be processed has been stored to complete the data synchronization.

[0056] In the embodiment, the table data to be processed is extracted from the settlement data table in the local settlement database and put into the local database to be synchronized. The mapping relationship between the settlement data table identifier and the preconfigured data table identifier and the target data table identifier in the target database is obtained. The target data table identifier corresponding to the settlement data table identifier is further determined according to the settlement data table identifier and the mapping relationship. Therefore, the table field mapping relationship between the preconfigured data table and each target data table corresponding to the settlement data table identifier is obtained according to the settlement data table identifier and each target data table identifier. The intermediate table corresponding to each target data table is generated based on the table field mapping relationship and the table data to be processed in the database to be synchronized. The intermediate table in the database to be synchronized is sent to the target database. The target database performs data synchronization processing on the corresponding target data table based on the intermediate table. The preconfigured mapping relationship is converted to realize data migration between different types of databases, thereby realizing data synchronization without manual operation, improving data migration efficiency, and saving time.

[0057] Figure 3 The data processing method provided in the embodiment Figure 2 . As shown in Figure 3 , the data processing method comprises the following steps:

[0058] In step 301, the table data to be processed is extracted from the settlement data table in the local settlement database and put into the local database to be synchronized. The table data to be processed includes a plurality of table fields and values corresponding to each table field.

[0059] In the embodiment, at least one table data is extracted from the table data in the local settlement database as the table data to be processed, and the table data to be processed includes a plurality of table fields and values corresponding to each table field. The table data to be processed is moved to the to-be-synchronized database.

[0060] Optionally, the table data to be processed is extracted from the settlement data table in the local settlement database, and the table data to be processed includes:

[0061] The table state corresponding to the settlement data table in the local settlement database is obtained. If the table state corresponding to a settlement data table is not completed data migration, at least one table data with a data state of not being extracted is extracted from the settlement data table, and the extracted table data is taken as the table data to be processed.

[0062] In the embodiment, the table state corresponding to the settlement data table in the local settlement database is obtained. If the table state corresponding to a settlement data table is not completed data migration, at least one table data with a data state of not being extracted is extracted from the settlement data table, and the extracted table data is taken as the table data to be processed.

[0063] In step 302, the settlement data table identifier and the mapping relationship between the preconfigured data table identifier and the target data table identifier in the target database are obtained, and each target data table identifier corresponding to the settlement data table identifier is determined according to the settlement data table identifier and the mapping relationship.

[0064] In the embodiment, the table data in the non-relational database can be inserted into a plurality of data tables in the relational database, so it is necessary to preconfigure the mapping relationship between tables for data migration. The settlement data table identifier and the mapping relationship between the preconfigured data table identifier and the target data table identifier in the target database are obtained, and each target data table identifier corresponding to the settlement data table identifier is determined according to the settlement data table identifier and the mapping relationship.

[0065] Optionally, each target data table identifier corresponding to the settlement data table identifier is determined according to the settlement data table identifier and the mapping relationship, and the method further includes:

[0066] The settlement data table identifier is matched with the data table identifier in the mapping relationship. Each target data table identifier corresponding to the settlement data table identifier is determined as each target data table identifier corresponding to the settlement data table identifier.

[0067] In the embodiment, the mapping relationship between the closing data table identifier and the preconfigured data table identifier is matched with the target data table identifier in the target database, and each target data table identifier corresponding to the data table identifier in the mapping relationship matched with the closing data table identifier is determined as each target data table identifier corresponding to the closing data table identifier.

[0068] Referring to Table 1, Table 1 is a mapping relationship between a certain preconfigured data table identifier and a target data table identifier in a target database, i.e., a mapping relationship between a closing data table and a target data table. The local database can be a non-relational database, and the target database can be a relational database. The data in the closing data table in the local database needs to be migrated to three target data tables in the target database. The mapping relationship between the closing data table in the local database and the year-sent order table, the sent order opinion table and the recipient order table in the target database is preconfigured.

[0069] Table 1: Mapping relationship between closing data table and target data table

[0070]

[0071] Among them, the 2019 closing data table is matched with the mapping relationship, and each target data table identifier corresponding to the data table identifier in the mapping relationship matched with the 2019 closing data table, i.e., the 2019 sent order table, the 2019 sent order opinion table and the 2019 recipient order table, is determined as the target data table corresponding to the 2019 closing data table.

[0072] In step 303, according to the closing data table identifier and each target data table identifier, the preconfigured data table and each target data table corresponding table field mapping relationship is obtained.

[0073] In the embodiment, according to the closing data table identifier and each target data table identifier, the table field mapping relationship matched with the closing data table identifier and each target data table identifier is found in the preconfigured data table and each target data table corresponding table field mapping relationship, and the table field mapping relationship is obtained.

[0074] Specifically, according to the closing data table identifier and the target data table identifier, the table field mapping relationship is obtained. For example, according to the closing data table identifier and the sent order table, the table field mapping relationship corresponding to the closing data table and the sent order table is obtained. Referring to Table 2, the table field mapping relationship corresponding to the closing data table and the sent order table is obtained. Taking table id as an example, the field of table id in the closing data table is mainid, the field of table id in the sent order table is ID, and the mapping relationship between the field mainid and the field ID is preconfigured. The mapping relationship between each field in the closing data table and each field in the sent order table is configured. It should be noted that the closing data table has a mapping relationship with the above sent order opinion table and recipient order table.

[0075] Table 2 Table field mapping relationship corresponding to the pre-configured completion data table and the sending order table

[0076] Name Close data table Send order table Table id Main id ID Structure id CurBankID Draft_organ_id Institution name CurBank Draft_organ Flow multi-entity identification CN000 Multi_tenancy_id Title Title Title Signing type Line letter Type Main document ID Main id DRAFT_TIME Main document ID signing association Main id Send_order_id Completion time ARCHTIME FINISH_TIME

[0077] Step 304, generating the intermediate table corresponding to each target data table based on the table field mapping relationship and the to-be-processed table data in the to-be-synchronized database.

[0078] In this embodiment, the intermediate table corresponding to each target table is generated based on the table field mapping relationship between the pre-configured data table and each target data table and the to-be-processed table data in the to-be-synchronized database, the table field format of the target table and the corresponding intermediate table is the same, and the to-be-processed table data is included in each intermediate table.

[0079] Optionally, the intermediate table corresponding to each target data table is generated based on the table field mapping relationship and the to-be-processed table data in the to-be-synchronized database, including:

[0080] The table field of each target data table is determined based on the to-be-processed table data and the table field mapping relationship corresponding to each target data table in the to-be-synchronized database, and the intermediate table corresponding to each target data table is generated according to the table field of each target data table and the corresponding value of the table field of the to-be-processed table data corresponding to the table field of the target data table.

[0081] In this embodiment, the table field of each target data table is determined based on the to-be-processed table data and the table field mapping relationship corresponding to each target data table, so that the intermediate table corresponding to each target data table is generated according to the table field of each target data table and the corresponding value of the table field of the to-be-processed table data corresponding to the table field of the target data table, the intermediate table and the corresponding target table have the same format and the same field ordering.

[0082] Step 305, sending the intermediate table in the to-be-synchronized database to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

[0083] In this embodiment, the intermediate table in the to-be-synchronized database is sent to the target database, and the target database performs data synchronization processing on the corresponding target data table based on the intermediate table. Specifically, the target database acquires the data identifier of the to-be-processed table data, determines whether the to-be-processed table data has been stored according to the data identifier, if it is determined that the to-be-processed table data has been stored, inserts the value corresponding to the table field in the target data table corresponding to the table in the intermediate table at the same table field, if it is determined that the to-be-processed table data has been stored to complete the data synchronization, updates the value corresponding to the table field in the target data table corresponding to the table in the intermediate table at the same table field to complete the data synchronization.

[0084] In step 306, the attachment information corresponding to the data identifier is searched in the local settlement file library according to the data identifier of the table data to be processed.

[0085] In the embodiment, the attachment information corresponding to the data identifier is searched in the local settlement file library according to the data identifier of the table data to be processed, specifically, the data identifier of the table data to be processed is matched with the mapping relationship between the data identifier and the attachment information, and the attachment information corresponding to the data identifier matched with the data identifier of the table data to be processed is obtained.

[0086] In step 307, the obtained attachment information is sent to the corresponding server, so that the server stores the attachment information and feeds back the storage path of the attachment information.

[0087] In the embodiment, the obtained attachment information is sent to the corresponding server, the server is provided with a plurality of hard disks, the server stores the attachment information on the corresponding hard disk, and the storage path of the attachment information is fed back.

[0088] In step 308, the storage path is received and associated with the table data to be processed, the association information of the storage path and the table data to be processed is obtained, and the association information is sent to the target database.

[0089] In the embodiment, the storage path of the attachment information sent by the server is received, the storage path is associated with the table data to be processed, the association information of the storage path and the table data to be processed is obtained, and the association information is sent to the target database. The target database stores the association information, so that the required attachment information can be directly obtained from the server in the future.

[0090] Optionally, the method further comprises:

[0091] The data migration instruction is received, the data migration instruction is parsed, the migration quantity is obtained, and the same number of table data to be processed as the migration quantity is extracted from the settlement data table in the local settlement database.

[0092] In the embodiment, the user can send the data migration instruction by using the terminal, the server receives the data migration instruction, parses the data migration instruction, obtains the migration quantity, and further extracts the same number of table data to be processed as the migration quantity from the settlement data table in the local settlement database. The user can customize the number, which is convenient for the user to use.

[0093] Optionally, the method further comprises:

[0094] If the current time is the preset time, the same number of table data to be processed as the preset migration quantity is extracted from the settlement data table in the local settlement database based on the preset migration quantity.

[0095] In the embodiment, in addition to the user triggering instruction, a migration time can be set, if the current time is the preset time, based on the preset migration quantity, the same quantity of to-be-processed table data as the preset migration quantity is extracted from the settlement data table in the local settlement database, without the user triggering instruction, the data migration can be automatically implemented at a fixed time.

[0096] The application adopts the pre-configured mapping relationship for conversion, can realize the data migration between different types of databases, thereby realizing the synchronization of data, without manual operation, improving the data migration efficiency, and saving time.

[0097] Figure 4 The data processing device provided in the embodiment of the application is shown in a structural schematic diagram. As shown in the figure, the data processing device comprises an acquisition module 401, a processing module 402 and a transceiver module 403. Figure 4

[0098] The acquisition module 401 is configured to extract to-be-processed table data from the settlement data table in the local settlement database and put the to-be-processed table data into the local to-be-synchronized database, wherein the to-be-processed table data comprises a plurality of table fields and values corresponding to each table field. The acquisition module 401 is further configured to acquire a settlement data table identifier and a pre-configured mapping relationship between a data table identifier and a target data table identifier in a target database. The processing module 402 is configured to determine each target data table identifier corresponding to the settlement data table identifier according to the settlement data table identifier and the mapping relationship. The acquisition module 401 is further configured to acquire a pre-configured table field mapping relationship between a data table and each target data table corresponding to each target data table identifier according to the settlement data table identifier and each target data table identifier. The processing module 402 is further configured to generate an intermediate table corresponding to each target data table in the to-be-synchronized database based on the table field mapping relationship and the to-be-processed table data. The transceiver module 403 is configured to send the intermediate table in the to-be-synchronized database to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

[0099] In some embodiments, the acquisition module 401 extracts to-be-processed table data from the settlement data table in the local settlement database, specifically comprising: acquiring a table state corresponding to the settlement data table in the local settlement database; if the table state corresponding to a certain settlement data table is not completed data migration, extracting at least one table data with an unextracted data state from the settlement data table, and taking the extracted table data as the to-be-processed table data.

[0100] ​In some embodiments, the processing module 402 determines the target data table identifiers corresponding to the closing data table identifier according to the mapping relationship, specifically including: matching the closing data table identifier with the data table identifiers in the mapping relationship; determining the target data table identifiers corresponding to the data table identifiers in the mapping relationship matching the closing data table identifier as the target data table identifiers corresponding to the closing data table identifier.

[0101] In some embodiments, the processing module 402 generates the intermediate table corresponding to each target data table in the to-be-synchronized database based on the table field mapping relationship and the to-be-processed table data, specifically including: determining the table fields of each target data table in the to-be-synchronized database based on the to-be-processed table data and the table field mapping relationship corresponding to each target data table; and generating the intermediate table corresponding to each target data table according to the table fields of each target data table and the field corresponding values of the table fields of the to-be-processed table data corresponding to the table fields of the target data table.

[0102] In some embodiments, the processing module 402 is further configured to: search for the attachment information corresponding to the data identifier in the local closing file library according to the data identifier of the to-be-processed table data; obtain the searched attachment information, and send the attachment information to the corresponding server to store the attachment information and feed back the storage path of the attachment information; receive the storage path, associate the storage path with the to-be-processed table data, obtain the association information of the storage path and the to-be-processed table data, and send the association information to the target database.

[0103] In some embodiments, the transceiver module 403 is further configured to receive a data migration instruction, parse the data migration instruction, and obtain a migration quantity. The obtaining module 401 is further configured to extract the same number of to-be-processed table data as the migration quantity from the closing data table in the local closing database.

[0104] In some embodiments, the obtaining module 401 is further configured to, if the current time is a preset time, extract the same number of to-be-processed table data as the preset migration quantity from the closing data table in the local closing database based on the preset migration quantity.

[0105] The data processing apparatus provided by the embodiments of the present application can be used to execute the technical solutions of the data processing method in the above embodiments, and the implementation principles and technical effects are similar, which will not be described here.

[0106] It should be noted that the division of each module of the above apparatus is only a logical functional division, and all or part of the modules can be integrated into one physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; or all be implemented in the form of hardware; or part of the modules are implemented in the form of software called by a processing element, and part of the modules are implemented in the form of hardware.

[0107] Figure 5 A block diagram of a server for implementing the data processing method of the present application is shown in FIG. 5. The server 500 includes a memory 501, a processor 502 and a transceiver 503. Figure 5

[0108] The processor 502, the memory 501 and the transceiver 503 are electrically connected to each other.

[0109] The transceiver 503 is configured to transceive data.

[0110] The memory 501 stores computer-executable instructions.

[0111] The processor 502 executes the computer-executable instructions stored in the memory 501, so that the processor 502 executes the method provided in any of the above embodiments.

[0112] The present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the technical solution of the data processing method of the above embodiments.

[0113] The present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, the technical solution of the data processing method in the above embodiments can be implemented.

[0114] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. In actual implementation, another division mode can be used, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0115] The modules described as separate components can or can not be physically separated, and the components shown as modules can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to implement the present embodiment.

[0116] ​In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each module can be physically present alone, or two or more modules can be integrated in one unit. The above-mentioned modules can be realized in the form of hardware or in the form of hardware plus software function modules.

[0117] The integrated modules realized in the form of software function modules can be stored in a computer readable storage medium. The software function modules are stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute part of the steps of the method of each embodiment of the present application.

[0118] It should be understood that the above-mentioned processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.

[0119] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0120] The bus can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0121] The aforementioned storage medium can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0122] An exemplary storage medium is coupled to the processor so that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can exist as discrete components in the electrical control unit or the host device.

[0123] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware instructed by programs. The aforementioned programs can be stored in a computer readable storage medium. When the programs are executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes various storage media that can store program codes, such as a ROM, a RAM, a magnetic disk or an optical disk.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit the same; although the present application has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacements to some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, characterized by, The method comprises: obtaining a table state corresponding to a concluded data table in a local concluded database; if the table state corresponding to a certain concluded data table is not completed data migration, extracting at least one table data with a non-extracted data state from the concluded data table in the local concluded database, taking the extracted table data as to-be-processed table data, and putting the to-be-processed table data into a local to-be-synchronized database, wherein the to-be-processed table data comprises a plurality of table fields and values corresponding to each table field, and the concluded data table refers to a type of data table that has been processed in an office automation system; obtaining a mapping relationship between the concluded data table identifier and the preconfigured data table identifier and the target data table identifier in the target database, and determining each target data table identifier corresponding to the concluded data table identifier according to the concluded data table identifier and the mapping relationship; wherein the local concluded database is a non-relational database, and the target database is a relational database; obtaining a table field mapping relationship between the preconfigured data table and each target data table according to the concluded data table identifier and each target data table identifier; generating an intermediate table corresponding to each target data table in the to-be-synchronized database based on the table field mapping relationship and the to-be-processed table data; sending the intermediate table in the to-be-synchronized database to the target database, so that the target database performs insertion or update processing on the corresponding target data table based on the intermediate table; The method further comprises: finding the attachment information corresponding to the data identifier in the local concluded file library according to the data identifier of the to-be-processed table data; obtaining the found attachment information, sending the attachment information to the corresponding server, so that the server stores the attachment information and feeds back the storage path of the attachment information; receiving the storage path, associating the storage path with the to-be-processed table data, obtaining the association information of the storage path and the to-be-processed table data, and sending the association information to the target database.

2. The method of claim 1, wherein, The method further comprises: matching the concluded data table identifier with the data table identifier in the mapping relationship; determining each target data table identifier corresponding to the concluded data table identifier as the target data table identifier corresponding to the concluded data table identifier.

3. The method of claim 1, wherein, The method further comprises: determining the table fields of each target data table in the to-be-synchronized database based on the to-be-processed table data and the table field mapping relationship corresponding to each target data table; generating an intermediate table corresponding to each target data table according to the table fields of each target data table and the corresponding values of the table fields of the to-be-processed table data corresponding to the table fields of the target data table.

4. The method of claim 1, wherein, The method further comprises: receiving a data migration instruction, parsing the data migration instruction, and obtaining a migration quantity; Extract the same number of to-be-processed table data as the migration number from a completed data table in a local completed database.

5. The method of claim 1, wherein, The method further includes: If the current time is a preset time, extract the same number of to-be-processed table data as a preset migration number from a completed data table in a local completed database based on the preset migration number.

6. A data processing apparatus for implementing the data processing method of any one of claims 1 to 5, characterized in that, The device includes: An obtaining module is configured to extract to-be-processed table data from a completed data table in a local completed database and put the to-be-processed table data into a local to-be-synchronized database, wherein the to-be-processed table data includes a plurality of table fields and values corresponding to each table field. The obtaining module is further configured to obtain a mapping relationship between the completed data table identifier and a target data table identifier in a target database and a preconfigured data table identifier; The processing module is configured to determine each target data table identifier corresponding to the completed data table identifier based on the completed data table identifier and the mapping relationship; The obtaining module is further configured to obtain a table field mapping relationship between a preconfigured data table and each target data table corresponding to the completed data table identifier and each target data table identifier; The processing module is further configured to generate an intermediate table corresponding to each target data table based on the table field mapping relationship and the to-be-processed table data in the to-be-synchronized database; A transceiver is configured to send the intermediate table in the to-be-synchronized database to the target database, so that the target database performs data synchronization processing on the corresponding target data table based on the intermediate table.

7. A server, characterized by includes: a processor, a memory, and a transceiver; a processor, a memory, and a transceiver circuit are interconnected; a transceiver is configured to transceive data; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the processor executes the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method of any one of claims 1 to 5.

9. A computer program product, characterised in that, includes a computer program, which is executed by the processor to implement the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device and server

    CN115687293A