Gray release method and device, computer equipment and storage medium

By adding request header tags and obtaining traffic distribution rules when receiving HTTP requests, the inefficiency problem of traditional canary release methods is solved, enabling consistent updates and efficient releases of front-end and back-end versions.

CN118885189APending Publication Date: 2024-11-01PING AN INT FINANCIAL LEASING CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410890683.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

Traditional canary release methods are inefficient in microservice architectures, as front-end and back-end version updates cannot be synchronized, resulting in low efficiency for new version updates.

Method used

By adding request header tags when receiving HTTP requests, the requests are sent to the corresponding business microservices based on the request header tags, and traffic distribution rules are obtained, thus enabling canary releases.

Benefits of technology

It enables seamless updates between the front-end and back-end versions, improves the efficiency of new version releases, and avoids the inefficiency of separate releases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885189A_ABST
    Figure CN118885189A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers and financial science and technology, and particularly discloses a gray release method and device, computer equipment and a storage medium. When the http is received, adding a request header mark to the http request based on a preset gray level configuration parameter; sending the http request to a business micro-service corresponding to the request header mark; and determining a target i ngress proxy in the business micro-service, obtaining a traffic distribution rule based on the target i ngress proxy, and distributing the http request to a corresponding server so as to respond to the http request and realize gray release. According to the method and the device, request header marking can be performed on the http request, the request is sent to different business micro-services according to the request header mark, the traffic distribution rule is further acquired according to the target i ngress, and the request is distributed to different servers for response, so that different http requests are processed by corresponding servers, and the processing efficiency is improved. And the front and rear ends can continuously update the new version without separately publishing the front and rear ends, so that the new version publishing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of computers and financial technology, and in particular to a grayscale release method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the development of computer technology, online trading systems are widely used in the financial sector (such as leasing systems). At the same time, to meet the increasingly diverse needs of users, the business systems of enterprises such as auto finance leasing companies (such as leasing systems) are constantly being upgraded and updated. To ensure normal user access, timely version updates are required on the user side. Currently, based on the vast underlying microservice system, traditional grayscale releases are usually achieved through the collaborative development of large teams with a large amount of resources. This results in a large development workload, or the front-end and back-end are separated and grayscale releases are implemented separately. This results in low correlation and synchronization between front-end and back-end version updates, resulting in low efficiency in new version updates. Therefore, how to improve version update efficiency has become an urgent problem that needs to be solved. Summary of the Invention

[0003] The present application provides a grayscale release method, apparatus, computer equipment, and storage medium to improve version update efficiency.

[0004] In a first aspect, the present application provides a phased release method, the method comprising:

[0005] When receiving an HTTP hypertext transfer protocol request, adding a preset request header tag to the HTTP request based on the preset grayscale configuration parameters;

[0006] Send the http request to the business microservice corresponding to the request header tag;

[0007] Determine a target ingress proxy in the business microservice, and obtain traffic distribution rules based on the target ingress proxy;

[0008] Based on the traffic distribution rules, the http request is distributed to the corresponding server to respond to the http request and realize grayscale release.

[0009] In a second aspect, the present application further provides a phased release device, comprising:

[0010] A tag adding module is used to add a preset request header tag to the HTTP request based on the preset grayscale configuration parameters when receiving the HTTP hypertext transfer protocol request;

[0011] A request sending module, used to send the http request to the business microservice corresponding to the request header tag;

[0012] A rule acquisition module is used to determine the target ingress proxy in the business microservice and obtain traffic distribution rules based on the target ingress proxy;

[0013] The request response module is used to distribute the http request to the corresponding server based on the traffic distribution rule to respond to the http request and realize grayscale release.

[0014] In a third aspect, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the grayscale release method as described above when executing the computer program.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the grayscale release method as described above.

