Data grayscale control method and device, business processing system and storage medium
The data grayscale control method and device address the challenges of controlling and isolating grayscale data in high-concurrency environments by determining data access through a service processing node, ensuring traceability and rollback, and minimizing business risks.
Patent Information
- Application Number
- CN202310755509.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2024-12-27
AI Technical Summary
Existing data grayscale control methods face challenges in ensuring controllability, traceability, and avoiding business risks during service version upgrades or data changes, particularly in high-concurrency environments, where incorrect configuration information can cause multiple request failures and transformative dependencies on upstream and downstream callers.
A data grayscale control method and device that utilize a data grayscale strategy to determine whether business requests hit grayscale or production databases, isolating grayscale data to avoid impacting business logic and managing dependencies through a service processing node with an interface, logic, and data layers, employing a data source determination module and control module to manage data access.
The solution effectively isolates grayscale data from production data, reducing business impact, ensuring traceability and rollback capabilities, and avoiding dependencies on upstream and downstream applications, while maintaining the integrity of the business processing flow.
Smart Images

Figure CN119201367A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, but is not limited to it, and in particular to a data grayscale control method, device, business processing system and storage medium. Background Art
[0002] In the Internet system architecture, grayscale strategy is very important, such as grayscale release of application services, grayscale effectiveness of configuration information, etc. Because in the Internet era, the concurrency of requests may be very high. In the process of service version upgrade or data information change, the loss of business caused by unexpected defects of new services or new data before the change should be reduced as much as possible.
[0003] Grayscale literally means a smooth transition area between black and white. So for Internet services, the data before and after the change are black and white, and one way to achieve a smooth transition of the data before the change is called data grayscale. Several characteristics of Internet services: large service scale and large data access volume. Every time the data changes, the service has to bear great pressure, and data grayscale avoids this risk well.
[0004] In a service architecture with high concurrency, in order to meet the high availability scenario of application services, higher requirements are placed on the change of configuration information. Configuration information is very important to the entire service system. Incorrect configuration information may cause geometric multiple request failures in a high-concurrency business system. In the process of data grayscale, we often face the following problems:
[0005] 1. How to ensure that grayscale data is controllable, including but not limited to data access volume, traceability, stoppage, and rollback.
[0006] 2. How to ensure that grayscale solutions and grayscale programs will not invade the original program processing flow and create business risks.
[0007] 3. How to avoid transformative dependencies on upstream and downstream callers of grayscale services.
[0008] Therefore, technicians in this field continue to improve and optimize the data grayscale control solution. Summary of the invention
[0009] The embodiments of the present disclosure provide a data grayscale control method, device, business processing system and storage medium, which use the set data grayscale strategy to control whether the business request hits the grayscale data, and then instruct the business processing logic to access the isolated grayscale database or production database, thereby achieving effective isolation of grayscale data and production data, avoiding the impact of the release of grayscale data on business logic, and reducing the impact on upstream and downstream related applications.
[0010] The present disclosure provides a data grayscale control method, which is applied to a service processing node, wherein the service processing node includes an interface layer, a service logic layer, and a data layer. The method includes:
[0011] Obtaining a service request sent to the interface layer, and determining whether the service request hits grayscale data according to a data grayscale strategy;
[0012] In the case of hitting grayscale data, enabling the business logic layer to access the grayscale database through the data layer to process the business request;
[0013] In the case of no hit on grayscale data, enabling the business logic layer to access the production database through the data layer to process the business request;
[0014] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0015] The present disclosure also provides a data grayscale control device, which is applied to a service processing node. The service processing node includes an interface layer, a service logic layer, and a data layer. The device includes:
[0016] A data source determination module, configured to determine whether the service request received by the interface layer hits the grayscale data according to the data grayscale strategy;
[0017] A control module, configured to determine that in the case of hitting the grayscale data, the business logic layer accesses the grayscale database through the data layer to process the business request; in the case of determining that the grayscale data is not hit, the business logic layer accesses the production database through the data layer to process the business request;
[0018] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0019] The present disclosure also provides a service processing system, including:
[0020] An interface layer module, a business logic layer module, a data layer module, and a data grayscale control device as described in any embodiment of the present disclosure;
[0021] The data grayscale control device is configured to determine whether the service request received by the interface layer module hits the grayscale data according to the data grayscale strategy;
[0022] The business logic layer module is configured to access the grayscale database or the production database through the data layer module to process the business request according to the determination result of the data grayscale control device;
[0023] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0024] An embodiment of the present disclosure further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the data grayscale control method described in any embodiment of the disclosure when running.
[0025] Other aspects will be apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0027] Figure 1 is a flow chart of a data grayscale control method in an embodiment of the present disclosure;
[0028] Figure 2 is a flow chart of another data grayscale control method in an embodiment of the present disclosure;
[0029] Figure 3 is a flow chart of another data grayscale control method in an embodiment of the present disclosure;
[0030] Figure 4 It is a structural schematic diagram of a data grayscale control device in an embodiment of the present disclosure;
[0031] Figure 5 A schematic diagram of the structure of a business processing system in an embodiment of the present disclosure;
[0032] Figure 6 A schematic diagram of a configuration for implementing a data grayscale control solution on a server in an embodiment of the present disclosure;
[0033] Figure 7 A schematic diagram of a configuration for implementing a data grayscale control solution on a server in an embodiment of the present disclosure;
[0034] Figure 8 is a flow chart of another data grayscale control method in an embodiment of the present disclosure;
[0035] Fig. 9 is a flow chart of another data grayscale control method in an embodiment of the present disclosure;
[0036] Fig.10is a flow chart of another data grayscale control method in an embodiment of the present disclosure;
[0037] Fig.11 Flow chart of another data grayscale control method in an embodiment of the present disclosure.
[0038] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] It should be noted that in the present invention, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0041] The technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0042] Grayscale strategies are extremely important in this field. For example, the grayscale release of application services and the grayscale effectiveness of configuration information (data) are increasingly becoming normal operations in the operation of large-scale application systems. For the grayscale release of applications or the grayscale release of data, they can only be officially released to the production stage after being verified to be correct and reliable in a small range. Among the related technical solutions, some grayscale control solutions use a parallel production environment and a test environment for verification and grayscale control; this method has a high overall system cost and requires the configuration of parallel server resources.
[0043] Before describing the embodiments of the present disclosure, several concepts are introduced:
[0044] Grayscale release includes grayscale release of applications or business logic, and also grayscale release of data (including configuration information and / or business data, etc.).
[0045] Grayscale data, the data involved in the grayscale release of data is called grayscale data, that is, the data involved during the grayscale release, including: configuration information and / or business data, etc. After the data is verified to be correct, it is released to the formal production environment; if the data is verified to be incorrect, it will not be released to the formal production environment, and the grayscale release will be terminated. If necessary, the data in the production environment will be rolled back. The relevant tests based on the grayscale database are collectively referred to as grayscale tests.
[0046] The present disclosure provides a data grayscale control method, which is applied to a business processing node, wherein the business processing node includes an interface layer, a business logic layer and a data layer. Figure 1 ,include,
[0047] Step 110, obtaining the service request sent to the interface layer, and determining whether the service request hits the grayscale data according to the data grayscale strategy;
[0048] Step 120, when grayscale data is hit, the business logic layer accesses the grayscale database through the data layer to process the business request;
[0049] Step 130, when no grayscale data is found, the business logic layer accesses the production database through the data layer to process the business request;
[0050] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0051] It should be noted that the interface layer included in the business processing node is also called interface layer module or interface module, the business logic layer is also called business logic layer module or business logic module, and the data layer is also called data layer module or data module.
[0052] In some exemplary embodiments, the data grayscale control method is executed by a separate grayscale control module (device), which is deployed on a business processing node. The interface layer of the business processing node obtains all business requests received by the business processing node, and then instructs the business logic layer of the business processing node to access different data sources through the data layer to execute individual business requests according to the above steps 120-130.
[0053] In some exemplary embodiments, the data grayscale strategy can be formulated through the grayscale console, sent to the business processing node, and then loaded and applied by the grayscale control module (device) on the business processing node. That is, the data grayscale strategy involved in the overall business system can be configured and controlled through the grayscale console, and sent to the business processing node where each specific application or business processing logic is located.
[0054] It should be noted that, for business processing nodes, the original business logic does not change when this solution is adopted. It only changes the data source for business requests that hit grayscale data. When executing business logic, the grayscale database is accessed and the business logic is executed according to the grayscale data in the grayscale database. The generated or changed data is stored in the grayscale database. It can be seen that by controlling the data grayscale policy, the application scope of grayscale data can be controlled / adjusted, that is, which business requests use grayscale data for testing / verification can be controlled / adjusted by the data grayscale policy.
[0055] In some exemplary embodiments, Figure 2 As shown, the method also includes:
[0056] Step 140 , when grayscale data is hit, the business request involving data change is saved.
[0057] In some exemplary embodiments, the attributes of the service request include at least one of the following:
[0058] Application name, business request ID, user IP address, interface ID, caller IP address, and grayscale weight.
[0059] For example, if a business processing node processes business requests belonging to multiple applications, then the business requests belonging to application 1 can be configured to point to the grayscale database for business processing, which can be understood as selecting a specific application to test the grayscale data; for another example, if the same application includes multiple business requests, then a specific business request can be configured to point to the grayscale database for business processing, which can be understood as selecting a specific business request to test the grayscale data; for another example, if a business processing node processes business requests from different user IPs, then the business requests from user IPs in a specific range can be configured to point to the grayscale database for business processing, which can be understood as selecting a specific user IP to test the grayscale data; for another example, the processing request for the same business can be accessed through different interfaces, such as app interface, website interface or SMS access, so the business from a specific interface can be configured The request is directed to the grayscale database for business processing, which can be understood as selecting business requests from a specific interface method for grayscale data testing, such as appointment processing based on grayscale data for appointments from text messages, and appointment processing based on production data for appointments from APPs; for another example, the same business processing request can be called by different callers, such as a business request to purchase goods, which can be called by different third-party platforms. In this case, the business request from a specific caller IP can be configured to point to the grayscale database for business processing, which can be understood as selecting business requests from specific callers for grayscale data testing; for another example, different business requests have different grayscale weights, so business requests with a specific range of grayscale weights can be configured to point to the grayscale database for business processing, which can be understood as selecting business requests within a specific grayscale weight range for grayscale data testing.
[0060] The above examples separately illustrate the aspects of each attribute. Those skilled in the art will know that the data grayscale strategy can also be determined comprehensively based on multiple attributes without conflict; it can also include multiple sub-strategies, and satisfying one of them determines that the grayscale database is hit. For example, the business request from a specific interface and within a specific user IP range is configured to be directed to the grayscale database for business processing, which will not be given one by one here.
[0061] In some exemplary embodiments, before obtaining the service request, the method further includes:
[0062] Step 100, synchronizing data from the production database to the grayscale database.
[0063] It can be seen that although the grayscale database is independent of the production database, before the grayscale release, the data is synchronized with the production database in advance to keep consistent, so that the testing in the grayscale database is closer to the actual application situation, thereby improving the effectiveness of the grayscale test.
[0064] In some exemplary embodiments, the business request is a grayscale data publishing request; then the corresponding steps 110-130 correspond to:
[0065] Step 110, obtaining the grayscale data publishing request sent to the interface layer, and determining whether the grayscale data publishing request hits the grayscale data according to the data grayscale strategy;
[0066] Step 120, when grayscale data is hit, the business logic layer accesses the grayscale database through the data layer, and performs business processing according to the grayscale data publishing request to complete the publishing of grayscale data in the grayscale database.
[0067] It should be noted that, for the grayscale data publishing request, the data grayscale policy can be configured as follows: the grayscale data publishing request identifies the corresponding business request hitting the grayscale data. Then, step 110 corresponds to determining that the grayscale data publishing request hits the grayscale data, and then step 120 is executed. It can be seen that the publication of the grayscale data in the grayscale database is thus completed. Those skilled in the art can understand that for the overall grayscale data solution, when it is determined that the grayscale data is to be published, step 100 can be triggered by relevant instructions or requests, and then a grayscale data publishing request is initiated to the business processing node to publish the grayscale data. After the publication is completed, subsequent business requests will be directed to the production database or the grayscale database for grayscale testing according to the data grayscale policy.
[0068] It can be seen that even for the release of grayscale data in the grayscale database, the unified business request processing flow described in steps 110-130 is adopted, but the data grayscale strategy determines that the grayscale data release request hits the grayscale data, thereby ensuring that the grayscale data is only released in the grayscale database and becomes the data basis for subsequent business requests for grayscale data-related business tests; and it has no impact on the production database.
[0069] In some exemplary embodiments, a grayscale data publishing request is submitted to the service processing node by a related grayscale data configuration application or module.
[0070] In some exemplary embodiments, Figure 3 As shown, the method also includes:
[0071] Step 150, when the grayscale data validation conditions are met, obtain the saved historical business requests;
[0072] Step 160: construct a production database business request according to the historical business request so that the business logic layer accesses the production database through the data layer to process the historical business request in sequence.
[0073] Among them, satisfying the grayscale data validity condition indicates that: after confirmation, the grayscale data released this time is normal and can be released to the production system to formally take effect. Accordingly, the saved historical business requests are obtained, and these historical business requests are constructed into production library business requests. Further, according to step 110, it is determined that these production library business requests do not hit the grayscale data, and then step 130 is subsequently executed to enable the business logic layer to access the production database through the data layer to process these production library business requests in sequence.
[0074] It should be noted that these newly constructed production database business requests are business requests that do not hit grayscale data according to the data grayscale strategy. By setting an appropriate data grayscale strategy, the data layer can be connected to the production database to execute these business requests.
[0075] It can be seen that step 140 is executed to record all business requests for data changes directed to the grayscale database. These business requests include grayscale data release requests, as well as all subsequent business requests for data changes directed to the grayscale database. Based on these historical business requests, business-consistent but determined business requests that do not hit the grayscale data (i.e., hit the production database data, called production database business requests) are constructed and submitted or sent to the interface layer of the business processing node. Then, according to steps 110 and 130, these reconstructed business requests will be directed to the production database and the business processing logic will be executed, which can realize the formal release of grayscale data to the production system, and the normal business requests submitted to the grayscale database during the grayscale test will be resubmitted to the formal production database. That is, when it is determined that the current grayscale test is successful and the grayscale data is effective, the historical business requests are used to synchronize the relevant grayscale data to the production database.
[0076] It should be noted that whether the grayscale data effectiveness conditions are met can be automatically determined by the relevant modules according to the rules; or it can be confirmed to be met after system management verification and confirmation, which means the official release corresponding to this grayscale test.
[0077] In some exemplary embodiments, the method further comprises:
[0078] Step 170, when the grayscale data test end condition is met, the data grayscale strategy is changed so that all business requests hit the production database.
[0079] Among them, satisfying the grayscale data test end condition can be when the grayscale test is successful, determining that the grayscale data test end condition is satisfied; or, it can be when the grayscale test fails, determining that the grayscale data test end condition is satisfied.
[0080] It can be understood that, in the case of a successful grayscale test, after the formal release and synchronization of the relevant grayscale data to the production database are completed according to steps 150 and 160, and there is no further grayscale data that needs to be tested and verified in the relevant grayscale database, by changing the data grayscale strategy, subsequent business requests will no longer hit the grayscale database, and will all point to the formal production database to execute business logic, and the overall system will end the grayscale state. In the case of a grayscale test failure, the grayscale test needs to be terminated. Without readjusting the grayscale data, there is no need to perform more tests in the grayscale database. Therefore, the data grayscale strategy can also be changed so that subsequent business requests no longer hit the grayscale state, but resume using the production database.
[0081] In some exemplary embodiments, the method further comprises:
[0082] Step 180, when the grayscale data rollback condition is met, obtain the saved historical business requests involving data changes other than the grayscale data publishing request;
[0083] Step 190: construct a production database business request according to the historical business request so that the business logic layer accesses the production database through the data layer to process the historical business request in sequence.
[0084] It can be seen that when data rollback is required, the business requests involved in the grayscale test can be re-executed in the production database through steps 180 and 190 to achieve data rollback. It can be understood that these saved historical business requests involving data changes other than grayscale data release requests are normal business requests. Due to problems with the grayscale data, the test cannot pass. These historical business requests are directed to the production database for re-execution, which can avoid the ultimate impact of the problems with the grayscale data on these business requests. This process is called data rollback.
[0085] Specifically, whether grayscale data rollback is required and under what circumstances the grayscale data rollback conditions are met are determined according to relevant systems or business rules and are not limited here.
[0086] In some exemplary embodiments, the method further comprises:
[0087] Step 1110, when the grayscale data rollback condition is met, obtain the saved historical business requests involving data changes;
[0088] Step 1120: Roll back the data in the grayscale database according to the historical business request.
[0089] It can be understood that rolling back the data in the grayscale database according to the historical business request in step 1120 can be implemented using database-related technical solutions, so that the data in the grayscale database returns to before the grayscale database is hit for the first time in this grayscale test.
[0090] The embodiment of the present disclosure also provides a data grayscale control device, which is applied to a service processing node. The service processing node includes an interface layer, a service logic layer and a data layer. Figure 4 As shown, the device comprises:
[0091] The data source determination module 401 is configured to determine whether the service request received by the interface layer hits the grayscale data according to the data grayscale strategy;
[0092] The control module 402 is configured to determine that if the grayscale data is hit, the business logic layer accesses the grayscale database through the data layer to process the business request; if the grayscale data is not hit, the business logic layer accesses the production database through the data layer to process the business request;
[0093] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0094] In some exemplary embodiments, the device further comprises a business request saving module, configured to save a business request involving data change when hitting grayscale data.
[0095] In some exemplary embodiments, the apparatus further comprises a data synchronization module configured to synchronize data from the production database to the grayscale database.
[0096] In some exemplary embodiments, the grayscale data publishing module is configured to obtain saved historical business requests when the grayscale data effectiveness conditions are met; it is also configured to construct production library business requests based on the historical business requests so that the business logic layer accesses the production database through the data layer to process the historical business requests in sequence.
[0097] In some exemplary embodiments, the grayscale data rollback module is configured to obtain saved historical business requests involving data changes other than grayscale data publishing requests when the grayscale data rollback conditions are met; and is also configured to construct production library business requests based on the historical business requests so that the business logic layer accesses the production database through the data layer to process the historical business requests in sequence.
[0098] The present disclosure also provides a service processing system. Figure 5 As shown, including,
[0099] Interface layer module 501, business logic layer module 502, data layer module 503 and data grayscale control device 504 as described above;
[0100] The data grayscale control device 504 is configured to determine whether the service request received by the interface layer module 501 hits the grayscale data according to the data grayscale strategy;
[0101] The business logic layer module 502 is configured to access the grayscale database 510 or the production database 511 through the data layer module 503 to process the business request according to the determination result of the data grayscale control device 504;
[0102] The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
[0103] In some exemplary embodiments, the system further includes: a grayscale console 505, configured to formulate a data grayscale strategy; and further configured to issue the data grayscale strategy.
[0104] In some exemplary embodiments, the data grayscale control device 504 is further configured to obtain the data grayscale strategy from the grayscale console 505 .
[0105] In some exemplary embodiments, the data grayscale control device 504 is further configured to, when grayscale data is hit, report a business request involving data change to the grayscale console 505; the grayscale console 505 is further configured to save the business request involving data change.
[0106] In some exemplary embodiments, the service processing system is deployed on a node, referred to as a service processing node.
[0107] In some exemplary embodiments, the grayscale console 505 is further configured to obtain saved historical business requests when the grayscale data validation conditions are met; construct a production library business request based on the historical business request and send it to the interface layer module 501.
[0108] In some exemplary embodiments, the grayscale console 505 is further configured to change the data grayscale strategy and issue the changed data grayscale strategy when the grayscale data test end condition is met.
[0109] In some exemplary embodiments, the system further includes: a grayscale data publishing module 506, which is configured to submit a grayscale data publishing request to the interface layer module 501. That is, after the grayscale data is prepared and configured, the grayscale data publishing module 506 publishes the grayscale data. In some exemplary embodiments, the grayscale data publishing module 506 is a module in the deployment information configuration application, which is responsible for configuring the business data (including the grayscale data).
[0110] It can be seen that in the business processing system provided by the embodiment of the present disclosure, the business logic layer module 502 that executes the specific business logic does not modify the business logic during the grayscale release, and maintains the stability of the business logic. It can be configured at the interface layer (interface layer module) of the business processing node, adding the processing logic of the data grayscale control device 504 to determine whether each business request hits the grayscale data, so that the business logic layer points to different data sources when performing subsequent business logic execution through the data layer.
[0111] For example, taking the business processing node implemented by the Spring framework as an example, add a line of configuration at the business entrance. Among them, the data grayscale control device 504 uses AOP (Aspect Oriented Programming) to complete the acquisition of business requests and service node information, and provides annotations to facilitate user access. By adding @ABTest annotations to the target interface, the target interface can be handed over to the data grayscale control device 504 (verifyMrchntWithBlack). Figure 6 As shown in the interface. When the interface is accessed, the data grayscale control device 504 maintains the result (identification) of whether the grayscale data is hit in the memory context. When controlling the use of the grayscale data source and the production data source, the data grayscale control device 504 also uses the aspect technology. When the business logic layer module 502 performs database operations through the data layer module 503, it will automatically switch the data source according to the result (identification) of hitting the grayscale data in the memory context. Therefore, when applying the solution provided by the present disclosure, it is necessary to increase the configuration of the grayscale data source, such as Figure 7 The grayscale data source shown in abTestDataSource can be used, and the aspect ABTestInterceptor provided by the data grayscale control device 504 can be introduced.
[0112] For application systems implemented using other frameworks, those skilled in the art can also know the corresponding configuration methods based on the above examples, which are not given one by one here. The data grayscale control solution provided by the embodiment of the present disclosure is not limited to being applied only to business systems implemented by the Spring framework.
[0113] It can be seen that the data grayscale control solution provided by the embodiment of the present disclosure can fully isolate grayscale data from production data, and can flexibly adjust the business traffic directed to the grayscale database that participates in grayscale data testing and verification; by saving historical records, the traceability and rollback of the entire grayscale test can be achieved; by adjusting the data grayscale strategy, the start and end of the grayscale release can be controlled in time. Grayscale release is performed by separating data sources without intruding on or changing the existing business logic processing flow, and without generating business process risks. The introduction of a data grayscale strategy avoids the modification dependency of grayscale release on upstream and downstream callers.
[0114] The present disclosure also provides a data grayscale control system. Figure 8-11 As shown, it includes: a grayscale console, a data grayscale control device (also called a grayscale control module), and a grayscale database.
[0115] Among them, the grayscale console is set to configure data grayscale strategy for business processing nodes according to dimensions such as application name, business request identifier, user IP address, interface identifier, caller IP address, grayscale weight, etc.; it is also set to send a production library data synchronization request to the business processing node when the grayscale test is successful and the grayscale data effectiveness conditions are met; it is also set to change the data grayscale strategy when it is determined that the grayscale is over, so that all business requests hit the production database.
[0116] The grayscale control module is configured to report node information to the grayscale console and business requests to the grayscale console; it is also configured to synchronize the data grayscale strategy of the grayscale console; it is also configured to obtain business requests to determine whether grayscale data is hit; it is also configured to take over the data persistence layer so that the business processing logic layer uses the production data source or the grayscale data source when executing business logic for data operations.
[0117] The grayscale database is set to be independent of the production database. It is also set to synchronize the production data 1:1 before grayscale testing to maintain consistency. It is also set that during grayscale testing, grayscale data is only written to the grayscale database and isolated from the production database.
[0118] The present disclosure also provides a data grayscale control method. Figure 8 As shown, including:
[0119] 1. The operator configures the data grayscale strategy through the grayscale console;
[0120] 2. Data grayscale strategy persistence;
[0121] 3. The data grayscale strategy is sent to the business processing node;
[0122] 4. The data change request is sent to the business processing node;
[0123] 5. The grayscale control module detects the data change request and determines the hit grayscale data according to the data grayscale strategy;
[0124] 6. The grayscale control module reports the data change request to the grayscale console for saving;
[0125] 7. The business processing node processes the business logic normally, that is, after being processed by the interface layer and the business logic layer, the business data is written into the grayscale database in the data persistence layer according to the instructions of the grayscale control module.
[0126] The data change request includes a grayscale data publishing request and / or other business requests. In the case where the data change request is a grayscale data publishing request, the grayscale data can be published in the grayscale database according to the above process.
[0127] In some exemplary embodiments, in step 5, if the grayscale control module monitors a data change request and determines that the grayscale data is not hit according to the data grayscale strategy, step 7 is executed, and the business processing node processes the business logic normally, that is, after being processed by the interface layer and the business logic layer, the business data is written into the production database at the data persistence layer according to the instructions of the grayscale control module.
[0128] It can be seen that according to the above scheme, the release of grayscale data and the processing flow of other business requests related to data changes are realized. On the business processing node, a grayscale control module is added to perform relevant judgment and data source indication steps.
[0129] The present disclosure also provides a data grayscale control method. Fig. 9 As shown, including:
[0130] 1. The data query request is sent to the business processing node;
[0131] 2. The grayscale control module detects the data query request and determines the hit grayscale data according to the data grayscale strategy;
[0132] 3-5, the business processing node processes the data query request normally;
[0133] 6. In the data persistence layer, according to the instructions of the grayscale control module, access the grayscale database;
[0134] 7. Return the query results from the grayscale database.
[0135] In some exemplary embodiments, in step 2, the grayscale control module monitors the data query request and determines the missed grayscale data according to the data grayscale strategy; after executing steps 3-5, in step 6, the production database is accessed according to the instructions; in step 7, the query results are returned from the production database.
[0136] The present disclosure also provides a data grayscale control method. Fig.10 As shown, including:
[0137] 1. After the grayscale data is released, if it is confirmed that the release is correct, the operator initiates the grayscale synchronization production operation in the grayscale console, which meets the grayscale data effectiveness conditions;
[0138] 2. Obtain the historical business requests saved in the Grayscale console;
[0139] 3. Based on these historical business requests, the production database business requests are constructed in sequence and sent to the business processing node;
[0140] 4-6, the grayscale control module monitors the business requests of the production library and determines the missed grayscale data according to the data grayscale strategy; the business processing node processes these business requests of the production library normally;
[0141] 7. In the data persistence layer, access the production database according to the instructions of the grayscale control module;
[0142] 8. The relevant data is written into the production database to complete the synchronization of the grayscale data to the production database.
[0143] It can be seen that by using the historical business requests involving data changes whose data source is the grayscale database saved in the grayscale console, when it is determined that the grayscale release is successful and the grayscale data can take effect, these business requests can be reproduced completely and orderly and resubmitted to the production database to achieve synchronization of the grayscale data to the production database.
[0144] The present disclosure also provides a data grayscale control method. Fig.11 As shown, including:
[0145] 1. After the grayscale data is released, it is confirmed that there are problems with this release and it cannot take effect. The operator initiates the operation of ending the grayscale data test in the grayscale console, which means that the grayscale data test end conditions are met;
[0146] 2. The grayscale console records the end of this grayscale;
[0147] 3. The grayscale console changes the data grayscale strategy so that all business requests hit the production database and are sent to the grayscale control module;
[0148] 4-6, the grayscale control module monitors each business request and determines the missed grayscale data according to the data grayscale strategy; the business processing node processes each business request normally;
[0149] 7. At the data persistence layer, according to the instructions of the grayscale control module, each business request accesses the production database;
[0150] 8. Access the production database to complete business processing.
[0151] It can be seen that when it is determined that this grayscale release has failed, by changing the data grayscale strategy, the data source direction of the business request can be changed in time, and the production data source can be restored for business processing. Flexible data source switching can be achieved, and the impact scope of this grayscale release and test can be controlled in time.
[0152] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0153] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A data grayscale control method, characterized in that: Applied to a business processing node, the business processing node includes an interface layer, a business logic layer and a data layer, and the method includes: Obtaining a service request sent to the interface layer, and determining whether the service request hits grayscale data according to a data grayscale strategy; In the case of hitting grayscale data, enabling the business logic layer to access the grayscale database through the data layer to process the business request; In the case of no hit on grayscale data, enabling the business logic layer to access the production database through the data layer to process the business request; The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
2. The method according to claim 1, characterized in that The method further comprises: In the case of hitting grayscale data, business requests involving data changes are saved.
3. The method according to claim 1 or 2, characterized in that The attributes of the service request include at least one of the following: Application name, business request ID, user IP address, interface ID, caller IP address, and grayscale weight.
4. The method according to claim 1 or 2, characterized in that: Before acquiring the service request sent to the interface layer, the method further includes: Synchronize data from the production database to the grayscale database.
5. The method according to claim 4, characterized in that The business request is a grayscale data publishing request; The acquiring the service request sent to the interface layer and determining whether the service request hits the grayscale data according to the data grayscale strategy includes: According to the data grayscale strategy, determining that the grayscale data publishing request hits grayscale data; In the case of hitting the grayscale data, enabling the business logic layer to access the grayscale database through the data layer to process the business request, including: The business logic layer accesses the grayscale database through the data layer, and performs business processing according to the grayscale data publishing request to complete the publishing of grayscale data in the grayscale database.
6. The method according to claim 2, characterized in that The method further comprises: When the grayscale data validation conditions are met, obtain the saved historical business requests; According to the historical business requests, a production database business request is constructed so that the business logic layer accesses the production database through the data layer to process the historical business requests in sequence.
7. The method according to claim 1, characterized in that The method further comprises: When the grayscale data test end condition is met, the data grayscale strategy is changed so that all business requests hit the production database.
8. A data grayscale control device, characterized in that: Applied to a service processing node, the service processing node includes an interface layer, a service logic layer and a data layer, and the device includes: A data source determination module, configured to determine whether the service request received by the interface layer hits the grayscale data according to the data grayscale strategy; A control module, configured to determine that in the case of hitting the grayscale data, the business logic layer accesses the grayscale database through the data layer to process the business request; in the case of determining that the grayscale data is not hit, the business logic layer accesses the production database through the data layer to process the business request; The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
9. A business processing system, characterized in that: include: An interface layer module, a business logic layer module, a data layer module and a data grayscale control device as claimed in claim 8; The data grayscale control device is configured to determine whether the service request received by the interface layer module hits the grayscale data according to the data grayscale strategy; The business logic layer module is configured to access the grayscale database or the production database through the data layer module to process the business request according to the determination result of the data grayscale control device; The data grayscale strategy is a rule for determining whether to use grayscale data processing or production data processing for a business request according to the attributes of the business request.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.