Gray release method and device, equipment, storage medium and computer program product

By generating grayscale publishing parameters and combining different types of switch routing, the poor universality of message middleware RabbitMQ and Kafka is solved, and flexible and reliable grayscale publishing support is achieved, suitable for multiple message switch types and complex publishing. Strategy.

CN119316467APending Publication Date: 2025-01-14CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411293040.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The grayscale publishing functions of the message middleware RabbitMQ and Kafka lack flexibility and universality, resulting in poor universality and ineffective support of multiple message switch types and complex publishing strategies.

Method used

Generate grayscale publishing parameters through preset public packages, create grayscale themes, temporary consumer group identifications and access control lists, and combine different types of switches (direct connections, topics, broadcasts, delay switches) to route messages to achieve the RabbitMQ and Kafka grayscale release support.

Benefits of technology

It improves the universality of message middleware, supports multiple message switch types and complex publishing strategies, ensures the flexibility and reliability of grayscale publishing, and reduces publishing risks and resource costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316467A_ABST
    Figure CN119316467A_ABST
Patent Text Reader

Abstract

The invention discloses a gray level release method, device and equipment, a storage medium and a computer program product, and relates to the technical field of the Internet, and the gray level release method comprises the steps: receiving a gray level release request sent by a consumption end; generating a gray release message according to the gray release request; and based on a pre-acquired gray release parameter, according to the gray release message, performing gray release on a corresponding application through message middleware to obtain a gray release result. According to the method and the device, function support is provided for the most common message middleware of RabbitMQ and Kafka according to the gray release parameter generated by the public packet, the technical problem of poor universality of the message middleware in the prior art is solved, and the universality of the message middleware for gray release is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a grayscale publishing method, device, equipment, storage medium and computer program product. Background Art

[0002] Currently, there are relatively complete grayscale traffic control solutions for http request traffic in the industry. For message queue (MQ) traffic, Alibaba's RocketMQ can achieve the distribution and consumption of grayscale traffic and formal traffic through the component's message tag (Tag) filtering feature. However, the message middleware RabbitMQ itself does not have advanced features like RocketMQ's internal message filtering. NetEase Cloud Commerce distinguishes grayscale environments through environmental information, and writes grayscale messages to grayscale topics (Topic) as a whole to achieve grayscale verification. NetEase Cloud Commerce's solution for Kafka grayscale is not flexible and universal, and the versatility of the message middleware is poor.

[0003] 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

[0004] The main purpose of this application is to provide a grayscale publishing method, device, equipment, storage medium and computer program product, aiming to solve the technical problem of poor versatility of message middleware.

[0005] To achieve the above objectives, the present application proposes a grayscale release method, which is applied to the production end and includes:

[0006] Receive the grayscale release request sent by the consumer;

[0007] Generate a grayscale release message according to the grayscale release request;

[0008] Based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through the message middleware to obtain the grayscale publishing result.

[0009] In one embodiment, based on the pre-acquired grayscale release parameters and according to the grayscale release message, grayscale release is performed on the corresponding application through the message middleware, and before the step of obtaining the grayscale release result, the step also includes:

[0010] Through the preset public package, according to the grayscale release request, a grayscale topic, a temporary consumer group identifier and an access control list are created;

[0011] Injecting the grayscale subject, temporary consumer group identifier and access control list into the preset original annotation parameters to obtain the grayscale annotation parameters;

[0012] The grayscale publishing parameters are obtained according to the grayscale annotation parameters.

[0013] In one embodiment, based on the pre-acquired grayscale release parameters and according to the grayscale release message, the step of performing grayscale release on the corresponding application through the message middleware to obtain the grayscale release result includes:

[0014] When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through a preset type of switch to obtain the grayscale publishing result.

[0015] In one embodiment, the grayscale publishing result is a first grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes:

[0016] When the switch of the preset type is a direct-connected switch, based on the routing binding relationship in the grayscale publishing parameters, the grayscale publishing message is delivered to the preset first queue through the direct-connected switch;

[0017] Through the first queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the first grayscale release result.

[0018] In one embodiment, the grayscale publishing result is a second grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes:

[0019] When the preset type of switch is a topic switch, based on the regular paradigm data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset second queue through the topic switch;

[0020] Through the second queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the second grayscale release result.

[0021] In one embodiment, the grayscale publishing result is a third grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes:

[0022] When the preset type of switch is a broadcast switch, based on the queue grayscale configuration data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset third queue through the broadcast switch;

[0023] Through the third queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the third grayscale release result.

[0024] In one embodiment, the grayscale publishing result is a fourth grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a preset type of switch. The step of obtaining the grayscale publishing result includes:

[0025] When the preset type of switch is a delay switch, based on the delay message in the grayscale publishing parameter, the grayscale publishing message is delivered to a preset fourth queue through the delay switch;

[0026] Through the fourth queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the fourth grayscale release result.

[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a grayscale publishing device, which includes:

[0028] The request receiving module is used to receive the grayscale release request sent by the consumer end;

[0029] A message generation module, used to generate a grayscale release message according to the grayscale release request;

[0030] The grayscale publishing module is used to perform grayscale publishing on the corresponding application through the message middleware based on the pre-acquired grayscale publishing parameters and the grayscale publishing message to obtain the grayscale publishing result.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a grayscale release device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the grayscale release method described above.

[0032] 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 a processor, the steps of the grayscale release method described above are implemented.

[0033] 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 release method described above.

[0034] The present application provides a grayscale publishing method, which provides functional support for the two most commonly used message middlewares, RabbitMQ and Kafka, based on the grayscale publishing parameters generated by the public package, solves the technical problem of poor versatility of message middleware in the prior art, and improves the versatility of message middleware for grayscale publishing. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] 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.

[0036] 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.

[0037] Figure 1 A flowchart of the first embodiment of the grayscale release method of the present application is provided;

[0038] Figure 2 A flowchart of the second embodiment of the grayscale release method of the present application is provided;

[0039] Figure 3 A schematic diagram of a process for grayscale release through a direct-connected switch provided in Embodiment 2 of the present application;

[0040] Figure 4 A schematic diagram of the process of grayscale publishing through a theme switch provided in the second embodiment of the present application;

[0041] Figure 5 A schematic diagram of a process for grayscale publishing via a broadcast switch provided in Embodiment 2 of the present application;

[0042] Figure 6 A schematic diagram of the process of grayscale release through a delay switch provided in the second embodiment of the present application;

[0043] Figure 7 A schematic diagram of the process of grayscale publishing through Kafka message middleware provided in Example 2 of the present application;

[0044] Figure 8 A schematic diagram of the system functional architecture of the grayscale publishing method provided in Example 2 of the present application;

[0045] Fig. 9 A schematic diagram of the technical principles of general components of the grayscale publishing method provided in Example 2 of the present application;

[0046] Fig.10 This is a schematic diagram of the module structure of the grayscale publishing device according to an embodiment of the present application;

[0047] Fig.11 This is a schematic diagram of the device structure of the hardware operating environment involved in the grayscale publishing method in the embodiment of the present application.

[0048] 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

[0049] 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.

[0050] 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.

[0051] The main solutions of the embodiments of this application are:

[0052] Receive the grayscale release request sent by the consumer;

[0053] Generate a grayscale release message according to the grayscale release request;

[0054] Based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through the message middleware to obtain the grayscale publishing result.

[0055] In the existing technology, Alibaba's RocketMQ can achieve the distribution and consumption of grayscale traffic and formal traffic through the message tag filtering characteristics of the components, but the message middleware RabbitMQ itself does not have advanced features similar to RocketMQ's internal message filtering; NetEase Cloud Commerce distinguishes the grayscale environment through environmental information, and writes grayscale messages to the grayscale Topic as a whole to achieve grayscale verification. The NetEase Cloud Commerce solution is not flexible and universal for Kafka grayscale, and the versatility of the message middleware is poor.

[0056] The present application provides a solution, which provides functional support for the two most commonly used message middlewares, RabbitMQ and Kafka, based on the grayscale release parameters generated by the public package. It solves the technical problem of poor versatility of message middleware in the prior art and improves the versatility of message middleware for grayscale release.

[0057] Among them, RabbitMQ is an open source messaging middleware used to implement and manage message queues based on AMQP (Advanced Message Queuing Protocol); Kafka is a distributed stream processing platform developed by the Apache Software Foundation for high-throughput, low-latency messaging and stream processing.

[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 release system, etc. The grayscale release system is taken as an example to illustrate this embodiment and the following embodiments.

[0059] Based on this, the present application embodiment provides a grayscale release method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the grayscale release method of the present application.

[0060] In this embodiment, the grayscale publishing method is applied to the production end of the grayscale publishing system, and the method includes steps S10 to S30:

[0061] Step S10, receiving a grayscale publishing request sent by a consumer end;

[0062] It should be noted that the grayscale release request usually includes key information such as the target application, version information, policy settings, etc. By sending the request, the consumer side clarifies the grayscale release operation that needs to be performed.

[0063] Step S20, generating a grayscale release message according to the grayscale release request;

[0064] The production end receives a grayscale release request, which usually contains information such as the release version, target users, and release strategy. It then parses the parameters in the request, such as version number, target range, schedule, etc. Finally, based on the parsing results, it constructs a message containing the grayscale release details to obtain a grayscale release message. This message usually includes new version information, release strategy, user or server range, etc.

[0065] Step S30, based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through the message middleware to obtain a grayscale publishing result.

[0066] The production end uses the message middleware to send the application grayscale release message to the target application and perform the actual release operation. Through the preset grayscale release parameters, the system can control the scope and rhythm of the release and gradually launch the new version to users. Finally, the grayscale release results are obtained through the message middleware, which helps to monitor the application status, evaluate the release effect, and make necessary adjustments. This ensures a smooth release process, timely discovers and solves problems, and optimizes user experience.

[0067] In a feasible implementation manner, before step S30, steps S401 to S403 may also be included:

[0068] Step S401, creating a grayscale topic, a temporary consumer group identifier and an access control list according to the grayscale publishing request through a preset public package;

[0069] Step S402, injecting the grayscale subject, temporary consumer group identifier and access control list into the preset original annotation parameters to obtain grayscale annotation parameters;

[0070] Step S403: Obtain the grayscale publishing parameters according to the grayscale annotation parameters.

[0071] Based on the application's grayscale release request, the production end generates the topics, consumer group IDs, and access control lists required for the release through the public package. These elements are used to manage message delivery and access rights, provide the necessary message channels and permission configuration for the release process, and ensure that messages can be correctly delivered and processed. The created grayscale topics, temporary consumer group IDs, and access control lists are then injected into the preset original annotation parameters to obtain the grayscale annotation parameters, which will be used for the actual configuration in the application. Finally, the grayscale annotation parameters are parsed, and based on the parsed annotation parameters, grayscale release parameters are created. These parameters usually include configuration details for actual grayscale release operations.

[0072] It should be noted that the public package is a predefined code or toolkit that contains some common functions and configurations. It can be used to create and manage topics, consumer groups and access control, provide the basic functions and configurations required to create grayscale releases, and make the whole process more standardized and automated. It can provide the basic functions and configurations required to create grayscale releases, and make the whole process more standardized and automated. A grayscale topic is a classification identifier in a messaging system, used to process messages of different versions. A consumer group is a collection of clients that process messages. Temporary identifiers can be used to distinguish different release stages or test groups. Access control lists (ACLs) are used to set permissions and control access to messages. Raw annotation parameters refer to parameters used to mark or configure specific functions in the code, and are usually used for configuration in frameworks or libraries. These parameters define the basic structure of the annotation and the required configuration items, but do not contain specific grayscale release information.

[0073] In this embodiment, a grayscale topic, a temporary consumer group identifier and an access control list are created according to the grayscale publishing request through a preset public package; the grayscale topic, temporary consumer group identifier and access control list are injected into the preset original annotation parameters to obtain the grayscale annotation parameters; according to the grayscale annotation parameters, the grayscale publishing parameters are obtained. By creating topics, consumer groups and configuring access control, it is ensured that each link in the publishing process is executed as expected. Through the combination of access control lists and grayscale annotation parameters, flexible permission management is provided to ensure the security of publishing. The generated grayscale publishing parameters can guide the publishing operation in real time, and monitor and adjust the publishing strategy in time. Therefore, by setting topics and consumer groups, it is ensured that messages can be accurately delivered to the target system. Through the configuration of the access control list, the security of the system is improved to prevent unauthorized access and operation. By injecting and generating detailed grayscale publishing parameters, configuration consistency is ensured to reduce the occurrence of publishing errors and problems.

[0074] This embodiment provides a grayscale publishing method, which provides functional support for the two most commonly used message middlewares, RabbitMQ and Kafka, based on the grayscale publishing parameters generated by the public package. It solves the technical problem of poor versatility of message middleware in the prior art and improves the versatility of message middleware performing grayscale publishing.

[0075] 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 2 , step S30 may further include step S301:

[0076] Step S301, when the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a preset type of switch to obtain the grayscale publishing result.

[0077] When the message middleware is RabbitMQ, the production end configures a preset type of switch based on the grayscale release parameters, where the RabbitMQ switch determines the message routing method, and then sends the grayscale release message to the target application through the configured switch for grayscale release to obtain the grayscale release result, where the grayscale release message contains the specific content and instructions of the grayscale release.

[0078] In a feasible implementation manner, the grayscale publishing result is a first grayscale publishing result, and step S301 may include steps S30111 to S30112:

[0079] Step S30111: When the switch of the preset type is a direct-connected switch, based on the routing binding relationship in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset first queue through the direct-connected switch;

[0080] Step S30112: Perform a grayscale release on the corresponding application according to the grayscale release message through the first queue to obtain the first grayscale release result.

[0081] When the preset type of switch is a direct-connected switch, the production end delivers the grayscale release message to the preset first queue through the direct-connected switch based on the routing binding relationship in the grayscale release parameters, and then grayscale releases the corresponding application through the first queue according to the grayscale release message to obtain the first grayscale release result.

[0082] It should be noted that a direct-connected switch is a type of message switch that directly routes messages to one or more specified queues, which can simplify the message routing process, reduce intermediate links, and enable messages to be directly delivered to the predetermined queues; routing binding relationships refer to message routing rules configured on a direct-connected switch, which define which messages will be sent to which queue. Through these binding relationships, a direct-connected switch can accurately deliver messages to the corresponding queues based on their content and type.

[0083] For example, refer to Figure 3 , Figure 3 A schematic diagram of the process of grayscale release through a direct switch provided in Example 2 of the present application.

[0084] After the producer application P delivers the message to the EX switch, the EX switch delivers the message to the corresponding queue according to the routing binding, and then it is consumed by the downstream C1 / C2 consumers. In the simple scenario of a direct switch, when the application starts, the public package automatically copies the existing bindings, automatically creates a direct type EX.GRAY grayscale switch, and automatically creates downstream grayscale queues Q1.GRAY, Q2.GRAY, and grayscale bindings.

[0085] When multiple queues correspond to the same routing key, the direct switch has a broadcast feature. When a message specifying the routing key is written, both downstream Q1 and Q2 will receive the message. At this time, if only the grayscale configuration of the Q1 producer is adjusted, the grayscale message cannot be distributed to Q2.GRAY, resulting in message leakage. Therefore, by verifying the twin configuration in broadcast mode, the grayscale configuration is adjusted for the twin queues of the same producer, ensuring that there is no leakage of grayscale messages in direct switch-like broadcast situations.

[0086] In this embodiment, when the preset type of switch is a direct-connected switch, based on the routing binding relationship in the grayscale publishing parameters, the grayscale publishing message is delivered to the preset first queue through the direct-connected switch; through the first queue, the corresponding application is grayscale published according to the grayscale publishing message, and the first grayscale publishing result is obtained, ensuring that the message can be accurately delivered to the target queue according to the configuration, reducing the risk of message loss or erroneous delivery, and achieving fine control of the grayscale publishing process through precise routing and queue management. By collecting the publishing results, the publishing effect can be evaluated in real time and necessary adjustments can be made to reduce the publishing risk.

[0087] In another feasible implementation manner, the grayscale publishing result is a second grayscale publishing result, and step S301 may include steps S30121 to S30122:

[0088] Step S30121: When the preset type of switch is a topic switch, based on the regular paradigm data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset second queue through the topic switch;

[0089] Step S30122: Perform a grayscale release on the corresponding application according to the grayscale release message through the second queue to obtain the second grayscale release result.

[0090] When the switch type is a topic switch, the production end delivers the grayscale release message to the preset second queue through the topic switch based on the regular paradigm data in the grayscale release parameters, and then grayscale releases the corresponding application through the second queue according to the grayscale release message to obtain the second grayscale release result.

[0091] It should be noted that a topic switch is a message switch that routes messages to one or more queues based on the subject of the message. It is suitable for multi-channel message distribution; regular paradigm data can define the pattern of message routing rules for matching and filtering messages.

[0092] For example, refer to Figure 4 , Figure 4 A schematic diagram of the process of grayscale publishing through a topic switch provided in Example 2 of the present application.

[0093] In addition to direct connection scenarios and broadcast-like scenarios similar to direct type switches, topic switches have routingkey regularization implemented with # and *. When storing traffic ratio information in the producer application memory, the switch name, routingkey, traffic ratio or whitelist information cannot be simply stored. Regularization processing is required, where the RabbitMQ regularization symbol * is mapped to (\\w)+, . is mapped to \\., and # is mapped to (\\S)*, ensuring that the user-defined routingkey can be correctly matched with the original RabbitMQ regularization paradigm.

[0094] In this implementation, when the preset type of switch is a topic switch, based on the regular paradigm data in the grayscale publishing parameters, the grayscale publishing message is delivered to the preset second queue through the topic switch; through the second queue, the corresponding application is grayscale published according to the grayscale publishing message to obtain the second grayscale publishing result. Through the combination of the topic switch and the regular paradigm data, the problem of inaccurate message routing is solved, and accurate message routing is achieved. Through accurate message delivery and control, the reliability of the grayscale publishing process is ensured, and the appropriate processing method is selected according to the needs. Batch processing and real-time processing are supported, the efficiency of message processing is optimized, the delay and burden of the system are reduced, and the flexibility and response speed of the system are improved.

[0095] In another feasible implementation manner, the grayscale publishing result is a third grayscale publishing result, and step S301 may include steps S30131 to S30132:

[0096] Step S30131: When the preset type of switch is a broadcast switch, based on the queue grayscale configuration data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset third queue through the broadcast switch;

[0097] Step S30132: Perform a grayscale release on the corresponding application according to the grayscale release message through the third queue to obtain the third grayscale release result.

[0098] When the preset type of switch is a broadcast switch, the production end delivers the grayscale release message to the preset third queue through the broadcast switch based on the queue grayscale configuration data in the grayscale release parameters, and then uses the third queue to grayscale release the corresponding application according to the grayscale release message to obtain the third grayscale release result.

[0099] It should be noted that the broadcast switch can broadcast the received messages to all bound queues, not just a specific queue, so as to realize multi-target grayscale release and send messages to multiple queues at the same time; the queue grayscale configuration data defines how messages are distributed to different queues and controls how the broadcast switch routes messages to each target queue.

[0100] For example, refer to Figure 5 , Figure 5 A schematic diagram of the process of grayscale publishing through a broadcast switch provided in Embodiment 2 of the present application.

[0101] When adjusting grayscale traffic, it is necessary to ensure that all grayscale brother queues of the broadcast (fanout) switch can receive the same message. Because the grayscale component can grayscale a single Q granularity, if the user does not configure grayscale for Q3, directly switching traffic will result in the message not being delivered to Q3.GRAY normally. Automatically detect the grayscale configuration of all Qs of the fanout switch. If the brother Q grayscale configuration is incomplete, it will prompt that traffic adjustment is not allowed. Otherwise, one-click adjustment of all Q traffic can be performed.

[0102] In this implementation, when the preset type of switch is a broadcast switch, based on the queue grayscale configuration data in the grayscale release parameters, the grayscale release message is delivered to a preset third queue through the broadcast switch; through the third queue, the corresponding application is grayscale released according to the grayscale release message, and the third grayscale release result is obtained. By broadcasting to multiple queues, the problem of insufficient test coverage that may be caused by a single queue is overcome. The phased release and feedback mechanism reduces the direct impact of the new version on the production environment and reduces the release risk. Release and testing are performed in parallel in multiple target applications to quickly obtain feedback on the performance of the new version.

[0103] In another feasible implementation manner, the grayscale publishing result is a third grayscale publishing result, and step S301 may include steps S30141 to S30142:

[0104] Step S30141: When the preset type of switch is a delay switch, based on the delay message in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset fourth queue through the delay switch;

[0105] Step S30142: Perform grayscale publishing on the corresponding application according to the grayscale publishing message through the fourth queue to obtain the fourth grayscale publishing result.

[0106] When the preset type of switch is a delayed switch, the production end delivers the grayscale release message to the preset fourth queue through the delayed switch based on the delay message in the grayscale release parameters, and then grayscale releases the corresponding application through the fourth queue according to the grayscale release message to obtain the fourth grayscale release result.

[0107] For example, refer to Figure 6 , Figure 6 A schematic diagram of the process of grayscale release through a delay switch provided in Example 2 of the present application.

[0108] The x-delayed-message delayed switch automatically creates a CustomExchange and specifies the real switch type in the arguments to complete the creation of the grayscale delayed switch and automatically bind it to the queue and routingkey. The public package provides a delayed message writing API sendDelayedMessage, which can specify a personalized delay duration by entering the parameter milliseconds.

[0109] In this embodiment, when the preset type of switch is a delay switch, based on the delay message in the grayscale release parameters, the grayscale release message is delivered to the preset fourth queue through the delay switch; through the fourth queue, the corresponding application is grayscale released according to the grayscale release message to obtain the fourth grayscale release result. The delay switch can flexibly control the delivery time of the message, which is helpful to gradually release and test the new version. Accurate grayscale release is performed through the fourth queue to ensure that the release process meets expectations and collects effective feedback, ensuring that the grayscale release of the new version can proceed as planned. At the same time, the release rhythm is controlled through the delay mechanism, and the efficiency and effect of grayscale release are improved through delay and queue processing.

[0110] In addition, illustratively, referring to Figure 7 , Figure 7 A flowchart of grayscale publishing through Kafka message middleware provided in Example 2 of the present application.

[0111] If the current application is a producer, the public package will automatically create a topic for receiving traffic adjustment messages, as well as a temporary consumer group ID (groupId) and ACL. By scanning the consumption annotation @CommKafkaConsumer in the application, the grayscale consumption information is replaced, and the user-configured grayscale topic and groupId are injected into the annotation parameters to achieve automatic binding of grayscale applications with grayscale topics and other information.

[0112] When producing messages through the CommKafkaProducer.sendMsg method, the original topic information is intercepted and the percentage traffic is distributed according to the random algorithm. When consuming messages, you can specify the topic and groupId through the annotation @CommKafkaConsumer(topic="${key:value}",groupId="${key:value}").

[0113] In addition, when the connection between the application and RabbitMQ is disconnected due to network jitter, the temporary anonymous queue AnonymousQueue will be automatically deleted, the thread will not be able to consume messages, and the instance will not be able to receive traffic adjustment messages. Therefore, by declaring Bean to register AnonymousQueue, GrayFanoutExchange, and GrayBinding object instances, the temporary anonymous information is persisted to the application memory. When the network is disconnected, the RabbitMQ connection is automatically reconnected, triggering the monitoring event, traversing the specific type of Bean in a Bean scanning manner, and re-executing the registration of queues, switches, and binding relationships. The anonymous queue consumption thread does not need to be changed, and the original anonymous queue monitoring consumption is still maintained, ensuring that each application instance can automatically restore the connection after the network is disconnected and receive traffic adjustment messages normally.

[0114] In this embodiment, when the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through a preset type of switch to obtain the grayscale publishing result. By determining the message middleware, configuring the switch, publishing the message and obtaining the result, an efficient grayscale publishing strategy can be implemented, new functions can be gradually introduced, feedback can be obtained in real time, and the publishing strategy can be adjusted. It can solve the risk control problem in traditional publishing, reduce the potential failures introduced by the new version, and provide a flexible publishing and rollback mechanism.

[0115] For example, in order to help understand the implementation process of the grayscale release method obtained by combining the first embodiment and the second embodiment, please refer to Figure 8 and Figure 8 , Figure 8 This is a schematic diagram of the system functional architecture of the grayscale publishing method provided in Example 2 of the present application. Fig. 9 A schematic diagram of the technical principles of the general components of the grayscale publishing method provided in Example 2 of the present application, specifically:

[0116] The functional architecture of the grayscale release system mainly includes three functional modules: grayscale configuration operation UI, backend general grayscale change service, and RabbitMQ and Kafka production and consumption public packages.

[0117] At the same time, in order to achieve the grayscale release of message middleware with the least possible resources and the simplest possible operation, and support horizontal expansion, the above Figure 8 The technical solution of the process shown mainly includes two parts: public resources and user resources. Among them, public resources include: public front-end and back-end grayscale service applications, databases for storing configuration information, Redis and public packages for storing temporary original and grayscale traffic data; user resources can realize grayscale adjustment message transmission by reusing RabbitMQ / Kafka configured by users themselves, without the need for additional resources.

[0118] Among them, when the application starts:

[0119] 2.1 Pull the production and consumption configuration, store the traffic ratio and customize the whitelist information to the application memory for the producer application.

[0120] 2.2 For consumer applications, automatically create grayscale Q / Topic and bind authentication, identify grayscale applications, and replace the original Q / Topic with grayscale. Producer applications automatically establish anonymous temporary message channels to monitor grayscale traffic adjustment messages.

[0121] In combination with Embodiment 1 and Embodiment 2, the grayscale publishing method described in this embodiment has the following advantages over the prior art:

[0122] 1) For applications involving RabbitMQ and Kafka, the two most commonly used message middleware, grayscale release function support is implemented. This component is universal. If needed, each product developer can introduce public components in the application and adjust and monitor grayscale traffic through the configuration page.