[0016] The present application discloses a grayscale release method, apparatus, computer device, and storage medium. Upon receiving an HTTP Hypertext Transfer Protocol (HTTP) request, the method adds a preset request header tag to the HTTP request based on preset grayscale configuration parameters; sends the HTTP request to a business microservice corresponding to the request header tag; determines a target ingress proxy within the business microservice, and obtains traffic distribution rules based on the target ingress proxy; and distributes the HTTP request to corresponding servers based on the traffic distribution rules to respond to the HTTP request, thereby achieving grayscale release. The present application can perform request header tagging on HTTP requests, send the request to different business microservices based on the request header tag, and further obtain traffic distribution rules based on the target ingress, distributing the request to different servers for response. This ensures that different HTTP requests are processed by corresponding servers, and allows the front-end and back-end to update new versions coherently, eliminating the need for separate releases, thereby improving the efficiency of new version releases. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 This is a schematic flowchart of a first embodiment of a phased release method provided in an embodiment of the present application;

[0019] Figure 2 This is a schematic flowchart of a second embodiment of a phased release method provided in an embodiment of the present application;

[0020] Figure 3 This is a schematic flowchart of a third embodiment of a phased release method provided in an embodiment of the present application;

[0021] Figure 4 A schematic block diagram of a phased release device provided in an embodiment of the present application;

[0022] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0024] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0025] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0026] It should be further understood that the term “and / or” used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0027] The embodiments of the present application provide a grayscale publishing method, apparatus, computer equipment, and storage medium. The grayscale publishing method can be applied to a server, by marking the HTTP request with a request header, sending the request to different business microservices based on the request header tag, and further obtaining traffic distribution rules based on the target ingress, distributing the request to different servers for response, so that different HTTP requests are processed by corresponding servers, and the front-end and back-end can update the new version in a coherent manner without the need to publish the front-end and back-end separately, thereby improving the efficiency of new version publishing. The server can be an independent server or a server cluster.

[0028] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.

[0029] See also Figure 1 , Figure 1 This is a schematic flow chart of a grayscale release method provided in an embodiment of the present application. This grayscale release method can be applied to a server to tag HTTP requests with request headers, send the requests to different business microservices based on the request header tags, and further obtain traffic distribution rules based on the target ingress to distribute the requests to different servers for response. This ensures that different HTTP requests are processed by corresponding servers and enables the frontend and backend to update new versions coherently, eliminating the need for separate releases, thereby improving the efficiency of new version releases.

[0030] like Figure 1 As shown, the phased release method specifically includes steps S101 to S104.

[0031] S101. When receiving an http hypertext transfer protocol request, adding a preset request header tag to the http request based on preset grayscale configuration parameters;

[0032] In one embodiment, upon receiving an HTTP request, it is necessary to determine whether the request complies with the grayscale rules based on preset grayscale configuration parameters. If the request complies with the grayscale rules, it is necessary to add preset request header tags to the request. These tags typically identify whether the request is a grayscale release request and the request's routing destination, among other information. By adding these tags, grayscale release requests can be tracked and monitored.

[0033] In a specific embodiment, GrayFilter acts as an http traffic filter. Combining the service registration information of the service registration center, the grayscale users and grayscale rules in the grayscale management platform, GrayFilter adds gray request header tags to different user traffic based on session information at the gateway filtering layer, marking the grayscale tags that their traffic should follow, as the first step in implementing grayscale traffic. GrayFilter can identify incoming http requests and determine whether the request is part of a grayscale release based on certain rules. Gray request headers are usually customized in specific application scenarios, especially in scenarios such as grayscale release, A / B testing, or traffic segmentation, to indicate that a request should be routed to a specific service version or processing logic.

[0034] S102, sending the http request to the business microservice corresponding to the request header tag;

[0035] In one embodiment, after adding a preset request header tag to an HTTP request, the request needs to be sent to the corresponding business microservice for processing. A business microservice is typically a cluster consisting of multiple microservices, each responsible for handling specific business logic. By sending the HTTP request to the corresponding microservice, the request can be processed and responded to.

[0036] In a specific embodiment, based on the request header information of the http request, the routing component is called to make a decision and send the http request to the business microservice that matches the respective request header tag.

[0037] S103: Determine a target ingress proxy in the business microservice, and obtain traffic distribution rules based on the target ingress proxy;

[0038] Furthermore, determining the target ingress proxy in the business microservice includes: obtaining the grayscale attributes of each ingress proxy in the business microservice and the grayscale release version in the http request; based on the grayscale attributes, obtaining the ingress proxy corresponding to the grayscale release version as the target ingress proxy.

