Grayscale publishing method, device, electronic device and computer-readable storage medium
By receiving grayscale publishing requests and outputting files according to diversion rules, the problem that distributed systems based on data file interaction cannot perform grayscale publishing is solved, and the function of grayscale publishing is realized.
Patent Information
- Application Number
- CN202111572137.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing grayscale distribution method based on software and hardware load balancers is not suitable for distributed systems that interact through data files.
By receiving the grayscale release request, determining the diversion rules, and outputting the official version file of the first service and the grayscale version file to the input directory of the second service based on the service number and policy group configuration information, the grayscale release is realized.
Grayscale release under distributed systems is realized based on data files, solving the problem that the existing technology cannot be applied to distributed systems that interact through data files.
Smart Images

Figure CN114610371B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology. Specifically, the present application relates to a grayscale publishing method, device, electronic device and computer-readable storage medium. Background Art
[0002] Before a distributed system goes online, a grayscale release method is usually used to reduce the risk of software going online, so that the online process is smooth and the system runs stably. In the actual operation process, the choice of grayscale release method has a certain correlation with the communication method between various services in the system. For example, services that communicate through protocols such as HTTP (HyperText Transfer Protocol) or TCP (Transmission Control Protocol) can use grayscale release methods based on software and hardware load balancers to implement grayscale release functions. Software and hardware load balancers such as Nginx or F5.
[0003] However, some services in distributed systems do not interact through message communication, but through data files. In this case, the existing grayscale release method based on software and hardware load balancers is no longer applicable. Summary of the invention
[0004] The purpose of the embodiments of the present application is to solve the problem that in a distributed system, the grayscale publishing method based on software and hardware load balancers is not suitable for a distributed system that interacts through data files.
[0005] According to one aspect of an embodiment of the present application, a grayscale publishing method is provided, the method comprising:
[0006] Receive a grayscale release request and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information;
[0007] According to the service number, determine the first service and the second service corresponding to the grayscale release request; wherein the second service is a downstream service of the first service;
[0008] According to the policy group configuration information, the official version file and the gray version file of the first service are output to the input directory of the second service; wherein the input directory of the second service is the output directory of the first service.
[0009] Optionally, determine the diversion rules corresponding to the grayscale release request, including:
[0010] Determine the first service corresponding to the grayscale release request, obtain the corresponding policy group configuration information according to the service number of the first service, and determine the diversion rule.
[0011] Optionally, before outputting the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information, the method includes:
[0012] The data file of the first service is split according to the policy group configuration information to obtain a formal version file and a gray version file.
[0013] Optionally, according to the policy group configuration information, outputting the official version file and the gray version file of the first service to the input directory of the second service includes:
[0014] Determine the official version directory and the gray version directory of the second service according to the policy group configuration information;
[0015] The official version file of the first service is output to the official version directory of the second service, and the gray version file of the first service is output to the gray version directory of the second service.
[0016] Optionally, the method further comprises:
[0017] When the policy group configuration information is not obtained, the data file of the first service is output to the input directory of the second service.
[0018] Optionally, after outputting the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information, the method includes:
[0019] Update the identification information of the official version directory and the gray version directory, and delete the diversion rules.
[0020] According to another aspect of an embodiment of the present application, a grayscale publishing device is provided, the device comprising:
[0021] A receiving module, used to receive a grayscale release request and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information;
[0022] A determination module, used to determine the first service and the second service corresponding to the grayscale release request according to the service number; wherein the second service is a downstream service of the first service;
[0023] The first output module is used to output the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information; wherein the input directory of the second service is the output directory of the first service.
[0024] Optionally, the receiving module includes:
[0025] The acquisition module is used to determine the first service corresponding to the grayscale release request, obtain the corresponding policy group configuration information according to the service number of the first service, and determine the diversion rules.
[0026] Optionally, the device further comprises:
[0027] The splitting module is used to split the data file of the first service according to the policy group configuration information to obtain the official version file and the gray version file.
[0028] Optionally, the first output module includes:
[0029] A determination submodule, used to determine a formal version directory and a gray version directory of the second service according to the policy group configuration information;
[0030] The first output submodule is used to output the official version file of the first service to the official version directory of the second service, and output the gray version file of the first service to the gray version directory of the second service.
[0031] Optionally, the device further comprises:
[0032] The second output module is used to output the data file of the first service to the input directory of the second service when the policy group configuration information is not obtained.
[0033] Optionally, the device further comprises:
[0034] The update module is used to update the identification information of the official version directory and the gray version directory and delete the diversion rules.
[0035] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the grayscale release method of any one of the above aspects.
[0036] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the grayscale release method of any one of the above aspects are implemented.
[0037] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0038] By configuring the diversion rules, the data files for grayscale release are output to the corresponding directory according to the diversion rules, thus realizing grayscale release in a distributed system based on data files. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0040] Figure 1 One of the flowcharts of a grayscale publishing method provided in an embodiment of the present application;
[0041] Figure 2 A second flowchart of a grayscale publishing method provided in an embodiment of the present application;
[0042] Figure 3 A third flowchart of a grayscale publishing method provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of a grayscale publishing device provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of the structure of an electronic device for grayscale publishing provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0046] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".
[0047] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0048] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0049] The present application provides a grayscale publishing method, such as Figure 1 As shown, including:
[0050] Step S101, receiving a grayscale release request, and determining a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information.
[0051] A distributed system is a software system built on a network, which has a high degree of cohesion and transparency and is often used in the fields of communications, finance, etc. In the embodiments of the present application, a communication billing system used in the field of communications is taken as an example. Currently, there are two main ways to bill users for communications: online billing and offline billing, both of which require calling services in the communication billing system to process relevant data.
[0052] Among them, the service called in the online billing method interacts based on message communication methods such as HTTP protocol or TCP protocol. Therefore, under the online billing method, the service implements the grayscale release function based on software and hardware load balancers such as Nginx or F5.
[0053] The services called in the offline billing method interact through data files. The communication billing system determines the corresponding user bill based on the user's call record file. In this case, the grayscale release function cannot be implemented based on the software and hardware load balancer.
[0054] The grayscale publishing method provided in the embodiment of the present application configures the diversion rules required for grayscale publishing, constructs a complete grayscale publishing process, and can implement the grayscale publishing function based on data files.
[0055] Specifically, the distributed system receives a grayscale release request, where the grayscale release request can be a request initiated by a human or a request initiated by a device related to the distributed system, and there is no restriction on this.
[0056] After receiving the grayscale release request, the distributed system determines the diversion rule corresponding to the grayscale release request, that is, whether there is a preset diversion rule for grayscale release. If there is a preset diversion rule, it means that the grayscale release process can be executed normally. The diversion rule includes the service number and policy group configuration information.
[0057] The diversion rules can be preconfigured in the distributed cache of the distributed system, or other preset shared locations, so that the services in the distributed system can obtain the diversion rules at the preset shared locations. The service number includes the numbers of all services related to the grayscale release configured in the diversion rules. The service number of each service is unique, that is, the corresponding diversion rules can be obtained based on the service number.
[0058] The policy group configuration information includes at least one diversion policy rule, wherein the diversion policy rule is used to determine the object of grayscale release. For example, for the communication billing system, it is necessary to first determine which users will be grayscale released to new functions and which users will temporarily maintain the current version of the function. One diversion policy rule is to grayscale release new functions to users in Hangzhou, and another diversion policy rule is to grayscale release new functions to users whose mobile phone numbers end in 1. Accordingly, the diversion rule including these two diversion policy rules is to grayscale release new functions to users in Hangzhou and whose mobile phone numbers end in 1.
[0059] Step S102: Determine the first service and the second service corresponding to the grayscale release request according to the service number; wherein the second service is a downstream service of the first service.
[0060] When it is determined that there is a diversion rule corresponding to the grayscale release request, the first service and the second service corresponding to the grayscale release request are determined according to the service number of the current service.
[0061] When determining the corresponding user bill based on the user's call record file, the distributed system needs to call multiple services to analyze and process the call record file. There is an upstream and downstream relationship between these services, and they are called in sequence. For example, the second service is a downstream service of the first service, and some functions of the first service need to call the downstream second service to implement. When the distributed system performs data processing, it first calls the first service and then calls the second service.
[0062] If the current service called by the distributed system is the first service, the preset diversion rules are obtained according to the service number of the first service. The diversion rules are configured with the service numbers of all services related to the grayscale release, including the service number of the first service and the service number of the second service. In other words, the first service is the current service called by the distributed system, and the second service is the downstream service of the first service. In the grayscale release process, the first service transmits the grayscale release data file to the second service. The first service and the second service corresponding to the grayscale release request are determined based on the diversion rules. After the first service obtains the preset diversion rules, the data files that need to be released in grayscale are output to the second service according to the diversion rules.
[0063] It should be noted that the first service and the second service here only refer to two grayscale release-related services with an upstream and downstream relationship. In actual applications, a first service may also have multiple corresponding second services, and a second service may also have multiple corresponding downstream services. When the services in the distributed system are released in grayscale, they execute the same grayscale release process. For example, if the currently called service is the second service, the grayscale release data file is output to the downstream service of the second service according to the diversion rule corresponding to the second service.
[0064] Step S103: Output the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information; wherein the input directory of the second service is the output directory of the first service.
[0065] According to the policy group configuration information in the diversion rule, the data file of the first service is output to the input directory of the second service. The second service is a downstream service of the first service, so the input directory of the second service is the output directory of the first service.
[0066] Specifically, according to the policy group configuration information, the objects to be grayscale released can be determined. The second service has a data file directory corresponding to the objects to be grayscale released. Among them, the data file directory corresponding to the objects that need to grayscale release new functions is the grayscale version directory, and the data file directory corresponding to the objects that temporarily maintain the current version functions is the formal version directory.
[0067] In the grayscale release process, the official version file of the first service is output to the official version directory of the second service, and the grayscale version file of the second service is output to the grayscale version directory of the second service, completing the grayscale release data file from the first service to the second service without affecting the normal operation of the current version.
[0068] Apply the grayscale release method provided in the embodiment of the present application, receive a grayscale release request, and determine the diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information; according to the service number, determine the first service and the second service corresponding to the grayscale release request; wherein the second service is a downstream service of the first service; according to the policy group configuration information, output the official version file and the grayscale version file of the first service to the input directory of the second service; wherein the input directory of the second service is the output directory of the first service.
[0069] The embodiment of the present application configures diversion rules and outputs the data files for grayscale release to corresponding directories according to the diversion rules, thereby realizing grayscale release in a distributed system based on data files.
[0070] The present application provides a grayscale publishing method, such as Figure 2 ,3 As shown, including:
[0071] Step S201, receiving a grayscale release request, and determining a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information.
[0072] A distributed system is a software system built on a network, which has a high degree of cohesion and transparency and is often used in the fields of communications, finance, etc. In the embodiments of the present application, a communication billing system used in the field of communications is taken as an example. Currently, there are two main ways to bill users for communications: online billing and offline billing, both of which require calling services in the communication billing system to process relevant data.
[0073] Among them, the service called in the online billing method interacts based on message communication methods such as HTTP protocol or TCP protocol. Therefore, under the online billing method, the service implements the grayscale release function based on software and hardware load balancers such as Nginx or F5.
[0074] The services called in the offline billing method interact through data files. The communication billing system determines the corresponding user bill based on the user's call record file. In this case, the grayscale release function cannot be implemented based on the software and hardware load balancer.
[0075] The grayscale publishing method provided in the embodiment of the present application configures the diversion rules required for grayscale publishing, constructs a complete grayscale publishing process, and can implement the grayscale publishing function based on data files.
[0076] Specifically, the distributed system receives a grayscale release request, where the grayscale release request can be a request initiated by a human or a request initiated by a device related to the distributed system, and there is no restriction on this.
[0077] After receiving the grayscale release request, the distributed system determines the diversion rule corresponding to the grayscale release request, that is, whether there is a preset diversion rule for grayscale release. If there is a preset diversion rule, it means that the grayscale release process can be executed normally. The diversion rule includes the service number and policy group configuration information.
[0078] The diversion rules can be pre-configured in the distributed cache of the distributed system, or other preset shared locations, so that the services in the distributed system can obtain the diversion rules at the preset shared locations. The diversion rules are configured and implemented through the grayscale diversion rule configuration module built into the distributed system. The service number includes the numbers of all services related to the grayscale release configured in the diversion rules. The service number of each service is unique, that is, the corresponding diversion rules can be obtained based on the service number.
[0079] The policy group configuration information includes at least one diversion policy rule, wherein the diversion policy rule is used to determine the object of grayscale release. For example, for the communication billing system, it is necessary to first determine which users will be grayscale released to new functions and which users will temporarily maintain the current version of the function. One diversion policy rule is to grayscale release new functions to users in Hangzhou, and another diversion policy rule is to grayscale release new functions to users whose mobile phone numbers end in 1. Accordingly, the diversion rule including these two diversion policy rules is to grayscale release new functions to users in Hangzhou and whose mobile phone numbers end in 1.
[0080] In a preferred embodiment of the present application, determining the diversion rule corresponding to the grayscale release request includes:
[0081] Determine the first service corresponding to the grayscale release request, obtain the corresponding policy group configuration information according to the service number of the first service, and determine the diversion rule.
[0082] During operation, the distributed system needs to call multiple services for data processing. There are upstream and downstream relationships between these services, and they are called in sequence. Determine the first service corresponding to the grayscale release request. When the data processing process is executed to call the first service, obtain the corresponding policy group configuration information according to the service number of the first service, where the policy group configuration information is pre-configured in the distributed cache of the distributed system, or other preset shared locations, so that the services in the distributed system can obtain the corresponding policy group configuration information at the preset shared location.
[0083] If the first service can obtain the corresponding policy group configuration information, it means that the grayscale release process can be executed normally, and the first service is a related service for grayscale release. According to the service number of the first service and the obtained policy group configuration information, the diversion rule including the service number of the first service and the policy group configuration information can be determined, that is, the diversion rule to which the first service belongs.
[0084] Step S202: Determine the first service and the second service corresponding to the grayscale release request according to the service number; wherein the second service is a downstream service of the first service.
[0085] When it is determined that there is a diversion rule corresponding to the grayscale release request, the first service and the second service corresponding to the grayscale release request are determined according to the service number of the current service.
[0086] The second service is a downstream service of the first service. Some functions of the first service need to call the downstream second service to implement. When the distributed system processes data, it first calls the first service and then calls the second service.
[0087] If the current service called by the distributed system is the first service, the preset diversion rule is obtained according to the service number of the first service. The diversion rule is configured with the service numbers of all services related to the grayscale release, including the service number of the first service and the service number of the second service. The first service and the second service corresponding to the grayscale release request are determined based on the diversion rule. After the first service obtains the preset diversion rule, the data file that needs to be released in grayscale is output to the second service according to the diversion rule.
[0088] It should be noted that the first service and the second service here only refer to two grayscale release-related services with an upstream and downstream relationship. In actual applications, a first service may also have multiple corresponding second services, and a second service may also have multiple corresponding downstream services. When the services in the distributed system are released in grayscale, they execute the same grayscale release process. For example, if the currently called service is the second service, the grayscale release data file is output to the downstream service of the second service according to the diversion rule corresponding to the second service.
[0089] Step S203: split the data file of the first service according to the policy group configuration information to obtain a formal version file and a gray version file.
[0090] According to the policy group configuration information corresponding to the first service, the data file to be output by the first service is split to obtain a formal version file and a gray version file. The formal version file is the current version of the data file currently running, and the gray version file is the data file that needs to be grayed out.
[0091] In the embodiment of the present application, the grayscale publishing process and the normal data processing process of the distributed system are run simultaneously, that is, the grayscale publishing step does not affect the transmission of the current version of the data file. The official version file and the grayscale version file obtained by splitting the data file of the first service are transmitted to different data file directories respectively.
[0092] Step S204: output the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information; wherein the input directory of the second service is the output directory of the first service.
[0093] According to the policy group configuration information in the diversion rule, the data file of the first service is output to the input directory of the second service. The second service is a downstream service of the first service, so the input directory of the second service is the output directory of the first service.
[0094] Specifically, according to the policy group configuration information, the objects to be grayscale released can be determined. The second service has a data file directory corresponding to the objects to be grayscale released. Among them, the data file directory corresponding to the objects that need to grayscale release new functions is the grayscale version directory, and the data file directory corresponding to the objects that temporarily maintain the current version functions is the formal version directory.
[0095] In the grayscale release process, the official version file of the first service is output to the official version directory of the second service, and the grayscale version file of the second service is output to the grayscale version directory of the second service, completing the grayscale release data file from the first service to the second service without affecting the normal operation of the current version.
[0096] In a preferred embodiment of the present application, according to the policy group configuration information, the official version file and the gray version file of the first service are output to the input directory of the second service, including:
[0097] According to the policy group configuration information, the official version directory and the gray version directory of the second service are determined.
[0098] According to the policy group configuration information corresponding to the second service, determine the objects that need to release new functions in grayscale, use the data file directory corresponding to the objects that need to release new functions in grayscale as the grayscale version directory, temporarily maintain the data file directory corresponding to the objects of the current version function as the formal version directory, and determine the formal version directory and grayscale version directory of the second service. Specifically, a grayscale diversion engine module can be built into the grayscale released service to determine the formal version directory and grayscale version directory of the downstream service; a grayscale service configuration module is used to configure the grayscale version configuration of the service and copy the formal version configuration to the grayscale version.
[0099] The official version file of the first service is output to the official version directory of the second service, and the gray version file of the first service is output to the gray version directory of the second service.
[0100] Therefore, the grayscale release process does not affect the normal process of data file processing of the current version of the distributed system. The data file of the first service is output to the input directory of the second service, so that the second service can perform data processing based on the corresponding data file. Furthermore, the second service can output the data file to the downstream service of the second service based on the diversion rules until the grayscale release process is completed.
[0101] Step S205, update the identification information of the official version directory and the gray version directory, and delete the diversion rules.
[0102] In the grayscale release process, the scope of objects that need grayscale release of new functions gradually increases until there are no objects that maintain the current version of the function, and the grayscale release process is about to be completed. At this time, the second service can determine all the data files output by the first service according to the preset diversion rules and perform version switching operations.
[0103] Specifically, the official version directory and the gray version directory are updated, for example, the identification information of the official version directory and the identification information of the gray version directory are replaced, the relevant data files of the original official version directory are deleted, and the corresponding diversion rules are deleted simultaneously.
[0104] A grayscale release planning module is built into the distributed system to control the automatic execution of the grayscale release process and realize grayscale release automation.
[0105] In a preferred embodiment of the present application, the method further includes:
[0106] When the policy group configuration information is not obtained, the data file of the first service is output to the input directory of the second service.
[0107] When the distributed system is processing data, it executes the step of calling the first service and obtains the corresponding policy group configuration information according to the service number of the first service. If the corresponding policy group configuration information is obtained, it means that the grayscale release process corresponding to the first service is executed normally; if the corresponding policy group configuration information is not obtained, it means that the first service is not a related service of the grayscale release process.
[0108] In the case where the policy group configuration information is not obtained, the data file of the first service is directly output to the input directory of the second service, and the normal data processing flow of the current version is executed.
[0109] Further, the step of calling the second service is executed, and the corresponding policy group configuration information is obtained according to the service number of the second service. If the corresponding policy group configuration information is obtained, it means that the grayscale release process corresponding to the second service is executed normally; if the corresponding policy group configuration information is not obtained, it means that the second service is not a related service of the grayscale release process, and no further details are given.
[0110] Apply the grayscale release method provided in the embodiment of the present application, receive a grayscale release request, and determine the diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information; according to the service number, determine the first service and the second service corresponding to the grayscale release request; wherein the second service is a downstream service of the first service; according to the policy group configuration information, output the official version file and the grayscale version file of the first service to the input directory of the second service; wherein the input directory of the second service is the output directory of the first service.
[0111] The embodiment of the present application configures diversion rules and outputs the data files for grayscale release to corresponding directories according to the diversion rules, thereby realizing grayscale release in a distributed system based on data files.
[0112] The present application embodiment provides a grayscale publishing device, such as Figure 4 As shown, the grayscale publishing device 40 may include:
[0113] The receiving module 401 is used to receive a grayscale release request and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information;
[0114] A determination module 402 is used to determine the first service and the second service corresponding to the grayscale release request according to the service number; wherein the second service is a downstream service of the first service;
[0115] The first output module 403 is used to output the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information; wherein the input directory of the second service is the output directory of the first service.
[0116] In a preferred embodiment of the present application, the receiving module 401 includes:
[0117] The acquisition module is used to determine the first service corresponding to the grayscale release request, obtain the corresponding policy group configuration information according to the service number of the first service, and determine the diversion rules.
[0118] In a preferred embodiment of the present application, the device further includes:
[0119] The splitting module is used to split the data file of the first service according to the policy group configuration information to obtain the official version file and the gray version file.
[0120] In a preferred embodiment of the present application, the first output module 403 includes:
[0121] A determination submodule, used to determine a formal version directory and a gray version directory of the second service according to the policy group configuration information;
[0122] The first output submodule is used to output the official version file of the first service to the official version directory of the second service, and output the gray version file of the first service to the gray version directory of the second service.
[0123] In a preferred embodiment of the present application, the device further includes:
[0124] The second output module is used to output the data file of the first service to the input directory of the second service when the policy group configuration information is not obtained.
[0125] In a preferred embodiment of the present application, the device further includes:
[0126] The update module is used to update the identification information of the official version directory and the gray version directory and delete the diversion rules.
[0127] The grayscale release device provided in the embodiment of the present application is used to receive a grayscale release request and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information; according to the service number, the first service and the second service corresponding to the grayscale release request are determined; wherein the second service is a downstream service of the first service; according to the policy group configuration information, the official version file and the grayscale version file of the first service are output to the input directory of the second service; wherein the input directory of the second service is the output directory of the first service.
[0128] The embodiment of the present application configures diversion rules and outputs the data files for grayscale release to corresponding directories according to the diversion rules, thereby realizing grayscale release in a distributed system based on data files.
[0129] An electronic device (computer device / equipment / system) is provided in an embodiment of the present application, including a memory, a processor and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the grayscale release method. Compared with the related art, it can achieve: by configuring diversion rules, the grayscale released data files are output to the corresponding directory according to the diversion rules, thereby realizing grayscale release in a distributed system based on data files.
[0130] In an optional embodiment, an electronic device is provided, such as Figure 5 As shown, Figure 5 The electronic device 5000 shown includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are connected, such as through a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 5004 is not limited to one, and the structure of the electronic device 5000 does not constitute a limitation on the embodiments of the present application.
[0131] Processor 5001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 5001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0132] The bus 5002 may include a path to transmit information between the above components. The bus 5002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 5002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0133] The memory 5003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0134] The memory 5003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 5001. The processor 5001 is used to execute the computer program stored in the memory 5003 to implement the steps shown in the above method embodiment.
[0135] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0136] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0137] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0138] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0139] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A grayscale release method, characterized in that: include: Receive a grayscale release request, and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information; the policy group configuration information includes at least one diversion policy rule, and the at least one diversion policy rule is used to determine an object for grayscale release; Determine, according to the service number, a first service and a second service corresponding to the grayscale publishing request; wherein the second service is a downstream service of the first service; According to the policy group configuration information, output the official version file and the gray version file of the first service to the input directory of the second service; wherein the input directory of the second service is the output directory of the first service; The step of outputting the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information includes: Determine, according to the policy group configuration information, a formal version catalog and a gray version catalog of the second service; Output the official version file of the first service to the official version directory of the second service, and output the grayscale version file of the first service to the grayscale version directory of the second service; the second service has a data file directory corresponding to the objects of grayscale release, the data file directory corresponding to the objects that need to release new functions in grayscale is the grayscale version directory, and the data file directory corresponding to the objects that temporarily maintain the current version functions is the official version directory.
2. The grayscale release method according to claim 1, characterized in that: The determining of the diversion rule corresponding to the grayscale publishing request includes: Determine the first service corresponding to the grayscale release request, obtain the corresponding policy group configuration information according to the service number of the first service, and determine the diversion rule.
3. The grayscale release method according to claim 1, characterized in that: Before outputting the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information, the method includes: The data file of the first service is split according to the policy group configuration information to obtain a formal version file and a gray version file.
4. The grayscale release method according to claim 2, characterized in that: The method further comprises: When the policy group configuration information is not obtained, the data file of the first service is output to the input directory of the second service.
5. The grayscale release method according to claim 1, characterized in that: After outputting the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information, the method includes: The identification information of the official version directory and the gray version directory is updated, and the diversion rule is deleted.
6. A grayscale publishing device, characterized in that: include: A receiving module, configured to receive a grayscale release request and determine a diversion rule corresponding to the grayscale release request; wherein the diversion rule includes a service number and policy group configuration information; the policy group configuration information includes at least one diversion policy rule, and the at least one diversion policy rule is used to determine an object for grayscale release; A determination module, configured to determine, according to the service number, a first service and a second service corresponding to the grayscale release request; wherein the second service is a downstream service of the first service; A first output module, configured to output the official version file and the gray version file of the first service to the input directory of the second service according to the policy group configuration information; wherein the input directory of the second service is the output directory of the first service; The first output module includes a determination submodule and a first output submodule: The determination submodule is used to determine the official version directory and the gray version directory of the second service according to the policy group configuration; The first output submodule is used to output the official version file of the first service to the official version directory of the second service, and to output the gray version file of the first service to the gray version directory of the second service; the second service has a data file directory corresponding to objects for grayscale release, the data file directory corresponding to objects that need to release new functions in grayscale is the gray version directory, and the data file directory corresponding to objects that temporarily maintain the current version functions is the official version directory.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the grayscale release method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the grayscale release method according to any one of claims 1 to 5 is implemented.
