Database upgrading method and device, storage medium and electronic equipment

By synchronizing the data of the initial database to a shadow database with the same environmental parameters, database upgrades and data updates are performed, and inefficiency caused by manual import and export of data during database upgrades is solved, and efficient database upgrades and data consistency is achieved.

CN119739726APending Publication Date: 2025-04-01INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411843258.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, data needs to be manually imported and exported when upgrading databases, resulting in low upgrade efficiency and lack of effective solutions.

Method used

By synchronizing the data of the initial database to be upgraded to the shadow database, the shadow database is the same as the environment parameter information corresponding to the initial database, the initial database is upgraded, the shadow database is updated based on the preset business rules, and the target database is obtained based on the updated shadow database data.

Benefits of technology

It avoids manual import and export of data, improves the efficiency of database upgrade, and updates the shadow database through preset business rules, avoids data inconsistency caused by daily cuts, and improves data accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739726A_ABST
    Figure CN119739726A_ABST
Patent Text Reader

Abstract

The invention discloses a database upgrading method and device, a storage medium and electronic equipment. The method relates to the field of financial science and technology and comprises the steps that data of an initial database to be upgraded is synchronized to a shadow database, and environment parameter information corresponding to the shadow database and environment parameter information corresponding to the initial database are the same; carrying out upgrading processing on the initial database to obtain an upgraded initial database; updating the data in the shadow database based on a preset business rule to obtain an updated shadow database; and processing the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database. Through the method and the device, the problem of relatively low upgrading efficiency of the database due to the fact that data needs to be manually imported and exported when the database is upgraded in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and specifically, to a database upgrade method and device, a storage medium, and an electronic device. Background Art

[0002] Batch business of large financial institutions is usually carried out at night (i.e., during the daytime), including account settlement, interest calculation, transaction processing, etc. During database upgrade, migration or maintenance, it is necessary to switch the batch business database to ensure the continuous operation of the business. However, in the prior art, database switching usually involves the following steps: before switching, export the data in the existing database; after the database upgrade is completed, import the data, but manual export and import of data has the problem of low efficiency.

[0003] With regard to the problem in the related art that manual import and export of data is required when upgrading a database, resulting in relatively low database upgrade efficiency, no effective solution has been proposed yet. Summary of the invention

[0004] The main purpose of the present application is to provide a database upgrade method and device, a storage medium and an electronic device to solve the problem in the related art that manual import and export of data is required when upgrading the database, resulting in relatively low database upgrade efficiency.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for upgrading a database is provided. The method comprises: synchronizing data of an initial database to be upgraded to a shadow database, wherein the environmental parameter information corresponding to the shadow database and the initial database is the same; performing an upgrade process on the initial database to obtain an upgraded initial database; updating the data in the shadow database based on preset business rules to obtain an updated shadow database; and processing the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

[0006] Furthermore, before synchronizing the data of the initial database to be upgraded to the shadow database, the method also includes: obtaining environmental parameter information of the initial database; building an initial shadow database based on the environmental parameter information; configuring the initial shadow database based on the storage engine of the initial database to obtain the shadow database.

[0007] Furthermore, synchronizing the data of the initial database to be upgraded to the shadow database includes: creating a database link between the shadow database and the initial database; and synchronizing the data of the initial database to the shadow database based on the database link.

[0008] Furthermore, the data in the shadow database is updated based on preset business rules to obtain an updated shadow database, including: determining preset business rules at the time of daily cutting according to the type of the first financial business, wherein the preset business rules are change rules for the data in the shadow database; determining the first data to be updated in the shadow database according to the preset business rules; and updating the first data to obtain the updated shadow database.

[0009] Furthermore, processing the data in the upgraded initial database according to the data in the updated shadow database to obtain the target database includes: performing consistency check on the data in the updated shadow database and the data in the upgraded initial database to obtain a check result; if the check result indicates that there is a second data in the upgraded initial database that is different from the data in the shadow database, overwriting the second data according to the data in the updated shadow database to obtain the target database; if the check result indicates that the data in the upgraded initial database is the same as the data in the shadow database, determining the upgraded initial database as the target database.

[0010] Furthermore, during the process of upgrading the initial database, the method also includes: obtaining a processing instruction for a second financial service triggered by a target object; determining change information of data in the initial database based on the processing instruction; and recording the change information in a log file.

[0011] Furthermore, after processing the data in the upgraded initial database based on the data in the updated shadow database to obtain the target database, the method further includes: obtaining the change information from the log file; and updating the data in the target database based on the change information.