[0123] 2) Highly flexible grayscale granularity: Supports grayscale at queue, topic + group, application, and asynchronous application link granularity, which is suitable for grayscale release of various simple or complex production and consumption relationships. It covers production and consumption relationships such as one-to-one, one-to-many, many-to-one, many-to-many, and self-production and self-consumption within applications, and grayscale support for various switch types and their combination scenarios.

[0124] 3) Availability guarantee at low resource cost: In order to effectively reduce the cost of resource use, without introducing other resource components, by restoring the site and rebuilding temporary bindings, the impact of network interruptions on grayscale traffic adjustment message communication is avoided, thereby improving the availability of grayscale components.

[0125] 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 release method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0126] This application also provides a grayscale publishing device, please refer to Fig.10 , the grayscale release device includes:

[0127] The request receiving module 10 is used to receive the grayscale publishing request sent by the consumer end;

[0128] A message generating module 20, configured to generate a grayscale release message according to the grayscale release request;

[0129] The grayscale publishing module 30 is used to perform grayscale publishing on the corresponding application through the message middleware based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, and obtain the grayscale publishing result.

[0130] Optionally, based on the pre-acquired grayscale release parameters and according to the grayscale release message, grayscale release is performed on the corresponding application through the message middleware, and before the step of obtaining the grayscale release result, the step also includes:

[0131] Through the preset public package, according to the grayscale release request, a grayscale topic, a temporary consumer group identifier and an access control list are created;

[0132] Injecting the grayscale subject, temporary consumer group identifier and access control list into the preset original annotation parameters to obtain the grayscale annotation parameters;

[0133] The grayscale publishing parameters are obtained according to the grayscale annotation parameters.

[0134] Optionally, the grayscale publishing module 30 is further used for:

[0135] When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through a preset type of switch to obtain the grayscale publishing result.

[0136] Optionally, the grayscale publishing result is a first grayscale publishing result, and when the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type, and the step of obtaining the grayscale publishing result includes:

[0137] When the switch of the preset type is a direct-connected switch, based on the routing binding relationship in the grayscale publishing parameters, the grayscale publishing message is delivered to the preset first queue through the direct-connected switch;

[0138] Through the first queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the first grayscale release result.

[0139] Optionally, the grayscale publishing result is a second grayscale publishing result, and when the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type, and the step of obtaining the grayscale publishing result includes:

[0140] When the preset type of switch is a topic switch, based on the regular paradigm data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset second queue through the topic switch;

[0141] Through the second queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the second grayscale release result.

[0142] Optionally, the grayscale publishing result is a third grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type, and the step of obtaining the grayscale publishing result includes:

[0143] When the preset type of switch is a broadcast switch, based on the queue grayscale configuration data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset third queue through the broadcast switch;

[0144] Through the third queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the third grayscale release result.

[0145] Optionally, the grayscale publishing result is a fourth grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes:

[0146] When the preset type of switch is a delay switch, based on the delay message in the grayscale publishing parameter, the grayscale publishing message is delivered to a preset fourth queue through the delay switch;

[0147] Through the fourth queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the fourth grayscale release result.

[0148] The grayscale publishing device provided by the present application adopts the grayscale publishing method in the above embodiment, which can solve the technical problem of poor versatility of the message middleware. Compared with the prior art, the beneficial effects of the grayscale publishing device provided by the present application are the same as the beneficial effects of the grayscale publishing method provided by the above embodiment, and other technical features in the grayscale publishing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0149] The present application provides a grayscale release 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 release method in the above-mentioned embodiment one.

[0150] Reference below Fig.11 , which shows a schematic diagram of the structure of a grayscale publishing device suitable for implementing the embodiment of the present application. The grayscale publishing 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. Fig.11 The grayscale publishing 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.

[0151] like Fig.11As shown, the grayscale publishing device may include a processing device 1001 (e.g., 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 publishing 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 publishing device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a grayscale publishing 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.

[0152] 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.

[0153] The grayscale publishing device provided by the present application adopts the grayscale publishing method in the above embodiment, which can solve the technical problem of poor versatility of the message middleware. Compared with the prior art, the beneficial effects of the grayscale publishing device provided by the present application are the same as the beneficial effects of the grayscale publishing method provided by the above embodiment, and the other technical features in the grayscale publishing device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0154] 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.