[0039] In one embodiment, the ingress proxy is incorporated into the service registry like a regular service. During the grayscale container release phase, the ingress proxy is configured with a grayscale metadata tag to indicate its grayscale attributes. When the proxy starts, the configured traffic distribution rule metadata is instead obtained from the grayscale configuration center, allowing for dynamic management of the proxy's traffic rules. This serves as the second step in the inter-service grayscale traffic flow.

[0040] In one embodiment, a business microservice needs to determine a target ingress proxy to distribute and route HTTP requests. An ingress proxy is a server used for traffic forwarding and load balancing, distributing HTTP requests to different servers or service clusters for processing. By obtaining traffic distribution rules, HTTP requests can be distributed and routed, enabling a phased release.

[0041] In one embodiment, the Ingress proxy is configured with grayscale meta tags (such as annotations, labels, etc.) to mark its grayscale attributes. These grayscale meta tags are used to distinguish whether the Ingress proxy instance participates in grayscale releases and which version of grayscale release it participates in. Based on the grayscale attributes of the Ingress proxy and the grayscale release version in the HTTP request, the target Ingress proxy corresponding to the grayscale release version in the HTTP request is determined.

[0042] S104. Based on the traffic distribution rule, distribute the http request to the corresponding server to respond to the http request and realize grayscale release.

[0043] In one embodiment, HTTP requests can be distributed to corresponding servers or service clusters for processing based on traffic distribution rules. This ensures that only users or requests that meet the grayscale rules are routed to the new version of the service for processing, thereby achieving a grayscale release of the service. At the same time, this ensures that other users or requests can still use the old version of the service normally, thereby achieving smooth service upgrades and transitions.

[0044] Furthermore, the responding to the http request and realizing the grayscale release includes: grouping the http requests based on a preset rolling release rule to obtain a grouping result; and rolling releasing the grayscale release version based on the grouping result.

[0045] In one embodiment, in view of the particularity of APP packaging, combined with the back-end grayscale mechanism, the front-end project is optimized for rolling release based on the front-end incremental release, so as to achieve seamless switching of the user's front-end.

[0046] In one embodiment, rolling release rules are determined, such as dividing user groups according to factors such as user group, geographic location, device type, etc., and determining which version each user group should receive.

[0047] In one embodiment, a dynamically configurable release system is created for the front-end project, such as using environment variables, configuration files, or container images, to ensure that the front-end project can smoothly switch to the new version and support downgrade and rollback.

[0048] In one embodiment, integration with the backend service registry ensures that frontend projects can dynamically obtain the address information of backend services. This also enables grayscale routing of frontend requests, selectively routing requests to different versions of backend services based on user groups or other conditions.

[0049] For example, assuming the grouping results include user groups A and B, according to the rolling release rules, user group A will be updated with the grayscale release version first. After confirming that user group A can use the grayscale release version normally, user group B will be updated with the grayscale release version until all grayscale release versions cover all user groups. The rolling release of the front-end project can be combined with the grayscale mechanism of the back-end to achieve seamless user switching. This helps reduce the risk of version releases and improve software reliability and stability.

[0050] In the above embodiment, when releasing a grayscale version, the user is added to the grayscale list and grayscale rules are configured. After the grayscale container is released, the ingress proxy service metadata is registered with the service registry, and the traffic rules for related services are dynamically adjusted. Simultaneously, the frontend obtains the grayscale tag and releases the corresponding service for the grayscale version. When a user opens a terminal, the frontend traffic carries the user's basic information, and the user terminal information is sent to the backend gateway. When the traffic enters the gateway, the gateway performs the first traffic distribution. When the traffic enters the business microservice, the business microservice ingress proxy performs another traffic distribution according to the microservice traffic rules. This allows different servers to respond to different HTTP requests based on different versions, and returns in sequence after the service is processed, thus achieving a complete service call.

[0051] See also Figure 2 , Figure 2 This is a schematic flow chart of a grayscale release method provided by an embodiment of the present application. This grayscale release method can be applied to a server to parse HTTP requests, obtain user session information and request configuration parameters, classify HTTP requests based on the session information and request configuration parameters, and then add request header tags to different HTTP requests to route the HTTP requests to the corresponding business microservice for processing, ensuring normal grayscale release for grayscale users and normal use for non-grayscale users.

