CN113342803B - Database updating method, device, equipment and medium - Google Patents

Database updating method, device, equipment and medium Download PDF

Info

Publication number
CN113342803B
CN113342803B CN202110237809.6A CN202110237809A CN113342803B CN 113342803 B CN113342803 B CN 113342803B CN 202110237809 A CN202110237809 A CN 202110237809A CN 113342803 B CN113342803 B CN 113342803B
Authority
CN
China
Prior art keywords
database group
updating
group
new
backup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110237809.6A
Other languages
Chinese (zh)
Other versions
CN113342803A (en
Inventor
王瑜
朱道彬
叶磊
曹力元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110237809.6A priority Critical patent/CN113342803B/en
Publication of CN113342803A publication Critical patent/CN113342803A/en
Application granted granted Critical
Publication of CN113342803B publication Critical patent/CN113342803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The present disclosure provides a database updating method, device, apparatus and medium. The database updating method comprises the following steps: updating the first backup database group into a first new database group; updating the first master database group to a second new database group based on the first new database group; updating the first new database group into a second main database group; updating the second new database group to a second standby database group; wherein updating the first primary database group to the second new database group based on the first new database group comprises: and synchronizing incremental data generated by the first main database group in the process of updating the first standby database group into the first new database group to the first new database group. The database updating method and device can be applied to the information security field and the big data processing field in the financial field.

Description

Database updating method, device, equipment and medium
Technical Field
The present disclosure relates to the field of big data technologies, and in particular, to a database updating method, a database updating device, an electronic device, and a computer readable storage medium.
Background
For large financial service institutions, the loss of direct business and indirect loss of reputation caused by the shutdown of a business system exceeding half an hour can reach hundreds of millions of primes, and the tendency of rapid annual increase exists. Thus, the financial services industry has exceptionally stringent requirements for operational continuity of critical business systems. After the mobile finance accelerates the popularization of the finance service, the finance field service channel of the finance service institution represented by banking industry presents the characteristics of multiple channels, mobility and all weather, wherein the requirements of a core business system on continuity are up to the level of 365 days multiplied by 24 hours. If the online service is stopped for a long time for each maintenance update of the service system, for example, large-version production, the reputation of the financial service institution is likely to be negatively affected, and meanwhile, the online service system becomes a disadvantageous factor for expanding large businesses and large clients.
With the rapid development of database platforms under the hosts of major financial service institutions, higher demands are being made on the database platform service capabilities. To ensure that the accessed database is not shutdown during system updates, such as application version commissioning upgrades, it is desirable to ensure that service is not interrupted during database updates while ensuring high availability of the original base data service. In particular, some very core transactions need to be provided with basic services to minimize the change window time that system maintenance, patch upgrades, etc. have a global impact on the database.
Disclosure of Invention
One aspect of the present disclosure provides a database updating method, including: updating the first backup database group into a first new database group; updating the first master database group to a second new database group based on the first new database group; updating the first new database group into a second main database group; updating the second new database group to a second standby database group; wherein updating the first primary database group to the second new database group based on the first new database group comprises: and synchronizing incremental data generated by the first main database group in the process of updating the first standby database group into the first new database group to the first new database group.
According to an embodiment of the present disclosure, before updating the first backup database group to the first new database group, further comprising: creating a first temporary table of a first primary database group; moving the original data of the first main database group to a first temporary table; the first temporary table is synchronized to the first backup database group based on a primary-backup relationship between the first primary database group and the first backup database group.
According to an embodiment of the present disclosure, before updating the first backup database group to the first new database group, further comprising: intercepting a non-core access request and starting a basic access service of a first main database group. According to an embodiment of the present disclosure, updating a first backup database group to a first new database group includes: disconnecting the primary-backup relationship between the first primary database group and the first backup database group; and establishing a master-slave relation inside the first slave database group.
According to an embodiment of the present disclosure, updating the first backup database group to be the first new database group further includes: the first backup database group is upgraded to form a first new database group.
In accordance with an embodiment of the present disclosure, before synchronizing incremental data generated by the first primary database group in the process of updating the first backup database group to the first new database group, further comprising: ending the basic access service of the first main database group to control the shutdown of the first main database group; a primary-backup relationship between the first primary database group and the first new database group is established.
According to an embodiment of the present disclosure, after synchronizing incremental data generated by a first primary database group in updating the first backup database group to a first new database group to the first new database group, the method includes: the incremental data is moved to a second temporary table of the first new database group.
According to an embodiment of the present disclosure, updating the first master database group to a second new database group based on the first new database group, further comprising; and upgrading the first main database group based on the main-standby relation between the first main database group and the first new database group to form a second new database group.
According to an embodiment of the present disclosure, updating a first new database group to a second master database group includes: updating the first temporary table of the first new database group as a backup table, and simultaneously updating the second temporary table of the first new database group as a formal table of the first new database group to form a second main database group.
According to an embodiment of the present disclosure, updating the first new database group to the second master database group further includes: establishing a data access relationship between the first new database group and the first application server group; and upgrading the first application server group based on the data access relation to form a second application server group.
According to an embodiment of the present disclosure, updating the second new database group to be the second standby database group includes: updating the first temporary table of the second new database group as a backup table, and simultaneously updating the second temporary table of the second new database group as a formal table of the second new database group to form a second backup database group; and establishing a master-slave relation inside the second slave database group.
According to an embodiment of the present disclosure, the database updating method further includes: and starting the full-function access service of the second main database group.
Another aspect of the present disclosure provides a database updating apparatus, including a first updating module, a second updating module, a third updating module, and a fourth updating module. The first updating module is used for updating the first standby database group into a first new database group; the second updating module is used for updating the first main database group into a second new database group based on the first new database group; the third updating module is used for updating the first new database group into a second main database group; and a fourth updating module for updating the second new database group into a second standby database group; the second updating module comprises a data synchronizing unit, and the data synchronizing unit is used for synchronizing incremental data generated by the first main database group to the first new database group in the process of updating the first standby database group to the first new database group.
Another aspect of the present disclosure provides an electronic device comprising one or more processors and memory; the memory is used to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the methods of embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are configured to implement a method of an embodiment of the present disclosure.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions which, when executed, are for implementing the method of embodiments of the present disclosure.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture 100 in which a database update method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a database update method according to an embodiment of the present disclosure;
FIG. 3A schematically illustrates an exemplary architecture of a database group with fully functional services in accordance with an embodiment of the present disclosure;
FIG. 3B schematically illustrates an exemplary architecture of a database group with basic services in accordance with an embodiment of the present disclosure;
FIG. 3C schematically illustrates another exemplary architecture of a database group with basic services in accordance with an embodiment of the present disclosure;
FIG. 3D schematically illustrates another exemplary architecture of a database group with basic services in accordance with an embodiment of the present disclosure;
FIG. 3E schematically illustrates an exemplary architecture of a database group during shutdown according to an embodiment of the disclosure;
FIG. 3F schematically illustrates another exemplary architecture of a database group during shutdown according to an embodiment of the disclosure;
FIG. 3G schematically illustrates an exemplary architecture of a database group restoring full-function services in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of another database update method according to an embodiment of the present disclosure;
FIG. 5A schematically illustrates an exemplary architecture of a database group with fully functional services in accordance with an embodiment of the present disclosure;
FIG. 5B schematically illustrates another exemplary architecture of a database group with fully functional services according to an embodiment of the present disclosure;
FIG. 5C schematically illustrates an exemplary architecture of database groups during downtime according to an embodiment of the disclosure;
FIG. 5D schematically illustrates another exemplary architecture of a database group during shutdown according to an embodiment of the disclosure;
FIG. 5E schematically illustrates an exemplary architecture of a database group restoring full function services in accordance with an embodiment of the present disclosure;
FIG. 6 schematically illustrates an exemplary architecture of a data synchronization rebate apparatus in accordance with an embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of a database updating apparatus corresponding to the method of FIGS. 2-3G, in accordance with an embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of another database updating apparatus corresponding to the method described in FIGS. 4-5E, in accordance with an embodiment of the present disclosure;
fig. 9 schematically illustrates a block diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some of the block diagrams and/or flowchart illustrations are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, when executed by the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon, the computer program product being for use by or in connection with an instruction execution system.
For databases in the financial services industry, it is common to implement a large server group that typically includes a vast number of various types of servers that differ in functionality, such as application servers (e.g., application server groups 330, 530 shown in fig. 3A-3G, 5A-5E) and database servers (e.g., first master database groups 310, 510 and first slave database groups 320, 520 shown in fig. 3A-3G, 5A-5E), etc.
In general, in order to prevent various accidents such as server failure, hacking, and even power failure, and ensure normal data access of clients to databases, and ensure data security, a financial business organization sets a plurality of server groups in different regions, as shown in fig. 3A-3G and fig. 5A-5E, online servers 331, 531 and batch servers 332, 532 of the application server groups and first master database groups 310, 510 are located in region a, and online servers 333, 533 and batch servers 334, 534 of the application server groups and first standby database groups 320, 520 are located in region B. In this case, the first main database group 310, 510 of the area a may be used as a main access object of the client and a main storage object of the client access data, while the first standby database group 320, 520 of the area B may be used as a standby group of the first main database group 310, 510, and may replace the first main database group 310, 510 to accept the client access requirement to the database when an accident occurs in the first main database group 310, 510 of the area a, and simultaneously store the client access data in time.
In the embodiment of the disclosure, in the process of updating the database, such as upgrading and production of an application version, maintaining a system function, and the like, if the main database group and the standby database group are updated at the same time, the two database groups are stopped at the same time, which greatly affects the access service of the client to the data, affects the client experience, and is easy to cause direct huge business loss, indirect reputation loss, and the like, so how to ensure the basic service continuity of the whole database updating process becomes a difficulty and focus of the technicians.
The basic service of the database server mainly relates to the data access service of the core business, and is the basic core function service for supporting the core business service. Currently, most important platform applications have no basic service scheme. In the process of updating the database, the basic service continuity scheme design generally considered in the prior art mainly comprises two technical schemes of node rotation updating and grid-connected application double writing. The node rotation updating scheme divides all nodes under application into different database groups, the different database groups are alternately updated in batches, and the core business service capability of the node database is updated and accepted by the basic service of other database groups. However, this scheme is only suitable for applications and scenarios that do not require data synchronization, i.e. do not contain or have no impact on the core traffic. And then, batch upgrading of different nodes is realized through gray scale production under load balancing, data synchronization among the nodes is not involved, and the application scene is very limited. In addition, different from the scheme of node rotation, the technical scheme of parallel design gray scale realization by applying double-write grid connection also exists in the prior art, mainly relates to two-ring environment data verification, and has the advantages of tight scheme and application coupling, very complex design and more severe application realization conditions.
In order to solve the technical problems that in the process of upgrading the application version, the basic service scheme in the prior art is very limited in design application scene and/or very complex in design scheme, the embodiment of the disclosure provides a database updating method, a database updating device, electronic equipment, a computer readable storage medium and a computer program.
Fig. 1 schematically illustrates an exemplary system architecture 100 in which a database update method may be applied according to an embodiment of the present disclosure.
It should be noted that fig. 1 illustrates only an example of a system architecture of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a database upgrade application, a database modification application, a database editing application, etc. (by way of example only) may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for the control of database groups by users with the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (for example, control information, control data, and instructions acquired or generated according to the user request) to the terminal device, so as to be presented by the terminal device.
It should be noted that the database updating method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the database updating apparatus provided in the embodiments of the present disclosure may be generally disposed in the server 105. The database updating method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the database updating apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server group that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. Further, the user of the embodiment of the present disclosure may be a technician or related person who controls the server 105 or the like to perform the database update method through the terminal device; customers of embodiments of the present disclosure may be the offering object of a financial commerce service for data access to a database.
The database updating method, the database updating device, the electronic device, the computer readable storage medium and the computer program provided in the embodiments of the present disclosure are described in further detail below with reference to fig. 2 to 9.
The updating in the embodiment of the disclosure can comprise the special running conditions of the database, such as the production upgrading of the application product, the system maintenance updating, the new patch adding and the like, which are not unexpected conditions, and mainly relates to the change of the database data table architecture, including the table of the newly added field, the application scenes such as the modification of the field content, the type and the length, the deletion of the field, the field renaming and the like. Wherein, the newly added field table can be understood as adding the fields of the data table, such as updating the field of the "graduation institution" newly added in the formal table; modifying field content can be understood as modifying field names, such as modifying the university of Qinghua corresponding to the field 'graduation university' to 'Beijing university', and generally, the modification can be performed in a batch modification mode; modifying the type of a field can be understood as modifying a character type field into a numeric type field; the length of the modified field refers to the change of field bytes which can be accommodated by the position of the field, for example, the required length of the original field is 0000, the modified field is 00, and the field length is shortened; the deletion field can be understood as deleting unnecessary information, such as deleting the field of the address of the home book in the original formal table; the field renaming then involves, for example, modifying "graduation university" to "graduation university".
Fig. 2 schematically illustrates a flowchart of a database update method according to an embodiment of the present disclosure.
As shown in fig. 2, one aspect of the present disclosure provides a database updating method, which includes steps S201 to S204.
In step S201, the first backup database group is updated to be a first new database group;
in step S202, based on the first new database group, updating the first main database group to be the second new database group;
in step S203, the first new database group is updated to be the second master database group; and
in step S204, the second new database group is updated to be the second backup database group.
Wherein, in step S202, based on the first new database group, updating the first main database group into the second new database group includes: and synchronizing incremental data generated by the first main database group in the process of updating the first standby database group into the first new database group to the first new database group.
In the embodiment of the disclosure, the backup database group is a backup database set of the main database group, and generally, the two database sets only have functional differences in different running time periods, for example, when the accident situation does not occur, the main database group is used as a main access database of a client, and when the accident situation occurs, the backup database group is used as a backup database of the main database group to replace and realize the data access service of the client. Wherein each database may be implemented based on a respective database server.
In an embodiment of the present disclosure, the first backup database group is a backup database group of the first primary database group. The corresponding model or version of the backup database group and the primary database group may be understood as the first version v1.0, i.e. the first backup database group and the first primary database group, before no database update is performed. After the database update, the corresponding model or version of the backup database group and the primary database group may be understood as the second version v2.0, i.e. the second backup database group and the second primary database group. In addition, the first new database group is mainly used for distinguishing an intermediate model or version between the first standby database group and the second standby database group, and can be substantially identical to the second standby database group in practice; similarly, the second new database group is primarily used to distinguish an intermediate model or version between the first and second master database groups, and may in fact be substantially identical to the second master database group.
Before the database is updated, the data of the first main database group and the first standby database group are original data, and in a period of update preparation time before the update, the first main database group generates new real-time access data due to the fact that the data access of the client exists all the time. That is, the real-time access data of the first primary database group is still changing during the process of updating the first backup database group to the first new database group. Therefore, when the first main database group is updated, the real-time access data of the first main database group needs to be synchronized to the first new database group of the updated first standby database group, and the first new database group is used as the standby database group of the first main database group at the moment, so that the real-time access data of the first main database group in the updating process of the original data and the first standby database group can be simultaneously provided. The real-time access data of the first main database group in the updating process of the first standby database group is the incremental data of the embodiment of the disclosure.
Therefore, in the actual updating process, the data updating method in the embodiment of the present disclosure only needs to synchronize the real-time access data of the first master database group of the first standby database group to the first new database group as incremental data. Because the generation time of the incremental data is very short, the data volume is very small, so that the quick realization of the database update can be ensured even if the first main database group is required to be stopped in the process of updating the first main database group into the second new database group, and the stopping time is very short and even can be ignored. Therefore, the whole database updating process can greatly improve the service continuity of the core service system on the basis of the realization of the database level.
According to the database updating method, aiming at the updating process of the database, the shutdown time of the core business service can be controlled within 1 minute, even the situation that the operation of a user accessing the database is influenced by shutdown in the updating process can be greatly avoided, the shutdown time caused by updating is very short, the whole updating process is very fast and effective, the characteristics of simplicity, stability and high efficiency in operation of the updating process can be achieved under the condition of ensuring the accuracy and the comprehensiveness of data, the labor cost is greatly reduced, the method can be popularized as a standardized general scheme, and the method is suitable for database updating production in various application scenes.
Fig. 3A schematically illustrates an exemplary architecture of a database group with fully functional services according to an embodiment of the present disclosure.
As shown in fig. 3A, before updating the first backup database group to the first new database group in step S201, according to an embodiment of the present disclosure, the method further includes: creating a first temporary table D1 of the first primary database group 310; moving the original data of the first primary database group 310 to a first temporary table D1; the first temporary table D1 is synchronized to the first standby database group 320 based on the primary-standby relationship between the first primary database group 310 and the first standby database group 320.
Each database server in the first primary database group 310 typically has a data table for use as an architecture for storing various types of desired access service data for clients. Under normal operation state, the data table can be generally understood as a formal table D, where the original data of the first main database group is stored, and when the client performs related service editing operation on the formal table D, related service editing data can be written in real time, and modification such as adding and deleting is performed on the original data. Based on the formal table D, a temporary table D1 may be directly and correspondingly established, and the original data of the formal table D is transferred to the temporary table D1 by a data transfer technique to form a first temporary table D1.
The first backup database group 320 is used as a backup database group of the first main database group 310, and has a stable main-backup relationship therebetween, so that the data of the first main database group 310 can be transferred to the data of the first backup database group 320, and the first temporary table D1 is synchronized to the first backup database group 320, that is, the first backup database group 320 also has the original data of the first backup database group 310.
At this point, the first primary database group 310 remains providing full-featured services to the customer.
Therefore, the method of the embodiment of the present disclosure may implement data consistency between the first backup database group 320 and the first main database group 310, so as to ensure that in the process of updating the first backup database group 320 into the first new database group, only incremental data generated by the first main database group 310 needs to be synchronized to the first new database group, so that in the process of updating the first main database group 310 into the second new database group, even if the first main database group 310 is required to be stopped, fast implementation of database update can be ensured, and the stopping time is extremely short.
Fig. 3B schematically illustrates an exemplary architecture of a database group with basic services in accordance with an embodiment of the present disclosure.
As shown in fig. 3B, before updating the first standby database group 320 to the first new database group, according to an embodiment of the present disclosure, further includes: the non-core access request is intercepted and the basic access service of the first primary database group 310 is opened.
Basic access services involve key access services that are primarily involved in the customer's access to databases, such as core access requests provided by changes to financial transfers, financial transactions, and the like. Rather than a core access request, a change to non-critical information of the financial account, such as an ID address change, etc. In the case of basic access services, it may be ensured that the first primary database group 310 may continue to provide continuity services to the client when the first backup database group 320 is subsequently updated.
At this point, the first primary database group 310 remains providing basic services to the customer, entering an update preparation time.
Fig. 3C schematically illustrates another exemplary architecture of a database group with basic services according to an embodiment of the present disclosure.
As shown in fig. 3C, in step S201, updating the first standby database group 320 to a first new database group includes: disconnecting the primary-backup relationship between the first primary database group 310 and the first backup database group 320; a primary-backup relationship is established within the first backup database group 320.
To prepare for a shutdown update of the first primary database group and to prevent long-term transmission of large data volume data of the database update process, in the method of the embodiments of the present disclosure, the primary backup relationship between the first backup database group 320 and the first primary database group is considered to preferentially upgrade the first backup database group 320 while ensuring that the first backup database group 320 is able to have the primary data of the first primary database group prior to the update.
In addition, the first primary database group 310 and the first backup database group 320 each have a plurality of database servers, at least one primary server 311, 321 and one backup server 312, 322. The backup server 312 may further ensure the data security of the primary server 311 under the backup function of the first backup database group 310. The backup servers 312 and 322 serve as backup servers of the main servers 311 and 321, and can replace the backup servers to provide data access service for clients when the main servers 311 and 321 are in a shutdown state or unexpected situations, and meanwhile, original data is saved, so that higher data security is ensured.
At this point, the first primary database group 310 remains providing basic services to the customer, still in the update preparation time.
Fig. 3D schematically illustrates another exemplary architecture of a database group with basic services according to an embodiment of the present disclosure.
As shown in fig. 3D, in step S201, updating the first backup database group 320 into the first new database group further includes: the first standby database group 320 is upgraded to form a first new database group.
The primary server 321 of the first standby database group 320 is upgraded based on the upgrade version data, so that the first standby database group 320 is upgraded from the first version v1.0 to the second version v2.0, that is, a new primary server 321 is formed. Meanwhile, since there is a primary-backup relationship between the primary server 321 and the backup server 322, the backup server 322 is updated from the first version v1.0 to the second version v2.0 at the same time, that is, the new backup server 322 is formed. Thus, the new primary 321 and backup 322 servers form a first new database group 320 of the second version v 2.0.
At this point, the first primary database group 310 remains providing basic services to the customer, still in the update preparation time.
FIG. 3E schematically illustrates an exemplary architecture of a database group during shutdown according to an embodiment of the disclosure; FIG. 3F schematically illustrates another exemplary architecture of a database group during shutdown according to an embodiment of the disclosure; FIG. 3G schematically illustrates an exemplary architecture of a database group that resumes fully functional services in accordance with an embodiment of the present disclosure.
As shown in fig. 3E, according to an embodiment of the present disclosure, before synchronizing incremental data generated by the first primary database group in the process of updating the first backup database group to the first new database group, further includes: ending the basic access service of the first primary database group 310 to control the first primary database group 310 to stop; a primary-backup relationship is established between the first primary database group 310 and the first new database group 320.
When the database is updated, if it is to be ensured that the incremental data generated by the first main database group is synchronized to the first new database group, it is required to ensure that the first main database group 310 is disconnected from the basic access service and is in a shutdown state, so as to prevent further generation of new incremental data.
Since the primary-backup relationship between the first primary database group 310 and the first backup database group 320 has been broken in the early stage, in order to ensure that the incremental data Δd of the first primary database group 310 can be synchronized to the first new database group 320 during the formation of the first new database group 320, the primary-backup relationship between the first primary database group 310 and the first new database group 320 needs to be restored to synchronize the incremental data Δd into the first new database group 320 through the primary-backup relationship.
At this point, the first primary database group 310 is in a shutdown state, and is suspended from providing basic services to clients for an update time.
As shown in fig. 3E, after synchronizing incremental data Δd generated by the first primary database group 310 during the updating of the first backup database group 320 to the first new database group, in accordance with an embodiment of the present disclosure, includes: the delta data Δd is moved to a second temporary table of the first new database group.
After restoring the primary-backup relationship between the first new database group 320 and the first primary database group 310, the first new database group 320 establishes a second temporary table D2 based on the first temporary table D1, and moves the original data in the first temporary table D1 to the second temporary table D2 through data movement, and simultaneously moves the incremental data Δd generated by the first primary database group 310 during the basic service to the second temporary table D2 to form the latest data table, thereby forming the updated data of the first new database group 320.
The second temporary table D2 can ensure that the first new database group 320 can synchronously store all data of the first main database group 310, ensure that the data is complete, and improve the data security.
At this point, the first primary database group 310 is in a shutdown state, and is suspended from providing basic services to clients for an update time.
As shown in fig. 3F, in step S202, based on the first new database group, updating the first master database group 310 into a second new database group further includes; the first primary database group 310 is upgraded to form a second new database group based on the primary-backup relationship between the first primary database group 310 and the first new database group.
Since the first main database group 310 and the first new database group 320 have a main-standby relationship, the corresponding upgrade data of the first new database group 320 can be synchronously moved to the first main database group 310, so that the first main database group 310 is upgraded and updated to form a second new database group.
The upgrade update of the first main database group 310 includes an update to the main server 311, and meanwhile, since there is a corresponding main-standby relationship between the main server 311 and the standby server 312, the upgrade data of the first new database group 320 received by the main server 311 can be synchronized to the standby server 312, so that it is ensured that both can implement the upgrade update at the same time, and the first main database group 310 is updated to be the second new database group.
At this point, the first primary database group 310 is in a shutdown state, and is suspended from providing basic services to clients for an update time.
As shown in fig. 3F and 3G, according to an embodiment of the present disclosure, updating the first new database group into the second master database group in step S203 includes: the first temporary table D1 of the first new database group 320 is updated as a backup table, while the second temporary table D2 of the first new database group 320 is updated as a formal table of the first new database group to form a second main database group.
The first temporary table D1 of the first new database group 320 is used as a data backup of the database group, and the second temporary table D2 thereof is used as a formal data of the database group, and in addition, the first new database group 320 of the original region B is used as a new second master database group for providing a database data access function.
Therefore, the function exchange of the first main database group and the first standby database group can be realized, the whole first new database group is ensured to serve as the second main database group to serve as the corresponding data access function, and the continuity of the whole data access is provided.
As shown in fig. 3F and 3G, in step S203, updating the first new database group into the second master database group further includes: establishing a data access relationship between the first new database group and the first application server group 330; the first application server group 330 is upgraded based on the data access relationship to form a second application server group.
The application server group 330 is used to provide application support in the customer data access process for the main database group, and includes various application servers, and each application server in the application server group forms a data access link with the router 340 to enable contact with the access server 105 through the router 340. The online servers 331, 333 of the application server group 330 are used for realizing application support of access requests for clients to access, download, edit, etc. data in the main server 311, and the batch servers 332, 334 of the application server group 330 are used for realizing application support when the main server 311 performs batch processing on some data of clients, accordingly.
When the first standby database group 320 is upgraded to a first new database group, the first new database group establishes a data access relationship with the batch servers 332, 334 of the first application server group 330, through which the upgrade data of the respective application servers can be synchronized to the batch servers 332, 334 such that the batch servers 332, 334 are upgraded from the original first version v1.0 to the corresponding second version v2.0.
Further, the first new database group establishes a data access relationship with the online servers 331, 333 of the first application server group 330, through which the upgrade data of the corresponding application server can be synchronized to the online servers 331, 333, such that the online servers 331, 333 are upgraded from the original first version v1.0 to the corresponding second version v2.0.
Thus, it may be ensured that all application servers 331-334 of the first application server group 330 are upgraded to the second version v2.0 corresponding to the second master database group, so as to meet that the second master database group can be smoothly accessed by the client in the new client data access process, so as to provide a full-function access service.
As shown in fig. 3F and 3G, according to an embodiment of the present disclosure, updating the second new database group to the second standby database group in step S204 includes: updating a first temporary table D1 of the second new database group as a backup table, and simultaneously updating a second temporary table D2 of the second new database group as a formal table of the second new database group to form a second backup database group; and establishing a master-slave relation inside the second slave database group.
Because the primary-backup relationship is restored between the first new database group and the first primary database group 310, the first new database group 320 can synchronize the second temporary table to the first primary database group 310, and can synchronize the upgrade data to the first primary database group 310, so that the updated second new database group has the second temporary table D2 to cover the original first temporary table D1, and the first temporary table D1 can be used as the formal table to cover the original formal table D.
The first temporary table D1 of the second new database group 310 is used as a data backup of the database group, and the second temporary table D2 thereof is used as formal data of the database group, and in addition, the second database group 310 of the original area a is used as a new second standby database group for a standby server group which is a second main database group.
Therefore, the function exchange of the first main database group 310 and the first standby database group 320 can be realized, so that the whole second new database group is ensured to serve as the second standby database group to serve as a corresponding backup data access function, and the continuity of data access in the whole updating process is ensured.
As shown in fig. 3G, according to an embodiment of the present disclosure, the database update method further includes: and starting the full-function access service of the second main database group.
After the second main database group 320 realizes the data access relationship with the second application server group, it can be ensured that the second main database group replaces the first main database group to continue providing the data access service to the client, thereby ensuring the continuity of data access as much as possible and further reducing the update time of the whole process.
The database updating method according to another embodiment of the present disclosure is further described in detail below with reference to fig. 4 to 6, so as to illustrate differences from the database updating method shown in fig. 2 to 3G.
Fig. 4 schematically illustrates another flowchart of a database update method according to an embodiment of the present disclosure.
As shown in fig. 4, one aspect of the present disclosure provides a database updating method, which includes S401-S402.
In step S401, the first master database group is updated to be a first new database group;
in step S402, the first new database group is updated to be the second master database group.
In step S401, before updating the first master database group into the first new database group, the database updating method further includes step S403.
In step S403, the real-time incremental data generated by the first master database group is synchronously complemented.
The master database group is used as the database of the primary access of the clients, wherein each database may be implemented based on a corresponding database server. The corresponding model and version of the primary database group may be understood as the first version v1.0, i.e. the first primary database group, before no database update is performed. After a database update, the corresponding model or version of the master database group may be understood as the second version v2.0, i.e. the second master database group. In addition, the first new database group is mainly used to distinguish an intermediate model or version between the first main database group and the second main database group, and may be substantially identical to the second main database group in practice.
Before the database is updated, the data of the first main database group is original data, and after the update preparation time is performed, in order to maintain the main access function of the first main database group, the downtime of the first main database group is reduced as much as possible, and the first main database group is required to continuously maintain the data access function provided for the client, so that in the update preparation time, the data of the first main database group is still in real-time change due to the data access of the client, and new incremental data, namely real-time incremental data, is continuously generated.
Therefore, when the first main database group is updated, the original data in the first main database group needs to be updated in real time to increase the integrity and the security of the data. Based on the synchronous compensation technology, the real-time incremental data generated in the update preparation time can be directly synchronously compensated to the first main database group, so that the data cannot be missed.
Therefore, in the actual update process, the data update method in the embodiment of the present disclosure only needs to synchronize the real-time incremental data of the first primary database group to the original first primary database group. Because the generation time of the real-time incremental data is very short, the data volume is very small, so that the quick realization of the database update can be ensured even if the first main database group is required to be stopped in the process of updating the first main database group into the first new database group, and the stopping time is very short and even can be ignored. Therefore, the whole database updating process can greatly improve the service continuity of the core service system on the basis of the realization of the database level.
According to the database updating method, aiming at the updating process of the database, the shutdown time of the core business service can be controlled within 1 minute, even the situation that the operation of a user accessing the database is influenced by shutdown in the updating process can be greatly avoided, the shutdown time caused by updating is very short, the whole updating process is very fast and effective, the characteristics of simplicity, stability and high efficiency in operation of the updating process can be achieved under the condition of ensuring the accuracy and the comprehensiveness of data, the labor cost is greatly reduced, the method can be popularized as a standardized general scheme, and the method is suitable for database updating production in various application scenes.
Fig. 5A schematically illustrates an exemplary architecture of a database group with fully functional services according to an embodiment of the present disclosure.
As shown in fig. 5A, in step S403, synchronizing and compensating the real-time incremental data generated by the first master database group 510 includes: creating a first temporary table D1 of the first primary database group 510 based on the formal table D of the first primary database group; a synchronous transitional relationship between the first temporary table D1 and the formal table D is determined.
Each database server in the first primary database group 510 typically has a data table for use as an architecture for storing various types of desired access service data for clients. In a normal running state, the data table can be generally understood as a formal table D, where the original data of the first main database group 510 is stored, and when the client performs the related service editing operation on the formal table D, the related service editing data can be written in real time, and modifications such as adding and deleting the original data can be performed. Based on the formal table D, a temporary table may be directly established correspondingly, so as to migrate the original data of the formal table D to the temporary table, to form a first temporary table D1. For this reason, a stable data transmission relationship is required between the primary table D and the first temporary table D1 to ensure that the data changed in the primary table D can be transmitted to the first temporary table D1 in real time, so that the data contents of the two data tables are kept consistent. In the embodiment of the disclosure, the stable data transmission relationship may be implemented according to a synchronous migration relationship.
As shown in fig. 5A, according to an embodiment of the present disclosure, the synchronization and the compensation of the real-time incremental data generated by the first main database group further includes: and based on the synchronous migration relation, the original data in the formal table is migrated to the first temporary table.
The original data of the formal table D of the first main database group 510 is migrated to the first temporary table D1, so that the first temporary table D1 also has the original data of the formal table D.
At this point, the first primary database group 310 remains providing full-featured services to the customer.
Therefore, the method of the embodiment of the present disclosure may implement the data consistency between the formal table and the temporary table of the first main database group 510, so as to ensure that, before the process of updating the first main database group 510 into the first new database group, only the real-time incremental data generated by the first main database group 510 in the update preparation time needs to be synchronized to the first new database group in real time, so that, in the process of updating the first main database group 510 into the first new database group, even if the first main database group 510 is required to be shutdown, the fast implementation of the database update can be ensured, and the shutdown time is extremely short.
As shown in fig. 5A, according to an embodiment of the present disclosure, the synchronization and the compensation of the real-time incremental data generated by the first main database group further includes: the first temporary table D1 is updated to determine a second temporary table D2 of the first primary database group 510.
Before the first main database group 510 is updated, the first temporary table D1 may be updated according to the configuration, and in particular, the data table configuration may be updated according to the data table configuration update data, so that the overall data table configuration of the updated second temporary table D2 may be matched with the first new database group of the first main database group 510 that needs to be updated.
The data stored in the second temporary table D2 is consistent with the data of the original first temporary table D1, and the second temporary table D2 is actually the first temporary table D1 with a different architecture. At this point, the first primary database group 310 remains providing full-featured services to the customer.
FIG. 5B schematically illustrates another exemplary architecture of a database group with fully functional services according to an embodiment of the present disclosure; fig. 6 schematically illustrates an exemplary architecture of a data synchronization rebate apparatus according to an embodiment of the present disclosure.
As shown in fig. 5B and 6, according to an embodiment of the present disclosure, the synchronization and the compensation of the real-time incremental data generated by the first main database group 510 in step S403 further includes: analyzing the real-time increment data in the formal table D to form a real-time analysis data stream; sequencing the real-time queue data to form a real-time queue data stream; the queue data stream is appended to the second temporary table D2 to form a third temporary table D3.
As shown in fig. 5B and 6, the database updating method of the embodiment of the present disclosure uses the data synchronization and compensation module 550 that cooperates with the primary server 511 of the first primary database group 510 to be updated, and the synchronization and compensation module 550 compensates the real-time incremental data generated by the primary server 511 due to the data access during the update preparation to the latest second temporary table D2 in real time, so that when the update is performed, the stock data of the second temporary table D2 in the primary server 511 includes all the real-time incremental data to form the third temporary table D3.
As shown in fig. 6, the data synchronization and compensation module 550 includes an analysis end 610, a queue 620 and a compensation end 630, where the analysis end 610 can analyze the formal table D in the main server 511, and can distinguish the data transformation in the formal table D between the analysis time and the previous time, so as to accurately obtain the real-time incremental data in the formal table D, and order the real-time incremental data according to the time sequence in the operation log in the formal table a, so as to form a real-time analysis data stream.
The queue 620 may be a data transfer unit or an intermediate channel implemented based on KAFKA or the like, and determines the processing sequence of the parsed data stream when the parsed data stream is complemented according to the sequence of the parsed data stream, so as to form a real-time queue data stream.
The repayment terminal 630 performs a repayment operation on the real-time queue data streams passing through the queue 620 one by one according to the corresponding repayment rule, so as to repaint the corresponding incremental data into the second temporary table D2. The repayment rule reversely corresponds to the parsing rule of the parsing end 610, specifically, when the repayment end 630 obtains certain data in the corresponding real-time queue data stream, the repayment rule matches with a field in the second temporary table D2 according to a field of the data, and supplements the corresponding field content to a corresponding field in the second temporary table D2; in addition, when matching with the field in the second temporary table D2 cannot be performed according to the field of the data, a corresponding field is created in the second temporary table D2 according to the field, and the field and the content of the corresponding field are supplemented to the corresponding field. Therefore, the real-time incremental data acquired by the parsing end 610 can be real-time restored to the second temporary table D2 through the restoring end 630, and when the main server 511 is updated, the data in the third temporary table D3 includes all the access data of the clients, so as to ensure the integrity and security of the data.
The data synchronization and compensation module 550 may be an integral part of the controller in the main server 511.
Fig. 5C schematically illustrates an exemplary architecture of database groups during shutdown according to an embodiment of the disclosure. Fig. 5D schematically illustrates another exemplary architecture of database groups during shutdown according to an embodiment of the disclosure.
As shown in fig. 5C and 5D, in step S401, updating the first master database group 510 to be the first new database group includes: ending the full function access service of the first master database group 510 to control the first master database group 510 to stop; based on the third temporary table D3, the first master database group 510 is updated to be the first new database group.
By disconnecting the data access link between the router 540 and the application server group 530, the data access of the client to the first main database group 510 is cut off, and the possibility that the first main database group 510 performs batch operations on the data through the application server group 530 is also cut off, so that the main server 511 of the first main database group 510 and the corresponding standby server 512 enter a shutdown state, and at this time, the client cannot perform data access to the first main database group 510.
Further, the real-time incremental data of the formal table D in the first main database group 510 is synchronously complemented into the real-time incremental data of the second temporary table D2 based on the data synchronization complemented module 550, so that the data content of the first main database group 510 at the time of shutdown includes the sum of the original data and the real-time incremental data. Based on the third temporary table D3, the first main database group is updated by the update data, so that the first main database group becomes a first new database group.
Therefore, during the shutdown period, the first main database group actually includes all the original data and the real-time incremental data of the formal table D, so that the upgrade update process of the first main database group 510 is only to process the upgrade data, and no synchronous migration or copying of the original data or the real-time incremental data is required, thereby greatly reducing the processing amount during the upgrade operation of the first main database group 510, reducing the shutdown time to even 1min, greatly improving the update speed of the database server, and having the characteristics of universal applicability and being capable of performing standardized design.
As shown in fig. 5C and 5D, according to an embodiment of the present disclosure, updating the first new database group into the second master database group at step S402 includes: updating the formal table D of the first new database group as a backup table, and simultaneously updating the third temporary table D3 of the first new database group as the formal table of the first new database group to form a second main database group.
The formal table D of the first new database group is used as a data backup of the database group, and the third temporary table D3 is used as formal data of the database group, and in addition, the first new database group is used as a new second main database group for providing a database data access function.
Therefore, the upgrade and replacement of the first main database group 510 can be realized, so that the whole first new database group is ensured to serve as the second main database group to serve as a corresponding data access function, and the continuity of whole data access is ensured.
As shown in fig. 5C and 5D, in step S402, updating the first new database group into the second master database group further includes: establishing a data access relationship between the first new database group and the first application server group 530; the first application server group 530 is upgraded based on the data access relationship to form a second application server group.
The application server group 530 is used to provide application support in the customer data access process for the main database group, and includes various application servers, and each application server in the application server group forms a data access link with the router 540 to enable contact with the access server 105 through the router 540. For example, the online servers 531, 533 of the application server group 530 are used to implement application support for clients to access, download, edit, etc. modified access requests to the data in the main server 511, and the batch servers 532, 534 of the application server group 530 are used to implement application support when the main server 511 performs batch processing on some data of the clients, accordingly.
When the first primary database group 510 is upgraded to a first new database group, the first new database group establishes a data access relationship with the batch servers 532, 534 of the first application server group 530 by which the upgrade data of the respective application servers can be synchronized to the batch servers 532, 534 such that the batch servers 532, 534 are upgraded from the original first version v1.0 to the corresponding second version v2.0.
Further, the first new database group establishes a data access relationship with the online servers 531, 533 of the first application server group 530, by which the upgrade data of the respective application servers can be synchronized to the online servers 531, 533 such that the online servers 531, 533 are upgraded from the original first version v1.0 to the corresponding second version v2.0.
Thus, it can be ensured that all application servers 531-534 of the first application server group 530 are upgraded to the second version v2.0 corresponding to the second master database group, so as to meet that the second master database group can be smoothly accessed by the client in the new client data access process, so as to provide full-function access service.
As shown in fig. 5A-5E, according to an embodiment of the present disclosure, the database update method further includes: establishing a primary-backup relationship between the second primary database group and the first backup database group 520; based on the primary-backup relationship, the first backup database group 520 is updated to a second backup database group.
For the first backup database group 520 that is disposed in a different area from the second main database group, the first backup database group 520 may have a primary-backup relationship with the first main database group 510, that is, when the first main database group 510 performs synchronous repayment of the real-time incremental data, the corresponding third temporary table D3 may be formed in the first backup database group 520 in real time. However, on the other hand, the first standby database group 520 may also have no synchronous migration relationship with the first main database group 510, so after the upgrade and update of the first main database group 510 are implemented, a corresponding synchronous migration data transmission relationship between the updated second main database group and the first standby database group 520 needs to be re-established, and meanwhile, a main/standby relationship is formed, the first standby database group 510 is used as a standby database group of the second main database group, so that the synchronous migration of data is implemented, and the third temporary table D3 of the second main database group is synchronized to the first standby database group 520.
After the second main database group and the first standby database group 520 have the main-standby relationship, the corresponding upgrade data of the second main database group may be synchronously moved to the first standby database group 520, so that the first standby database group 520 performs upgrade update to form the second standby database group.
The upgrade update of the first standby database group 520 includes an update to the main server 521, and meanwhile, since the main server 521 and the standby server 522 also have a corresponding main-standby relationship, upgrade data of the second main database group 520 received by the main server 521 can be synchronized to the standby server 522, so that it is ensured that both can implement the upgrade update at the same time, so that the first standby database group 20 is updated to be the second standby database group, and is used as a standby group of the second main database group.
Fig. 5E schematically illustrates an exemplary architecture of a database group restoring full function services according to an embodiment of the present disclosure.
As shown in fig. 5E, according to an embodiment of the present disclosure, the database update method further includes: and starting the full-function access service of the second main database group.
After the second main database group realizes the data access relation with the second application server group, the second main database group can be ensured to replace the first main database group to continuously provide data access service for clients, thereby ensuring the continuity of data access as much as possible and further reducing the updating time of the whole process.
Fig. 7 schematically illustrates a block diagram of a database updating apparatus corresponding to the method described in fig. 2-3G, according to an embodiment of the present disclosure.
As shown in fig. 7, another aspect of the present disclosure provides a database updating apparatus 700, which includes a first updating module 710, a second updating module 720, a third updating module 730, and a fourth updating module 740. The first updating module 710 is configured to update the first backup database group to a first new database group; the second updating module 720 is configured to update the first main database group to be a second new database group based on the first new database group; the third updating module 730 is configured to update the first new database group to be the second master database group; and a fourth updating module 740 configured to update the second new database group to be a second standby database group; the second updating module 720 includes a data synchronizing unit 721, where the data synchronizing unit 721 is configured to synchronize incremental data generated by the first primary database group to the first new database group during updating the first backup database group to the first new database group.
Fig. 8 schematically illustrates a block diagram of a database updating apparatus corresponding to the method described in fig. 4-5E, according to an embodiment of the present disclosure.
As shown in fig. 8, another aspect of the present disclosure provides a database updating apparatus 800, which includes a first updating module 810 and a second updating module 810, where the first updating module 810 is configured to update a first main database group into a first new database group; the second updating module 820 is configured to update the first new database group to a second master database group; the database updating apparatus 800 further includes a data synchronization and compensation module 830, where the data synchronization and compensation module 830 is configured to perform synchronization and compensation on real-time incremental data generated by the first main database group before updating the first main database group into the first new database group.
It should be noted that fig. 7 and 8 illustrate only architecture examples of devices to which the methods of the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios. In addition, the embodiment mode of the database updating device part is similar to the embodiment mode of the database updating method part correspondingly, and the achieved technical effects are similar correspondingly, and are not repeated here.
It should be noted that, the database updating method and apparatus of the present disclosure may be used in the technical field related to big data and information security in the financial business field, and may also be used in any field other than the financial field, and the application fields of the method and apparatus of the database updating method and apparatus of the present disclosure are not limited.
Fig. 9 schematically illustrates a block diagram of an electronic device according to an embodiment of the disclosure.
As shown in fig. 9, another aspect of the present invention discloses an electronic device 900, which includes: one or more processors and storage devices; the storage device is configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the nonlinear data processing method described above. The electronic device shown in fig. 9 is only an example, and should not impose any limitation on the functions and use scope of the embodiments of the present disclosure.
As shown in fig. 9, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
According to an embodiment of the disclosure, the device 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The device 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are configured to implement a method of an embodiment of the present disclosure.
In particular, the computer-readable storage medium may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium described above carries one or more programs, which when executed, implement a database switching method according to an embodiment of the present disclosure.
Alternatively, the computer-readable storage medium may be contained in the apparatus/device/system described in the above-described embodiment; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium described above carries one or more programs, which when executed, implement a communication method according to an embodiment of the present disclosure.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions which, when executed, are for implementing a database switching method or a communication method of an embodiment of the present disclosure.
Thus, embodiments of the present disclosure have been described in detail with reference to the accompanying drawings.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be understood by those skilled in the art that while the present disclosure has been shown and described with reference to particular exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. The scope of the disclosure should, therefore, not be limited to the above-described embodiments, but should be determined not only by the following claims, but also by the equivalents of the following claims.
While the foregoing is directed to embodiments of the present invention, other and further details of the invention may be had by the present invention, it should be understood that the foregoing description is merely illustrative of the present invention and that no limitations are intended to the scope of the invention, except insofar as modifications, equivalents, improvements or modifications are within the spirit and principles of the invention.

Claims (10)

1. A method of updating a database, the method comprising:
creating a first temporary table of a first primary database group;
moving the original data of the first main database group to the first temporary table;
Synchronizing the first temporary table to a first backup database group based on a primary-backup relationship between the first primary database group and the first backup database group;
updating the first backup database group into a first new database group;
updating the first main database group to be a second new database group based on the first new database group;
updating the first new database group to a second master database group; and
updating the second new database group into a second standby database group;
wherein updating the first backup database group to be the first new database group comprises:
version upgrades are performed on the first standby database group to a first new database group,
and wherein updating the first master database group to a second new database group based on the first new database group comprises:
based on the first new database group, version upgrade is carried out on the first main database group to a second new database group, and the method specifically comprises the following steps:
synchronizing incremental data generated by the first primary database group to the first new database group during the updating of the first backup database group to the first new database group; and
Moving the delta data to a second temporary table of the first new database group, wherein the second temporary table comprises the original data and delta data of the first temporary table,
and wherein said updating said first new database group to a second master database group comprises:
updating a first temporary table of the first new database group as a backup table while updating a second temporary table of the first new database group as a formal table of the first new database group to form a second main database group,
and wherein said updating said second new database group to be a second backup database group comprises:
updating the first temporary table of the second new database group as a backup table, and simultaneously updating the second temporary table of the second new database group as a formal table of the second new database group to form a second backup database group; and
and establishing a master-slave relation inside the second slave database group.
2. The method of claim 1, wherein prior to the updating the first backup database group to be the first new database group, further comprising:
and intercepting a non-core access request, and starting a basic access service of the first main database group.
3. The method of claim 1, wherein the updating the first backup database group to be the first new database group comprises:
disconnecting a primary-backup relationship between the first primary database group and the first backup database group;
and establishing a master-slave relation inside the first slave database group.
4. The method of claim 1, wherein prior to synchronizing incremental data generated by the first primary database group during the updating of the first backup database group to a first new database group to the first new database group, further comprising:
controlling the first master database group to stop;
and establishing a master-slave relation between the first master database group and the first new database group.
5. The method of claim 1, wherein the updating the first master database group to a second new database group based on the first new database group further comprises;
and performing version upgrade on the first main database group based on the main-standby relation between the first main database group and the first new database group so as to form the second new database group.
6. The method of claim 1, wherein the updating the first new database group is a second master database group, further comprising:
establishing a data access relationship between the first new database group and a first application server group;
and upgrading the first application server group based on the data access relation to form a second application server group.
7. The method of claim 1, further comprising:
and starting the full-function access service of the second main database group.
8. A database updating apparatus, the apparatus comprising:
the first updating module is used for updating the first standby database group into a first new database group;
a second updating module, configured to update the first main database group to a second new database group based on the first new database group;
a third updating module, configured to update the first new database group to be a second master database group; and
a fourth updating module, configured to update the second new database group to be a second standby database group;
wherein the second update module comprises:
a data synchronizing unit for synchronizing incremental data generated by the first master database group to the first new database group in the process of updating the first backup database group to the first new database group,
And wherein prior to said updating the first backup database group to be the first new database group, further comprising:
creating a first temporary table of the first primary database group;
moving the original data of the first main database group to the first temporary table; and
synchronizing the first temporary table to the first backup database group based on a primary backup relationship between the first primary database group and the first backup database group,
and wherein updating the first backup database group to be the first new database group comprises:
version upgrades are performed on the first standby database group to a first new database group,
and wherein updating the first master database group to a second new database group based on the first new database group comprises:
based on the first new database group, version upgrade is carried out on the first main database group to a second new database group, and the method specifically comprises the following steps:
synchronizing incremental data generated by the first primary database group to the first new database group during the updating of the first backup database group to the first new database group; and
Moving the delta data to a second temporary table of the first new database group, wherein the second temporary table comprises the original data and delta data of the first temporary table,
and wherein said updating said first new database group to a second master database group comprises:
updating a first temporary table of the first new database group as a backup table while updating a second temporary table of the first new database group as a formal table of the first new database group to form a second main database group,
and wherein said updating said second new database group to be a second backup database group comprises:
updating the first temporary table of the second new database group as a backup table, and simultaneously updating the second temporary table of the second new database group as a formal table of the second new database group to form a second backup database group; and
and establishing a master-slave relation inside the second slave database group.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 7.
10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are for implementing the method of any of claims 1 to 7.
CN202110237809.6A 2021-03-03 2021-03-03 Database updating method, device, equipment and medium Active CN113342803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110237809.6A CN113342803B (en) 2021-03-03 2021-03-03 Database updating method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110237809.6A CN113342803B (en) 2021-03-03 2021-03-03 Database updating method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN113342803A CN113342803A (en) 2021-09-03
CN113342803B true CN113342803B (en) 2024-03-12

Family

ID=77467821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110237809.6A Active CN113342803B (en) 2021-03-03 2021-03-03 Database updating method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113342803B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737768A (en) * 2004-08-20 2006-02-22 中兴通讯股份有限公司 Method and apparatus for internal memory data base synchronous data
CN102103613A (en) * 2009-12-22 2011-06-22 中兴通讯股份有限公司 Distributed database upgrade method, upgrade processing device and upgrade control device
CN106888245A (en) * 2016-06-07 2017-06-23 阿里巴巴集团控股有限公司 A kind of data processing method, apparatus and system
CN110413685A (en) * 2019-04-12 2019-11-05 财付通支付科技有限公司 Database service switching method, device, readable storage medium storing program for executing and computer equipment
CN111694845A (en) * 2020-05-29 2020-09-22 中国建设银行股份有限公司 Redis-based identifier generation method and device
CN111737059A (en) * 2020-07-02 2020-10-02 中国工商银行股份有限公司 Data backup method and device, electronic equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8326800B2 (en) * 2011-03-18 2012-12-04 Microsoft Corporation Seamless upgrades in a distributed database system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737768A (en) * 2004-08-20 2006-02-22 中兴通讯股份有限公司 Method and apparatus for internal memory data base synchronous data
CN102103613A (en) * 2009-12-22 2011-06-22 中兴通讯股份有限公司 Distributed database upgrade method, upgrade processing device and upgrade control device
CN106888245A (en) * 2016-06-07 2017-06-23 阿里巴巴集团控股有限公司 A kind of data processing method, apparatus and system
CN110413685A (en) * 2019-04-12 2019-11-05 财付通支付科技有限公司 Database service switching method, device, readable storage medium storing program for executing and computer equipment
CN111694845A (en) * 2020-05-29 2020-09-22 中国建设银行股份有限公司 Redis-based identifier generation method and device
CN111737059A (en) * 2020-07-02 2020-10-02 中国工商银行股份有限公司 Data backup method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN113342803A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
EP2944070B1 (en) Service migration across cluster boundaries
CN111639061A (en) Data management method, device, medium and electronic equipment in Redis cluster
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN114358921A (en) System switching method, apparatus, device, medium, and program product
CN115658098A (en) Upgrading method and device for distributed business processing system
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN113342803B (en) Database updating method, device, equipment and medium
CN110119279A (en) A kind of method and apparatus applied and its upgrade
CN113010515A (en) Database updating method, device, equipment and medium
WO2020060617A1 (en) Disturbance-free partitioning and migration of data from one storage account to another storage account
CN112860796B (en) Method, apparatus, device and storage medium for synchronizing data
CN110599112A (en) Method and device for developing and maintaining network page
CN115639953A (en) Data migration method and device
US11360866B2 (en) Updating stateful system in server cluster
CN110661857B (en) Data synchronization method and device
CN110019525A (en) A kind of method and apparatus of data-base capacity-enlarging
CN114003659A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN113326038A (en) Method, apparatus, device, storage medium and program product for providing service
CN108733460B (en) Method and apparatus for maintaining sessions for network storage devices
CN111984686A (en) Data processing method and device
CN111880831A (en) Method and device for synchronously updating server, computer equipment and storage medium
CN114615025B (en) Key synchronization processing method and device
CN110851192A (en) Method and device for responding to configuration of degraded switch
CN117193817A (en) Method, apparatus, device and computer readable medium for software upgrade
CN117667845A (en) Mirror image warehouse migration method and device for large data volume, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant