Database upgrading method, device and equipment and computer readable medium

Through the methods of full backup, incremental backup and differential data update, database upgrades are efficiently carried out, solving the problem of long downtime affecting business in the existing technology, and achieving the goal of completing database upgrades without affecting business.

CN119537394APending Publication Date: 2025-02-28CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411624859.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing database upgrade and data migration methods require downtime to export source database data and import into target databases, resulting in a long downtime for systems with large data volumes, which seriously affects business.

Method used

By responding to the database operation instructions, the changed business data in the source database is used for full backup, and the full backup data is transmitted to the target database under the business operation conditions; at the same time, incremental backup is performed based on the source database backup document and the target database recovery document to ensure that the target database is consistent with the source database data; finally, the differential data query conditions are used to query the business data table concurrently, identify the differential data table and update it to the target database.

Benefits of technology

While ensuring data integrity, it shortens the time spent on database upgrades, reduces the impact of database upgrades on business, and avoids long downtime.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537394A_ABST
    Figure CN119537394A_ABST
Patent Text Reader

Abstract

The invention discloses a database upgrading method, device and equipment and a computer readable medium, and relates to the technical field of big data. A specific embodiment of the method comprises the following steps: performing full-amount backup on a source database by utilizing variable business data in the source database, and transmitting full-amount backup data obtained by the full-amount backup to a target database under a business operation condition; the source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database; and concurrently querying the data volume of the business data table in the source database by using a thread according to the difference data query condition, and identifying the difference data table according to the data volume of the business data table in the source database and the data volume of the business data table in the target database so as to update the business data to the target database according to the difference data table. According to the embodiment, the influence of database upgrading on services can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a method, device, equipment and computer-readable medium for upgrading a database. Background Art

[0002] With the rapid development of the Internet and informatization, banking systems are pursuing higher performance, reliability and high scalability, so database upgrades and data migration have become a very important technical link.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: the database upgrade and data migration method requires downtime to export the data of the source database and then import it into the target database. The above method is not feasible for systems with large amounts of data, and the long downtime seriously affects the business. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, device, and computer-readable medium for upgrading a database, which can reduce the impact of the database upgrade on services.

[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for upgrading a database is provided, comprising:

[0006] In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation condition;

[0007] The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data;

[0008] The current timestamp is used as a difference data query condition, and the difference data query condition is used to concurrently query the data volume of the business data table in the source database using threads. The difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

[0009] In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation condition, including:

[0010] Based on the identifier of the source database and the identifier of the target database, establishing a connection relationship between the source database and the target database, and configuring a listener in the source database;

[0011] In response to a database operation indication, the changed business data in the source database is obtained through the listener, so as to use the changed business data in the source database to perform a full backup of the source database, and the full backup data obtained by the full backup is transmitted to the target database through the connection relationship under business operation conditions.

[0012] The full backup data obtained by the full backup is transmitted to the target database through the connection relationship under the business operation condition, including:

[0013] In the source database, according to the user identifier and the user authority data, the full backup data obtained by the full backup is transmitted to the target database through the connection relationship;

[0014] The full backup data meets the business operation conditions, and is stored in the target database based on the user identifier and the user authority data to ensure the validity of the user authority data.

[0015] The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data, including:

[0016] The source database meets the incremental backup condition, the source database backup document is obtained from the source database and the target database recovery document is obtained from the target database, and the source database backup document and the target database recovery document match;

[0017] The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database to make the target database consistent with the source database data.

[0018] The step of acquiring the source database backup document from the source database and acquiring the target database recovery document from the target database, wherein the database backup document matches the database recovery document, comprises:

[0019] Acquire the source database backup document from the source database and acquire the target database recovery document from the target database, wherein the source database backup document and the target database recovery document do not match;

[0020] According to the target database recovery document, a document is screened out from the source database historical backup document as the source database backup document, and the source database backup document matches the target database recovery document.

[0021] The method of using the difference data query condition and concurrently querying the data amount of the business data table in the source database by using threads includes:

[0022] Determine the number of threads based on the startup time of the target database and the amount of data in the source database corresponding to the current timestamp;

[0023] The current timestamp is used as a difference data query condition, and the difference data query condition is utilized to concurrently query the data volume of the business data table in the source database using the threads of the number of threads.

[0024] The step of identifying a difference data table according to the amount of data of the business data table in the source database and the amount of data of the business data table in the target database, so as to update the business data to the target database according to the difference data table, includes:

[0025] Identify the difference data table by comparing the data volume of the business data table in the source database with the data volume of the business data table in the target database;

[0026] After the difference table is exported in the source database, the difference data table is imported into the target database through an intermediate table.

[0027] According to a second aspect of an embodiment of the present invention, there is provided a device for upgrading a database, comprising:

[0028] A first backup module is used to perform a full backup of the source database using the changed business data in the source database in response to the database operation instruction, and transmit the full backup data obtained by the full backup to the target database under the business operation condition;

[0029] A second backup module is used for performing incremental backup of the source database according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmitting the incremental backup data to the target database so that the target database is consistent with the source database data;

[0030] An update module is used to use the current timestamp as a difference data query condition, use the difference data query condition to concurrently query the data volume of the business data table in the source database using threads, identify the difference data table according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

[0031] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for upgrading a database, comprising:

[0032] one or more processors;

[0033] a storage device for storing one or more programs,

[0034] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.

[0035] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.

[0036] According to a fifth aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the program is executed by a processor, the method as described above provided by an embodiment of the present invention is implemented.

[0037] One embodiment of the above invention has the following advantages or beneficial effects: in response to a database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under business operation conditions; the source database performs incremental backup based on the source database backup document and the target database recovery document to obtain incremental backup data, and the incremental backup data is transmitted to the target database so that the target database is consistent with the source database data; the current timestamp is used as a differential data query condition, and the differential data query condition is used to concurrently query the data volume of the business data table in the source database using threads, and the differential data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the differential data table. The full backup data, incremental backup data and differential data are used to implement the database upgrade from the source database to the target database, thereby shortening the time consumed for database upgrade while ensuring data integrity, and reducing the impact of database upgrade on business.

[0038] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0040] Figure 1 is a schematic diagram of the main flow of a method for upgrading a database according to an embodiment of the present invention;