[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a database upgrade device is provided. The device comprises: a synchronization unit, used to synchronize the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; a first processing unit, used to perform upgrade processing on the initial database to obtain an upgraded initial database; a first updating unit, used to update the data in the shadow database based on preset business rules to obtain an updated shadow database; and a second processing unit, used to process the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

[0013] Furthermore, the device also includes: a first acquisition unit, used to obtain environmental parameter information of the initial database before synchronizing the data of the initial database to be upgraded to the shadow database; a construction unit, used to build an initial shadow database based on the environmental parameter information; and a configuration unit, used to configure the initial shadow database based on the storage engine of the initial database to obtain the shadow database.

[0014] Furthermore, the synchronization unit includes: a creation module, used to create a database link between the shadow database and the initial database; and a synchronization module, used to synchronize the data of the initial database to the shadow database based on the database link.

[0015] Furthermore, the first update unit includes: a first determination module, used to determine the preset business rules at the time of daily cutting based on the type of the first financial business, wherein the preset business rules are the change rules of the data in the shadow database; a second determination module, used to determine the first data to be updated in the shadow database based on the preset business rules; an update module, used to update the first data to obtain the updated shadow database.

[0016] Furthermore, the second processing unit includes: a verification module, which is used to perform consistency verification on the data in the updated shadow database and the data in the upgraded initial database to obtain a verification result; an overwriting module, which is used to overwrite the second data based on the data in the updated shadow database to obtain the target database if the verification result indicates that there is a difference between the second data in the upgraded initial database and the data in the shadow database; and a third determination module, which is used to determine the upgraded initial database as the target database if the verification result indicates that the data in the upgraded initial database is the same as the data in the shadow database.

[0017] Furthermore, the device also includes: a second acquisition unit, used to obtain the processing instructions of the second financial business triggered by the target object during the process of upgrading the initial database; a determination unit, used to determine the change information of the data in the initial database based on the processing instructions; and a recording unit, used to record the change information in a log file.

[0018] Furthermore, the device also includes: a third acquisition unit, used to process the data in the upgraded initial database based on the data in the updated shadow database, and after obtaining the target database, obtain the change information from the log file; a second update unit, used to update the data in the target database based on the change information.

[0019] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the steps of any one of the above-mentioned method embodiments.

[0020] In order to achieve the above-mentioned purpose, according to another aspect of the present application, there is further provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned method embodiments.

[0021] In the embodiment of the present application, the data of the initial database to be upgraded is synchronized to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; the initial database is upgraded to obtain an upgraded initial database; the data in the shadow database is updated based on preset business rules to obtain an updated shadow database; the data in the upgraded initial database is processed according to the data in the updated shadow database to obtain a target database, which solves the technical problem in the related art that manual import and export of data is required when upgrading the database, resulting in relatively low database upgrade efficiency. In this solution, manual import and export of data is avoided through data interaction between the shadow database and the initial database, and when the initial database is upgraded, the data in the shadow database will also be updated based on preset business rules, which can effectively avoid the problem of inconsistent data in the upgraded initial database caused by daily cutting, thereby achieving the effect of improving data accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0023] Figure 1 is a hardware structure block diagram of a computer terminal provided according to an embodiment of the present application;

[0024] Figure 2 is a flowchart of a database upgrade method provided according to an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of a database upgrade device provided according to an embodiment of the present application;

[0026] Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[0030] Example 1

[0031] According to an embodiment of the present application, a method embodiment for upgrading a database is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1The hardware structure block diagram of a computer terminal (or mobile device) for implementing a database upgrade method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0033] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the database upgrade method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned database upgrade method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0036] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0037] Under the above operating environment, this application provides Figure 2 The database upgrade method shown. Figure 2 It is a flowchart of a database upgrade method according to the first embodiment of the present application.

[0038] Step S201, synchronizing the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database.

[0039] Optionally, after determining the initial database to be upgraded, a shadow database with exactly the same environmental parameter information as that of the initial database can be built, and then the data of the initial database to be upgraded can be synchronized to the shadow database. For example, data synchronization can be achieved by capturing the transaction log of the database and transferring it to the shadow database, or by setting a trigger on the initial database. When data is inserted, updated or deleted, the trigger will automatically execute predefined operations to synchronize the data to the shadow database.

[0040] Step S202, upgrading the initial database to obtain an upgraded initial database.