[0052] like Figure 2 As shown, the grayscale release method specifically includes steps S201 to S203.

[0053] S201. When receiving the HTTP request, parse the HTTP request to obtain request configuration parameters and user session information;

[0054] In one embodiment, upon receiving an HTTP request, the request needs to be parsed to obtain information such as the user identifier and request configuration parameters. The request configuration parameters can be obtained by parsing the request header or request parameters. The user's session information is typically stored in the server's memory and includes the user's session state and identity information.

[0055] S202: classify the http request based on the session information and the request configuration parameters to obtain a classification result;

[0056] Furthermore, the http request is classified based on the session information and the request configuration parameters to obtain a classification result, including: comparing the preset grayscale rules with the request configuration parameters to determine whether the http request complies with the grayscale rules; when the http request complies with the grayscale rules, parsing the session information to obtain the user ID of the user; comparing the user ID with a preset grayscale user list to determine whether the user is a grayscale user; when the user is a grayscale user, classifying the http request as a grayscale release request.

[0057] In one embodiment, classification can be determined based on preset grayscale rules, such as user ID, device information, request path, etc. If a request meets the grayscale rules, it will be classified as a grayscale release request; otherwise, it will be classified as a normal request.

[0058] In one embodiment, a grayscale rule is a set of rules defined during the grayscale release process to determine which users or requests should be routed to the new version of the service. These rules typically include conditions such as user ID, device information, request path, and the corresponding routing target (such as the address of the new version of the service). Grayscale rules can be freely configured by the user as needed.

[0059] In one embodiment, in an HTTP request, request configuration information such as user identification, device information, etc. can be obtained by analyzing the request header or request parameters. This information can be used to determine whether the request complies with the grayscale rules.

[0060] In one embodiment, when an HTTP request is received, the request configuration parameters are compared with the preset grayscale rules to determine whether the request complies with the grayscale rules. If certain parameters in the request meet the conditions in the grayscale rules, the request is considered a qualified grayscale release request.

[0061] In one embodiment, when an HTTP request is determined to be a qualified grayscale release request, the user ID of the user in the request needs to be obtained. The user ID can be obtained by parsing the session information in the request. The session information is typically stored in the server's memory and includes the user's session state and identity information.

[0062] In one embodiment, after obtaining the user ID of the user, it is necessary to compare it with the preset grayscale user list to determine whether the user is a grayscale user. If the user is in the grayscale user list, then the user will be considered a qualified grayscale release user.

[0063] In one embodiment, when an HTTP request is determined to be a qualified grayscale release request and the user is a grayscale release user, the request will be classified as a grayscale release request and routed to the new version of the service for processing, thereby enabling testing and optimization of grayscale users.

[0064] Furthermore, after comparing the preset grayscale rules with the request configuration parameters to determine whether the http request complies with the grayscale rules, it also includes: when the http request does not comply with the grayscale rules and / or the user is not a grayscale user, classifying the http request as a normal request.

[0065] In one embodiment, if an HTTP request is determined not to comply with the grayscale rules or the user involved is not a grayscale user, the request will be classified as a normal request. The request will not be routed to the new version of the service for processing, but will continue to be processed using the old version of the service. This ensures that the normal use of non-grayscale users is not affected during the grayscale release process.

[0066] S203: Add a preset request header tag to the http request based on the classification result.

[0067] In one embodiment, based on the classification results, preset request header tags can be added to HTTP requests. These tags are typically used to identify whether the request is a phased release request, as well as information such as the routing target of the request. Based on the request header tags, the HTTP request can be routed to the corresponding business microservice for processing.

[0068] In a specific embodiment, if a request meets the grayscale rules, a gray request header tag is added to the HTTP request header. This tag is usually a specific string or identifier used to identify grayscale traffic on the server side.

[0069] In the above embodiment, the http request is parsed to obtain the user's session information and request configuration parameters, and the http request is classified according to the session information and request configuration parameters, and then request header tags are added to different http requests to route the http request to the corresponding business microservice for processing, ensuring the normal grayscale release of grayscale users and the normal use of non-grayscale users.