[0041] Figure 2 is a schematic diagram of a process of performing a full backup of a source database by using changed business data in the source database according to an embodiment of the present invention;

[0042] Figure 3 is a schematic diagram of a process of transmitting full backup data to a target database through a connection relationship under business operation conditions according to an embodiment of the present invention;

[0043] Figure 4 It is a schematic diagram of a process of performing incremental backup to obtain incremental backup data based on a source database backup document and a target database recovery document according to an embodiment of the present invention;

[0044] Figure 5 is another flow chart of performing incremental backup based on a source database backup document and a target database recovery document to obtain incremental backup data according to an embodiment of the present invention;

[0045] Figure 6 It is a schematic diagram of a process of concurrently querying the data volume of a business data table in a source database by using a difference data query condition and adopting threads according to an embodiment of the present invention;

[0046] Figure 7 is a schematic diagram of a process of updating business data to a target database according to a difference data table according to an embodiment of the present invention;

[0047] Figure 8 is a schematic diagram of the main structure of a database upgrade device according to an embodiment of the present invention;

[0048] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0049] Fig.10 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description. The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0051] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0052] The database upgrade can be done in the following ways: After installing the new database software, shut down the server to export the business data of the source database, and then import the business data into the target database. After verifying the data integrity and validity, resume business services.

[0053] During the above database upgrade process, the downtime lasted from a few hours to more than 10 hours, and the larger the amount of data to be migrated, the longer the system downtime. For a system that needs to run 24 / 7 without interruption, the impact is huge. Long downtime seriously affects business.

[0054] In order to solve the problem that long downtime seriously affects business, the following technical solutions in the embodiments of the present invention can be adopted.

[0055] See also Figure 1 , Figure 1 1 is a schematic diagram of the main process of the method for upgrading a database according to an embodiment of the present invention, first using full backup; then using incremental backup; and finally upgrading the database data through the data table. Figure 1 As shown in 100, the following steps are specifically included:

[0056] S101 . In response to a database operation instruction, a source database is fully backed up using changed business data in the source database, and full backup data obtained by the full backup is transmitted to a target database under business operation conditions.

