Gray release method, device and equipment, computer storage medium and program product
By generating grayscale fragment tables in the IT system and performing SQL operations, the problem of downtime when the transaction record table structure changes during grayscale release is solved, and grayscale releases that are not stopped are achieved, improving business response speed.
Patent Information
- Application Number
- CN202410924348.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-01
AI Technical Summary
In the process of grayscale release of IT systems, when the transaction record table structure changes, it is necessary to wait for the downtime window to complete the transaction record table structure change before grayscale release is performed, resulting in business downtime and market response speed decreases.
By executing the grayscale declaration instruction to generate a grayscale fragment table of the transaction record table, SQL instruction operations are performed during the grayscale release process, data modification is completed, and grayscale end instruction is executed in the grayscale stage to change the table structure and data synchronization, so as to achieve Grayscale release without shutting down.
Without affecting the normal use of the business, the non-stop grayscale release of transaction record table structure modification is realized, which improves the market response speed of grayscale services when they are launched.
Smart Images

Figure CN118885192A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a grayscale publishing method, device, equipment, computer storage medium, and program product. Background Art
[0002] Grayscale release refers to the gradual introduction of new versions to some users or user groups for testing and verification during the software or system update process to reduce risks and ensure the stability and performance of the system.
[0003] In the prior art, the grayscale release method of IT systems is generally to perform grayscale release on the application side, in which the non-grayscale application on side A is the old program package, and the side B is rolled over to be replaced with the new program package to gradually replace the business with the grayscale application. The old package of the non-grayscale application and the new package of the grayscale application respectively call the methods of their corresponding configuration tables to realize the grayscale release without stopping the IT system.
[0004] However, if the grayscale released business involves structural changes of transaction record tables that are used by both grayscale and non-grayscale businesses, such as transaction record tables, all businesses still need to be stopped, and DDL (data definition language) must be executed in the database to modify the table structure and compile index invalid objects before the grayscale release of the business can be carried out. Related operations generally take more than hours to execute, and IT systems do not always have downtime windows. Therefore, it is necessary to wait for the downtime window to complete the changes in the transaction record table structure before grayscale release can be carried out. Summary of the invention
[0005] The embodiments of the present application provide a grayscale publishing method, apparatus, device, computer storage medium, and program product to solve the problem of having to wait for the shutdown window to complete the change of the transaction record table structure before grayscale publishing.
[0006] In a first aspect, an embodiment of the present application provides a grayscale release method, the method comprising:
[0007] Get the grayscale release instructions, which include grayscale declaration instructions, SQL instructions, and grayscale end instructions. Grayscale declaration instructions are used to declare grayscale release of the business involving the transaction record table;
[0008] When the database executes the grayscale declaration instruction, the grayscale declaration information in the grayscale declaration instruction is inserted into the grayscale record table to generate a grayscale fragment table corresponding to the transaction record table, wherein the grayscale record table is a database table pre-configured for storing grayscale declaration information;
[0009] When executing SQL instructions, determine whether grayscale fragment table data operations are involved;
[0010] When it is determined that the grayscale fragment table data operation is involved, the DML operation corresponding to the SQL instruction is performed on the transaction record table and the grayscale fragment table;
[0011] After the grayscale stage is completed and all SQL instructions are executed, the table structure of the relevant transaction record table is changed and the grayscale fragment table information is synchronized according to the grayscale end information in the grayscale end instruction to complete the grayscale release.
[0012] In a second aspect, an embodiment of the present application provides a grayscale publishing device, the device comprising:
[0013] The acquisition module is used to obtain the grayscale release instructions. The grayscale release instructions include grayscale declaration instructions, SQL instructions and grayscale end instructions. The grayscale declaration instructions are used to declare the grayscale release of the business involving the transaction record table;
[0014] A declaration module, used for inserting the grayscale declaration information in the grayscale declaration instruction into the grayscale record table when the database executes the grayscale declaration instruction, and generating a grayscale fragment table corresponding to the transaction record table, wherein the grayscale record table is a database table pre-configured for storing grayscale declaration information;
[0015] A judgment module, used to judge whether grayscale fragment table data operation is involved when executing SQL instructions;
[0016] An operation module, used for performing DML operations corresponding to SQL instructions on the transaction record table and the grayscale fragment table when it is determined that the grayscale fragment table data operation is involved;
[0017] The end module is used to change the table structure of the relevant transaction record table and synchronize the grayscale fragment table information according to the grayscale end information in the grayscale end instruction after the grayscale stage is completed and all the SQL instructions obtained are executed, so as to complete the grayscale release.
[0018] In a third aspect, an embodiment of the present application provides a grayscale release device, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the grayscale release method of the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the grayscale release method of the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the grayscale release method as in the first aspect.
[0021] The grayscale publishing method, apparatus, device, computer storage medium, and program product provided in the embodiments of the present application first execute a grayscale declaration instruction, generate a grayscale fragment table corresponding to a transaction record table based on the grayscale declaration information, execute SQL instructions during the grayscale publishing process, and modify data by performing corresponding DML operations on the grayscale fragment table and the transaction record table, so that the services involved in the grayscale publishing process can still be used normally, and there is no need to wait for the shutdown window to completely stop the services before grayscale publishing. Finally, after the grayscale stage is completed and the SQL instructions are executed, the grayscale end instruction is executed to modify the table structure and synchronize the grayscale fragment table data to complete the grayscale publishing process, so that when the table structure of the transaction record table is modified, grayscale publishing can still be achieved without shutting down. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 It is a logical principle diagram of the grayscale release process provided by the embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the system structure that can implement the grayscale publishing method provided in the embodiment of the present application;
[0025] Figure 3 It is a flowchart of the grayscale publishing method provided in the embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the structure of the grayscale publishing device provided in an embodiment of the present application;
[0027] Figure 5 It is a structural diagram of the grayscale publishing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0029] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0030] like Figure 1 As shown, when grayscale release is performed, the client application transmits the user request to the diversion layer, and requests the diversion layer to distribute the client request to the non-grayscale center and the grayscale center. The non-grayscale center application on side A is the old package, and the new package is rolled out on side B. The business is gradually replaced with the grayscale application. The non-grayscale center and the grayscale center call the non-grayscale parameter table and the grayscale parameter table respectively to realize the grayscale release and launch. However, when the existing grayscale release method involves the structural change of the transaction record table, since the table structure change sometimes involves the addition, deletion or modification of fields, it may cause data inconsistency between grayscale business and non-grayscale business, and grayscale business and non-grayscale business may rely on the specific structure and fields of the shared table. When the structure of the table changes, it may cause compatibility problems between grayscale business and non-grayscale business. Therefore, the grayscale release process is often carried out after the transaction table structure change is completed, and the IT system does not always have a shutdown window. If the business is completely stopped and the table structure of the transaction record table is modified when there is a shutdown window before grayscale release, it will not only affect the use of user business, but also reduce the market support response speed of grayscale business launch.
[0031] In order to solve the problems of the prior art, the embodiments of the present invention provide a grayscale publishing method, device, equipment, computer storage medium and computer program product to solve the problem of waiting for the shutdown window to complete the change of the transaction record table structure before grayscale publishing. The grayscale publishing method, device, equipment, computer storage medium and program product provided by the embodiments of the present application first execute the grayscale declaration instruction, generate the grayscale fragment table corresponding to the transaction record table based on the grayscale declaration information, execute SQL instructions during the grayscale publishing process, and modify the data by performing corresponding DML operations on the grayscale fragment table and the transaction record table, so that the business involved in the grayscale publishing process can still be used normally, without waiting for the shutdown window to stop all business before grayscale publishing, and finally after the grayscale stage is completed and the SQL instruction is executed, the grayscale end instruction is executed to modify the table structure and synchronize the grayscale fragment table data to complete the grayscale publishing process, so that when the table structure of the transaction record table is modified, grayscale publishing can still be achieved without stopping.
[0032] The following first provides an example of a system framework to which the grayscale publishing method provided in the embodiments of the present application can be applied.
[0033] like Figure 2 As shown, the system may include: a grayscale declaration module, a grayscale end module and a data modification module; when the data declaration module executes the grayscale declaration instruction in the database, it executes operations ①-③ respectively, operation ① is the grayscale declaration information in the grayscale declaration instruction parsing instruction, operation ② is inserting the grayscale declaration information into the grayscale record table of the database system, and operation ③ is generating a grayscale fragment table; during the grayscale process, the data modification module executes operations ④-⑤ respectively, operation ④ is performing DML operation on the transaction record table, and operation ⑤ is performing DML operation on the grayscale fragment table; when the grayscale end module executes the grayscale declaration end instruction in the database after the grayscale ends, it executes operations ⑥-⑧ respectively, operation ⑥ is executing the table structure change of the transaction record table, compiling the invalid objects caused by the table structure change, operation ⑦ is clearing the relevant record information in the grayscale record table, operation ⑧ is writing the grayscale fragment table corresponding to the transaction record table into the transaction record table, and deleting the grayscale fragment table after writing is completed.
[0034] The following is an introduction to the grayscale publishing method provided by an embodiment of the present invention.
[0035] Figure 3 FIG. 1 is a flow chart showing a method for grayscale publishing provided by an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:
[0036] S101, obtaining a grayscale release instruction, which includes a grayscale declaration instruction, an SQL instruction, and a grayscale end instruction. The grayscale declaration instruction is used to declare a grayscale release of a business involving a transaction record table.
[0037] The SQL instruction is an operation instruction on the transaction record table obtained during the grayscale process, and the grayscale end instruction is used to declare the grayscale end of the business that has completed the grayscale process.
[0038] In some embodiments, SQL instructions include DML operations, DDL operations, and DCL operations.
[0039] S102, when the database executes the grayscale declaration instruction, inserting the grayscale declaration information in the grayscale declaration instruction into the grayscale record table, generating a grayscale fragment table corresponding to the transaction record table, wherein the grayscale record table is a database table pre-configured for storing grayscale declaration information.
[0040] In some embodiments, the grayscale record table is used to store grayscale declaration information, the transaction record table is a data table used by both grayscale and non-grayscale businesses, and is used to store business-related data; the grayscale fragment table is a table temporarily created during grayscale release, and is used to store data fragments during the grayscale period.
[0041] S103, when executing the SQL instruction, determine whether grayscale fragment table data operation is involved.
[0042] During the grayscale release, the addition or length extension operations on the table data will be replaced by the grayscale fragment table instead of directly modifying the transaction record table, which can achieve data isolation and improve security.
[0043] S104: When it is determined that the grayscale fragment table data operation is involved, a DML operation corresponding to the SQL instruction is performed on the transaction record table and the grayscale fragment table.
[0044] By judging whether the grayscale fragment table is included, unnecessary queries and operations can be avoided, thereby improving the efficiency of executing SQL instructions; if the SQL instruction does not include the grayscale fragment table, the relevant operations can be skipped directly, reducing unnecessary calculations.
[0045] S105, after the grayscale stage is completed and all the SQL instructions obtained are executed, the table structure of the relevant transaction record table is changed and the grayscale fragment table information is synchronized according to the grayscale end information in the grayscale end instruction to complete the grayscale release.
[0046] The grayscale stage is completed, ensuring that all verification and testing of the grayscale process have been completed, and all SQL instructions obtained have been executed. Ensure that when the grayscale end instruction is executed, no business accesses the relevant transaction record table to ensure data integrity and consistency.
[0047] The grayscale publishing method, apparatus, device, computer storage medium, and program product provided in the embodiments of the present application first execute a grayscale declaration instruction, generate a grayscale fragment table corresponding to a transaction record table based on the grayscale declaration information, execute SQL instructions during the grayscale publishing process, and modify data by performing corresponding DML operations on the grayscale fragment table and the transaction record table, so that the services involved in the grayscale publishing process can still be used normally, and there is no need to wait for the shutdown window to completely stop the services before grayscale publishing. Finally, after the grayscale stage is completed and the SQL instructions are executed, the grayscale end instruction is executed to modify the table structure and synchronize the grayscale fragment table data to complete the grayscale publishing process, so that when the table structure of the transaction record table is modified, grayscale publishing can still be achieved without shutting down.
[0048] In some embodiments, in step S102, when the database executes the grayscale declaration instruction, the grayscale declaration information in the grayscale declaration instruction is inserted into the grayscale record table, and a grayscale fragment table corresponding to the transaction record table is generated, including:
[0049] Parse the grayscale declaration instruction to obtain the grayscale declaration table name, grayscale field and grayscale action;
[0050] The grayscale declaration table name, grayscale field, and grayscale action are written into the grayscale record table to generate a grayscale fragment table corresponding to the transaction record table, wherein the grayscale declaration table name corresponds to the transaction record table name involving grayscale release.
[0051] Inserting the grayscale declaration information into the grayscale record table records all grayscale declaration information during the grayscale release process, which can manage and track grayscale data. By generating a grayscale fragment table corresponding to the transaction record table, during the grayscale release, the transaction record table is replaced to add data or extend the length. By copying and updating data in the grayscale fragment table, data consistency can be ensured to avoid data conflicts and errors.
[0052] In some embodiments, the grayscale table, grayscale fields, grayscale actions and related information are written into the grayscale record table. One grayscale field in a table corresponds to one record. A grayscale fragment table corresponding to the transaction record table is generated. The grayscale record table structure is shown in Table 1.
[0053] Table 1 Grayscale record table
[0054]
[0055] Taking the transaction record table of the ordering service as an example, the structure of the transaction record table is shown in Table 2. The transaction record table may include the record id, telephone number, ordered product, handling operator id and record creation time.
[0056] Table 2 Transaction record table
[0057]
[0058]
[0059] The grayscale declaration of the ordering business is performed, and the grayscale record table corresponding to the generated transaction record table is shown in Table 3.
[0060] Table 3 Grayscale fragment table
[0061] Field Name Field Type Chinese description Detailed Description Remark id NUMBER(14) Related transaction table id none Primary Key prod VARCHAR(30) Grayscale Order Products none none created Date Record creation time none none
[0062] In some embodiments, in step S103, when executing the SQL instruction, before determining whether grayscale fragment table data operation is involved, the method may include:
[0063] Check whether the grayscale record table contains the operation table name in the SQL command;
[0064] In the case where the grayscale record table includes the operation table name in the SQL instruction, when executing the SQL instruction, it is determined whether the grayscale segment table data operation is involved;
[0065] When a grayscale record table exists, it means that the current business is in the grayscale release stage, and the corresponding DML operations can be performed. If the corresponding grayscale record table does not exist, that is, the grayscale release has ended, you can directly perform corresponding operations on the transaction record table.
[0066] The grayscale fragment table is a table temporarily created during the grayscale release, which is used to store data fragments during the grayscale period. If the existence of the relevant grayscale fragment table data needs to be checked every time an SQL instruction is executed, additional maintenance costs will be added. If the grayscale record table does not exist, the corresponding grayscale fragment table data must not exist, and there is no need to check whether the relevant grayscale fragment table data exists.
[0067] Therefore, when it is determined that the grayscale record table exists, the corresponding grayscale fragment table is queried to perform the corresponding DML operation, which can reduce the occupation of database resources and the complexity of management work.
[0068] In some embodiments, in step S103, when the operation table name does not exist in the grayscale record table or the SQL instruction does not involve grayscale fragment table data operation, the operation corresponding to the SQL instruction is performed on the transaction record table.
[0069] When the operation table name does not exist in the grayscale record table, it proves that there is no related grayscale business in the corresponding transaction record table, and the relevant operations can be directly performed on the transaction record table; when the SQL instruction does not involve grayscale fragment table data operations, that is, there is no need to perform DML operations, the remaining operations in the SQL instruction, such as DDL operations and DCL operations, can be directly performed on the transaction record table.
[0070] When the operation table name does not exist in the grayscale record table or the SQL instruction does not involve grayscale fragment table data operations, directly executing the corresponding SQL instruction on the transaction record table can simplify the operation process and reduce additional judgment and processing steps.
[0071] In some embodiments, in step S104, the DML operation corresponding to the SQL instruction includes:
[0072] Add operation, write the added data into the grayscale fragment table;
[0073] Delete operation, delete the deleted data in the transaction record table and the corresponding fragment table;
[0074] Change the operation and update the modified data in the transaction record table and the corresponding fragment table;
[0075] Query operation, merge the query data in the transaction record table and the corresponding fragment table and return to the query page.
[0076] When adding data or extending its length, the grayscale fragment table is used instead of the transaction record table to add data or extend its length, to prevent the writing of grayscale business data from affecting non-grayscale business data. The deletion, modification and query operations are performed on both the transaction record table and the grayscale record table to ensure data consistency.
[0077] In some embodiments, in step S105, according to the grayscale end information in the grayscale end instruction, the table structure of the relevant transaction record table is changed and the grayscale fragment table information is synchronized to complete the grayscale release, including:
[0078] Parse the grayscale end instruction to obtain the grayscale end table name, grayscale field and grayscale action;
[0079] Filter the grayscale record table that matches the grayscale end table name, grayscale field, and grayscale action;
[0080] When the transaction record table corresponding to the matched grayscale record table has no business access, execute the table structure modification instruction on the transaction record table and compile the related invalidation objects of the index table;
[0081] Write the information in the grayscale fragment table into the transaction record table, and clear the corresponding information in the grayscale fragment table and the grayscale record table.
[0082] By matching information such as the grayscale end table name, we can determine the related businesses that need to complete the grayscale release, write the information in the grayscale fragment table back to the corresponding transaction record table, and clear the corresponding information in the grayscale fragment table and the grayscale record table. This can complete data migration and cleanup, help keep the database clean and efficient, and avoid unnecessary data redundancy and waste of storage space.
[0083] In some embodiments, the primary key of the grayscale segment table is associated with the unique key or primary key of the transaction record table for matching and associating the grayscale segment table with the transaction record table.
[0084] Figure 4 Schematic diagram of a grayscale publishing device provided in an embodiment of the present application. Figure 4 As shown, the device may include an acquisition module 401 , a declaration module 402 , a judgment module 403 , an operation module 404 , and an end module 405 .
[0085] The acquisition module 401 is used to acquire a grayscale release instruction, which includes a grayscale declaration instruction, an SQL instruction, and a grayscale end instruction. The grayscale declaration instruction is used to declare a grayscale release of a business involving a transaction record table;
[0086] A declaration module 402 is used to insert the grayscale declaration information in the grayscale declaration instruction into the grayscale record table when the database executes the grayscale declaration instruction, and generate a grayscale fragment table corresponding to the transaction record table;
[0087] A judgment module 403 is used to judge whether a grayscale segment table is involved when executing an SQL instruction;
[0088] An operation module 404 is used to perform a DML operation corresponding to the SQL instruction on the transaction record table and the grayscale fragment table when it is determined that the grayscale fragment table is involved;
[0089] End module 405 is used to change the table structure of the relevant transaction record table and synchronize the grayscale fragment table information according to the grayscale end information in the grayscale end instruction after the grayscale stage is completed and all the SQL instructions obtained are executed, so as to complete the grayscale release.
[0090] In some embodiments, the acquisition module is further used to parse the grayscale declaration instruction to obtain the grayscale declaration table name, grayscale field and grayscale action;
[0091] The declaration module is also used to write the grayscale declaration table name, grayscale fields, and grayscale actions into the grayscale record table to generate a grayscale fragment table corresponding to the transaction record table, wherein the grayscale declaration table name corresponds to the transaction record table name involving grayscale release.
[0092] In some embodiments, the judgment module is further used to query whether the grayscale record table includes the operation table name in the SQL instruction;
[0093] The judgment module is also used to judge whether grayscale segment table data operation is involved when executing the SQL instruction when the grayscale record table includes the operation table name in the SQL instruction.
[0094] In some embodiments, the operation module is further configured to perform an operation corresponding to the SQL instruction on the transaction record table when the operation table name does not exist in the grayscale record table or the SQL instruction does not involve grayscale fragment table data operation.
[0095] In some embodiments, the operation module is used to execute the DML operation corresponding to the SQL instruction, and the DML operation includes:
[0096] Add operation, write the added data into the grayscale fragment table;
[0097] Delete operation, delete the deleted data in the transaction record table and the corresponding fragment table;
[0098] Change the operation and update the modified data in the transaction record table and the corresponding fragment table;
[0099] Query operation, merge the query data in the transaction record table and the corresponding fragment table and return to the query page.
[0100] In some embodiments, the acquisition module is further used to parse the grayscale end instruction to obtain the grayscale end table name, grayscale field and grayscale action;
[0101] The judgment module is also used to filter the grayscale record table that matches the grayscale end table name, grayscale field and grayscale action;
[0102] The end module is also used for executing the table structure modification instruction and compiling the related invalidation objects of the index table in the corresponding transaction record table when there is no business access to the matched grayscale record table;
[0103] The end module is also used to write the information in the grayscale fragment table back to the corresponding transaction record table, and clear the corresponding information in the grayscale fragment table and the grayscale record table.
[0104] Figure 4 The modules in the system shown can be implemented Figure 3 Each step in the above steps can achieve the corresponding technical effect, which will not be repeated here for the sake of brevity.
[0105] Figure 5 A schematic diagram of the hardware structure of the grayscale publishing device provided in an embodiment of the present application is shown.
[0106] The grayscale release device may include a processor 501 and a memory 502 storing computer program instructions.
[0107] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0108] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In one example, the memory 502 may include a removable or non-removable (or fixed) medium, or the memory 502 is a non-volatile solid-state memory. The memory 502 may be inside or outside the integrated gateway disaster recovery device.
[0109] In one example, the memory 502 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0110] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement Figure 3 The grayscale publishing method in the illustrated embodiment.
[0111] In one example, the grayscale publishing device may further include a communication interface 503 and a bus 504. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 504 and communicate with each other.
[0112] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0113] Bus 504 includes hardware, software or both, and the parts of grayscale release equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, front side bus (Front Side Bus, FSB), Hyper Transport (Hyper Transport, HT) interconnection, industry standard architecture (Industry Standard Architecture, ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 504 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0114] In addition, in combination with the grayscale release method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any grayscale release method in the above embodiment is implemented.
[0115] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the grayscale release methods in the above embodiments.
[0116] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0117] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0118] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0119] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0120] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A grayscale release method, It is characterized in that The method comprises: Obtaining a grayscale release instruction, wherein the grayscale release instruction includes a grayscale declaration instruction, an SQL instruction, and a grayscale end instruction, wherein the grayscale declaration instruction is used to declare a grayscale release of a business involving a transaction record table; When the database executes the grayscale declaration instruction, the grayscale declaration information in the grayscale declaration instruction is inserted into the grayscale record table to generate a grayscale fragment table corresponding to the transaction record table, wherein the grayscale record table is a database table pre-configured for storing grayscale declaration information; When executing SQL instructions, determine whether grayscale fragment table data operations are involved; When it is determined that the grayscale fragment table data operation is involved, a DML operation corresponding to the SQL instruction is performed on the transaction record table and the grayscale fragment table; After the grayscale stage is completed and all SQL instructions are executed, the table structure of the relevant transaction record table is changed and the grayscale fragment table information is synchronized according to the grayscale end information in the grayscale end instruction to complete the grayscale release.
2. The grayscale release method according to claim 1, It is characterized in that When the grayscale declaration instruction is executed in the database, the grayscale declaration information in the grayscale declaration instruction is inserted into the grayscale record table, and a grayscale fragment table corresponding to the transaction record table is generated, including: Parsing the grayscale declaration instruction to obtain the grayscale declaration table name, grayscale field and grayscale action; The grayscale declaration table name, grayscale field, and grayscale action are written into the grayscale record table to generate a grayscale fragment table corresponding to the transaction record table, wherein the grayscale declaration table name corresponds to the transaction record table name involving grayscale release.
3. The grayscale release method according to claim 1, It is characterized in that Before determining whether grayscale fragment table data operation is involved when executing the SQL instruction, the method includes: Query whether the grayscale record table includes the operation table name in the SQL instruction; In the case where the grayscale record table includes the operation table name in the SQL instruction, when the SQL instruction is executed, it is determined whether grayscale segment table data operation is involved.
4. The grayscale release method according to claim 3, It is characterized in that When the operation table name does not exist in the grayscale record table or the SQL instruction does not involve grayscale fragment table data operation, the operation corresponding to the SQL instruction is performed on the transaction record table.
5. The grayscale release method according to claim 1, It is characterized in that The DML operations corresponding to the SQL instructions include: Add operation, write the added data into the grayscale fragment table; Delete operation, delete the deleted data in the transaction record table and the corresponding fragment table; Change the operation and update the modified data in the transaction record table and the corresponding fragment table; Query operation, merge the query data in the transaction record table and the corresponding fragment table and return to the query page.
6. The grayscale release method according to claim 1, It is characterized in that According to the grayscale end information in the grayscale end instruction, the table structure of the relevant transaction record table is changed and the grayscale fragment table information is synchronized to complete the grayscale release, including: Parsing the grayscale end instruction to obtain the grayscale end table name, grayscale field and grayscale action; Filter the grayscale record table that matches the grayscale end table name, grayscale field, and grayscale action; When the transaction record table corresponding to the matched grayscale record table has no business access, execute the table structure modification instruction on the transaction record table and compile the related invalidation objects of the index table; Write the information in the grayscale fragment table into the transaction record table, and clear the corresponding information in the grayscale fragment table and the grayscale record table.
7. A grayscale release device, It is characterized in that The device comprises: An acquisition module is used to acquire a grayscale release instruction, wherein the grayscale release instruction includes a grayscale declaration instruction, an SQL instruction, and a grayscale end instruction, wherein the grayscale declaration instruction is used to declare a grayscale release of a business involving a transaction record table; A declaration module, used for inserting the grayscale declaration information in the grayscale declaration instruction into the grayscale record table when the database executes the grayscale declaration instruction, and generating a grayscale fragment table corresponding to the transaction record table, wherein the grayscale record table is a database table pre-configured for storing grayscale declaration information; A judgment module, used to judge whether grayscale fragment table data operation is involved when executing SQL instructions; An operation module, configured to perform a DML operation corresponding to the SQL instruction on the transaction record table and the grayscale fragment table when it is determined that the grayscale fragment table data operation is involved; The end module is used to change the table structure of the relevant transaction record table and synchronize the grayscale fragment table information according to the grayscale end information in the grayscale end instruction after the grayscale stage is completed and all the SQL instructions obtained are executed, so as to complete the grayscale release.
8. A grayscale release device, It is characterized in that The device includes: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the grayscale release method according to any one of claims 1-6.
9. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the grayscale release method according to any one of claims 1 to 6 is implemented.
10. A computer program product, It is characterized in that The computer product includes a computer program, which, when executed by a processor, implements the grayscale release method described in any one of claims 1 to 6.