[0155] 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.

[0156] 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 publishing method in the above-mentioned embodiment.

[0157] 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.

[0158] The above-mentioned computer-readable storage medium may be included in the grayscale release device; or it may exist independently without being assembled into the grayscale release device.

[0159] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the grayscale publishing device, the grayscale publishing device:

[0160] Receive the grayscale release request sent by the consumer;

[0161] Generate a grayscale release message according to the grayscale release request;

[0162] Based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through the message middleware to obtain the grayscale publishing result.

[0163] 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).

[0164] 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.

[0165] 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.

[0166] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned grayscale publishing method, and can solve the technical problem of poor versatility of message middleware. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the grayscale publishing method provided in the above-mentioned embodiment, and will not be repeated here.

[0167] The present application also provides a computer program product, including a computer program, which implements the steps of the grayscale release method as described above when executed by a processor.

[0168] The computer program product provided by this application can solve the technical problem of poor versatility of message middleware. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the grayscale publishing method provided by the above embodiment, which will not be repeated here.

[0169] 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 release method, characterized in that: The method is applied to the production end, and the method includes: Receive the grayscale release request sent by the consumer; Generate a grayscale release message according to the grayscale release request; Based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through the message middleware to obtain the grayscale publishing result.

2. The method according to claim 1, characterized in that Before the step of performing grayscale publishing on the corresponding application based on the pre-acquired grayscale publishing parameters and the grayscale publishing message through the message middleware to obtain the grayscale publishing result, the step also includes: Through the preset public package, according to the grayscale release request, a grayscale topic, a temporary consumer group identifier and an access control list are created; Injecting the grayscale subject, temporary consumer group identifier and access control list into the preset original annotation parameters to obtain the grayscale annotation parameters; The grayscale publishing parameters are obtained according to the grayscale annotation parameters.

