Gray traffic verification method and device, equipment, storage medium and program product
Through the grayscale registration module based on registration discovery, the instances are given general ability to grayscale, formal and even isolation, and the problem of dynamically changing and isolating instance labels in the prior art is solved, and the high-level abstraction of grayscale instances and formal instances is realized. Dynamic management.
Patent Information
- Application Number
- CN202411424119.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-12
AI Technical Summary
The existing grayscale solution cannot divide formal instances and grayscale instances from the perspective of fundamental instances, resulting in the inability to realize dynamic changes or even isolation of instance labels.
Through the grayscale registration module based on registration discovery, the general ability to grayscale, formal and even isolation of instances with different calling relationships is given to instances with different call relationships, and dynamic changes and isolation of instance tags are realized.
It achieves the high-level abstraction of grayscale instances and formal instances, realizes dynamic changes and even isolation of instance labels, and solves the problem that the formal instance and grayscale instance cannot be divided from the fundamental instance perspective in the prior art.
Smart Images

Figure CN119449897A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a grayscale traffic verification method, device, equipment, storage medium and program product. Background Art
[0002] Today's advanced grayscale solutions take into account the full-link grayscale functions of the entire business scenario. Based on the call of conventional microservices, the full-link flow of grayscale traffic can be realized.
[0003] Other methods involve a full-link grayscale function for a message queue. A grayscale environment and a formal environment are provided in the method, and independent instances are deployed in the corresponding environments. A first message is generated through a message producer of a first application instance. The first message includes a grayscale attribute field. The grayscale attribute field includes a field indicating a custom attribute of the message, and the value of the grayscale attribute field is used to indicate that the first message belongs to a grayscale message. The first application instance is an application instance running in a grayscale environment in a target call link.
[0004] The above methods all visualize message queue calls or microservice calls, and cannot divide formal instances and grayscale instances from the perspective of fundamental instances, so it is impossible to achieve dynamic changes or even isolation of instance labels.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a grayscale traffic verification method, device, equipment, storage medium and program product, aiming to solve the technical problem that the existing grayscale scheme cannot divide formal instances and grayscale instances from the perspective of fundamental instances.
[0007] To achieve the above objectives, the present application proposes a grayscale flow verification method, the method comprising:
[0008] Receive the traffic to be published sent by the upstream service;
[0009] Based on the pre-registered grayscale message queue instance and the preset instance call relationship, the traffic to be released is released to the downstream service, and the grayscale traffic release result sent by the downstream service is received. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module;
[0010] Grayscale traffic verification is performed according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0011] In one embodiment, the instance call relationship is a call relationship based on the hypertext transfer protocol, the grayscale message queue instance is a first grayscale message queue instance, the downstream service includes a downstream consumer, the grayscale traffic publishing result is a first grayscale traffic publishing result, and the steps of publishing the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service include:
[0012] Based on the call relationship based on the hypertext transfer protocol, and according to the first grayscale message queue instance, obtaining pre-generated instance flag data from a preset registration center;
[0013] According to the instance flag data, determining that the downstream consumer instance that is consistent with the grayscale state of the first grayscale message queue instance is the first consumer instance;
[0014] Generate a full-link grayscale routing request according to the instance flag data;
[0015] Through the first grayscale message queue instance, the traffic to be published is published to the first consumer instance, and the first grayscale traffic publishing result sent by the first consumer instance is received, and the full-link grayscale routing request is sent to the first consumer instance, so that the downstream service performs corresponding full-link grayscale routing.
[0016] In one embodiment, before the step of publishing the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service, it also includes:
[0017] When the instance calling relationship is a calling relationship based on the Hypertext Transfer Protocol, receiving a grayscale message queue instance registration request;
[0018] By means of a preset grayscale registration module, according to the grayscale message queue instance registration request, the root message queue instance is changed to the first grayscale message queue instance;
[0019] According to the first grayscale message queue instance, the instance flag data is generated and sent to the registration center.
[0020] In one embodiment, the instance call relationship is an asynchronous call relationship, the grayscale message queue instance is a second grayscale message queue instance, the downstream service includes a pre-acquired first grayscale environment consumer, the grayscale traffic publishing result is a second grayscale traffic publishing result, and the steps of publishing the to-be-published traffic to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service include:
[0021] Based on the asynchronous call relationship, the to-be-published traffic is sent to the first grayscale environment consumer through the second grayscale message queue instance, and the second grayscale traffic publishing result sent by the first grayscale environment consumer is received.
[0022] In one embodiment, before the step of sending the to-be-published traffic to the first grayscale environment consumer through the second grayscale message queue instance based on the asynchronous call relationship and receiving the second grayscale traffic publishing result sent by the first grayscale environment consumer, it also includes:
[0023] When the instance calling relationship is an asynchronous calling relationship, receiving a consumer capability change request;
[0024] According to the consumer capability change request, the capability of the first formal environment consumer in the downstream service is changed through a preset registration center to obtain the first grayscale environment consumer.
[0025] In one embodiment, the downstream service includes a second grayscale environment consumer, and after the step of performing grayscale traffic verification according to the grayscale traffic publishing result and obtaining the grayscale traffic verification result, the step further includes:
[0026] When the grayscale traffic verification result indicates that the grayscale traffic verification is successful, receiving a consumer status change request;
[0027] Through a preset registration center, according to the consumer status change request, the status of the second grayscale environment consumer is changed to obtain a second formal environment consumer, so that the second formal environment consumer consumes formal traffic.
[0028] In addition, to achieve the above purpose, the present application also proposes a grayscale flow verification device, the grayscale flow verification device comprising:
[0029] Traffic receiving module, used to receive the traffic to be published sent by the upstream service;
[0030] A traffic publishing module, used to publish the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receive the grayscale traffic publishing result sent by the downstream service. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module;
[0031] The traffic verification module is used to perform grayscale traffic verification according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a grayscale flow verification device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the grayscale flow verification method described above.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the grayscale flow verification method described above are implemented.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the grayscale flow verification method described above.
[0035] The present application provides a grayscale traffic verification method. Through a grayscale registration module based on registration discovery, it gives instances with different calling relationships the general ability to be grayscale, formal, and even isolated. It solves the technical problem that the existing grayscale scheme cannot divide formal instances and grayscale instances from the perspective of fundamental instances, achieves high-level abstraction of grayscale instances and formal instances, and can realize dynamic changes and even isolation of instance labels. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 A schematic diagram of the process flow provided for the first embodiment of the grayscale flow verification method of the present application;
[0039] Figure 2 A schematic diagram of a simplified process for a consumer to convert from a gray state to a formal state provided in Example 1 of the present application;
[0040] Figure 3 A schematic diagram of the process flow provided for the second embodiment of the grayscale flow verification method of the present application;
[0041] Figure 4 A schematic diagram of a general grayscale capability module provided in Example 2 of the present application;
[0042] Figure 5 A schematic diagram of the message queue calling relationship provided in Example 2 of the present application;
[0043] Figure 6 This is a schematic diagram of the module structure of the grayscale flow verification device according to an embodiment of the present application;
[0044] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the grayscale traffic verification method in the embodiment of the present application.
[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0048] The main solutions of the embodiments of this application are:
[0049] Receive the traffic to be published sent by the upstream service;
[0050] Based on the pre-registered grayscale message queue instance and the preset instance call relationship, the traffic to be released is released to the downstream service, and the grayscale traffic release result sent by the downstream service is received. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module;
[0051] Grayscale traffic verification is performed according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0052] In the existing technology, today's advanced grayscale solutions take into account the full-link grayscale functions of the entire business scenario, and based on the call of conventional microservices, the full-link flow of grayscale traffic can be realized.
[0053] Other methods involve a full-link grayscale function for a message queue. A grayscale environment and a formal environment are provided in the method, and independent instances are deployed in the corresponding environments. A first message is generated through a message producer of a first application instance. The first message includes a grayscale attribute field. The grayscale attribute field includes a field indicating a custom attribute of the message, and the value of the grayscale attribute field is used to indicate that the first message belongs to a grayscale message. The first application instance is an application instance running in a grayscale environment in a target call link.
[0054] The above methods all have the following problems:
[0055] First, by visualizing message queue calls or microservice calls, it is impossible to divide formal instances and grayscale instances from the perspective of fundamental instances, and thus it is impossible to achieve dynamic changes or even isolation of instance labels.
[0056] Second, the formal environment and the grayscale environment are completely independent. The formal environment and the grayscale environment need to be deployed. During the change process, it is often necessary to modify the configuration, restart the service, and other operations, which may affect the consumption capacity of the environment.
[0057] The present application provides a solution, which, through a grayscale registration module based on registration discovery, gives instances with different calling relationships the general ability to be grayscale, formal, and even isolated. It solves the technical problem that the existing grayscale scheme cannot divide formal instances and grayscale instances from the perspective of fundamental instances, achieves high-level abstraction of grayscale instances and formal instances, and can realize dynamic changes and even isolation of instance labels.
[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a grayscale flow verification system, etc. The grayscale flow verification system is taken as an example to illustrate this embodiment and the following embodiments.
[0059] Based on this, the embodiment of the present application provides a grayscale flow verification method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the grayscale flow verification method of the present application.
[0060] In this embodiment, the grayscale flow verification method includes steps S10 to S30:
[0061] Step S10, receiving the traffic to be published sent by the upstream service;
[0062] It should be noted that the upstream service refers to the module or service in the system that is responsible for generating or providing data, and the traffic to be released refers to the traffic data that has not yet been verified and is ready to be released.
[0063] Step S20, based on the pre-registered grayscale message queue instance and the preset instance call relationship, publish the traffic to be published to the downstream service, and receive the grayscale traffic publishing result sent by the downstream service, the grayscale message queue instance is a preset grayscale registration module that registers and generates a preset root message queue instance;
[0064] Step S30, performing grayscale traffic verification according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0065] The grayscale traffic verification system is based on pre-registered grayscale message queue instances and preset instance call relationships. It uses polling, weight distribution and other strategies to publish the traffic to be released to downstream services and receive the grayscale traffic release results sent by downstream services. The system will then verify the previous grayscale traffic release results to evaluate the performance and stability of new functions or versions, and obtain grayscale traffic verification results. Through verification, it can be ensured that the release of traffic will not have a negative impact on user experience.
[0066] It should be noted that the grayscale message queue instance is generated by registering the preset root message queue instance with the preset grayscale registration module. The grayscale message queue instance is a service instance of a specific version, which is used to gradually introduce new features or fix bugs. The instance call relationship is used to define the interaction and dependency between different service instances.
[0067] In a feasible implementation manner, the downstream service includes a second grayscale environment consumer, and step S30 may further include steps S401 to S402:
[0068] Step S401, when the grayscale traffic verification result indicates that the grayscale traffic verification is successful, receiving a consumer status change request;
[0069] Step S402: through a preset registration center, according to the consumer status change request, the status of the second grayscale environment consumer is changed to obtain a second formal environment consumer, so that the second formal environment consumer consumes formal traffic.
[0070] When the grayscale traffic verification result is expressed as a successful grayscale traffic verification, the grayscale traffic verification system receives a consumer status change request from the relevant component or team, indicating that the current consumer status needs to be switched from the grayscale environment to the formal consumer status, and then through the preset registration center, according to the consumer status change request, the status of the second grayscale environment consumer is changed, and the status of the corresponding consumer is changed from "grayscale environment" to "formal environment" to obtain the second formal environment consumer, so that the second formal environment consumer consumes the formal traffic.
[0071] It should be noted that a consumer status change request is a request issued by the system to notify related components that a consumer's status needs to be changed from a grayscale environment to a formal environment. The registration center is a service discovery and management component that is responsible for maintaining the status information of service instances and supports dynamic registration and deregistration of services. It plays a core role in consumer status changes.
[0072] For example, refer to Figure 2 , Figure 2 A schematic diagram of a simplified process for a consumer to convert from a gray state to a formal state provided in Example 1 of the present application.
[0073] Specifically, the conventional full-link grayscale solution needs to strictly distinguish between the formal environment and the grayscale environment. At the same time, during the change process, the corresponding environment configuration needs to be set and the service needs to be restarted. This process provides the risk of service unavailability.
[0074] This embodiment utilizes the general capabilities of the grayscale registration module and has the ability to smoothly convert the grayscale environment instance directly into the formal environment instance. In this way, after the grayscale verification is completed, it can be directly converted into the formal environment, reducing configuration modifications and changes in service instance status.
[0075] After the user completes the grayscale traffic verification, the status of the message queue consumer is modified through the registration center. If it is a message queue associated with a topic, the topic of the grayscale instance is updated, and the consumer role is changed from grayscale to formal. In this way, when formal traffic enters, the producer will write the request or message content to the consumer message queue, and then consume the formal traffic through the consumer.
[0076] In this implementation, the registration center centrally manages consumer information to ensure that all services can obtain the latest consumer status and capability configuration in a timely manner, respond to traffic changes in real time, and dynamically adjust consumer capabilities through the preset registration center, thereby ensuring that the system remains highly efficient during peak hours and improving the reliability and flexibility of the overall service. As a result, a one-click switching process from grayscale to formal is provided, which can convert the grayscale instance that has passed the verification into a formal instance, completing the smooth switching between grayscale and formal, solving the problem of the formal environment and grayscale environment being separated and generating a series of operation and maintenance costs.
[0077] This embodiment provides a grayscale traffic verification method. Through a grayscale registration module based on registration discovery, it gives instances with different calling relationships the general ability to be grayscale, formal, and even isolated. It solves the technical problem that the existing grayscale scheme cannot divide formal instances and grayscale instances from the perspective of fundamental instances, achieves high-level abstraction of grayscale instances and formal instances, and can realize dynamic changes and even isolation of instance labels.
[0078] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , the instance call relationship is a call relationship based on the hypertext transfer protocol, the grayscale message queue instance is a first grayscale message queue instance, the downstream service includes a downstream consumer, the grayscale traffic publishing result is a first grayscale traffic publishing result, and step S20 includes steps S2011 to S2014:
[0079] Step S2011, based on the call relationship based on the hypertext transfer protocol, according to the first grayscale message queue instance, obtaining pre-generated instance flag data from a preset registration center;
[0080] Step S2012: determining, according to the instance flag data, a downstream consumer instance that is consistent with the grayscale state of the first grayscale message queue instance as a first consumer instance;
[0081] Step S2013, generating a full-link grayscale routing request according to the instance mark data;
[0082] Step S2014: Publish the traffic to be published to the first consumer instance through the first grayscale message queue instance, receive the first grayscale traffic publishing result sent by the first consumer instance, and send the full-link grayscale routing request to the first consumer instance, so that the downstream service can perform corresponding full-link grayscale routing.
[0083] The grayscale traffic verification system is based on a call relationship based on the Hypertext Transfer Protocol. According to the first grayscale message queue instance, the pre-generated instance flag data is obtained from the preset registration center, and then the instance flag data obtained from the registration center is parsed to extract relevant grayscale status information. The grayscale status of the first grayscale message queue instance is compared with the status of all downstream consumer instances, and the instances with consistent status are screened out to obtain the first consumer instance. Then, according to the instance flag data, a full-link grayscale routing request is generated, and then the traffic to be released is released to the first consumer instance through the first grayscale message queue instance, and the first grayscale traffic release result sent by the first consumer instance is received, which may include key indicators such as response time, error rate, and throughput, which are used to evaluate the effect and stability of the grayscale release, and the full-link grayscale routing request is sent to the first consumer instance so that the downstream service can perform corresponding full-link grayscale routing to ensure that the downstream service can process the traffic according to the set routing rules.
[0084] It should be noted that HTTP is the abbreviation of Hypertext Transfer Protocol, which is a protocol used to transmit data on the network, especially between clients (such as browsers) and servers. TTP defines the format of requests and responses so that users can access and interact with Web resources. The instance identifier data is an identifier associated with the first grayscale message queue instance, containing the current status and other metadata. The downstream consumer refers to the downstream service instance that receives and processes upstream service traffic. The full-link grayscale routing request contains a request for complete routing information to ensure that the traffic can be forwarded correctly.
[0085] In a feasible implementation manner, before step S20, steps S501 to S503 may also be included:
[0086] Step S501, when the instance calling relationship is a calling relationship based on the Hypertext Transfer Protocol, receiving a grayscale message queue instance registration request;
[0087] Step S502, through a preset grayscale registration module, according to the grayscale message queue instance registration request, the root message queue instance is changed to the first grayscale message queue instance;
[0088] Step S503: Generate the instance identification data according to the first grayscale message queue instance and send it to the registration center.
[0089] When the instance calling relationship is a calling relationship based on the Hypertext Transfer Protocol, the grayscale traffic verification system receives a grayscale message queue instance registration request, and then through the preset grayscale registration module, according to the grayscale message queue instance registration request, registers the root message queue instance as the first grayscale message queue instance; finally, based on the characteristics of the first grayscale message queue instance (such as instance ID, version number, status, etc.), generates instance flag data and sends it to the registration center.
[0090] It should be noted that the grayscale registration module is a module used to process and manage instance registration requests. It is responsible for updating the instance status to the system. The instance identification data may include instance ID, version number, status information, registration timestamp and other information.
[0091] For example, refer to Figure 4 , Figure 4 A schematic diagram of a general grayscale capability module provided in Example 2 of the present application.
[0092] Specifically, the grayscale registration module provides a general grayscale capability interface, and implements the grayscale capability registration and sending, independent configuration, and instance isolation capabilities of registration discovery. Services with different calling relationships only need to expand the grayscale capability interface to implement grayscale routing capabilities with different calling relationships.
[0093] The calling relationship based on HTTP is relatively simple. You only need to register the instance as formal or grayscale. Because the module itself supports full-link calling capabilities, during downstream routing, only instances with the same grayscale status as the current instance are selected for routing according to the instance flag in the registration center; and the necessary grayscale flag is set in the HTTP request header during each request routing, so that after the downstream service receives the request, it can continue the same full-link grayscale routing.
[0094] In this implementation, the dynamic registration and state perception mechanism solves the flexibility problem in traffic management, ensuring that the system can adapt to different loads and demand changes, marking the newly registered instance as the first grayscale message queue instance, ensuring that the system can clearly identify different instances, and by generating instance mark data and sending it to the registration center, it realizes information sharing among multiple components and improves the system's collaborative working ability. As a result, an efficient instance registration and management framework is formed, which improves the flexibility, real-time and reliability of the system, and lays a solid foundation for subsequent traffic management and grayscale release.
[0095] In another feasible implementation, the instance call relationship is an asynchronous call relationship, the grayscale message queue instance is a second grayscale message queue instance, the downstream service includes a pre-acquired first grayscale environment consumer, the grayscale traffic publishing result is a second grayscale traffic publishing result, and step S20 may further include step S202:
[0096] Step S202: Based on the asynchronous call relationship, the traffic to be published is sent to the first grayscale environment consumer through the second grayscale message queue instance, and the second grayscale traffic publishing result sent by the first grayscale environment consumer is received.
[0097] The grayscale traffic verification system distributes the traffic to be released from the second grayscale message queue instance to the first grayscale environment consumer through an asynchronous call relationship, and receives the second grayscale traffic release result sent by the first grayscale environment consumer.
[0098] It should be noted that the asynchronous call relationship is a calling mechanism that allows the sender to continue other operations without waiting for the receiver to complete the processing. It can improve the system's responsiveness and concurrent processing capabilities and is suitable for high-traffic scenarios.
[0099] In this implementation, the asynchronous call relationship is used to avoid traffic conflicts in high-concurrency situations, ensuring that traffic between different versions can be processed independently, reducing the impact on the existing system, and improving the utilization efficiency of system resources by reasonably allocating traffic to different consumer instances, reducing performance issues caused by resource overload. As a result, the asynchronous call and precise traffic control are effectively combined, which not only improves the system's responsiveness, but also strengthens risk management and function verification, ensuring that new functions can be released efficiently and safely.
[0100] In another feasible implementation manner, before step S202, steps S601 to S602 may also be included:
[0101] Step S601, when the instance calling relationship is an asynchronous calling relationship, receiving a consumer capability change request;
[0102] Step S602: According to the consumer capability change request, the capability of the first formal environment consumer in the downstream service is changed through a preset registration center to obtain the first grayscale environment consumer.
[0103] When the instance call relationship is an asynchronous call relationship, the grayscale traffic verification system receives a consumer capability change request, and then based on the consumer capability change request, changes the capabilities of the first formal environment consumer in the downstream service through the preset registration center to obtain the first grayscale environment consumer, ensuring that the first formal environment consumer can be adjusted according to the new traffic requirements to maintain service performance and availability, thereby generating the first grayscale environment consumer for testing.
[0104] It should be noted that a consumer capacity change request is a signal or message indicating that a consumer instance needs to increase or decrease its processing capacity, which may involve adjustments in the number of instances, number of threads, memory limits, etc.
[0105] For example, refer to Figure 5 , Figure 5 A schematic diagram of the message queue calling relationship provided in Example 2 of the present application.
[0106] Specifically, with the capabilities of the grayscale registration module, the message queue of the asynchronous call relationship can also quickly realize the full-link calling capability. The message queue producer can treat the downstream consumer as a service provider and change the consumer's capabilities by controlling the service, from a formal environment consumer to a grayscale environment consumer, or even isolate the consumer. This greatly enhances the capabilities of the service instance and can more finely control the roles and states of different instances.
[0107] In this implementation, as the scale of the system expands, the management of consumers becomes increasingly complex. By changing the capabilities of the registration center, the consumer management process is simplified, the complexity of operation and maintenance is reduced, and when a service failure occurs, the consumer capabilities can be quickly adjusted to avoid affecting the entire system, thereby improving the system's fault tolerance and fault recovery speed. In this way, dynamic and flexible consumer capability management can be achieved, improving the adaptability and efficiency of the system, while solving a series of technical problems such as traffic fluctuations, capability lags, system complexity management, and fault recovery, ensuring the stability and reliability of the system in a high-concurrency environment.
[0108] In this embodiment, by accurately matching consumer instances, the problem of uneven traffic distribution is avoided, ensuring that each consumer receives appropriate traffic according to its capabilities, and grayscale release is achieved. By routing requests through the entire link, new functions can be gradually introduced to reduce the impact of problems on the entire platform. The real-time data acquisition of the registration center enables the system to quickly adapt to changes in business needs and reduce downtime or performance degradation caused by environmental changes. As a result, not only the flexibility and response speed of the system are enhanced, but also the security of traffic management and function release is optimized, which helps to improve the stability of the overall service and user experience.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the grayscale flow verification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0110] This application also provides a grayscale flow verification device, please refer to Figure 6 , the grayscale flow verification device comprises:
[0111] The traffic receiving module 10 is used to receive the traffic to be published sent by the upstream service;
[0112] The traffic publishing module 20 is used to publish the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receive the grayscale traffic publishing result sent by the downstream service. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module;
[0113] The traffic verification module 30 is used to perform grayscale traffic verification according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0114] Optionally, the instance call relationship is a call relationship based on the hypertext transfer protocol, the grayscale message queue instance is a first grayscale message queue instance, the downstream service includes a downstream consumer, the grayscale traffic publishing result is a first grayscale traffic publishing result, and the traffic publishing module 20 is further used to:
[0115] Based on the call relationship based on the hypertext transfer protocol, and according to the first grayscale message queue instance, obtaining pre-generated instance flag data from a preset registration center;
[0116] According to the instance flag data, determining that the downstream consumer instance that is consistent with the grayscale state of the first grayscale message queue instance is the first consumer instance;
[0117] Generate a full-link grayscale routing request according to the instance flag data;
[0118] Through the first grayscale message queue instance, the traffic to be published is published to the first consumer instance, and the first grayscale traffic publishing result sent by the first consumer instance is received, and the full-link grayscale routing request is sent to the first consumer instance, so that the downstream service performs corresponding full-link grayscale routing.
[0119] Optionally, before the step of publishing the traffic to be published to a downstream service based on a pre-registered grayscale message queue instance and a preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service, it also includes:
[0120] When the instance calling relationship is a calling relationship based on the Hypertext Transfer Protocol, receiving a grayscale message queue instance registration request;
[0121] By means of a preset grayscale registration module, according to the grayscale message queue instance registration request, the root message queue instance is changed to the first grayscale message queue instance;
[0122] According to the first grayscale message queue instance, the instance flag data is generated and sent to the registration center.
[0123] Optionally, the instance call relationship is an asynchronous call relationship, the grayscale message queue instance is a second grayscale message queue instance, the downstream service includes a pre-acquired first grayscale environment consumer, the grayscale traffic publishing result is a second grayscale traffic publishing result, and the traffic publishing module 20 is further used to:
[0124] Based on the asynchronous call relationship, the to-be-published traffic is sent to the first grayscale environment consumer through the second grayscale message queue instance, and the second grayscale traffic publishing result sent by the first grayscale environment consumer is received.
[0125] Optionally, before the step of sending the to-be-published traffic to the first grayscale environment consumer through the second grayscale message queue instance based on the asynchronous call relationship and receiving the second grayscale traffic publishing result sent by the first grayscale environment consumer, it also includes:
[0126] When the instance calling relationship is an asynchronous calling relationship, receiving a consumer capability change request;
[0127] According to the consumer capability change request, the capability of the first formal environment consumer in the downstream service is changed through a preset registration center to obtain the first grayscale environment consumer.
[0128] Optionally, the downstream service includes a second grayscale environment consumer, and after the step of performing grayscale traffic verification according to the grayscale traffic publishing result and obtaining the grayscale traffic verification result, the step further includes:
[0129] When the grayscale traffic verification result indicates that the grayscale traffic verification is successful, receiving a consumer status change request;
[0130] Through a preset registration center, according to the consumer status change request, the status of the second grayscale environment consumer is changed to obtain a second formal environment consumer, so that the second formal environment consumer consumes formal traffic.
[0131] The grayscale flow verification device provided by the present application adopts the grayscale flow verification method in the above-mentioned embodiment, which can solve the technical problem that the existing grayscale scheme cannot divide the formal instance and the grayscale instance from the perspective of the fundamental instance. Compared with the prior art, the beneficial effects of the grayscale flow verification device provided by the present application are the same as the beneficial effects of the grayscale flow verification method provided by the above-mentioned embodiment, and the other technical features in the grayscale flow verification device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0132] The present application provides a grayscale flow verification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the grayscale flow verification method in the above-mentioned embodiment one.
[0133] Reference below Figure 7, which shows a schematic diagram of the structure of a grayscale flow verification device suitable for implementing the embodiment of the present application. The grayscale flow verification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The grayscale flow verification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0134] like Figure 7 As shown, the grayscale flow verification device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the grayscale flow verification device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the grayscale flow verification device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a grayscale flow verification device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0135] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0136] The grayscale flow verification device provided by the present application adopts the grayscale flow verification method in the above embodiment, which can solve the technical problem that the existing grayscale scheme cannot divide the formal instance and the grayscale instance from the perspective of the fundamental instance. Compared with the prior art, the beneficial effects of the grayscale flow verification device provided by the present application are the same as the beneficial effects of the grayscale flow verification method provided by the above embodiment, and the other technical features in the grayscale flow verification device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.
[0137] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0139] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the grayscale flow verification method in the above-mentioned embodiment.
[0140] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0141] The above-mentioned computer-readable storage medium may be included in the grayscale flow verification device; or it may exist independently without being assembled into the grayscale flow verification device.
[0142] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the grayscale flow verification device, the grayscale flow verification device:
[0143] Receive the traffic to be published sent by the upstream service;
[0144] Based on the pre-registered grayscale message queue instance and the preset instance call relationship, the traffic to be released is released to the downstream service, and the grayscale traffic release result sent by the downstream service is received. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module;
[0145] Grayscale traffic verification is performed according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
[0146] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0148] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0149] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned grayscale flow verification method, and can solve the technical problem that the existing grayscale scheme cannot divide formal instances and grayscale instances from the perspective of fundamental instances. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the grayscale flow verification method provided by the above-mentioned embodiment, and will not be repeated here.
[0150] The present application also provides a computer program product, including a computer program, which implements the steps of the grayscale flow verification method as described above when executed by a processor.
[0151] The computer program product provided by the present application can solve the technical problem that the existing grayscale solution cannot divide the formal instance and the grayscale instance from the perspective of the fundamental instance. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the grayscale flow verification method provided by the above embodiment, which will not be repeated here.
[0152] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A grayscale flow verification method, characterized in that: The method comprises: Receive the traffic to be published sent by the upstream service; Based on the pre-registered grayscale message queue instance and the preset instance call relationship, the traffic to be released is released to the downstream service, and the grayscale traffic release result sent by the downstream service is received. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module; Grayscale traffic verification is performed according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
2. The method according to claim 1, characterized in that The instance call relationship is a call relationship based on the Hypertext Transfer Protocol, the grayscale message queue instance is a first grayscale message queue instance, the downstream service includes a downstream consumer, the grayscale traffic publishing result is a first grayscale traffic publishing result, and the steps of publishing the to-be-published traffic to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service include: Based on the call relationship based on the hypertext transfer protocol, and according to the first grayscale message queue instance, obtaining pre-generated instance flag data from a preset registration center; According to the instance flag data, determining that the downstream consumer instance that is consistent with the grayscale state of the first grayscale message queue instance is the first consumer instance; Generate a full-link grayscale routing request according to the instance flag data; Through the first grayscale message queue instance, the traffic to be published is published to the first consumer instance, and the first grayscale traffic publishing result sent by the first consumer instance is received, and the full-link grayscale routing request is sent to the first consumer instance, so that the downstream service performs corresponding full-link grayscale routing.
3. The method according to claim 2, characterized in that Before the step of publishing the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service, it also includes: When the instance calling relationship is a calling relationship based on the Hypertext Transfer Protocol, receiving a grayscale message queue instance registration request; By means of a preset grayscale registration module, according to the grayscale message queue instance registration request, the root message queue instance is changed to the first grayscale message queue instance; According to the first grayscale message queue instance, the instance flag data is generated and sent to the registration center.
4. The method according to claim 1, characterized in that The instance call relationship is an asynchronous call relationship, the grayscale message queue instance is a second grayscale message queue instance, the downstream service includes a pre-acquired first grayscale environment consumer, the grayscale traffic publishing result is a second grayscale traffic publishing result, and the steps of publishing the to-be-published traffic to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receiving the grayscale traffic publishing result sent by the downstream service include: Based on the asynchronous call relationship, the traffic to be published is sent to the first grayscale environment consumer through the second grayscale message queue instance, and the second grayscale traffic publishing result sent by the first grayscale environment consumer is received.
5. The method according to claim 4, characterized in that Before the step of sending the to-be-published traffic to the first grayscale environment consumer through the second grayscale message queue instance based on the asynchronous call relationship and receiving the second grayscale traffic publishing result sent by the first grayscale environment consumer, the step further includes: When the instance calling relationship is an asynchronous calling relationship, receiving a consumer capability change request; According to the consumer capability change request, the capability of the first formal environment consumer in the downstream service is changed through a preset registration center to obtain the first grayscale environment consumer.
6. The method according to claim 1, characterized in that The downstream service includes a second grayscale environment consumer. After the step of performing grayscale traffic verification according to the grayscale traffic publishing result and obtaining the grayscale traffic verification result, the step further includes: When the grayscale traffic verification result indicates that the grayscale traffic verification is successful, receiving a consumer status change request; Through a preset registration center, according to the consumer status change request, the status of the second grayscale environment consumer is changed to obtain a second formal environment consumer, so that the second formal environment consumer consumes formal traffic.
7. A grayscale flow verification device, characterized in that: The device comprises: Traffic receiving module, used to receive the traffic to be published sent by the upstream service; A traffic publishing module, used to publish the traffic to be published to the downstream service based on the pre-registered grayscale message queue instance and the preset instance call relationship, and receive the grayscale traffic publishing result sent by the downstream service. The grayscale message queue instance is generated by registering the preset root message queue instance by the preset grayscale registration module; The traffic verification module is used to perform grayscale traffic verification according to the grayscale traffic publishing result to obtain a grayscale traffic verification result.
8. A grayscale flow verification device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the grayscale flow verification method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the grayscale flow verification method as described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the grayscale flow verification method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Grayscale release method, device and equipment and readable storage medium
CN112087325A
Non-intrusive application gray release control method
CN115665230A
Micro-service grayscale edition issuing method, device and equipment and storage medium thereof
CN116483425A
Service Upgrade Management Method, Apparatus, And Storage Medium
US20210011834A1