[0070] See also Figure 3 , Figure 3 This is a schematic flow chart of a grayscale release method provided by an embodiment of the present application. The grayscale release method can be applied to a server to monitor the running status of grayscale release versions, solve problems in a timely manner, and improve version release efficiency.

[0071] like Figure 3 As shown, the grayscale release method specifically includes steps S301 to S302.

[0072] S301. Obtain the running status of the grayscale release version and the flow record of the http request;

[0073] S302: Based on the running status and the circulation record, obtain user usage of the grayscale release version, and adjust the grayscale release based on the user usage.

[0074] In one embodiment, by querying the service governance center's container metadata, the traffic rules configured by the grayscale traffic distribution center, and the grayscale tags and device information in user traffic, a user-friendly interface is provided for observing the overall monitoring of grayscale services. Furthermore, by connecting grayscale tags, users can observe the call logs for various business functions, from the terminal to the gateway to the specific server.

[0075] In one embodiment, the service governance center is typically a centralized service management platform that supports registration, discovery, configuration, and monitoring of grayscale releases. Container metadata refers to information about grayscale releases running in containers, such as the container's status, configuration, and dependencies. By querying the service governance center's container metadata, you can understand the overall health of grayscale releases.

[0076] In one embodiment, in a grayscale release environment, traffic rules need to be configured to control which users or requests are routed to the new version of the service. These traffic rules typically include conditions such as user ID, device information, request path, and the corresponding routing target (such as the address of the new version of the service). By querying the traffic rules configured in the grayscale traffic distribution center, you can understand which users or requests are participating in the grayscale test.

[0077] In one embodiment, HTTP requests are typically marked with tags to indicate whether the request should be routed to the new version of the service. These tags can be fields in the request header or request parameters. By querying the grayscale tags in user traffic, it is possible to determine which requests are routed to the new version of the service.

[0078] In one embodiment, device information refers to information related to the device used by the user, such as device model, operating system version, network status, etc. By querying the device information in user traffic, the user group and device environment participating in the grayscale test can be analyzed.

[0079] In one embodiment, the above information is integrated into a user-friendly monitoring system, enabling comprehensive monitoring of Grayscale services. The monitoring system displays information such as service status, performance metrics, and error logs, and can filter and categorize requests based on traffic rules and device information. This allows developers and operations personnel to more intuitively understand the operational status of Grayscale services and identify and resolve issues promptly.

[0080] In one embodiment, grayscale tag chaining involves tracing the flow of HTTP requests through the system, linking the call relationships between different services. In a grayscale release environment, by tracking the grayscale tags in HTTP requests, one can observe the call logs for different business functions, from the terminal to the gateway to the specific server. This allows developers to gain a deeper understanding of the HTTP request flow within the system and identify potential performance bottlenecks or issues.

[0081] In one embodiment, based on user usage, problems encountered during use, such as errors, performance degradation, or poor user experience, are identified. This determines whether adjustments to the new version are necessary or whether the scope of the grayscale release should be expanded. For example, necessary adjustments can be made to the new version, such as bug fixes, performance optimizations, or feature improvements. Once the new version is confirmed to be stable and has received positive user feedback, the grayscale release ratio can be gradually increased until the old version is completely replaced.

[0082] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of a phased release device, which is used to execute the aforementioned phased release method. The phased release device can be configured on a server.

[0083] like Figure 4 As shown, the grayscale release device 400 includes:

[0084] The tag adding module 401 is used to add a preset request header tag to the HTTP request based on the preset grayscale configuration parameters when receiving the HTTP request;

[0085] The request sending module 402 is used to send the HTTP request to the business microservice corresponding to the request header tag;

[0086] A rule acquisition module 403 is used to determine a target ingress proxy in the business microservice and obtain a traffic distribution rule based on the target ingress proxy;

[0087] The request response module 404 is used to distribute the http request to the corresponding server based on the traffic distribution rule to respond to the http request and achieve grayscale release.

[0088] Furthermore, the tag adding module 401 includes:

[0089] The request parsing unit is used to parse the HTTP request upon receiving the HTTP request, and obtain the request configuration parameters and the user's session information;