3. The method according to claim 1, characterized in that The step of performing grayscale publishing on the corresponding application through the message middleware based on the pre-acquired grayscale publishing parameters and according to the grayscale publishing message to obtain the grayscale publishing result includes: When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, the corresponding application is grayscale published through a preset type of switch to obtain the grayscale publishing result.

4. The method according to claim 3, characterized in that The grayscale publishing result is a first grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes: When the switch of the preset type is a direct-connected switch, based on the routing binding relationship in the grayscale publishing parameters, the grayscale publishing message is delivered to the preset first queue through the direct-connected switch; Through the first queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the first grayscale release result.

5. The method according to claim 3, characterized in that The grayscale publishing result is a second grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes: When the preset type of switch is a topic switch, based on the regular paradigm data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset second queue through the topic switch; Through the second queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the second grayscale release result.

6. The method according to claim 3, characterized in that The grayscale publishing result is a third grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes: When the preset type of switch is a broadcast switch, based on the queue grayscale configuration data in the grayscale publishing parameters, the grayscale publishing message is delivered to a preset third queue through the broadcast switch; Through the third queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the third grayscale release result.

7. The method according to claim 3, characterized in that The grayscale publishing result is a fourth grayscale publishing result. When the message middleware is RabbitMQ, based on the grayscale publishing parameters and according to the grayscale publishing message, grayscale publishing is performed on the corresponding application through a switch of a preset type. The step of obtaining the grayscale publishing result includes: When the preset type of switch is a delay switch, based on the delay message in the grayscale publishing parameter, the grayscale publishing message is delivered to a preset fourth queue through the delay switch; Through the fourth queue, the corresponding application is released in grayscale according to the grayscale release message to obtain the fourth grayscale release result.

8. A grayscale publishing device, characterized in that: The device comprises: The request receiving module is used to receive the grayscale release request sent by the consumer end; A message generation module, used to generate a grayscale release message according to the grayscale release request; The grayscale publishing module is used to perform grayscale publishing on the corresponding application through the message middleware based on the pre-acquired grayscale publishing parameters and the grayscale publishing message to obtain the grayscale publishing result.

9. A grayscale release 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 release method according to any one of claims 1 to 7.

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 release method according to any one of claims 1 to 7 are implemented.