[0041] Optionally, an upgrade code package corresponding to the initial database is obtained, and the initial database is upgraded according to the upgrade code package to obtain an upgraded initial database.

[0042] Step S203: updating the data in the shadow database based on preset business rules to obtain an updated shadow database.

[0043] Optionally, database upgrades are often performed during the daily cutting period, which often involves the execution of some fixed businesses, such as account settlement, interest calculation, etc. In order to avoid data inconsistency problems, the data in the shadow database can be updated according to the preset business rules during the daily cutting period to obtain an updated shadow database.

[0044] Step S204, processing the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

[0045] Optionally, after the initial database is upgraded, the data in the upgraded initial database is processed by using the data in the updated shadow database to obtain the target database.

[0046] In summary, the data interaction between the shadow database and the initial database avoids manual import and export of data. When the initial database is upgraded, the data in the shadow database will be updated based on the preset business rules, which can effectively avoid the problem of data inconsistency in the upgraded initial database caused by daily cutting, thereby achieving the effect of improving data accuracy.

[0047] Optionally, in the database upgrade method provided in the embodiment of the present application, before synchronizing the data of the initial database to be upgraded to the shadow database, the method also includes: obtaining environmental parameter information of the initial database; building an initial shadow database based on the environmental parameter information; configuring the initial shadow database based on the storage engine of the initial database to obtain a shadow database.

[0048] In an optional embodiment, the following steps are used to construct a shadow database: obtain environmental parameter information of the initial database, such as database table structure, maximum number of connections, etc. Build an initial shadow database according to the environmental parameter information, and then configure the initial shadow database according to the storage engine of the initial database to obtain a shadow database.

[0049] The above steps ensure the consistency of the shadow database and the initial database, which can ensure that the data in the shadow database is always synchronized with the initial database, thereby ensuring that when the initial database is subsequently upgraded, the consistency of the updated database data can be verified based on the shadow database.

[0050] Optionally, in the database upgrade method provided in the embodiment of the present application, synchronizing the data of the initial database to be upgraded to the shadow database includes: creating a database link between the shadow database and the initial database; based on the database link, synchronizing the data of the initial database to the shadow database.

[0051] In an optional embodiment, the following steps are used to synchronize data: a database link is created between the shadow database and the initial database, and the data of the initial database is synchronized to the shadow database through the database link.

[0052] It should be noted that the data of the initial database can be synchronized to the shadow database in the following ways: Input parameters: source Database (initial database): batch business data extracted from the source system. Target Database (shadow database): database connection information in the target system. mappingSchema (mapping schema): defines the mapping relationship between the source data and the target database structure. Output parameters: loadingSuccess (loading success): Boolean value, indicating whether the data is successfully loaded into the target database.

[0053] Specifically include: Initialize the database connection and use the connection information of the target database. Traverse each record in the initial database: Build SQL insert or update statements: Prepare to insert records into the shadow database; Execute SQL statements to load records into the shadow database. Check the SQL execution results to confirm whether the records are loaded successfully. If all records are loaded successfully, set loadingSuccess to True. If any record fails to load, record the error message and set loadingSuccess to False. Close the database connection. Return the value of loadingSuccess.

[0054] By building a database link, the data of the initial database can be synchronized to the shadow database more accurately and efficiently.

[0055] Optionally, in the database upgrade method provided in the embodiment of the present application, the data in the shadow database is updated based on preset business rules to obtain an updated shadow database, including: determining the preset business rules at the time of daily cut-off based on the type of the first financial business, wherein the preset business rules are the rules for changing the data in the shadow database; determining the first data to be updated in the shadow database based on the preset business rules; and updating the first data to obtain an updated shadow database.

[0056] In an optional embodiment, updating the data in the shadow database according to preset business rules includes the following steps: determining the preset business rules at the time of daily cutting according to the type of the first financial business, for example, the update rules for interest business at the time of daily cutting, or the update rules for regular transfer business at the time of daily cutting.

[0057] The first data to be updated in the shadow database is determined according to the preset business rules, and finally the first data is updated to obtain an updated shadow database.

[0058] The above steps can ensure that the data in the shadow database is updated normally during the daily switching period, avoiding the problem of subsequent data inconsistency.

[0059] Optionally, in the database upgrade method provided in the embodiment of the present application, the data in the upgraded initial database is processed according to the data in the updated shadow database to obtain the target database, including: performing consistency check on the data in the updated shadow database and the data in the upgraded initial database to obtain a check result; if the check result indicates that there is a second data in the upgraded initial database that is different from the data in the shadow database, overwriting the second data according to the data in the updated shadow database to obtain the target database; if the check result indicates that the data in the upgraded initial database is the same as the data in the shadow database, determining the upgraded initial database as the target database.

[0060] In an optional embodiment, processing the data in the upgraded initial database to obtain the target database includes the following steps: performing consistency check on the data in the updated shadow database and the data in the upgraded initial database to obtain a check result.

[0061] For example, input parameter: sourceData (updated shadow database): business data in the updated shadow database. TargetData (upgraded initial database): data in the upgraded initial database. Output parameter: consistencyResult (consistency result): Boolean value, indicating whether the business data in the updated shadow database is consistent with the data in the upgraded initial database.

[0062] Specific steps: Sort the business data in the updated shadow database and the data in the upgraded initial database to ensure that the comparison order is consistent. Traverse the business data in the updated shadow database and the data in the upgraded initial database and compare the corresponding records: a. Compare the field values ​​of each source data record with the target data record. b. If all field values ​​match, the records are consistent and continue with the next pair of comparisons. c. If any field values ​​do not match, the records are inconsistent, set consistency Result to False, and record the inconsistent data. If all records have been compared and no inconsistencies are found, return consistency Result as True. If inconsistencies are found, return consistency Result as False and inconsistent data.

[0063] If the verification result indicates that there is a difference between the second data in the upgraded initial database and the data in the shadow database, the second data is directly overwritten by the data in the updated shadow database to obtain the target database; if the verification result indicates that the data in the upgraded initial database is the same as the data in the shadow database, the upgraded initial database is determined as the target database.

[0064] By processing the data in the upgraded initial database with the data in the updated shadow database, it can be ensured that the upgraded initial database accurately records the data changes during the daily cut, thus avoiding the problem of data inconsistency.

[0065] Optionally, in the database upgrade method provided in the embodiment of the present application, during the process of upgrading the initial database, the method also includes: obtaining the processing instructions of the second financial business triggered by the target object; determining the change information of the data in the initial database based on the processing instructions; and recording the change information in a log file.

[0066] In an optional embodiment, for the sake of business continuity, during the process of upgrading the initial database, it is still necessary to process the financial services triggered by the user normally. For example, a trigger may be set in the initial database to receive a processing instruction for a second financial service triggered by the user (i.e., the target object mentioned above) during the process of upgrading the initial database, such as a transfer service. The trigger determines the change information that will occur to the data in the initial database based on the processing instruction, and records the change information in the log file of the initial database so that the data in the database can be updated later.

[0067] The above steps ensure the continuous operation of financial services during the upgrade of the initial database, thereby improving the user experience.

[0068] Optionally, in the database upgrade method provided in the embodiment of the present application, after processing the data in the upgraded initial database based on the data in the updated shadow database to obtain the target database, the method also includes: obtaining change information from the log file; and updating the data in the target database based on the change information.

[0069] In an optional embodiment, after the data in the upgraded initial database is processed based on the data in the updated shadow database, the following steps are also included: obtaining from the log file information on data changes caused by financial services triggered by users during the process of upgrading the initial database, and updating the data in the target database based on the change information to ensure data consistency.

[0070] The above steps ensure the continuous operation of the business, reduce operational complexity and risks, avoid daily inconsistencies, improve the stability and security of the financial business system, and provide users with a better service experience.

[0071] The database upgrade method provided in the embodiment of the present application is to synchronize the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; perform upgrade processing on the initial database to obtain an upgraded initial database; update the data in the shadow database based on preset business rules to obtain an updated shadow database; process the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database, thereby solving the technical problem in the related art that manual import and export of data is required when upgrading the database, resulting in relatively low database upgrade efficiency. In this solution, manual import and export of data is avoided through data interaction between the shadow database and the initial database, and when the initial database is upgraded, the data in the shadow database will also be updated based on preset business rules, which can effectively avoid the problem of inconsistent data in the upgraded initial database caused by daily cutting, thereby achieving the effect of improving data accuracy.

[0072] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0073] Example 2

[0074] The embodiment of the present application also provides a database upgrade device. It should be noted that the database upgrade device of the embodiment of the present application can be used to execute the database upgrade method provided in the embodiment of the present application. The database upgrade device provided in the embodiment of the present application is introduced below.

[0075] According to an embodiment of the present application, a device for implementing the above database upgrade method is also provided, such as Figure 3 As shown, the device includes: a synchronization unit 301, a first processing unit 302, a first updating unit 303 and a second processing unit 304.