[0090] a classification result obtaining unit, configured to classify the http request based on the session information and the request configuration parameters to obtain a classification result;

[0091] A tag adding unit is used to add a preset request header tag to the http request based on the classification result.

[0092] Furthermore, the classification result obtaining unit includes:

[0093] A grayscale rule judgment subunit is used to compare the preset grayscale rule with the request configuration parameters to determine whether the http request complies with the grayscale rule;

[0094] A user representation obtaining subunit is used to parse the session information and obtain the user ID of the user when the HTTP request meets the grayscale rule;

[0095] a grayscale user determination subunit, configured to compare the user identifier with a preset grayscale user list to determine whether the user is a grayscale user;

[0096] The request division subunit is used to divide the http request into a grayscale publishing request when the user is a grayscale user.

[0097] Furthermore, the classification result obtaining unit further includes:

[0098] The request classification subunit is used to classify the http request into a common request when the http request does not comply with the grayscale rule and / or the user is not a grayscale user.

[0099] Furthermore, the rule acquisition module 403 includes:

[0100] A grayscale version acquisition unit, used to obtain the grayscale attributes of each ingress agent in the business microservice and the grayscale release version in the http request;

[0101] The target agent determining unit is used to obtain the ingress agent corresponding to the grayscale release version as the target ingress agent based on the grayscale attribute.

[0102] Furthermore, the phased release device 400 further includes a phased monitoring module, which includes:

[0103] A flow record acquisition unit, used to obtain the running status of the grayscale release version and the flow record of the http request;

[0104] A usage obtaining unit is configured to obtain user usage of the phased release version based on the running status and the circulation record, so as to adjust the phased release based on the user usage.

[0105] Furthermore, the request response module 404 includes:

[0106] A grouping result obtaining unit, configured to group the http requests based on a preset rolling release rule to obtain a grouping result;

[0107] The rolling release unit is used to roll out the grayscale release version based on the grouping result.

[0108] It should be noted that those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0109] The above-mentioned device can be realized in the form of a computer program. The computer program can be used in Figure 5 Runs on the computer equipment shown.

[0110] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0111] See Figure 5 The computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0112] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions that, when executed, enable the processor to perform any of the phased release methods.

[0113] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0114] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any grayscale release method.

[0115] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0116] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0117] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:

[0118] When receiving an HTTP hypertext transfer protocol request, adding a preset request header tag to the HTTP request based on the preset grayscale configuration parameters;

[0119] Send the http request to the business microservice corresponding to the request header tag;

[0120] Determine a target ingress proxy in the business microservice, and obtain traffic distribution rules based on the target ingress proxy;

[0121] Based on the traffic distribution rules, the http request is distributed to the corresponding server to respond to the http request and realize grayscale release.

[0122] In one embodiment, when the processor receives an http hypertext transfer protocol request, based on a preset grayscale configuration parameter, adding a preset request header tag to the http request, the processor is configured to implement:

[0123] When receiving the http request, parsing the http request to obtain request configuration parameters and user session information;

[0124] Classify the http request based on the session information and the request configuration parameters to obtain a classification result;

[0125] Add a preset request header tag to the http request based on the classification result.

[0126] In one embodiment, when the processor classifies the http request based on the session information and the request configuration parameters to obtain the classification result, it is configured to implement:

[0127] Compare the preset grayscale rules with the request configuration parameters to determine whether the http request complies with the grayscale rules;

[0128] When the http request meets the grayscale rule, parsing the session information to obtain the user ID of the user;

[0129] Comparing the user ID with a preset grayscale user list to determine whether the user is a grayscale user;

[0130] When the user is a grayscale user, the http request is classified as a grayscale publishing request.

[0131] In one embodiment, after comparing the preset grayscale rules with the request configuration parameters to determine whether the http request complies with the grayscale rules, the processor is further configured to implement:

[0132] When the http request does not comply with the grayscale rule and / or the user is not a grayscale user, the http request is classified as a common request.

[0133] In one embodiment, when determining the target ingress proxy in the business microservice, the processor is configured to implement:

[0134] Obtain the grayscale attributes of each ingress agent in the business microservice and the grayscale release version in the http request;

