CN117149747A - Gray level release method and system for database change and computer equipment - Google Patents

Gray level release method and system for database change and computer equipment Download PDF

Info

Publication number
CN117149747A
CN117149747A CN202311414402.1A CN202311414402A CN117149747A CN 117149747 A CN117149747 A CN 117149747A CN 202311414402 A CN202311414402 A CN 202311414402A CN 117149747 A CN117149747 A CN 117149747A
Authority
CN
China
Prior art keywords
database
table structure
change
data
data copy
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.)
Granted
Application number
CN202311414402.1A
Other languages
Chinese (zh)
Other versions
CN117149747B (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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202311414402.1A priority Critical patent/CN117149747B/en
Publication of CN117149747A publication Critical patent/CN117149747A/en
Application granted granted Critical
Publication of CN117149747B publication Critical patent/CN117149747B/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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of computers, and provides a gray level publishing method and system for database change and computer equipment. The gray level release method for database change comprises the following steps: splitting the original database into two data copies during gray level release, wherein the table structures of the two data copies are the first table structure; database change is carried out on one of the two data copies, and the table structure of the changed data copy is a second table structure; establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure; and after the successful gray level release is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship. According to the invention, two data copies are split during gray level release, different data copies are used by new and old applications, the different data copies are copied in a bidirectional mode, the influence on the original application in the change is isolated, and the problems of inconsistent table structure and data writing conflict can be solved.

Description

Gray level release method and system for database change and computer equipment
Technical Field
The present invention relates to the field of computer technology, and in particular, to a method for distributing a database modified gray scale, a system for distributing a database modified gray scale, a computer device, a computer readable storage medium, and a computer program product.
Background
Gray scale distribution is a distribution mode that can smoothly transition between black and white. During gray level release, both the old version application and the new version application have traffic entering. Rollback is easier for stateless applications and not as easy for database changes. The writing of the new application and the old application is maintained during the gray level release, and the writing of the new application and the old application is production data and cannot be directly discarded, so that the writing of the data of the old version application and the new version application during the gray level release needs to be fused by adopting a reasonable technology. Since gray level distribution is a change distribution process, the ability to distribute changes and rollback is required. The difficulty of gray level release of the change of the database terminal is that the old version application and the new version application simultaneously provide services to the outside, and the problem that the table structure of the database is inconsistent and the data writing conflict can be caused because different version applications exist simultaneously during the gray level release transition period, so that the gray level release function of the change and rollback of the database terminal can not be realized.
The technical characteristics of the gray level release of database change in the prior art are that a shadow table mode is adopted, the association relation between table names and shadow tables is required to be maintained, however, the situation of excessive logic relations has more resource consumption to cause performance degradation, and the change between old application data and new application data easily causes the risk of database failure.
Disclosure of Invention
In order to solve the technical defects, the invention provides a gray level release method and a gray level release system for database modification.
The invention provides a gray level release method for database change, which comprises the following steps:
splitting the original database into two data copies during gray level release, wherein the table structures of the two data copies are the first table structure;
database change is carried out on one of the two data copies, and the table structure of the changed data copy is a second table structure;
establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure;
and after the successful gray level release is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In the embodiment of the invention, the method for publishing the gray level of the database change further comprises the following steps:
and retaining the data copy of the first table structure under the condition that the gray level release is not successful, and reconstructing the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In the embodiment of the invention, the method for publishing the gray level of the database change further comprises the following steps:
triggering database change through application publishing;
judging whether the database change affects the running of the old version application;
splitting the current database into two data copies under the condition that the database change is determined to influence the operation of the old version application;
and under the condition that the database change does not influence the running of the old version application, generating a database change rollback statement, and changing on a data table of the original database.
In the embodiment of the present invention, the retaining the data copy of the second table structure after the successful gray level release is determined includes: after the successful release of the gray level is determined, judging whether the change type of the database is a conflict change; under the condition that the change type of the database is determined to be the conflict change, reserving and applying the data copy of the second table structure; in the event that the database change type is determined to be a non-conflicting type change, no change is made to the database.
In the embodiment of the present invention, the step of retaining the data copy of the first table structure when the gray level distribution is determined to be unsuccessful includes: judging whether the change type of the database is a conflict change or not under the condition that the gray level release is unsuccessful; in the event that the database change type is determined to be a conflict-type change, backing off to the data copy of the first table structure; in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
In the embodiment of the invention, the conflict type change comprises an update statement, a deletion field or deletion data;
the non-conflicting class changes include field length increase/decrease, field addition, insert data, or character set conversion.
Another aspect of the present invention provides a gray level distribution system for database modification, including:
the data copy module is used for splitting the original database into two data copies when the gray level is released, and the table structures of the two data copies are the first table structure;
the data change module is used for carrying out database change on one of the two data copies, the table structure of the changed data copy is a second table structure, and a bidirectional copy relationship is established for the data copy of the first table structure and the data copy of the second table structure;
and the data reconstruction module is used for retaining the data copy of the second table structure after the successful release of the gray level is determined, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In the embodiment of the invention, the data reconstruction module is further configured to keep the data copy of the first table structure when the gray level release is determined to be unsuccessful, and reconstruct the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In an embodiment of the present invention, the system further includes:
the rollback module is used for judging whether the database change affects the operation of the old version application, and splitting the current database into two data copies under the condition that the database change is determined to affect the operation of the old version application; and under the condition that the database change does not influence the running of the old version application, generating a database change rollback statement, and changing on a data table of the original database.
In the embodiment of the present invention, the data reconstruction module is specifically configured to:
after the successful release of the gray level is determined, judging whether the change type of the database is a conflict change, and reserving and applying the data copy of the second table structure under the condition that the change type of the database is the conflict change; under the condition that the change type of the database is determined to be non-conflict change, the database is not changed;
judging whether the database change type is a conflict type change or not under the condition that the gray level release is unsuccessful, and returning to the data copy of the first table structure under the condition that the database change type is the conflict type change; in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
The invention also provides a computer device comprising a processor and a memory communicatively connected to the processor; the memory stores computer instructions; the processor executes the computer instructions stored in the memory to implement the database change gray level distribution method described above.
The invention also provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, and the computer instructions realize the gray level issuing method of database change when being executed.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described grey scale distribution method of database changes.
According to the invention, by utilizing the copy resource capability of the existing database, two data copies are split during gray level release, different data copies are used by new and old applications, and the different data copies are synchronously copied in a two-way mode, so that data is not lost during gray level release, and as the old application and the new application are separated, the existing service system is not invaded, the influence on the original application in the change is isolated, and the database fault risk caused by the change process is avoided; the problem of inconsistent table structure and data writing conflict caused by simultaneous existence of different versions of applications in the gray release transition period can be solved, and the gray release function of changing and backing back of a database terminal can be flexibly realized.
Other features and advantages of the present invention will be apparent from the detailed description that follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flowchart of a method for gray level distribution of database changes provided by an embodiment of the present invention;
FIG. 2 is a flowchart of a method for gray level distribution of database changes according to an embodiment of the present invention;
FIG. 3 is a block diagram of a gray level distribution system for database changes provided by an embodiment of the present invention;
fig. 4 is a schematic diagram of a database node state relationship change of a database change gray level distribution system provided by an embodiment of the present invention in a master-slave application scenario;
FIG. 5 is a schematic diagram of a database node state relationship change of a database modified gray level distribution system in a main < - > -main (heterogeneous) application scenario provided by an embodiment of the present invention;
FIG. 6 is a schematic diagram of a database node state relationship change of a database change gray level distribution system in a slave < (slave) > -master application scenario according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a database node state relationship change of a database change gray distribution system in a master-slave application scenario according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions and advantages of the embodiments of the present invention more apparent, the following detailed description of exemplary embodiments of the present invention is provided in conjunction with the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention and not exhaustive of all embodiments. It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other.
In the process of realizing the invention, the inventor finds that in the gray level release process of database change, the old version application and the new version application simultaneously provide services to the outside, and the problem that the table structure of the database is inconsistent and the data writing conflict can be caused because different version applications exist simultaneously in the gray level release transition period, so that the gray level release function of changing and backing of the database terminal can not be realized.
In view of the above problems, an embodiment of the present invention provides a method for distributing gray levels of database changes, in which an original database is split into two data copies during gray level distribution, the table structures of the two data copies are both a first table structure, database changes are performed on one of the two data copies, the table structure of the changed data copy is a second table structure, a bidirectional copy relationship is established for the data copy of the first table structure and the data copy of the second table structure, the data copy of the second table structure is retained after the success of gray level distribution is determined, and the data copy of the first table structure is reconstructed based on the bidirectional copy relationship between the data copy of the first table structure and the data copy of the second table structure. According to the invention, by utilizing the copy resource capability of the existing database, two data copies are split during gray level release, different data copies are used by new and old applications, and the different data copies are synchronously copied in a two-way mode, so that data is not lost during gray level release, and as the old application and the new application are separated, the existing service system is not invaded, the influence on the original application in the change is isolated, and the database fault risk caused by the change process is avoided; the problem of inconsistent table structure and data writing conflict caused by simultaneous existence of different versions of applications in the gray release transition period can be solved, and the gray release function of changing and backing back of a database terminal can be flexibly realized.
Fig. 1 is a flowchart of a method for distributing gray scale of database modification according to an embodiment of the present invention. As shown in fig. 1, the method for publishing database change gray scale according to the present embodiment includes the following steps:
s110, splitting an original database into two data copies during gray level release, wherein the table structures of the two data copies are first table structures;
s120, carrying out database change on one of the two data copies, wherein the changed data copy has a second table structure;
s130, establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure;
s140, after the successful release of the gray level is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure; and retaining the data copy of the first table structure under the condition that the gray level release is not successful, and reconstructing the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
It should be understood that, although the steps in the flowchart of fig. 1 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps of other steps.
Prior to step S110, the method further includes: and triggering database change through application publishing, and judging whether the database change affects the running of the old version application. Under the condition that the database change affects the operation of the old version application, the current database is split into two data copies, under the condition that the database change does not affect the operation of the old version application, a database change rollback statement is generated, and the change is performed on a data table of the original database.
In the step S140, after the success of the gray level distribution is determined, whether the database change type is a conflict type change is determined, and if the database change type is determined to be a conflict type change, the data copy of the second table structure is reserved and applied; in the event that the database change type is determined to be a non-conflicting type change, no change is made to the database. Judging whether the database change type is a conflict type change or not under the condition that the gray level release is unsuccessful, and returning to the data copy of the first table structure under the condition that the database change type is the conflict type change; in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
Database change types are classified into non-conflicting type changes and conflicting type changes. The non-conflict type change comprises an expansion type change and a shortening type change, and the expansion type change and the shortening type change do not influence the operation of the original application and are changed by the direct master node. Extension class changes include field length increases, field additions, insert data, character set to character set conversions supporting more characters, and the like. For the extension class change, a rollback statement is first generated in the gray level release process, the rollback statement is stored, and then the original table is changed. Shortening class changes includes field length shortening, character set conversion to character sets supporting fewer characters, and the like. For the shortened class change, a rollback sentence is first generated in the gray level release process, the rollback sentence is stored, and then the change is performed.
The conflict type change refers to a change affecting the original application operation after the change, such as updating a statement, deleting a field, deleting data, and the like. The type change corresponds to the mixed running condition of the new and old version applications, and meanwhile, data of different versions exist, and after the old version application exits, the old version data needs to be cleaned. The conflict type change controls a plurality of versions through a master-slave architecture, for example, a master-slave architecture is changed into a master < - > new master, the master and the new master correspond to old application and new application, and after the old application is off line, the corresponding database is backed up for historical version tracing.
As shown in fig. 2, in one embodiment, the overall flow of the database change gray level distribution is as follows:
1. triggering database change by applying a trigger;
2. triggering different processing flows according to whether the database change affects the old version application operation:
2.1, executing the following processes without affecting the normal operation of the old version application:
2.1.1, generating a rollback statement;
2.1.2, changing the database on the original table;
2.2, affecting the normal operation of the old version application, executing the following processes:
2.2.1, separating two versions of data copies, wherein the table structure versions of the two data copies are all "table structure version 1" (namely, a first table structure);
2.2.2, performing a database change for the newly separated data version, applying the database change in one of the versions, the table structure version of the data copy being labeled "table structure version 2" (i.e. the second table structure);
2.2.3, establishing a bidirectional replication relationship between the data copy of the table structure version 1 and the data copy of the table structure version 2;
3. whether to keep a new database change result or to rollback the database change result to a previous version is determined according to whether the release is successful:
3.1, if the edition is successfully transmitted, the application change processing flow is as follows:
3.1.1, determining if the change type is a conflicting database change:
3.1.1.1, if a conflicting database change:
3.1.1.1.1, keep a copy of the data of "table structure version 2"; reconstructing a data copy of the table structure version 1, and constructing a replication relationship with the data copy of the table structure version 2;
3.1.1.2 if it is a non-conflicting database change:
3.1.1.2.1 is not treated;
and 3.2, if the version fails, the rollback processing flow is as follows:
3.2.1, determining if the change type is a conflicting database change:
3.2.1.1, if conflicting, class database changes:
3.2.1.1.1, keep a copy of the data of "table structure version 1"; reconstructing a data copy of the table structure version 2, and constructing a replication relationship with the data copy of the table structure version 1;
3.2.1.2, if non-conflicting, class database changes:
3.2.1.2.1, application database change rollback statement;
4. and finishing the release of the data change.
Fig. 3 is a block diagram of a gray level distribution system for database modification according to an embodiment of the present invention. As shown in fig. 3, the database modification gray scale distribution system provided in this embodiment includes: the system comprises a data copy module, a data change module and a data reconstruction module. The data copy module is used for splitting the original database into two data copies during gray level release, and the table structures of the two data copies are the first table structure. The data change module is used for carrying out database change on one of the two data copies, the table structure of the changed data copy is a second table structure, and a bidirectional copy relationship is established for the data copy of the first table structure and the data copy of the second table structure. The data reconstruction module is used for retaining the data copy of the second table structure after the successful release of the gray level is determined, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In an embodiment, the data reconstruction module is further configured to preserve a data copy of the first table structure if the gray level distribution is determined to be unsuccessful, and reconstruct a data copy of the second table structure based on a bi-directional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
In an embodiment, the database change gray level publishing system further includes a rollback module. The rollback module judges whether the database change affects the operation of the old version application, and splits the current database into two data copies under the condition that the database change is determined to affect the operation of the old version application; and under the condition that the database change does not influence the running of the old version application, generating a database change rollback statement, and changing on a data table of the original database.
In a specific embodiment, the data reconstruction module determines whether the database change type is a conflict type change after determining that the gray level release is successful, and applies the data copy of the second table structure when determining that the database change type is a conflict type change; under the condition that the change type of the database is determined to be non-conflict change, the database is not changed; judging whether the database change type is a conflict type change or not under the condition that the gray level release is unsuccessful, and returning to the data copy of the first table structure under the condition that the database change type is the conflict type change; in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
For conflict-type changes, during the grayscale distribution of the master- > slave application scenario, the database node state relationship change process is shown in fig. 4. Before gray release, the old version application finds the data node provided externally in the current state through the gray release system, and then establishes a link for communication with the data node. The access operation is completed.
For conflict-type changes, the database node state relationship change process is shown in fig. 5 during gray level distribution of the main < - > -main (heterogeneous) application scenario. In the gray level release process, the old version application finds out the corresponding data copy of the table structure version 1 through the gray level release system; the new version application finds a data copy corresponding to the table structure version 2 through the gray level release system. The copy synchronization is performed between the data copy of the table structure version 1 and the data copy of the table structure version 2 through a data conversion processing program.
The main < - - > main (heterogeneous) hotspot data change capability processing thought is as follows:
inserting data, and misplacing a main key;
updating data, locking two sides, updating one side, inquiring the updating result on the other side, and returning to the client side to be successfully updated;
deleting data, locking two sides, deleting one side, inquiring the deleting result on the other side, and returning to the client side to delete successfully.
For conflict-type changes, the database node state relationship change process is shown in fig. 6 during gray level distribution of the slave < (r) > -master application scenario. If the gray level release is successful, the data copy of the table structure version 1 is reconstructed to be consistent with the data copy of the table structure version 2, and a copy relationship is constructed with the data copy of the table structure version 2.
For conflict-type changes, during the grayscale distribution of the master- > slave application scenario, the database node state relationship change process is shown in fig. 7. If the gray level release fails, the data copy of the table structure version 2 is reconstructed to be consistent with the data copy of the table structure version 1, and a copy relationship is constructed with the data copy of the table structure version 1.
In the data gray scale publishing systems of fig. 4 to 7, the middleware includes the corresponding relation between the application version and the database master node, and no additional logic processing is performed when the routing forwarding is performed. And during the gray level release period, master-slave switching and cascade relation adjustment are performed through middleware, and hot spot data change between data copies is performed.
The data conversion processing program in fig. 5 is used to realize the data copying capability in the scene of the same name but partial table structure difference caused during the gradation release change.
According to the database change gray level release system, old application data and new application data are separated, and the risk of database faults caused by a change process is isolated. Compared with a shadow table mode, the method has the advantages that the physical boundary is clearer, the life cycle management can be better carried out, and the method is more suitable for cloud primary scenes.
The embodiment of the invention also provides computer equipment, which comprises a processor and a memory which is in communication connection with the processor. The memory stores computer instructions, and the processor executes the computer instructions stored in the memory to implement the technical scheme of the database changing gray level issuing method in the embodiment. Wherein execution of the computer instructions by the processor may at least effect the method steps of:
s110, splitting an original database into two data copies during gray level release, wherein the table structures of the two data copies are first table structures;
s120, carrying out database change on one of the two data copies, wherein the changed data copy has a second table structure;
s130, establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure;
s140, after the successful release of the gray level is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure; and retaining the data copy of the first table structure under the condition that the gray level release is not successful, and reconstructing the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer is caused to execute the technical scheme of the database change gray level release method in the embodiment. Computer-readable storage media include both non-transitory and non-transitory, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The embodiment of the invention also provides a computer program product, which comprises a computer program stored in a computer readable storage medium, wherein at least one processor can read the computer program from the computer readable storage medium, and the at least one processor can realize the technical scheme of the database changed gray distribution method in the embodiment when executing the computer program. Execution of the computer program by the processor may at least implement the method steps of:
s110, splitting an original database into two data copies during gray level release, wherein the table structures of the two data copies are first table structures;
s120, carrying out database change on one of the two data copies, wherein the changed data copy has a second table structure;
s130, establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure;
s140, after the successful release of the gray level is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure; and retaining the data copy of the first table structure under the condition that the gray level release is not successful, and reconstructing the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The scheme in the embodiment of the invention can be realized by adopting various computer languages, such as object-oriented programming language Java, an transliteration script language JavaScript and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, 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, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (13)

1. A gradation release method of database modification, comprising:
splitting the original database into two data copies during gray level release, wherein the table structures of the two data copies are the first table structure;
database change is carried out on one of the two data copies, and the table structure of the changed data copy is a second table structure;
establishing a bidirectional replication relationship for the data replicas of the first table structure and the data replicas of the second table structure;
and after the successful gray level release is determined, retaining the data copy of the second table structure, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
2. The method of claim 1, further comprising:
and retaining the data copy of the first table structure under the condition that the gray level release is not successful, and reconstructing the data copy of the second table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
3. The method of claim 1, further comprising:
triggering database change through application publishing;
judging whether the database change affects the running of the old version application;
splitting the current database into two data copies under the condition that the database change is determined to influence the operation of the old version application;
and under the condition that the database change does not influence the running of the old version application, generating a database change rollback statement, and changing on a data table of the original database.
4. The method for distributing gray levels of database modification according to claim 1, wherein said retaining a data copy of the second table structure after determining that the gray level distribution is successful comprises:
after the successful release of the gray level is determined, judging whether the change type of the database is a conflict change;
under the condition that the database change type is determined to be a conflict type change, reserving and applying a data copy of the second table structure;
in the event that the database change type is determined to be a non-conflicting type change, no change is made to the database.
5. The method for distributing gray levels of database alterations according to claim 2, wherein said retaining a data copy of the first table structure in case it is determined that gray level distribution is unsuccessful, comprises:
judging whether the change type of the database is a conflict change or not under the condition that the gray level release is unsuccessful;
in the event that the database change type is determined to be a conflict-type change, backing off to the data copy of the first table structure;
in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
6. The grayscale distribution method of database changes according to claim 4 or 5, wherein the conflict-type changes include update statements, delete fields, or delete data;
the non-conflicting class changes include field length increase/decrease, field addition, insert data, or character set conversion.
7. A gradation release system for database modification, comprising:
the data copy module is used for splitting the original database into two data copies when the gray level is released, and the table structures of the two data copies are the first table structure;
the data change module is used for carrying out database change on one of the two data copies, the table structure of the changed data copy is a second table structure, and a bidirectional copy relationship is established for the data copy of the first table structure and the data copy of the second table structure;
and the data reconstruction module is used for retaining the data copy of the second table structure after the successful release of the gray level is determined, and reconstructing the data copy of the first table structure based on the bidirectional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
8. The gray scale distribution system of database alterations of claim 7, wherein said data reconstruction module is further configured to preserve a data copy of the first table structure if gray scale distribution is determined to be unsuccessful, and reconstruct a data copy of the second table structure based on a bi-directional replication relationship between the data copy of the first table structure and the data copy of the second table structure.
9. The gray scale distribution system of database alterations according to claim 7, wherein said system further comprises:
the rollback module is used for judging whether the database change affects the operation of the old version application, and splitting the current database into two data copies under the condition that the database change is determined to affect the operation of the old version application; and under the condition that the database change does not influence the running of the old version application, generating a database change rollback statement, and changing on a data table of the original database.
10. The system for distributing gray levels of database modification according to claim 8, wherein the data reconstruction module is specifically configured to:
after the successful release of the gray level is determined, judging whether the change type of the database is a conflict change, and applying the data copy of the second table structure under the condition that the change type of the database is the conflict change; under the condition that the change type of the database is determined to be non-conflict change, the database is not changed;
judging whether the database change type is a conflict type change or not under the condition that the gray level release is unsuccessful, and returning to the data copy of the first table structure under the condition that the database change type is the conflict type change; in the event that the database change type is determined to be a non-conflicting type change, a database change rollback statement is applied.
11. A computer device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer instructions;
the processor executes the computer instructions stored in the memory to implement the method for gray scale distribution of database alterations of any of claims 1-5.
12. A computer readable storage medium having stored therein computer instructions which when executed implement the method of gray scale distribution of database alterations of any of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method of gray distribution of database alterations of any of claims 1-5.
CN202311414402.1A 2023-10-30 2023-10-30 Gray level release method and system for database change and computer equipment Active CN117149747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311414402.1A CN117149747B (en) 2023-10-30 2023-10-30 Gray level release method and system for database change and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311414402.1A CN117149747B (en) 2023-10-30 2023-10-30 Gray level release method and system for database change and computer equipment

Publications (2)

Publication Number Publication Date
CN117149747A true CN117149747A (en) 2023-12-01
CN117149747B CN117149747B (en) 2024-02-02

Family

ID=88906455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311414402.1A Active CN117149747B (en) 2023-10-30 2023-10-30 Gray level release method and system for database change and computer equipment

Country Status (1)

Country Link
CN (1) CN117149747B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150154164A1 (en) * 2013-09-12 2015-06-04 Wix.Com Ltd. System for comparison and merging of versions in edited websites and interactive applications
US20150363458A1 (en) * 2011-12-30 2015-12-17 Bmc Software, Inc. Systems and methods for migrating database data
US20160012184A1 (en) * 2014-07-10 2016-01-14 Ims Health Incorporated System and method for master data management
US20160239523A1 (en) * 2015-02-13 2016-08-18 Andre Haferkorn Simultaneous Operation Of Multiple Versions Of An Application Using Bidirectional Synchronization And Separated Read Write Channels
US20170139960A1 (en) * 2015-11-18 2017-05-18 Sap Se Table migration to updated structures without creating an intermediate copy of the table data
US20170192884A1 (en) * 2015-12-30 2017-07-06 Roku, Inc. Providing rolling updates of distributed systems with a shared cache
CN110688134A (en) * 2019-08-29 2020-01-14 阿里巴巴集团控股有限公司 Method and device for gray scale publishing
CN111158715A (en) * 2019-12-19 2020-05-15 中国平安财产保险股份有限公司 Gray scale release control method and system
CN113094434A (en) * 2021-04-08 2021-07-09 中国工商银行股份有限公司 Database synchronization method, system, device, electronic equipment and medium
WO2022037272A1 (en) * 2020-08-21 2022-02-24 烽火通信科技股份有限公司 Gray release method, apparatus and device, and readable storage medium
CN116633771A (en) * 2023-05-29 2023-08-22 中国建设银行股份有限公司 Gray release method, device and medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363458A1 (en) * 2011-12-30 2015-12-17 Bmc Software, Inc. Systems and methods for migrating database data
US20150154164A1 (en) * 2013-09-12 2015-06-04 Wix.Com Ltd. System for comparison and merging of versions in edited websites and interactive applications
US20160012184A1 (en) * 2014-07-10 2016-01-14 Ims Health Incorporated System and method for master data management
US20160239523A1 (en) * 2015-02-13 2016-08-18 Andre Haferkorn Simultaneous Operation Of Multiple Versions Of An Application Using Bidirectional Synchronization And Separated Read Write Channels
US20170139960A1 (en) * 2015-11-18 2017-05-18 Sap Se Table migration to updated structures without creating an intermediate copy of the table data
US20170192884A1 (en) * 2015-12-30 2017-07-06 Roku, Inc. Providing rolling updates of distributed systems with a shared cache
CN110688134A (en) * 2019-08-29 2020-01-14 阿里巴巴集团控股有限公司 Method and device for gray scale publishing
CN111158715A (en) * 2019-12-19 2020-05-15 中国平安财产保险股份有限公司 Gray scale release control method and system
WO2022037272A1 (en) * 2020-08-21 2022-02-24 烽火通信科技股份有限公司 Gray release method, apparatus and device, and readable storage medium
CN113094434A (en) * 2021-04-08 2021-07-09 中国工商银行股份有限公司 Database synchronization method, system, device, electronic equipment and medium
CN116633771A (en) * 2023-05-29 2023-08-22 中国建设银行股份有限公司 Gray release method, device and medium

Also Published As

Publication number Publication date
CN117149747B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
US11010358B2 (en) Data migration method and system
US20190340171A1 (en) Data Redistribution Method and Apparatus, and Database Cluster
US11086833B2 (en) Data storage method and apparatus for distributed database
CN106326239A (en) Distributed file system and file meta-information management method thereof
WO2020063600A1 (en) Data disaster recovery method and site
CN112732491B (en) Data processing system and business data processing method based on data processing system
JP6440773B2 (en) Data replication method and apparatus
CN112783868A (en) Distributed database table structure gray scale upgrading method, device and system
CN112418794A (en) Service transfer method and device
CN112860697A (en) Distributed database table structure changing method, device and system
CN117149747B (en) Gray level release method and system for database change and computer equipment
CN110991983B (en) Task processing method, device, medium and equipment
CN110912979B (en) Method for solving multi-server resource synchronization conflict
CN113297316A (en) Method, device and system for realizing data synchronization
CN111680040A (en) Data table processing method and device
CN110427423A (en) A kind of method, equipment and readable medium for avoiding database session from interrupting
CN116166196A (en) Method and device for recovering expansion and contraction capacity of storage pool in distributed storage system
CN114880717A (en) Data archiving method and device
CN115587141A (en) Database synchronization method and device
CN112231150B (en) Method and device for recovering fault database in database cluster
CN111400098B (en) Copy management method and device, electronic equipment and storage medium
CN114297003A (en) Database node fault recovery method, device, equipment and storage medium
CN113301177A (en) Domain name anti-blocking method and device
CN110990378A (en) Block chain-based data consistency comparison method, device and medium
CN111078669B (en) Processing method, device and equipment based on name resolution tree and storage 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