[0057] In one embodiment of the present invention, a database upgrade is required when receiving a database operation instruction. The database operation instruction includes a source database identifier and a target database identifier. In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database. That is, all changed business data are backed up in the source database to obtain full backup data, and then the full backup data is transmitted to the target database when the business operation conditions are met, so as to realize full data backup from the source database to the target database.

[0058] See also Figure 2 That is 200, Figure 2 This is a flow chart of performing a full backup of a source database using the changed business data in the source database according to an embodiment of the present invention. Specifically, the following steps are included:

[0059] S201: Based on the identifier of the source database and the identifier of the target database, a connection relationship is established between the source database and the target database, and a listener is configured in the source database.

[0060] In an embodiment of the present invention, in order to store the business data in the source database into the target database, it is necessary to establish a connection relationship between the source database and the target database. Specifically, based on the identifier of the source database and the identifier of the target database, the connection relationship between the source database and the target database is established. For example, a network attached storage (NAS) is used to build a connection relationship between the source database and the target database to achieve network access between the source database and the target database. The network access can be intranet access and / or extranet access.

[0061] In one embodiment of the present invention, considering that the business data in the source database needs to be stored in the target database, it is necessary to know the storage information of the business data in the source database. The source database is monitored by configuring a listener in the source database. For example, configure TNS (Transparent Network Substrate) pointing to the source database production monitor. Specifically, modify the three configuration files of tnsnames.ora, listener.ora and sqlnet.ora, and then configure the listener in the source database.

[0062] S202. In response to a database operation instruction, the changed business data in the source database is obtained through a listener, so as to perform a full backup of the source database using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database through a connection relationship under business operation conditions.

[0063] Receive and respond to a database operation indication. As an example, the database operation indication is actively triggered by a user through a client. As another example, in order to achieve data consistency between a source database and a target database and to achieve automatic upgrade of the target database, the database operation indication is triggered according to a preset database upgrade cycle.

[0064] The changed business data in the source database is acquired through the listener, so as to perform a full backup of the source database using the changed business data in the source database. As an example, the changed business data is recorded in a file in the source database, and then the source database is fully backed up according to the changed business data in the file in the source database.

[0065] Then, the full backup data obtained by the full backup is transferred to the target database through the connection relationship under the business operation condition. The business operation condition is a restriction condition to ensure the validity of the full backup data. In banking business, the validity of business data is the focus of attention. The validity of the full backup data is improved by adopting the business operation condition. As an example, the business operation condition is during the data validity period.

[0066] See also Figure 3 That is 300, Figure 3 This is a flow chart of the full backup data being transmitted to the target database through a connection relationship under business operation conditions according to an embodiment of the present invention. Specifically, the following steps are included:

[0067] S301. In the source database, according to the user identification and user authority data, the full backup data obtained by the full backup is transmitted to the target database through a connection relationship.

[0068] In an embodiment of the present invention, in order to ensure the consistency between the source database and the target database, a full backup may be implemented according to the user identification and the user authority data, wherein the user authority data corresponds to the user identification.

[0069] In the source database, according to the user ID and user authority data, the full backup data obtained by the full backup is transmitted to the target database through the connection relationship. In this way, the user ID and user authority data in the target database are consistent with those in the source database.

[0070] S302, the full backup data meets the business operation conditions, and the full backup data is stored in the target database based on the user identification and user authority data to ensure the validity of the user authority data.

[0071] The business operation conditions guarantee the validity of the full backup data. As an example, the business operation conditions include a data validity period of 48 hours. If the full backup data is created within 48 hours, the business operation conditions are met. In the target database, the full backup data is stored based on the user ID and user permission data to guarantee the validity of the user permission data.

[0072] exist Figure 3 In the embodiment, user identification and user authority data are used to ensure data consistency between the source database and the target database, and business operation conditions are used to determine the validity of the full backup data.

[0073] S102: The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data.

[0074] In the embodiment of the present invention, the business data in the source database changes over time, and the amount of data in the incremental backup is smaller than that in the full backup, so the incremental backup can be used on the basis of the full backup.

[0075] Specifically, the source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database to make the target database consistent with the source database data.

[0076] See also Figure 4 That is 400, Figure 4 This is a flow chart of performing incremental backup based on the source database backup document and the target database recovery document to obtain incremental backup data according to an embodiment of the present invention. Specifically, it includes the following steps:

[0077] S401. The source database meets the incremental backup condition, a source database backup document is obtained from the source database and a target database recovery document is obtained from the target database, and the source database backup document and the target database recovery document match.

[0078] In an embodiment of the present invention, an incremental backup condition is used to trigger an incremental backup from a source database to a target database. As an example, the incremental backup condition includes a preset incremental backup time interval. That is, the incremental backup is performed according to the preset incremental backup time interval.

[0079] The source database backup document is a document after performing incremental backup in the source database. As an example, the source database backup document includes a modified data identifier and a modified data time point in the source database.

[0080] The target database recovery document is a document after performing incremental backup in the target database. As an example, the target database backup document includes a modified data identifier and a modified data time point in the target database.

[0081] After completing an incremental backup, update the source database backup document and the target database recovery document.

[0082] The source database meets the incremental backup conditions, the source database backup document is obtained from the source database and the target database recovery document is obtained from the target database, and it is determined whether the incremental backups of the source database and the target database are synchronized based on the source database backup document and the target database recovery document.

[0083] In one embodiment of the present invention, the last modified data identifier and the last modified data time point in the source database backup document are the same as the current modified data identifier and the current modified data time point in the target database recovery document, indicating that the source database backup document and the target database recovery document match.

[0084] The last modified data identifier and the last modified data time point in the source database backup document are different from the current modified data identifier and the current modified data time point in the target database recovery document, indicating that the source database backup document and the target database recovery document do not match.

[0085] See also Figure 5 That is 500, Figure 5This is another flow chart of performing incremental backup based on the source database backup document and the target database recovery document to obtain incremental backup data according to an embodiment of the present invention. Specifically, it includes the following steps:

[0086] S501. Acquire a source database backup document from a source database and acquire a target database recovery document from a target database. The source database backup document and the target database recovery document do not match.

[0087] In one embodiment of the present invention, a source database backup document is obtained from a source database and a target database recovery document is obtained from a target database. If a last modified data identifier in the source database backup document is different from a current modified data identifier in the target database recovery document, and / or a last modified data time point in the source database backup document is different from a current modified data time point in the target database recovery document, it is determined that the source database backup document and the target database recovery document do not match.

[0088] S502: Filter out documents from the source database history backup documents as source database backup documents according to the target database recovery documents, and the source database backup documents match the target database recovery documents.

[0089] In an embodiment of the present invention, incremental backup is performed when the source database backup document and the target database recovery document match.

[0090] According to the target database recovery document, a document is selected from the source database historical backup document as the source database backup document, and the source database backup document matches the target database recovery document.

[0091] Specifically, the current modified data identifier and the current modified data time point in the target database recovery document are used to select documents from the source database historical backup document as the source database backup document. This indicates that the target database is successfully incrementally backed up to the database corresponding to the selected historical backup document, so it is necessary to implement incremental backup based on the database corresponding to the selected historical backup document.

[0092] According to the target database recovery document, the document is selected from the source database historical backup document as the source database backup document, and the source database backup document matches the target database recovery document.

[0093] exist Figure 5 In the embodiment, the documents selected from the historical backup documents of the source database are used as the backup documents of the source database to achieve matching between the backup documents of the source database and the recovery documents of the target database.

[0094] S402: The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data.

[0095] In the embodiment of the present invention, when the source database backup document and the target database recovery document match, it is ensured that the incremental backup can be correctly executed starting from the modified data identifier and modification time point of the last backup.

[0096] The source database performs incremental backup based on the source database backup document and the target database recovery document to obtain incremental backup data, that is, the incremental backup document created by the source database is transferred to the target database. The incremental backup data is transferred to the target database through the Secure Copy Protocol (Secure Copy Protocol) or the Network File System (NFS). Thus, the target database and the source database data are consistent.

[0097] exist Figure 4 In the embodiment, on the basis of full backup, multiple incremental backups are performed to make the source database consistent with the target database data.

[0098] S103, using the current timestamp as a difference data query condition, using the difference data query condition to concurrently query the data volume of the business data table in the source database using threads, identifying the difference data table according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

[0099] In the embodiment of the present invention, in order to improve the consistency between the source database and the target database, the difference data query condition may be used to determine the difference data table, thereby implementing the upgrade of the target database.