[0076] A synchronization unit 301 is used to synchronize the data of the initial database to be upgraded to the shadow database, wherein the environment parameter information corresponding to the shadow database is the same as that of the initial database;

[0077] The first processing unit 302 is used to upgrade the initial database to obtain an upgraded initial database;

[0078] A first updating unit 303, configured to update the data in the shadow database based on a preset business rule to obtain an updated shadow database;

[0079] The second processing unit 304 is used to process the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

[0080] The database upgrade device provided in the embodiment of the present application synchronizes the data of the initial database to be upgraded to the shadow database through the synchronization unit 301, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; the first processing unit 302 performs upgrade processing on the initial database to obtain the upgraded initial database; the first update unit 303 updates the data in the shadow database based on the preset business rules to obtain the updated shadow database; the second processing unit 304 processes the data in the upgraded initial database according to the data in the updated shadow database to obtain the target database, which solves the technical problem in the related technology that the manual import and export of data is required when upgrading the database, resulting in a relatively low upgrade efficiency of the database. In this solution, the manual import and export of data is avoided through the data interaction between the shadow database and the initial database, and when the initial database is upgraded, the data in the shadow database will also be updated based on the preset business rules, which can effectively avoid the problem of inconsistent data in the upgraded initial database caused by daily cutting, thereby achieving the effect of improving data accuracy.

[0081] Optionally, in the database upgrade device provided in the embodiment of the present application, the device also includes: a first acquisition unit, used to obtain environmental parameter information of the initial database before synchronizing the data of the initial database to be upgraded to the shadow database; a building unit, used to build an initial shadow database based on the environmental parameter information; a configuration unit, used to configure the initial shadow database based on the storage engine of the initial database to obtain a shadow database.

[0082] Optionally, in the database upgrade device provided in the embodiment of the present application, the synchronization unit includes: a creation module for creating a database link between the shadow database and the initial database; and a synchronization module for synchronizing the data of the initial database to the shadow database based on the database link.

[0083] Optionally, in the database upgrade device provided in the embodiment of the present application, the first update unit includes: a first determination module, used to determine the preset business rules at the time of daily cutting based on the type of the first financial business, wherein the preset business rules are the change rules of the data in the shadow database; a second determination module, used to determine the first data to be updated in the shadow database based on the preset business rules; an update module, used to update the first data to obtain an updated shadow database.

[0084] Optionally, in the database upgrade device provided in the embodiment of the present application, the second processing unit includes: a verification module, which is used to perform consistency verification on the data in the updated shadow database and the data in the upgraded initial database to obtain a verification result; an overwriting module, which is used to overwrite the second data based on the data in the updated shadow database to obtain a target database if the verification result indicates that there is a difference between the second data in the upgraded initial database and the data in the shadow database; and a third determination module, which is used to determine the upgraded initial database as the target database if the verification result indicates that the data in the upgraded initial database is the same as the data in the shadow database.

[0085] Optionally, in the database upgrade device provided in the embodiment of the present application, the device also includes: a second acquisition unit, used to obtain the processing instructions of the second financial business triggered by the target object during the upgrade of the initial database; a determination unit, used to determine the change information of the data in the initial database based on the processing instructions; and a recording unit, used to record the change information in a log file.

[0086] Optionally, in the database upgrade device provided in the embodiment of the present application, the device also includes: a third acquisition unit, used to process the data in the upgraded initial database based on the data in the updated shadow database, and after obtaining the target database, obtain change information from the log file; a second update unit, used to update the data in the target database based on the change information.

[0087] It should be noted that the synchronization unit 301, the first processing unit 302, the first updating unit 303 and the second processing unit 304 described above correspond to steps S201 to S204 in the first embodiment, and the four units and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the first embodiment. It should be noted that the modules or units described above may be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the modules described above may also be run in the computer terminal 10 provided in the first embodiment as part of the device.

[0088] Example 3

[0089] An embodiment of the present application may provide an electronic device, Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (only one is shown) processor 402, memory 404, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0090] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0091] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: synchronize the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; upgrade the initial database to obtain an upgraded initial database; update the data in the shadow database based on preset business rules to obtain an updated shadow database; process the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

[0092] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain the environmental parameter information of the initial database; build an initial shadow database based on the environmental parameter information; configure the initial shadow database based on the storage engine of the initial database to obtain a shadow database.

