Account set migration method and apparatus, computer device, and storage medium
By acquiring and merging backup files and business data from the source accounting sets, the problem of migrating multiple source accounting sets to a single target accounting set was solved, achieving efficient and low-cost accounting set migration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technology cannot merge and migrate data from multiple source accounts to a single target account, resulting in high migration costs and the need to purchase multiple target accounts on a new account management platform.
Obtain the target account set information and backup files of multiple source account sets, determine the database type of each source account set, store the backup files in the corresponding database, read the business data and merge it into the target object, and store it in the target database.
This technology enables the merging and migration of multiple source accounts to a single target account, reducing migration operations, improving efficiency, and lowering costs.
Smart Images

Figure CN114691653B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to methods, apparatus, computer equipment and storage media for account migration. Background Technology
[0002] An accounting system is a summary of information used by an enterprise to account for costs, expenses, income and expenditures within a certain period, as well as economic activities that occur in daily business operations. It includes accounting subjects, accounting vouchers, accounting books, financial statements, business data, etc.
[0003] An accounting set is an independent and complete collection of data, which includes a complete set of independent system control parameters, user permissions, basic files, accounting information, and account statement queries, thus forming an independent database.
[0004] In some scenarios, it is necessary to migrate source accounts from the original account management platform to a new account management platform. Existing technology can only migrate data from one source account to one target account. When the original account management platform has multiple source accounts that need to be migrated, it is not possible to merge the data of multiple source accounts into one target account. Instead, multiple target accounts must be purchased on the new account management platform, and the multiple source accounts must be migrated to the multiple target accounts separately. This results in high costs for migrating accounts. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for migrating multiple source sets of accounts into a single target set, addressing the aforementioned technical problems.
[0006] Firstly, this application provides a method for migrating an accounting system. The method includes:
[0007] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0008] The backup file for each source account set is stored in the database corresponding to the database type of each source account set;
[0009] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0010] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0011] In one embodiment, obtaining the target account set information and backup files of multiple source account sets includes:
[0012] Obtain the compressed file and target account information, store the compressed file in a network shared directory, and obtain the storage path of the compressed file in the network shared directory;
[0013] Unzip the compressed file corresponding to the storage path in the network shared directory to obtain backup files for multiple source account sets.
[0014] In one embodiment, determining the database type of each source account set based on the backup files of each source account set includes:
[0015] Obtain the filename of the backup file for each source account set, and determine the database type of each source account set based on the filename of the backup file.
[0016] In one embodiment, determining the business object of each source account set based on the target account set information and the business data of each source account set includes:
[0017] The business data of each source account set is serialized to obtain the preset format data of each source account set;
[0018] Based on the target account set information, the preset format data of each source account set is deserialized to obtain the data to be processed for each source account set, and the data to be processed for each source account set is encapsulated into a business object.
[0019] In one embodiment, storing the target object in the target database based on the target account information includes:
[0020] Locate the target database connection corresponding to the target account set information, and store the target object in the target database based on the target database connection.
[0021] In one embodiment, the method further includes:
[0022] Based on the filename of the backup file for each source account set, determine the sequence identifier for each source account set, where the sequence identifier of the source account set is used to reflect the business time of the source account set;
[0023] Accordingly, merging the business objects of multiple source account sets into a target object includes:
[0024] The business objects of multiple source accounts are merged sequentially according to the order of their sequence identifiers to obtain the target object.
[0025] Secondly, this application also provides an account set migration device. The device includes:
[0026] The database type determination module is used to obtain target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set.
[0027] The data storage module is used to store the backup files of each source account set into the database corresponding to the database type of each source account set;
[0028] The data processing module is used to read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0029] The migration module is used to merge business objects from multiple source accounts into a target object, and store the target object in the target database based on the target account information.
[0030] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0031] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0032] The backup file for each source account set is stored in the database corresponding to the database type of each source account set;
[0033] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0034] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0035] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0036] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0037] The backup file for each source account set is stored in the database corresponding to the database type of each source account set;
[0038] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0039] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0040] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0041] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0042] The backup file for each source account set is stored in the database corresponding to the database type of each source account set;
[0043] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0044] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0045] The aforementioned accounting system migration method, apparatus, computer equipment, storage medium, and computer program product acquire backup files of multiple source accounting systems, store the backup file of each source accounting system in a corresponding database, retrieve business data from each source accounting system's database, convert the business data of each source accounting system into the business objects required by the target accounting system, merge the business objects of each source accounting system to obtain the target object, and store the target object in the target database, thereby achieving the migration of multiple source accounting systems to the target accounting system. This accounting system migration method allows multiple source accounting systems to be merged and migrated to the target accounting system without the need to migrate multiple source accounting systems to multiple target accounting systems separately, reducing the number of migration operations and improving the efficiency of multiple source accounting system migration. Furthermore, it eliminates the need to purchase multiple target accounting systems for multiple source accounting systems, thus reducing the cost of accounting system migration for enterprises. Attached Figure Description
[0046] Figure 1 This is a diagram illustrating the application environment of the account migration method in one embodiment;
[0047] Figure 2 This is a flowchart illustrating an account migration method in one embodiment;
[0048] Figure 3 This is a flowchart illustrating the process of migrating N source account sets to a target account set in one embodiment.
[0049] Figure 4 This is a schematic diagram of the account migration system in another embodiment;
[0050] Figure 5 This is a flowchart illustrating the execution of an account migration method via an account migration system in another embodiment;
[0051] Figure 6 This is a structural block diagram of an account migration device in one embodiment;
[0052] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] The account migration method provided in this application can be implemented by a terminal, by a server, or by a combination of both, as shown in the example below. Figure 1 The application environment shown depicts a terminal 102 communicating with a server 104 via a network. A data storage system can store the data that the server 104 needs to process. The data storage system can be integrated onto the server 104, or it can be located in the cloud or on another network server.
[0055] Server 104 can obtain multiple source account set files and target information from terminal 102. Server 104 can store each source account set file in its corresponding database. Server 104 can obtain the business objects of each source account set file. Server 104 can also merge the business objects of multiple source account set files into a target object and store the target object in the target database. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0056] In one embodiment, such as Figure 2 As shown, a method for migrating accounting systems is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0057] S201. Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set.
[0058] In this context, "account set" refers to the collective name for all accounting business data files storing accounting objects, including accounting subjects, accounting vouchers, accounting books, financial statements, and business data. "Target account set information" refers to the information about the target account set, which can be used to locate the target account set. This information can be the target account set's internal key identifier. "Source account set" is the account set to be migrated; its backup file is a file obtained by backing up the business data from the database storing the source account set.
[0059] Backup files for multiple source accounting sets can be obtained from an Enterprise Resource Planning (ERP) system. The target accounting set can be established in another ERP system. The accounting set migration method described in this application is used to migrate multiple source accounting sets from one ERP system to a target accounting set in another ERP system. The ERP system includes, but is not limited to, manufacturing management systems, supply chain systems, human resources systems, financial systems, tax systems, and auditing systems.
[0060] Specifically, the server can obtain multiple source and target account set information sent by the terminal, as well as compressed files and target account set information sent by the terminal, and decompress the compressed files to obtain backup files of multiple source account sets.
[0061] The databases used to store business data for each source account set may differ, necessitating the storage of backup files for each source account set within that corresponding database. One implementation pre-defines the database type identifier for each source account set's backup files by including iteratively in the filenames, allowing the server to determine the database type based on the filename. Another implementation scans each source account set's backup files, determining the database type through a iterative process. Database types include, but are not limited to, SQL Server, MySQL, PostgreSQL, and Access.
[0062] S202. Save the backup file of each source account set to the database corresponding to the database type of each source account set.
[0063] Specifically, taking a backup file of a source account set as an example, the server connects to the database corresponding to the database type of the source account set's backup file, and stores the backup file of the source account set in its corresponding database through data recovery instructions.
[0064] In order to implement the account set migration method described in this application, a database corresponding to the database type of the source account set is created in advance. In the account set migration method, after the backup file of the source account set is stored in its corresponding database, the business data of the source account set can be obtained in the database corresponding to the source account set.
[0065] S203. Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0066] The business objects include at least one of the following: accounts, vouchers, ledgers, or reports.
[0067] Specifically, after saving the backup files of each source account set to the database, the server reads the business data of each source account set from the database of each source account set. The server can determine the business object corresponding to the target account set based on the target account set information, and determine the business object of each source account set based on the business data of each source account set.
[0068] S204. Merge the business objects of multiple source account sets into a target object, and store the target object in the target database based on the target account set information.
[0069] The target database is used to store data for the target account set.
[0070] Specifically, the server stores the business objects of multiple source accounts into one target object to merge the business objects of multiple source accounts into the target object; the server determines the target database connection of the target account based on the target account information, and the server stores the target object into the target database through the target database connection to realize the migration of multiple source accounts into one target account.
[0071] In the above-described account set migration method, backup files of multiple source account sets are obtained, and each source account set's backup file is saved to its corresponding database. Business data for each source account set is retrieved from its database, converted into the business objects required by the target account set, and then merged to obtain the target object. This target object is then stored in the target database, thus migrating multiple source account sets to the target account set. This method allows for the merging and migration of multiple source account sets to the target account set, eliminating the need for separate migrations from multiple source account sets to multiple target account sets. This reduces the number of migration operations and improves efficiency. Furthermore, it eliminates the need to purchase multiple target account sets for multiple source account sets, lowering the cost of account set migration for the enterprise.
[0072] In one embodiment, obtaining target account set information and backup files of multiple source account sets includes: obtaining a compressed file and target account set information; storing the compressed file in a network shared directory and obtaining the storage path of the compressed file in the network shared directory; and decompressing the compressed file corresponding to the storage path in the network shared directory to obtain backup files of multiple source account sets.
[0073] Specifically, the client sends a compressed file and target account information to the server. The server stores the compressed file in a subdirectory of a network shared directory and obtains the storage path of that subdirectory. Based on the storage path, the server reads the compressed file from the network shared directory and decompresses it. The decompressed file is located in the same subdirectory as the compressed file. The server scans this subdirectory to obtain backup files for multiple source account sets. After obtaining the backup files for multiple source account sets, the database can delete the compressed file from the network shared directory.
[0074] In the above embodiments, the compressed file is stored in a network shared directory, and the compressed file corresponding to the storage path is directly decompressed in the network shared directory to obtain backup files of multiple source account sets. This ensures that the compressed file does not occupy the server's memory, and the process of decompressing the compressed file does not occupy the server's operating resources, thus not affecting the server's performance.
[0075] In one embodiment, the server includes a file processing server and a database recovery server. The client sends a compressed file and target account information to the file processing server. The file processing server stores the compressed file in a subdirectory of a network shared directory and obtains the storage path of that subdirectory. The file processing server then sends a first request message to the database recovery server, carrying the storage path and target account information. The database recovery server obtains the first request message, the target account information carried in the first request message, and the storage path. Based on the storage path, the database recovery server reads the compressed file from the network shared directory and decompresses it. The decompressed file is located in the same subdirectory as the compressed file. The database recovery server scans this subdirectory to obtain backup files for multiple source account sets.
[0076] In the above embodiments, the client sends the compressed file and target account information to the file processing server. The file processing server stores the compressed file in a network shared directory and sends a first request message to the database recovery server. The database recovery server obtains the target account information from the first request message and retrieves backup files of multiple source account sets obtained by decompressing the compressed file from the network shared directory. Through the loosely coupled communication mechanism between the client, the file processing server, the network shared directory, and the database recovery server, the method of obtaining the target account information and backup files of multiple source account sets is more flexible.
[0077] In one embodiment, determining the database type of each source account set based on the backup file of each source account set includes: obtaining the filename of the backup file of each source account set, and determining the database type of each source account set based on the filename of the backup file of each source account set.
[0078] Specifically, the client pre-adds the database type identifier of the source account set to the filename of the backup file of the source account set. The server scans the filenames of the backup files of the source account set to obtain the database type identifier of the source account set, and then determines the database type of the source account set. For example, if the database type identifier of a certain source account set is SQL Server, then the database type of the source account set can be determined to be SQL Server.
[0079] In the above embodiments, scanning the filenames of backup files of the source account set to obtain the database type identifier of the source account set can quickly and accurately determine the database type of the source account set.
[0080] In one embodiment, the database recovery server saves the backup file of each source account set to the database corresponding to the database type of each source account set. After the database recovery server completes the saving of the backup file of each source account set, it obtains the database connection information of each source account set. The database recovery server sends a second request message to the data processing server. The second request message carries the target account set information, the database connection information of each source account set, and the database type of each source account set.
[0081] The second request information can be an HTTP request information. The data processing server receives the second request information and obtains the target account set information, the database connection information of each source account set, and the database type of each source account set carried in the second request information. Based on the database connection information of each source account set, the server obtains the business data of each source account set from the database corresponding to the database type of each source account set.
[0082] In the above embodiments, the database recovery server saves the backup file of each source account set to the database corresponding to the database type of each source account set, and sends the second request information to the data processing server. According to the second request information, the data processing server retrieves the business data of each source account set from the database corresponding to the database type of each source account set. Through the loosely coupled communication mechanism between the database recovery server and the data processing server, the way to retrieve the business data of each source account set is more flexible.
[0083] In one embodiment, the step of converting the business data of each source account set into a business object based on the target account set information includes: serializing the business data of each source account set to obtain a preset format data for each source account set; deserializing the preset format data of each source account set based on the target account set information to obtain the data to be processed for each source account set, and encapsulating the data to be processed for each source account set into a business object.
[0084] Specifically, taking a source account set as an example, the data processing server serializes the business data of the source account set to obtain the preset format data of the source account set. The preset format data can be, but is not limited to, JSON or XML format. The target account set information can be the internal code primary key ID of the target account set. The data processing server queries the business object corresponding to the internal code primary key ID. Based on the business object, the preset format data of the source account set is deserialized to read the data to be processed corresponding to the business object in the preset format data of the source account set. The data to be processed in the source account set is then encapsulated to obtain the business object of the source account set.
[0085] For example, the business objects corresponding to the target accounting set include accounts and vouchers. Through deserialization, the business data corresponding to the accounts and the business data corresponding to the vouchers are read from the preset format data of the source accounting set, and the business data corresponding to the accounts and the business data corresponding to the vouchers are encapsulated into business objects.
[0086] In the above embodiments, the business objects of the target account set are determined according to the target account set information. The business data corresponding to the business object is read from the preset format data of each source account set. The business data of each source account set is encapsulated into a business object, so that the business data of each source account set is converted into a business object of the same format, so as to facilitate the subsequent merging of the business objects of multiple source account sets into a target object.
[0087] In one embodiment, the target database connection corresponding to the target account set information is located, and the target object is stored in the target database based on the target database connection.
[0088] Specifically, the target account set information can be the internal key ID of the target account set. The data processing server pre-associates and saves the internal key ID and the target database connection. When the data processing server merges the business objects of multiple source account sets into a single target object, it looks up the target database connection corresponding to the internal key ID and stores the target object in the target database based on the target database connection.
[0089] In one embodiment, the method further includes: determining a sequence identifier for each source account set based on the filename of the backup file of each source account set, wherein the sequence identifier of the source account set is used to reflect the business time of the source account set.
[0090] Specifically, multiple source sets of accounts may be source sets from different months or different years. The sequence identifier of the source sets of accounts is determined according to the business time of the source sets of accounts. The sequence identifier of the source set with the earliest business time can be set to the smallest and the sequence identifier of the source set with the latest business time can be set to the largest, or the sequence identifier of the source set with the earliest business time can be set to the largest and the sequence identifier of the source set with the latest business time can be set to the smallest. This application embodiment does not make specific limitations on this.
[0091] For example, set the sequence identifier of the source account set for 2018 to 1, the sequence identifier of the source account set for 2019 to 2, the sequence identifier of the source account set for 2020 to 3, and the sequence identifier of the source account set for 2021 to 4; or, set the sequence identifier of the source account set for 2018 to 4, the sequence identifier of the source account set for 2019 to 3, the sequence identifier of the source account set for 2020 to 2, and the sequence identifier of the source account set for 2021 to 1.
[0092] The client obtains the business times of multiple source account sets, determines the sequence identifier of each source account set based on the business times, and adds the sequence identifier to the filename of the backup file of each source account set. The server obtains the backup file of each source account set and determines the sequence identifier of each source account set based on the filename of the backup file.
[0093] Once the server determines the sequence identifier for each source account set, the server merges the business objects of multiple source account sets sequentially according to the order of the sequence identifiers to obtain the target object.
[0094] Specifically, the business objects of multiple source accounts are saved to the initial object in ascending order of sequence identifier to obtain the target object; when the source account with the smallest sequence identifier is the source account with the earliest business time, the order of sequence identifier from smallest to largest is the order of business time from earliest to latest; when the source account with the smallest sequence identifier is the source account with the latest business time, the order of sequence identifier from smallest to largest is the order of business time from latest to earliest.
[0095] In the above embodiments, the business objects of each source account set in the target object are arranged according to sequential identifiers, so that continuous business data can be accurately queried in the target account set. For example, if multiple source account sets are source account sets from different years, after merging and migrating the source account sets of 2018, 2019 and 2020 to the target account set, data from June 2019 to June 2020 can be queried in the target account set. When it is necessary to query business data that is continuous in terms of business time but belongs to different source account sets, it is not necessary to query them separately in the source account sets. Continuous business data can be directly queried in the target account set, making the operation of querying continuous business data simpler.
[0096] In one embodiment, if the filename of the backup file of each source account set includes a sequence identifier, the business data of each source account set can be read sequentially from the database corresponding to the database type of each source account set in ascending order of the sequence identifier, and the business objects of each source account set can be determined sequentially in ascending order of the sequence identifier.
[0097] In one implementation, such as Figure 3 As shown, with the filename of the backup file for each source account set including a sequence identifier, the explanation is based on multiple source account sets, comprising N source account sets. The process involves reading the business data of each source account set from the database corresponding to its database type, determining the business objects of each source account set based on the target account set information and the business data of each source account set, merging the business objects of multiple source account sets into a target object, and storing the target object in the target database based on the target account set information.
[0098] In the database corresponding to the first source account set with sequence identifier 1, read the business data of the first source account set; in the database corresponding to the second source account set with sequence identifier 2, read the business data of the second source account set; ...; in the database corresponding to the Nth source account set with sequence identifier N, read the business data of the Nth source account set;
[0099] The business objects of the first source account set are determined based on the target account set information and the business data of the first source account set; the business objects of the second source account set are determined based on the target account set information and the business data of the second source account set; ...; the business objects of the Nth source account set are determined based on the target account set information and the business data of the Nth source account set;
[0100] Merge the business objects of N source accounts into a target object, and store the target object in the target database.
[0101] In one embodiment, such as Figure 4 As shown, the above-mentioned account migration method can be applied to an account migration system, which includes a client, a file processing server, a database recovery server, and a data processing server. The file processing server includes a file upload component and a network shared directory, and the database recovery server includes a backup file storage and processing component and a database.
[0102] The client sends the compressed file and target account set information to the file upload component. The file upload component stores the compressed file in a network shared directory and obtains the storage path. The file upload component then sends a first request message to the backup file storage processing component, which carries the storage path and target account set information. The backup file storage processing component obtains the storage path and target account set information based on the first request message. Based on the storage path, the backup file storage processing component decompresses the compressed file in the network shared directory, obtaining backup files for multiple source account sets. The backup file for each source account set is then stored in the corresponding database for each source account set. In the database, after the backup file storage processing component completes the storage of the backup file, it sends a second request message to the data processing server. The second request message carries the target account set information and the database type of each source account set. The data processing server determines the target account set information and the database type of each source account set based on the second request message. It reads the business data of each source account set from the database corresponding to the database type of each source account set. Based on the target account set information and the business data of each source account set, it obtains the business objects of each source account set. It merges the business objects of multiple source account sets into a target object and saves the target object to the target database.
[0103] In one embodiment, such as Figure 5 As shown, when the above-mentioned account set migration method is applied to the account set migration system, the account set migration method specifically includes:
[0104] The client obtains backup files of multiple source account sets to be migrated, determines the business time and database of each source account set, determines the sequence identifier of each source account set based on the business time, and determines the database type identifier based on the database of each source account set. The sequence identifier and database type identifier of each source account set are added to the filename of the backup file of each source account set. For example, the filename of the backup file of a source account set may include: 1_sqlserver, where 1 is the sequence identifier and sqlserver is the database type identifier.
[0105] The client compresses backup files from multiple source account sets into a compressed file, obtains the target account set information, and sends the compressed file and the target account set information to the file processing server.
[0106] The file processing server receives the compressed file and the target account information, stores the compressed file in a network shared directory, obtains the storage path, and sends the first request information to the database recovery server. The first request information carries the target account information and the storage path.
[0107] The database recovery server receives the first request information, decompresses the compressed file in the network shared directory according to the storage path carried in the first request information, obtains backup files of multiple source account sets, determines the database type and sequence identifier of each source account set according to the file name of each source account set's backup file, and saves the backup files of each source account set to the database corresponding to each source account set in sequence according to the sequence identifier. The database recovery server sends the second request information to the data processing server. The second request information carries the target account set information, the sequence identifier of each source account set, and the database type of each source account set.
[0108] The data processing server receives the second request information, determines the sequence identifier and database type of each source account set based on the second request information, and reads the business data of each source account set from the database corresponding to the database type of each source account set in ascending order of the sequence identifier; it finds the business object corresponding to the target account set information, and determines the business object of each source account set in ascending order of the sequence identifier based on the business data of each source account set; it merges the business objects of multiple source account sets into a target object in ascending order of the sequence identifier, and saves the target object to the target database.
[0109] In the above-described account set migration method, backup files of multiple source account sets are obtained, and each source account set's backup file is saved to its corresponding database. Business data for each source account set is retrieved from its database, converted into the business objects required by the target account set, and then merged to obtain the target object. This target object is then stored in the target database, thus migrating multiple source account sets to the target account set. This method allows for the merging and migration of multiple source account sets to the target account set, eliminating the need for separate migrations from multiple source account sets to multiple target account sets. This reduces the number of migration operations and improves efficiency. Furthermore, it eliminates the need to purchase multiple target account sets for multiple source account sets, lowering the cost of account set migration for the enterprise.
[0110] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0111] Based on the same inventive concept, this application also provides an account migration device for implementing the account migration method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more account migration device embodiments provided below can be found in the limitations of the account migration method described above, and will not be repeated here.
[0112] In one embodiment, such as Figure 6 As shown, an account migration device is provided, comprising:
[0113] The database type determination module 100 is used to obtain target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set.
[0114] The data storage module 200 is used to store the backup files of each source account set into the database corresponding to the database type of each source account set;
[0115] The data processing module 300 is used to read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0116] The migration module 400 is used to merge business objects from multiple source account sets into a target object, and store the target object in the target database based on the target account set information.
[0117] In one embodiment, the database type determination module includes:
[0118] A compressed file acquisition unit is used to acquire a compressed file and target account information, store the compressed file in a network shared directory, and acquire the storage path of the compressed file in the network shared directory;
[0119] The backup file acquisition unit is used to decompress the compressed file corresponding to the storage path in the network shared directory to obtain backup files of multiple source account sets.
[0120] In one embodiment, the database type determination module further includes:
[0121] The database type determination unit is used to obtain the filename of the backup file for each source account set and determine the database type of each source account set based on the filename of the backup file for each source account set.
[0122] In one embodiment, the data processing module includes:
[0123] The serialization processing unit is used to serialize the business data of each source account set to obtain the preset format data of each source account set.
[0124] The business object determination unit is used to deserialize the preset format data of each source account based on the target account information to obtain the data to be processed for each source account, and encapsulate the data to be processed for each source account into a business object.
[0125] In one embodiment, the migration module includes:
[0126] The merge migration unit is used to find the target database connection corresponding to the target account set information, and store the target object into the target database based on the target database connection.
[0127] In one embodiment, the account migration device further includes:
[0128] The sequence identifier determination module is used to determine the sequence identifier of each source account set based on the file name of the backup file of each source account set. The sequence identifier of the source account set is used to reflect the business time of the source account set.
[0129] Accordingly, the migration module is used to merge business objects from multiple source accounts in the order of their sequence identifiers to obtain the target object.
[0130] Each module in the aforementioned account migration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the corresponding operations of each module.
[0131] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an account migration method.
[0132] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0134] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0135] Save the backup file of each source account set to the database corresponding to the database type of each source account set;
[0136] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0137] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0138] In one embodiment, obtaining the target account set information and backup files of multiple source account sets includes:
[0139] Obtain the compressed file and target account information, store the compressed file in a network shared directory, and obtain the storage path of the compressed file in the network shared directory;
[0140] Unzip the compressed file corresponding to the storage path in the network shared directory to obtain backup files for multiple source account sets.
[0141] In one embodiment, determining the database type of each source account set based on the backup files of each source account set includes:
[0142] Obtain the filename of the backup file for each source account set, and determine the database type of each source account set based on the filename of the backup file.
[0143] In one embodiment, determining the business object of each source account set based on the target account set information and the business data of each source account set includes:
[0144] The business data of each source account set is serialized to obtain the preset format data of each source account set;
[0145] Based on the target account set information, the preset format data of each source account set is deserialized to obtain the data to be processed for each source account set, and the data to be processed for each source account set is encapsulated into a business object.
[0146] In one embodiment, storing the target object in the target database based on the target account information includes:
[0147] Locate the target database connection corresponding to the target account set information, and store the target object in the target database based on the target database connection.
[0148] In one embodiment, the method further includes:
[0149] Based on the filename of the backup file for each source account set, determine the sequence identifier for each source account set, where the sequence identifier of the source account set is used to reflect the business time of the source account set;
[0150] Accordingly, merging the business objects of multiple source account sets into a target object includes:
[0151] The business objects of multiple source accounts are merged sequentially in ascending order of their sequence identifiers to obtain the target object.
[0152] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0153] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0154] Save the backup file of each source account set to the database corresponding to the database type of each source account set;
[0155] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0156] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0157] In one embodiment, obtaining the target account set information and backup files of multiple source account sets includes:
[0158] Obtain the compressed file and target account information, store the compressed file in a network shared directory, and obtain the storage path of the compressed file in the network shared directory;
[0159] Unzip the compressed file corresponding to the storage path in the network shared directory to obtain backup files for multiple source account sets.
[0160] In one embodiment, determining the database type of each source account set based on the backup files of each source account set includes:
[0161] Obtain the filename of the backup file for each source account set, and determine the database type of each source account set based on the filename of the backup file.
[0162] In one embodiment, determining the business object of each source account set based on the target account set information and the business data of each source account set includes:
[0163] The business data of each source account set is serialized to obtain the preset format data of each source account set;
[0164] Based on the target account set information, the preset format data of each source account set is deserialized to obtain the data to be processed for each source account set, and the data to be processed for each source account set is encapsulated into a business object.
[0165] In one embodiment, storing the target object in the target database based on the target account information includes:
[0166] Locate the target database connection corresponding to the target account set information, and store the target object in the target database based on the target database connection.
[0167] In one embodiment, the method further includes:
[0168] Based on the filename of the backup file for each source account set, determine the sequence identifier for each source account set, where the sequence identifier of the source account set is used to reflect the business time of the source account set;
[0169] Accordingly, merging the business objects of multiple source account sets into a target object includes:
[0170] The business objects of multiple source accounts are merged sequentially in ascending order of their sequence identifiers to obtain the target object.
[0171] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0172] Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set;
[0173] Save the backup file of each source account set to the database corresponding to the database type of each source account set;
[0174] Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set.
[0175] The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information.
[0176] In one embodiment, obtaining the target account set information and backup files of multiple source account sets includes:
[0177] Obtain the compressed file and target account information, store the compressed file in a network shared directory, and obtain the storage path of the compressed file in the network shared directory;
[0178] Unzip the compressed file corresponding to the storage path in the network shared directory to obtain backup files for multiple source account sets.
[0179] In one embodiment, determining the database type of each source account set based on the backup files of each source account set includes:
[0180] Obtain the filename of the backup file for each source account set, and determine the database type of each source account set based on the filename of the backup file.
[0181] In one embodiment, determining the business object of each source account set based on the target account set information and the business data of each source account set includes:
[0182] The business data of each source account set is serialized to obtain the preset format data of each source account set;
[0183] Based on the target account set information, the preset format data of each source account set is deserialized to obtain the data to be processed for each source account set, and the data to be processed for each source account set is encapsulated into a business object.
[0184] In one embodiment, storing the target object in the target database based on the target account information includes:
[0185] Locate the target database connection corresponding to the target account set information, and store the target object in the target database based on the target database connection.
[0186] In one embodiment, the method further includes:
[0187] Based on the filename of the backup file for each source account set, determine the sequence identifier for each source account set, where the sequence identifier of the source account set is used to reflect the business time of the source account set;
[0188] Accordingly, merging the business objects of multiple source account sets into a target object includes:
[0189] The business objects of multiple source accounts are merged sequentially in ascending order of their sequence identifiers to obtain the target object.
[0190] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0191] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0192] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0193] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for migrating accounting records, characterized in that, The method includes: Obtain the target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set; The backup file for each source account set is stored in the database corresponding to the database type of each source account set; Read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set. The business objects of multiple source account sets are merged into a target object, and the target object is stored in the target database based on the target account set information; The target account set information is the internal code primary key ID of the target account set; The step of determining the business object of each source account set based on the target account set information and the business data of each source account set includes: The business data of each source account set is serialized to obtain the preset format data of each source account set; Query the business object corresponding to the internal code primary key ID, and deserialize the preset format data of each source account set according to the business object to read the data to be processed corresponding to the business object in the preset format data, and encapsulate the data to be processed of each source account set to obtain the business object of the source account set.
2. The method according to claim 1, characterized in that, The process of obtaining the target account set information and backup files of multiple source account sets includes: Obtain the compressed file and target account information, store the compressed file in a network shared directory, and obtain the storage path of the compressed file in the network shared directory; Unzip the compressed file corresponding to the storage path in the network shared directory to obtain backup files for multiple source account sets.
3. The method according to claim 1, characterized in that, The step of determining the database type of each source account set based on the backup files of each source account set includes: Obtain the filename of the backup file for each source account set, and determine the database type of each source account set based on the filename of the backup file.
4. The method according to claim 1, characterized in that, The step of storing the target object in the target database based on the target account information includes: Locate the target database connection corresponding to the target account set information, and store the target object in the target database based on the target database connection.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Based on the filename of the backup file for each source account set, determine the sequence identifier for each source account set, where the sequence identifier of the source account set is used to reflect the business time of the source account set; Accordingly, merging the business objects of multiple source account sets into a target object includes: The business objects of multiple source accounts are merged sequentially according to the order of their sequence identifiers to obtain the target object.
6. An account set migration device, characterized in that, The device includes: The database type determination module is used to obtain target account set information and backup files of multiple source account sets, and determine the database type of each source account set based on the backup file of each source account set. The data storage module is used to store the backup files of each source account set into the database corresponding to the database type of each source account set; The data processing module is used to read the business data of each source account set from the database corresponding to the database type of each source account set, and determine the business object of each source account set based on the target account set information and the business data of each source account set. The migration module is used to merge business objects from multiple source account sets into a target object, and store the target object in the target database based on the target account set information; The target account set information is the internal code primary key ID of the target account set; The data processing module includes: The serialization processing unit is used to serialize the business data of each source account set to obtain the preset format data of each source account set. The business object determination unit is used to query the business object corresponding to the internal code primary key ID, and perform deserialization processing on the preset format data of each source account set according to the business object, so as to read the data to be processed corresponding to the business object in the preset format data, and encapsulate the data to be processed of each source account set to obtain the business object of the source account set.
7. The apparatus according to claim 6, characterized in that, The database type determination module includes: A compressed file acquisition unit is used to acquire a compressed file and target account information, store the compressed file in a network shared directory, and acquire the storage path of the compressed file in the network shared directory; The backup file acquisition unit is used to decompress the compressed file corresponding to the storage path in the network shared directory to obtain backup files of multiple source account sets.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Database content combination method and device
CN105320681A