[0100] Specifically, the current timestamp is used as a difference data query condition, and the difference data query condition is used to concurrently query the data volume of the business data table in the source database using threads, thereby improving the query speed. Then, the difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table. The business data table is used to store business data in the database.

[0101] In one embodiment of the present invention, the differential data query condition is triggered to be executed after the incremental backup is completed. As an example, a SQL script is used to establish and trigger the differential data query condition.

[0102] See also Figure 6 That is 600, Figure 6This is a flow chart of using a difference data query condition to concurrently query the data volume of a business data table in a source database using threads according to an embodiment of the present invention. Specifically, the following steps are included:

[0103] S601 : Determine the number of threads based on the startup time of the target database and the amount of data in the source database corresponding to the current timestamp.

[0104] In an embodiment of the present invention, the target database needs to be started before the business data in the target database can be operated. At the same time, in order to improve the speed of comparing the difference between the target database and the source database, the startup time of the target database can be used to query the amount of data in the business data table in the source database. In this way, after the target database is started, the amount of data in the business data table in the source database and the amount of data in the business data table in the target database can be directly compared.

[0105] Specifically, the number of threads is determined based on the startup time of the target database and the amount of data in the source database corresponding to the current timestamp. As an example, when the number of threads is determined to be greater than or equal to 8, the time for querying the amount of data in the business data table in the source database is less than the startup time of the target database.

[0106] S602: Use the current timestamp as a difference data query condition, and use the difference data query condition to concurrently query the data volume of the business data table in the source database using the number of threads.

[0107] In an embodiment of the present invention, the current timestamp is used as a difference data query condition to set the comparison time point to the current timestamp. Further, the difference data query condition is used to concurrently query the data volume of the business data table in the source database using the number of threads. As an example, the business data table includes a table of high importance of banking business and a business data configuration table.

[0108] exist Figure 6 In an embodiment, the startup time of the target database is used to obtain the data volume of the source database service data packet to shorten the database upgrade time.

[0109] See also Figure 7 That is 700, Figure 7 This is a flow chart of updating business data to a target database according to a difference data table according to an embodiment of the present invention. Specifically, it includes the following steps:

[0110] S701. Identify difference data tables by comparing the data volume of the business data tables in the source database and the data volume of the business data tables in the target database.

[0111] In an embodiment of the present invention, the data volume of the business data table in the target database is directly acquired after the target database is started.

[0112] The difference data table is identified by comparing the data volume of the business data table in the source database with the data volume of the business data table in the target database. As an example, if the data volume of the business data table in the source database is different from the data volume of the business data table in the target database, a difference data table is obtained in the source database through a preset script. The difference data table includes the difference data between the business data table of the source database and the business data table of the target database.

[0113] S702: After exporting the difference table in the source database, import the difference data table into the target database through the intermediate table.

[0114] In an embodiment of the present invention, after the difference table is exported in the source database, the difference data table is imported into the target database through the intermediate table.

[0115] If the target database directly inserts data into the difference table, it may cause the target database to be locked for a long time, affecting business operations. Using an intermediate table can reduce direct operations on the target database, thereby shortening the target database lock time.

[0116] As an example, during off-peak hours, the data in the difference table is imported into the intermediate table, and then the intermediate table is used to import the data in the difference table from the intermediate table into the target database during off-peak hours. The intermediate table can be used as a data cache to reduce direct access to the source database and reduce the load on the source database.

[0117] exist Figure 7 In the embodiment, the data in the difference table in the source database is imported into the target database by using the intermediate table, thereby shortening the locking time of the target database.

[0118] In the above-mentioned embodiment of the present invention, in response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation conditions; the source database performs incremental backup based on the source database backup document and the target database recovery document to obtain incremental backup data, and the incremental backup data is transmitted to the target database to make the target database consistent with the source database data; the current timestamp is used as the difference data query condition, and the difference data query condition is used to concurrently query the data volume of the business data table in the source database using threads, and the difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table. The full backup data, incremental backup data and difference data are used to realize the database upgrade from the source database to the target database, thereby shortening the time consumed for database upgrade while ensuring data integrity, and reducing the impact of database upgrade on business.

[0119] See also Figure 8 , Figure 8 is a schematic diagram of the main structure of a database upgrade device according to an embodiment of the present invention. The database upgrade device can implement a database upgrade method, such as Figure 8 As shown in 800, the device for upgrading the database specifically includes:

[0120] The first backup module 801 is used to perform a full backup of the source database using the changed business data in the source database in response to the database operation instruction, and transmit the full backup data obtained by the full backup to the target database under the business operation condition;

[0121] The second backup module 802 is used for performing incremental backup on the source database according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmitting the incremental backup data to the target database so that the target database is consistent with the source database data;

[0122] Update module 803 is used to use the current timestamp as a difference data query condition, use the difference data query condition to concurrently query the data volume of the business data table in the source database using threads, identify the difference data table according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

[0123] In one embodiment of the present invention, the first backup module 801 is specifically configured to establish a connection relationship between the source database and the target database based on the identifier of the source database and the identifier of the target database, and configure a listener in the source database;

[0124] In response to a database operation indication, the changed business data in the source database is obtained through the listener, so as to use the changed business data in the source database to perform a full backup of the source database, and the full backup data obtained by the full backup is transmitted to the target database through the connection relationship under business operation conditions.

[0125] In one embodiment of the present invention, the first backup module 801 is specifically used to transmit the full backup data obtained by the full backup to the target database through the connection relationship according to the user identifier and the user authority data in the source database;

[0126] The full backup data meets the business operation conditions, and is stored in the target database based on the user identifier and the user authority data to ensure the validity of the user authority data.

[0127] In one embodiment of the present invention, the second backup module 802 is specifically configured to obtain the source database backup document from the source database and the target database recovery document from the target database when the source database meets the incremental backup condition, and the source database backup document and the target database recovery document match;

[0128] The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database to make the target database consistent with the source database data.

[0129] In one embodiment of the present invention, the second backup module 802 is specifically configured to obtain the source database backup document from the source database and obtain the target database recovery document from the target database, wherein the source database backup document and the target database recovery document do not match;

[0130] According to the target database recovery document, a document is screened out from the source database historical backup document as the source database backup document, and the source database backup document matches the target database recovery document.

[0131] In one embodiment of the present invention, the update module 803 is specifically used to determine the number of threads based on the startup time of the target database and the amount of data in the source database corresponding to the current timestamp;

[0132] The current timestamp is used as a difference data query condition, and the difference data query condition is utilized to concurrently query the data volume of the business data table in the source database using the threads of the number of threads.

[0133] In one embodiment of the present invention, the updating module 803 is specifically configured to identify a difference data table by comparing the data volume of the business data table in the source database with the data volume of the business data table in the target database;

[0134] After the difference table is exported in the source database, the difference data table is imported into the target database through an intermediate table.

[0135] Fig. 9 An exemplary system architecture 900 is shown to which the method or apparatus for upgrading a database according to an embodiment of the present invention may be applied.

[0136] like Fig. 9 As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0137] The user can use the terminal devices 901, 902, 903 to interact with the server 905 through the network 904 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 901, 902, 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0138] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0139] The server 905 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 901, 902, and 903. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0140] It should be noted that the database upgrade method provided in the embodiment of the present invention is generally executed by the server 905 , and accordingly, the database upgrade device is generally set in the server 905 .

[0141] It should be understood that Fig. 9 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0142] A computer program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the method for upgrading a database provided by an embodiment of the present invention is implemented.

[0143] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of a terminal device suitable for implementing an embodiment of the present invention. Fig.10 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0144] like Fig.10As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0145] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0146] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.

[0147] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be arranged in a processor, for example, they may be described as: a processor including a first backup module, a second backup module and an update module. The names of these modules do not constitute limitations on the modules themselves in certain cases. For example, the first backup module may also be described as "used to perform a full backup of the source database using the changed business data in the source database in response to a database operation instruction, and transmit the full backup data obtained by the full backup to the target database under business operation conditions".

[0150] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0151] In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation condition;

[0152] The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data;

[0153] The current timestamp is used as a difference data query condition, and the difference data query condition is used to concurrently query the data volume of the business data table in the source database using threads. The difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

[0154] According to the technical solution of the embodiment of the present invention, in response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation conditions; the source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and the incremental backup data is transmitted to the target database to make the target database consistent with the source database data; the current timestamp is used as the difference data query condition, and the difference data query condition is used to query the data volume of the business data table in the source database by concurrent threads, and the difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table. The full backup data, incremental backup data and difference data are used to realize the database upgrade from the source database to the target database, thereby shortening the time consumed for database upgrade while ensuring data integrity, and reducing the impact of database upgrade on business.