[0093] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: synchronizing the data of the initial database to be upgraded to the shadow database, including: creating a database link between the shadow database and the initial database; based on the database link, synchronizing the data of the initial database to the shadow database.

[0094] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: update the data in the shadow database based on the preset business rules, and obtain the updated shadow database including: determine the preset business rules at the time of daily cutting according to the type of the first financial business, wherein the preset business rules are the rules for changing the data in the shadow database; determine the first data to be updated in the shadow database according to the preset business rules; and update the first data to obtain the updated shadow database.

[0095] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: processing the data in the upgraded initial database according to the data in the updated shadow database to obtain the target database, including: performing consistency verification on the data in the updated shadow database and the data in the upgraded initial database to obtain a verification result; if the verification result indicates that there is a difference between the second data in the upgraded initial database and the data in the shadow database, then overwriting the second data according to the data in the updated shadow database to obtain the target database; if the verification result indicates that the data in the upgraded initial database is the same as the data in the shadow database, then determining the upgraded initial database as the target database.

[0096] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: During the process of upgrading the initial database, the method also includes: obtaining the processing instructions of the second financial business triggered by the target object; determining the change information of the data in the initial database based on the processing instructions; and recording the change information in a log file.

[0097] Furthermore, after the data in the upgraded initial database is processed according to the data in the updated shadow database to obtain the target database, the method further includes: obtaining change information from the log file; and updating the data in the target database according to the change information. Figure 4 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 4 The structure of the electronic device is not limited. Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.

[0098] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0099] Example 4

[0100] The embodiment of the present application also provides a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the database upgrade method provided in the first embodiment.

[0101] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0102] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the database upgrade method.

[0103] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0104] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0109] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for upgrading a database, characterized in that: include: Synchronize the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; Performing an upgrade process on the initial database to obtain an upgraded initial database; Updating the data in the shadow database based on preset business rules to obtain an updated shadow database; The data in the upgraded initial database is processed according to the data in the updated shadow database to obtain a target database.

2. The method according to claim 1, characterized in that Before synchronizing the data in the initial database to be upgraded to the shadow database, the method further includes: Acquire environmental parameter information of the initial database; Building an initial shadow database based on the environmental parameter information; The initial shadow database is configured according to the storage engine of the initial database to obtain the shadow database.

3. The method according to claim 1, characterized in that Synchronizing the data of the initial database to be upgraded to the shadow database includes: Creating a database link between the shadow database and the initial database; Based on the database link, the data of the initial database is synchronized to the shadow database.

4. The method according to claim 1, characterized in that The data in the shadow database is updated based on the preset business rules to obtain an updated shadow database including: Determine, according to the type of the first financial service, a preset service rule for daily cutting, wherein the preset service rule is a change rule of the data in the shadow database; Determining first data to be updated in the shadow database according to the preset business rule; The first data is updated to obtain the updated shadow database.

5. The method according to claim 1, characterized in that The data in the upgraded initial database is processed according to the data in the updated shadow database to obtain a target database including: Performing consistency check on the data in the updated shadow database and the data in the upgraded initial database to obtain a check result; If the checking result indicates that there is a difference between the second data in the upgraded initial database and the data in the shadow database, the second data is overwritten according to the data in the updated shadow database to obtain the target database; If the checking result indicates that the data in the upgraded initial database is the same as the data in the shadow database, the upgraded initial database is determined as the target database.

6. The method according to claim 1, characterized in that In the process of upgrading the initial database, the method further comprises: Obtaining the processing instruction of the second financial service triggered by the target object; Determining change information of data in the initial database according to the processing instruction; The change information is recorded in a log file.

7. The method according to claim 6, characterized in that After the data in the upgraded initial database is processed according to the data in the updated shadow database to obtain the target database, the method further includes: Acquire the change information from the log file; The data in the target database is updated according to the change information.

8. A database upgrade device, characterized in that: include: A synchronization unit, used to synchronize the data of the initial database to be upgraded to the shadow database, wherein the environmental parameter information corresponding to the shadow database is the same as that of the initial database; A first processing unit is used to perform an upgrade process on the initial database to obtain an upgraded initial database; A first updating unit, configured to update the data in the shadow database based on a preset business rule to obtain an updated shadow database; The second processing unit is used to process the data in the upgraded initial database according to the data in the updated shadow database to obtain a target database.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the computer-readable storage medium is located is controlled to execute the database upgrade method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program executes the database upgrade method described in any one of claims 1 to 7 when running.