[0135] Based on the grayscale attributes, an ingress proxy corresponding to the grayscale release version is obtained as the target ingress proxy.

[0136] In one embodiment, after distributing the http request to the corresponding server based on the traffic distribution rule to respond to the http request and implement the phased release, the processor is further configured to implement:

[0137] Obtain the running status of the grayscale release version and the flow record of the http request;

[0138] Based on the running status and the circulation record, user usage of the grayscale release version is obtained, so as to adjust the grayscale release based on the user usage.

[0139] In one embodiment, when the processor responds to the http request and implements the phased release, it is configured to implement:

[0140] Based on a preset rolling release rule, the http requests are grouped to obtain a grouping result;

[0141] Based on the grouping results, the grayscale release version is rolled out.

[0142] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement any one of the grayscale release methods provided in the embodiments of the present application.

[0143] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc., equipped on the computer device.

[0144] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A grayscale release method, It is characterized in that include: When receiving an http hypertext transfer protocol request, adding a preset request header tag to the http request based on a preset grayscale configuration parameter; Send the http request to the business microservice corresponding to the request header tag; Determine the target ingress proxy in the business microservice, and obtain the traffic distribution rule based on the target ingress proxy; Based on the traffic distribution rules, the http request is distributed to the corresponding server to respond to the http request and realize grayscale release.

2. The grayscale release method according to claim 1, It is characterized in that When receiving an http hypertext transfer protocol request, adding a preset request header tag to the http request based on a preset grayscale configuration parameter includes: When receiving the http request, parsing the http request to obtain request configuration parameters and user session information; Classify the http request based on the session information and the request configuration parameters to obtain a classification result; A preset request header tag is added to the http request based on the classification result.

3. The grayscale release method according to claim 2, It is characterized in that The classifying the http request based on the session information and the request configuration parameter to obtain the classification result includes: Compare the preset grayscale rule with the request configuration parameter to determine whether the http request complies with the grayscale rule; When the http request meets the grayscale rule, the session information is parsed to obtain the user ID of the user; Comparing the user identification with a preset grayscale user list to determine whether the user is a grayscale user; When the user is a grayscale user, the http request is classified as a grayscale publishing request.

4. The grayscale release method according to claim 3, It is characterized in that After comparing the preset grayscale rule with the request configuration parameter to determine whether the http request complies with the grayscale rule, the method further includes: When the http request does not comply with the grayscale rule and / or the user is not a grayscale user, the http request is classified as a common request.

5. The grayscale release method according to claim 1, It is characterized in that Determining the target ingress proxy in the business microservice includes: Obtain the grayscale attributes of each ingress agent in the business microservice and the grayscale release version in the http request; Based on the grayscale attributes, an ingress agent corresponding to the grayscale release version is obtained as the target ingress agent.

6. The grayscale release method according to claim 1, It is characterized in that After distributing the http request to the corresponding server based on the traffic distribution rule to respond to the http request and implement grayscale release, the method further includes: Obtain the running status of the grayscale release version and the flow record of the http request; Based on the running status and the circulation record, the user usage of the grayscale release version is obtained, so as to make grayscale release adjustments based on the user usage.

7. The grayscale release method according to any one of claims 1 to 6, It is characterized in that The step of responding to the http request and implementing grayscale publishing includes: Based on a preset rolling release rule, the http requests are grouped to obtain a grouping result; Based on the grouping results, the grayscale release version is rolled out.

8. A grayscale release device, It is characterized in that include: A tag adding module, used for adding a preset request header tag to the http request based on preset grayscale configuration parameters when receiving an http hypertext transfer protocol request; A request sending module, used to send the http request to the business microservice corresponding to the request header tag; A rule acquisition module is used to determine a target ingress proxy in the business microservice and acquire a traffic distribution rule based on the target ingress proxy; The request response module is used to distribute the http request to the corresponding server based on the traffic distribution rule to respond to the http request and realize grayscale release.

9. A computer device, It is characterized in that The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the grayscale release method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the grayscale release method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Micro-service system, full-link gray release method and full-link gray implementation method

    CN119232789A

  • Service routing method and device, electronic equipment and storage medium

    CN119743532A