[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0156] It should be noted that in the technical solution of the present invention, the collection, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken for user personal information to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. Once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.

[0157] When applicable, including in certain relevant applications, protect user privacy by de-identifying data, such as by removing specific identifiers (e.g., date of birth, etc.) when applicable, controlling the amount or specificity of data stored (e.g., collecting location data at a city level rather than at a specific address level), controlling how data is stored, and / or other de-identification methods.

Claims

1. A method for upgrading a database, characterized in that: include: In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation condition; The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data; The current timestamp is used as a difference data query condition, and the difference data query condition is used to concurrently query the data volume of the business data table in the source database using threads. The difference data table is identified according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

2. The method for upgrading a database according to claim 1, characterized in that: In response to the database operation instruction, the source database is fully backed up using the changed business data in the source database, and the full backup data obtained by the full backup is transmitted to the target database under the business operation condition, including: Based on the identifier of the source database and the identifier of the target database, establishing a connection relationship between the source database and the target database, and configuring a listener in the source database; In response to a database operation indication, the changed business data in the source database is obtained through the listener, so as to use the changed business data in the source database to perform a full backup of the source database, and the full backup data obtained by the full backup is transmitted to the target database through the connection relationship under business operation conditions.

3. The method for upgrading a database according to claim 2, characterized in that: The full backup data obtained by the full backup is transmitted to the target database through the connection relationship under the business operation condition, including: In the source database, according to the user identifier and the user authority data, the full backup data obtained by the full backup is transmitted to the target database through the connection relationship; The full backup data meets the business operation conditions, and is stored in the target database based on the user identifier and the user authority data to ensure the validity of the user authority data.

4. The method for upgrading a database according to claim 1, characterized in that: The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database so that the target database is consistent with the source database data, including: The source database meets the incremental backup condition, the source database backup document is obtained from the source database and the target database recovery document is obtained from the target database, and the source database backup document and the target database recovery document match; The source database performs incremental backup according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmits the incremental backup data to the target database to make the target database consistent with the source database data.

5. The method for upgrading a database according to claim 4, characterized in that: The step of acquiring the source database backup document from the source database and acquiring the target database recovery document from the target database, wherein the database backup document matches the database recovery document, comprises: Acquire the source database backup document from the source database and acquire the target database recovery document from the target database, wherein the source database backup document and the target database recovery document do not match; According to the target database recovery document, a document is screened out from the source database historical backup document as the source database backup document, and the source database backup document matches the target database recovery document.

6. The method for upgrading a database according to claim 1, characterized in that: The method of using the difference data query condition and concurrently querying the data amount of the business data table in the source database by using threads includes: Determine the number of threads based on the startup time of the target database and the amount of data in the source database corresponding to the current timestamp; The current timestamp is used as a difference data query condition, and the difference data query condition is utilized to concurrently query the data volume of the business data table in the source database using the threads of the number of threads.

7. The method for upgrading a database according to claim 1, characterized in that: The step of identifying a difference data table according to the amount of data of the business data table in the source database and the amount of data of the business data table in the target database, so as to update the business data to the target database according to the difference data table, includes: Identify the difference data table by comparing the data volume of the business data table in the source database with the data volume of the business data table in the target database; After the difference table is exported in the source database, the difference data table is imported into the target database through an intermediate table.

8. A device for upgrading a database, characterized in that: include: A first backup module is used to perform a full backup of the source database using the changed business data in the source database in response to the database operation instruction, and transmit the full backup data obtained by the full backup to the target database under the business operation condition; A second backup module is used for performing incremental backup of the source database according to the source database backup document and the target database recovery document to obtain incremental backup data, and transmitting the incremental backup data to the target database so that the target database is consistent with the source database data; An update module is used to use the current timestamp as a difference data query condition, use the difference data query condition to concurrently query the data volume of the business data table in the source database using threads, identify the difference data table according to the data volume of the business data table in the source database and the data volume of the business data table in the target database, so as to update the business data to the target database according to the difference data table.

9. An electronic device for database upgrading, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.