Gray release method, gray release device, medium and electronic equipment
By dividing first-class services and second-class services at the system level, and gradually switching real-time traffic to second-class services during the grayscale release process, an integrated grayscale release from the gateway layer to the bottom layer of the system is realized, which solves the problem of lack of overall processing in the existing technology and improves the success rate and adaptability of grayscale release.
Patent Information
- Application Number
- CN202311213390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
AI Technical Summary
The existing technology only solves the problem at the gateway level when implementing grayscale release, lacks a holistic solution from the gateway level to the underlying system, and cannot effectively deal with the problem of underlying service calls.
By sending real-time traffic to Class I services first, and after Class II services are launched, the traffic is sent to Class II services and launching Class I services. This solution divides first-class services and second-class services at the system level, and calls their unique sub-services and message queues respectively, thereby realizing an integrated grayscale release from the gateway layer to the bottom layer of the system.
It improves the success rate of grayscale release, enhances the adaptability with the Internet microservice system architecture, reduces the user's perception of the grayscale release process, and reduces the impact of grayscale release on user requests.
Smart Images

Figure CN119668627A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a grayscale publishing method, a grayscale publishing device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Grayscale release refers to a software release strategy that gradually pushes new versions or new features to some users or servers to test their stability and compatibility, and makes adjustments or rollbacks based on feedback. Grayscale release can reduce release risks, improve user experience, and achieve a smooth transition.
[0003] In the related art, the grayscale release is achieved by setting the launch time of the new version / new function of the software to midnight (e.g., 00:00) and notifying users not to use the software during the launch period. Or, further, at the gateway level, the target address that the user traffic needs to reach is controlled and forwarded to the specified service address, so as to achieve grayscale release for the target address.
[0004] However, the process of grayscale release of related technologies is rather one-sided, only solving the problems at the gateway level, and there are still some defects and shortcomings.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute an existing solution known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present application is to provide a grayscale publishing method, a grayscale publishing device, a computer-readable storage medium and an electronic device, which can provide Class I and Class II services. When there is a demand for grayscale publishing, real-time traffic can be sent to the Class I service first, until the Class II service is launched, and then the real-time traffic can be sent to the Class II service, and the Class I service can be launched. Compared with the grayscale publishing at the gateway level only implemented in the related technology, the grayscale publishing solution provided by the present application has stronger integrity. Class I service can call its unique Class I sub-service and apply its unique Class I sub-service call address and Class I message queue. Similarly, Class II service can call its unique Class II sub-service and apply its unique Class II sub-service call address and Class II message queue. Therefore, it can be seen that the present application provides an overall grayscale publishing solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale publishing.
[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0008] According to one aspect of the present application, a grayscale release method is provided, the method comprising:
[0009] In response to the grayscale release requirements, the real-time traffic is sent to the first-class service, and the second-class service is launched; wherein the first-class service is used to call the first-class sub-service to process the real-time traffic according to the first-class sub-service call address and the first-class message queue sent by the remote procedure call service;
[0010] When the second-class service is online, the real-time traffic is sent to the second-class service and the first-class service is online; among them, the second-class service is used to call the second-class sub-service to process the real-time traffic based on the second-class sub-service call address and the second-class message queue sent by the remote procedure call service.
[0011] In an exemplary embodiment of the present application, it further includes:
[0012] The server resources are divided into a plurality of services; wherein the plurality of services include a first-class service and a second-class service.
[0013] In an exemplary embodiment of the present application, it further includes:
[0014] A first service address corresponding to a first type of service and a second service address corresponding to a second type of service are configured in a proxy server; wherein the proxy server is used to forward real-time traffic according to a target script.
[0015] In an exemplary embodiment of the present application, it further includes:
[0016] During the launch of the second-class service, if the service address corresponding to the real-time traffic belongs to the second service address, the service address corresponding to the real-time traffic is modified according to the first service address;
[0017] During the launch of a type of service, if the service address corresponding to the real-time traffic belongs to the first service address, the service address corresponding to the real-time traffic is modified according to the second service address.
[0018] In an exemplary embodiment of the present application, it further includes:
[0019] When the first-class service is online, the real-time traffic will be distributed to the first-class service and the second-class service.
[0020] In an exemplary embodiment of the present application, it further includes:
[0021] In response to the mobile terminal request, during the online process of the second-class service, the mobile terminal request is sent to the first-class service; during the online process of the first-class service, the mobile terminal request is sent to the second-class service.
[0022] In an exemplary embodiment of the present application, in response to a mobile terminal request, during the online process of the second type of service, the mobile terminal request is sent to the first type of service; during the online process of the first type of service, the mobile terminal request is sent to the second type of service, including:
[0023] In response to a mobile terminal request sent by the wireless mobile terminal based on a remote procedure call service, determining a group alias corresponding to the mobile terminal request;
[0024] During the launch of the second-class service, the mobile terminal request is sent to the first-class service based on the group alias;
[0025] During the launch of the first-class service, the mobile terminal request is sent to the second-class service based on the group alias.
[0026] According to one aspect of the present application, a grayscale publishing device is provided, including:
[0027] The first traffic directional sending unit is used to send real-time traffic to the first-class service in response to the grayscale release demand, and launch the second-class service; wherein the first-class service is used to call the first-class sub-service to process the real-time traffic according to the first-class sub-service call address and the first-class message queue sent by the remote procedure call service;
[0028] The second traffic directional sending unit is used to send real-time traffic to the second class service and launch the first class service after the second class service is launched; wherein the second class service is used to call the second class sub-service to process real-time traffic based on the second class sub-service call address and the second class message queue sent by the remote procedure call service.
[0029] In an exemplary embodiment of the present application, it further includes:
[0030] The service resource division unit is used to divide the server resources into multiple services; wherein the multiple services include a first-class service and a second-class service.
[0031] In an exemplary embodiment of the present application, it further includes:
[0032] The configuration unit is used to configure a first service address corresponding to a first type of service and a second service address corresponding to a second type of service in a proxy server; wherein the proxy server is used to forward real-time traffic according to a target script.
[0033] In an exemplary embodiment of the present application, it further includes:
[0034] An address modification unit is used to modify the service address corresponding to the real-time traffic according to the first service address if the service address corresponding to the real-time traffic belongs to the second service address during the online process of the second-class service;
[0035] The address modification unit is also used to modify the service address corresponding to the real-time traffic according to the second service address if the service address corresponding to the real-time traffic belongs to the first service address during the online process of a type of service.
[0036] In an exemplary embodiment of the present application, it further includes:
[0037] The traffic distribution unit is used to distribute the real-time traffic to the first-class service and the second-class service after the first-class service is launched.
[0038] In an exemplary embodiment of the present application, it further includes:
[0039] The mobile terminal request response unit is used to respond to the mobile terminal request and send the mobile terminal request to the first class service during the second class service online process; and send the mobile terminal request to the second class service during the first class service online process.
[0040] In an exemplary embodiment of the present application, the mobile terminal request response unit responds to the mobile terminal request, and sends the mobile terminal request to the first class service during the second class service online process; and sends the mobile terminal request to the second class service during the first class service online process, including:
[0041] In response to a mobile terminal request sent by the wireless mobile terminal based on a remote procedure call service, determining a group alias corresponding to the mobile terminal request;
[0042] During the launch of the second-class service, the mobile terminal request is sent to the first-class service based on the group alias;
[0043] During the launch of the first-class service, the mobile terminal request is sent to the second-class service based on the group alias.
[0044] According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0045] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0046] The exemplary embodiments of the present application may have some or all of the following beneficial effects:
[0047] In the grayscale publishing method provided in an example implementation of the present application, a class I service and a class II service can be provided. When there is a demand for grayscale publishing, real-time traffic can be sent to the class I service first, until the class II service is online, and then the real-time traffic can be sent to the class II service, and the class I service is online. Compared with the grayscale publishing at the gateway level only implemented by the related technology, the grayscale publishing solution provided by the present application has stronger integrity. The class I service can call its unique class I sub-service and apply its unique class I sub-service call address and class I message queue. Similarly, the class II service can call its unique class II sub-service and apply its unique class II sub-service call address and class II message queue. Therefore, it can be seen that the present application provides an overall grayscale publishing solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale publishing. In addition, since the grayscale publishing solution provided by the present application is more holistic, it can reduce the user's perception of the grayscale publishing process and reduce the impact of the grayscale publishing process on user requests.
[0048] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A schematic diagram showing an exemplary system architecture of a grayscale publishing method and a grayscale publishing device to which the embodiments of the present application can be applied;
[0051] Figure 2 A flowchart of a grayscale publishing method according to an embodiment of the present application is schematically shown;
[0052] Figure 3 A timing diagram of a grayscale publishing method according to another embodiment of the present application is schematically shown;
[0053] Figure 4 The following schematically shows an architecture diagram for implementing a grayscale publishing method according to an embodiment of the present application;
[0054] Figure 5 The structure block diagram of the grayscale publishing device in one embodiment of the present application is schematically shown;
[0055] Figure 6The structure diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0056] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0057] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0058] See also Figure 1 , Figure 1 The schematic diagram shows the system architecture of an exemplary application environment in which a grayscale publishing method and grayscale publishing device according to an embodiment of the present application can be applied. Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105.
[0059] The network 104 may include various connection types, such as wired, wireless communication links or fiber optic cables, etc. The terminal devices 101, 102, and 103 may be devices that provide voice and / or data connectivity to users, handheld devices with wireless connection functions, or other processing devices connected to wireless modems. The wireless terminal may communicate with one or more core networks via the RAN. The wireless terminal may be a user equipment (UE), a handheld terminal, a laptop, a subscriber unit, a cellular phone, a smart phone, a wireless data card, a personal digital assistant (PDA) computer, a tablet computer, a wireless modem, a handheld device (handheld), a laptop computer, a cordless phone or a wireless local loop (WLL) station, a machine type communication (MTC) terminal, or other device that can access the network. The terminal and the access network device communicate with each other using a certain air interface technology (for example, 3GPP access technology or non-3GPP access technology). It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0060] The grayscale publishing method provided in the embodiment of the present application can be executed by the server 105, and accordingly, the grayscale publishing device is generally arranged in the server 105. However, it is easy for a person skilled in the art to understand that the grayscale publishing method provided in the embodiment of the present application can also be executed by the terminal device 101, 102 or 103, and this exemplary embodiment does not specifically limit this. For example, in an exemplary embodiment, the server 105 can respond to the grayscale publishing demand, send the real-time traffic from the terminal device 101, 102 or 103 to the first class service, and launch the second class service; wherein the first class service is used to call the first class sub-service to process the real-time traffic according to the first class sub-service call address and the first class message queue sent by the remote procedure call service. When the second class service is launched, the real-time traffic from the terminal device 101, 102 or 103 is sent to the second class service, and the first class service is launched; wherein the second class service is used to call the second class sub-service to process the real-time traffic based on the second class sub-service call address and the second class message queue sent by the remote procedure call service.
[0061] See also Figure 2 , Figure 2 The flowchart of the grayscale publishing method according to an embodiment of the present application is schematically shown. Figure 2 As shown, the grayscale release method may include: steps S210 to S220.
[0062] Step S210: In response to the grayscale release requirements, real-time traffic is sent to a class of services, and a class of services is launched; wherein the class of services is used to call a class of sub-services to process real-time traffic based on a class of sub-service call address and a class of message queue sent by a remote procedure call service.
[0063] Step S220: When the second-class service is online, the real-time traffic is sent to the second-class service and the first-class service is online; wherein the second-class service is used to call the second-class sub-service to process the real-time traffic based on the second-class sub-service call address and the second-class message queue sent by the remote procedure call service.
[0064] Implementation Figure 2 The method shown can provide a class of services and a class of services. When there is a demand for grayscale release, real-time traffic can be sent to the class of services first, until the class of services are online, and then the real-time traffic can be sent to the class of services, and the class of services can be online. Compared with the grayscale release at the gateway level only implemented by the relevant technology, the grayscale release scheme provided by this application has stronger integrity. Class A services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class A message queues. Similarly, class B services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class B message queues. Therefore, it can be seen that this application provides an overall grayscale release solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale release. In addition, since the grayscale release scheme provided by this application is more holistic, it can reduce the user's perception of the grayscale release process and reduce the impact of the grayscale release process on user requests.
[0065] Next, the above steps of this exemplary embodiment are described in more detail.
[0066] In an application scenario (such as a cloud warehouse management system scenario), it is usually necessary to provide warehouse management services to multiple users. The cloud warehouse management system needs to support high availability and high concurrency to ensure system stability. In order to provide users with better quality and more stable services, R&D personnel will continuously develop / update system functions, and enable users to continue to use the latest system through system iteration and change online. Generally speaking, batch releases or grayscale releases will be carried out when going online to avoid online problems caused by new functions. However, this method will have the problem of user experience interruption, that is, users cannot use the system during the system launch process, and the grayscale release at the gateway level does not solve the problem of underlying service calls, so it is not suitable for cloud warehouse management systems.
[0067] This application intends to connect the gateway layer and the bottom layer to provide a more holistic grayscale release solution.
[0068] In step S210, in response to the grayscale release requirements, real-time traffic is sent to a class of services, and a class of services is launched; wherein the class of services is used to call a class of sub-services to process real-time traffic based on a class of sub-service call address and a class of message queue sent by a remote procedure call service.
[0069] Specifically, the demand for grayscale release can be triggered by the operation end. When the demand for grayscale release is detected, real-time traffic can be sent to a class of services based on the settings corresponding to the grayscale release demand. A class of services can determine a class of sub-service call addresses (IP) corresponding to a class of services (web services) based on the remote procedure call service (Remote Procedure Call, RPC), and a class of sub-services (service services) can be called based on the class of sub-service addresses (IP) to respond to real-time traffic in a timely manner. Among them, RPC represents a remote procedure call, specifically a method or protocol that allows a program to call another program or service on different machines. RPC can shield the details of network communication, allowing R&D personnel to call remote functions like calling local functions. RPC has multiple implementation methods, such as XML-RPC, JSON-RPC, gRPC, etc.
[0070] Among them, there may be multiple sub-services of the same type corresponding to a type of service. A sub-service of the same type may be a system underlying service. A type of service may call one or more sub-services of the same type in the process of responding to real-time traffic, which is not limited in the embodiments of the present application.
[0071] Specifically, in the process of responding to real-time traffic, a class-one service can call a class-one message queue (Java Message Queue, JMQ) corresponding to the class-one service, and JMQ can be used to store multiple messages related to processing real-time traffic. In the process of launching a class-two service, processing real-time traffic through a class-one service can avoid the problem of real-time traffic accumulation. From the user's perspective, processing real-time traffic through a class-one service while launching a class-two service can reduce the user's perception of the service launch process and improve the response speed to real-time traffic.
[0072] Among them, JMQ supports both point-to-point and publish / subscribe models, and defines the standard of the API for message-oriented middleware (MOM) on the Java platform. JMQ can use Broker to manage and forward messages, Queue and Topic to store and distribute messages, and Producer and Consumer to send and receive messages. The first type of message queue (Java MessageQueue, JMQ) can use topicA1 to store and distribute messages, and the second type of message queue (Java Message Queue, JMQ) can use topicA2 to store and distribute messages. Topic is the transmission intermediary between message publishers (Pub) and subscribers (Sub). Devices can send and receive messages through Topic, thereby realizing communication between the server and the device.
[0073] The process of launching a Class II service can be understood as replacing the existing Class II service instance with a new Class II service implementation. In addition, it should be noted that the functions of Class II services and Class I services are the same, so as to ensure the reliability of real-time traffic processing during the grayscale release process.
[0074] In addition, a type of message queue can also be (Message Queue, MQ), which is the abbreviation of a message queue. It refers to a middleware that supports asynchronous communication and can transmit messages between different applications or components. MQ can achieve functions such as decoupling, buffering, load balancing, and reliable transmission. MQ has multiple implementations, such as RabbitMQ, Kafka, ActiveMQ, etc.
[0075] In addition, the point-to-point model means that a producer sends a message to a specific queue, and only one consumer reads the message from the queue. The producer and consumer do not need to be online at the same time, and the message will be saved in the queue until it is consumed. Multiple consumers are in competition for the messages in the same queue, and each consumer can only receive a part of the messages in the queue. The publish / subscribe model means that a producer sends a message to a specific topic, and multiple subscribers can receive messages from the topic. The producer and subscriber do not need to know each other's existence, and the message will be broadcast to all subscribers in the topic. Each subscriber can receive all the messages in the topic.
[0076] In addition, real-time traffic may be continuously received user requests, and the services corresponding to different user requests (eg, HTTP requests) may be the same or different, which is not limited in the embodiments of the present application.
[0077] In step S220, when the second-class service is online, the real-time traffic is sent to the second-class service and the first-class service is online; wherein the second-class service is used to call the second-class sub-service to process the real-time traffic based on the second-class sub-service call address and the second-class message queue sent by the remote procedure call service.
[0078] Specifically, when it is detected that the second-class service has been online, the real-time traffic received subsequently can be sent to the second-class service, so that the second-class service can determine the second-class sub-service call address (IP) corresponding to the second-class service (web service) based on the remote procedure call service (Remote Procedure Call, RPC), and can call the first-class sub-service (service service) based on the second-class sub-service address (IP) to respond to the real-time traffic in a timely manner. Among them, there can be multiple second-class sub-services corresponding to the second-class service, and the second-class sub-service can be a system bottom-level service. In the process of the second-class service responding to the real-time traffic, one or more second-class sub-services can be called, which is not limited in the embodiment of the present application.
[0079] It should be noted that the second-category sub-services and the first-category sub-services are consistent. For example, if the second-category service corresponds to 10 second-category sub-services, then the first-category service also corresponds to 10 first-category sub-services. Moreover, the 10 second-category sub-services and the 10 first-category sub-services also correspond one-to-one in terms of achievable functions.
[0080] Specifically, in the process of responding to real-time traffic, the second-class service can call the second-class message queue (Java Message Queue, JMQ) corresponding to the second-class service, and JMQ can be used to store multiple messages related to processing real-time traffic. In the process of launching a first-class service, processing real-time traffic through a second-class service can avoid the problem of real-time traffic accumulation, reduce the user's perception of the service launch process, and improve the response speed to real-time traffic. Among them, the process of launching a first-class service can be understood as replacing the existing first-class service instance with a new first-class service implementation.
[0081] In an exemplary embodiment of the present application, it further includes: dividing the server resources into multiple services; wherein the multiple services include a first-class service and a second-class service. This can facilitate the switching of the traffic delivery address, and further facilitate the grayscale release.
[0082] Specifically, server resources can be understood as various hardware resources that can be provided by the server. In the process of dividing server resources, the server resources can be divided into two equal parts, so that one of the resources in the two equal parts is implemented as a type of service and the other resource is implemented as a type of service. In addition, optionally, the server resources can also be divided into three equal parts, four equal parts, etc., which is not limited in the embodiments of the present application.
[0083] It should be noted that no matter how many services the server resources are divided into, the functions that can be achieved by these services are the same.
[0084] In an exemplary embodiment of the present application, it also includes: configuring a first service address corresponding to a first type of service and a second service address corresponding to a second type of service in a proxy server (Nginx); wherein the proxy server is used to forward real-time traffic according to a target script (Lua script). In this way, address configurability for traffic switching can be achieved, which facilitates timely and accurate switching of real-time traffic to the corresponding service during grayscale release.
[0085] Specifically, the proxy server (Nginx) is a high-performance HTTP and reverse proxy server. It can also be used as an IMAP / POP3 / SMTP server. It supports multiple modules and can expand its functions and performance. Among them, the IMAP / POP3 / SMTP server is a server used to receive and send emails. IMAP / POP3 / SMTP use different protocols. IMAP (Internet Message Access Protocol) is a protocol for accessing remote mail servers, which allows users to synchronize mail on multiple devices. POP3 (Post Office Protocol 3) is a protocol for downloading mail from a remote mail server to a local computer, and usually deletes mail on the server. SMTP (Simple Mail Transfer Protocol) is a protocol for sending mail to a remote mail server, which is used to deliver mail to the correct recipient. HTTP (Hypertext Transfer Protocol) is a protocol for transmitting hypertext on the Internet. It defines the format and rules for exchanging information between clients and servers. HTTP is an application layer protocol based on the TCP / IP protocol. It adopts a request-response mode, that is, the client sends a request to the server and the server returns a response.
[0086] Among the various modules supported by Nginx, there is the nginx_lua_module module, which enables Nginx to run Lua scripts, thereby achieving dynamic content generation and advanced Web development. Lua is a lightweight scripting language that is embedded in other applications to provide flexible expansion and customization capabilities. Lua has concise syntax, efficient memory management, cross-platform portability, and rich built-in libraries and third-party libraries.
[0087] Among them, the first service address (upstreamA1) and the first service address (upstreamA1) can be configured in the cache (Redis) of the proxy server (Nginx), the first service address (upstreamA1) can be one or more, and similarly, the second service address (upstreamA2) can also be one or more, the first service address (upstreamA1) represents the address of a specific web service that can be provided in the first class of services, and the second service address (upstreamA1) represents the address of a specific web service that can be provided in the second class of services. In addition, the comprehensive service address corresponding to the first class of services and the second class of services can also be configured in the proxy server (Nginx), and the comprehensive service address (upstreamAll) includes the first service address and the second service address.
[0088] Among them, Redis is an open source in-memory database that supports multiple data structures, such as strings, lists, sets, hashes, ordered sets, etc. Redis has high-speed read and write performance and can be used for caching, message queues, publish-subscribe systems, etc., and Redis also supports master-slave replication, persistence, transactions and other features. In addition, upstream means upstream or upstream. In Nginx, upstream is a configuration directive used to define the cluster and load balancing strategy of the backend server. Nginx can forward the client's request to a server in the upstream and send the returned result to the client.
[0089] Load balancing refers to the technology of distributing network traffic or computing tasks to multiple servers or resources to improve performance, availability, and scalability. Load balancing can be implemented at different levels, such as the network layer, transport layer, and application layer. Load balancing can use different algorithms, such as polling, random, weighted, and least connections.
[0090] The present application can be applied to a distributed system, which includes a service node cluster. Each service node can include a first-class service and a second-class service, and the first-class service and the second-class service included in each service node are consistent.
[0091] In an exemplary embodiment of the present application, it also includes: during the launch of the second-class service, if the service address corresponding to the real-time traffic belongs to the second service address, the service address corresponding to the real-time traffic is modified according to the first service address; during the launch of the first-class service, if the service address corresponding to the real-time traffic belongs to the first service address, the service address corresponding to the real-time traffic is modified according to the second service address. This can facilitate the realization of instant grayscale release and ensure that real-time traffic can be responded to in a timely manner.
[0092] Specifically, if it is detected that the service address (web service address) corresponding to the real-time traffic belongs to the second service address, the target service address that is consistent with the service address corresponding to the real-time traffic can be determined from the first service address based on nginx and lua scripts, and the service address corresponding to the real-time traffic can be modified to the target service address, so that the real-time traffic can be sent to the first class service so that the second class service can continue to go online. Similarly, if it is detected that the service address (web service address) corresponding to the real-time traffic belongs to the first service address, the target service address that is consistent with the service address corresponding to the real-time traffic can be determined from the second service address based on nginx and lua scripts, and the service address corresponding to the real-time traffic can be modified to the target service address, so that the real-time traffic can be sent to the second class service so that the first class service can continue to go online.
[0093] In an exemplary embodiment of the present application, it further includes: when the first type of service is online, the real-time traffic is distributed to the first type of service and the second type of service. In this way, by distributing the real-time traffic to the first type of service and the second type of service, the traffic can be split, load balancing can be achieved, and the load of the first type of service or the second type of service can be avoided.
[0094] Specifically, the real-time traffic can be distributed to Class I and Class II services at a specified ratio. For example, the real-time traffic can be distributed to Class I services at a ratio of 30% and to Class II services at a ratio of 70%, or the real-time traffic can be distributed to Class I services at a ratio of 50% and to Class II services at a ratio of 50%.
[0095] In an exemplary embodiment of the present application, it also includes: in response to a mobile terminal request, during the online process of the second-class service, the mobile terminal request is sent to the first-class service; during the online process of the first-class service, the mobile terminal request is sent to the second-class service. In this way, traffic processing for mobile devices can be implemented during grayscale release, expanding the scope of application of the grayscale release solution.
[0096] Specifically, the mobile terminal may be a portable radio frequency (RF) device.
[0097] In an exemplary embodiment of the present application, in response to a mobile terminal request, during the process of going online for a second type of service, the mobile terminal request is sent to a first type of service; during the process of going online for a first type of service, the mobile terminal request is sent to a second type of service, including: in response to a mobile terminal request sent by a wireless mobile terminal based on a remote procedure call service, determining a group alias corresponding to the mobile terminal request; during the process of going online for a second type of service, the mobile terminal request is sent to a first type of service based on the group alias; during the process of going online for a first type of service, the mobile terminal request is sent to a second type of service based on the group alias. In this way, the group alias of the mobile terminal request can be determined based on the remote procedure call service, and then different services can be accessed based on the group alias, thereby ensuring the processing efficiency of the mobile terminal request.
[0098] Specifically, the group alias is used to indicate that the user request comes from the mobile terminal, such as UserTenantRefSercice / jwms-center-v0.1 / getLogininfosForApp.
[0099] See also Figure 3 , Figure 3 The timing diagram of the grayscale publishing method according to another embodiment of the present application is schematically shown. Figure 3 As shown, the grayscale release method may include: steps S300 to S314.
[0100] Step S300: The user side detects the user operation and triggers the front-end response. The user side may be a client with which the user can interact, and the user operation is used to trigger the generation of a user request.
[0101] Step S302: The front end sends a user request to nginx.
[0102] Step S304: nginx obtains the service address corresponding to the user request in the real-time traffic through the Lua script.
[0103] Step S306: nginx forwards the service address to the first-class service / second-class service.
[0104] Step S308: The first-class service / second-class service in the Web application calls the corresponding RPC microservice to process the user request.
[0105] Step S310: The first-class service / second-class service in the Web application responds to the user request. The response object of the first-class service / second-class service in the Web application is nginx.
[0106] Step S312: nginx responds to the user request. The response object of nginx is the front end.
[0107] Step S314: The front end responds to the user request, which makes it easier for the user to intuitively understand the response result.
[0108] It can be seen that the implementation Figure 3 The method shown can provide a class of services and a class of services. When there is a demand for grayscale release, real-time traffic can be sent to the class of services first, until the class of services are online, and then the real-time traffic can be sent to the class of services, and the class of services can be online. Compared with the grayscale release at the gateway level only implemented by the relevant technology, the grayscale release scheme provided by this application has stronger integrity. Class A services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class A message queues. Similarly, class B services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class B message queues. Therefore, it can be seen that this application provides an overall grayscale release solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale release. In addition, since the grayscale release scheme provided by this application is more holistic, it can reduce the user's perception of the grayscale release process and reduce the impact of the grayscale release process on user requests.
[0109] See also Figure 4 , Figure 4 The following schematically shows an architecture diagram for implementing a grayscale publishing method according to an embodiment of the present application. Figure 4The architecture shown is described in detail below:
[0110] The browser 401 may be used to detect user operations and trigger front-end responses.
[0111] The operation end 402 can be used to trigger the demand for phased release.
[0112] Web platform (OpenResty) 410 can be used in the process of launching a second type of service. If the service address corresponding to the real-time traffic belongs to the second service address, the service address corresponding to the real-time traffic is modified according to the first service address through the proxy server (Nginx) + target script language (Lua) 411; in the process of launching a first type of service, if the service address corresponding to the real-time traffic belongs to the first service address, the service address corresponding to the real-time traffic is modified according to the second service address through the proxy server (Nginx) + target script language (Lua) 411. In addition, the first service address corresponding to the first type of service and the second service address corresponding to the second type of service can be configured in the cache (redis) 412 corresponding to the proxy server (Nginx); wherein the proxy server is used to forward real-time traffic according to the target script (Lua script). Among them, OpenResty is a scalable Web platform based on NGINX. Web developers can use the Lua scripting language to mobilize various C and Lua modules supported by Nginx.
[0113] The radio communication terminal (RF terminal) can be used to determine the address alias for the Web platform (OpenResty) 410 based on the communication with the remote call gateway (RPC gateway) 441 in the remote procedure call (RPC) 440, and trigger the Web platform (OpenResty) 410 based on the address alias to send the mobile terminal request to the first class service during the second class service online process; and send the mobile terminal request to the second class service during the first class service online process.
[0114] Furthermore, the Web platform (OpenResty) 410 may select the A service cluster 420 or the B service cluster 430 to receive real-time traffic.
[0115] Among them, the server resources in the A service cluster 420 can be divided into Web service A1 421, Web service A2 422, Web service A3 423, ..., Web service An 424. The sub-services are divided into service (service) A1 425 corresponding to Web service A1 421, service (service) A2 426 corresponding to Web service A2 422, service (service) A3 427 corresponding to Web service A3 423, and service (service) An 428 corresponding to Web service An 424; wherein n is a positive integer. In addition, the A service cluster 420 also corresponds to an independent middleware (JMQ cluster) 429 supporting asynchronous communication, which is used to record messages.
[0116] Similarly, the server resources in the B service cluster 430 can be divided into Web service B1 431, Web service B2 432, Web service B3 433, ..., Web service Bn 434. The sub-services are divided into service B1 435 corresponding to Web service B1 431, service B2 436 corresponding to Web service B2 432, service B3 437 corresponding to Web service B3 433, and service Bn 438 corresponding to Web service Bn 434; wherein n is a positive integer. In addition, the B service cluster 430 also corresponds to an independent middleware (JMQ cluster) 439 supporting asynchronous communication, which is used to record messages.
[0117] If Web service A1 421 is a first-class service and Web service A2 422 is a second-class service, Web service A1 421 can determine a first-class sub-service call address (the address of service A1 425) and a middleware (JMQ cluster) 429 supporting asynchronous communication according to a registration center addressing server 441 of a remote procedure call (RPC) 440, and call service A1 425 to process real-time traffic. Similarly, Web service A2 422 can determine a first-class sub-service call address (the address of service A2 426) and a middleware (JMQ cluster) 429 supporting asynchronous communication according to a registration center addressing server 441 of a remote procedure call (RPC) 440, and call service A2 426 to process real-time traffic.
[0118] In addition, the remote procedure call (RPC) 440 also includes multiple registration centers, including registration center 443, registration center 444, and registration center 445, which can realize the registration of various services and Web services. Among them, the registration center 443, registration center 444, and registration center 445 record the same information and back up each other. In addition, the database 446 and cache 447 in the remote procedure call (RPC) 440 are used to record data related to the remote procedure call (RPC) 440.
[0119] In addition, clusters such as A service cluster 420 or B service cluster 430 can all call the same database: Mysql cluster 451, ES 452, JIM 453. Among them, ES (Elasticsearch) 452 is an open source distributed search and analysis engine for processing large amounts of structured and unstructured data. JIM 453 is a distributed, memory-based, high-performance, scalable database that supports multiple data types. The data source of JIM can be a relational database such as MySQL, Oracle, PostgreSQL, or a non-relational database such as MongoDB, HBase, etc.
[0120] It can be seen that the implementation Figure 4 The architecture shown can provide a class of services and a class of services. When there is a demand for grayscale release, real-time traffic can be sent to the class of services first, until the class of services are online, and then the real-time traffic can be sent to the class of services, and the class of services can be online. Compared with the grayscale release at the gateway level only implemented by the relevant technology, the grayscale release solution provided by this application has stronger integrity. Class A services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class A message queues. Similarly, class B services can call their unique class of sub-services and apply their unique class of sub-service call addresses and class B message queues. Therefore, it can be seen that this application provides an overall grayscale release solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale release. In addition, since the grayscale release solution provided by this application is more holistic, it can reduce the user's perception of the grayscale release process and reduce the impact of the grayscale release process on user requests.
[0121] See also Figure 5 , Figure 5 The structure block diagram of the grayscale publishing device in one embodiment of the present application is schematically shown. Figure 2 The method shown corresponds to Figure 5 As shown, the grayscale publishing device 500 includes:
[0122] The first traffic directional sending unit 501 is used to send real-time traffic to the first-class service in response to the grayscale release demand, and launch the second-class service; wherein the first-class service is used to call the first-class sub-service to process the real-time traffic according to the first-class sub-service call address and the first-class message queue sent by the remote procedure call service;
[0123] The second traffic directional sending unit 502 is used to send real-time traffic to the second class service and launch the first class service after the second class service is launched; wherein the second class service is used to call the second class sub-service to process real-time traffic based on the second class sub-service call address and the second class message queue sent by the remote procedure call service.
[0124] It can be seen that the implementation Figure 5 The device shown can provide a class I service and a class II service. When there is a demand for grayscale release, real-time traffic can be sent to the class I service first, until the class II service is online, and then the real-time traffic can be sent to the class II service, and the class I service is online. Compared with the grayscale release at the gateway level only implemented in the related technology, the grayscale release scheme provided by this application has stronger integrity. Class I service can call its unique class I sub-service and apply its unique class I sub-service call address and class I message queue. Similarly, class II service can call its unique class II sub-service and apply its unique class II sub-service call address and class II message queue. Therefore, it can be seen that this application provides an overall grayscale release solution from the gateway layer to the bottom layer of the system, which is more compatible with the Internet microservice system architecture and can improve the success rate of grayscale release. In addition, since the grayscale release scheme provided by this application is more holistic, it can reduce the user's perception of the grayscale release process and reduce the impact of the grayscale release process on user requests.
[0125] In an exemplary embodiment of the present application, it further includes:
[0126] The service resource division unit is used to divide the server resources into multiple services; wherein the multiple services include a first-class service and a second-class service.
[0127] It can be seen that the implementation of this optional embodiment can facilitate the switching of traffic delivery addresses, thereby facilitating the grayscale release.
[0128] In an exemplary embodiment of the present application, it further includes:
[0129] The configuration unit is used to configure a first service address corresponding to a first type of service and a second service address corresponding to a second type of service in a proxy server; wherein the proxy server is used to forward real-time traffic according to a target script.
[0130] It can be seen that the implementation of this optional embodiment can achieve address configurability for traffic switching, which facilitates timely and accurate switching of real-time traffic to corresponding services during grayscale release.
[0131] In an exemplary embodiment of the present application, it further includes:
[0132] An address modification unit is used to modify the service address corresponding to the real-time traffic according to the first service address if the service address corresponding to the real-time traffic belongs to the second service address during the online process of the second-class service;
[0133] The address modification unit is also used to modify the service address corresponding to the real-time traffic according to the second service address if the service address corresponding to the real-time traffic belongs to the first service address during the online process of a type of service.
[0134] It can be seen that implementing this optional embodiment can facilitate instant grayscale release and ensure that real-time traffic can receive a timely response.
[0135] In an exemplary embodiment of the present application, it further includes:
[0136] The traffic distribution unit is used to distribute the real-time traffic to the first-class service and the second-class service after the first-class service is launched.
[0137] It can be seen that by implementing this optional embodiment, the real-time traffic can be distributed to the first-class service and the second-class service, so as to achieve traffic diversion, load balancing, and avoid the load of the first-class service or the second-class service.
[0138] In an exemplary embodiment of the present application, it further includes:
[0139] The mobile terminal request response unit is used to respond to the mobile terminal request and send the mobile terminal request to the first class service during the second class service online process; and send the mobile terminal request to the second class service during the first class service online process.
[0140] It can be seen that the implementation of this optional embodiment can realize traffic processing for mobile devices during grayscale release, thereby expanding the scope of application of the grayscale release solution.
[0141] In an exemplary embodiment of the present application, the mobile terminal request response unit responds to the mobile terminal request, and sends the mobile terminal request to the first class service during the second class service online process; and sends the mobile terminal request to the second class service during the first class service online process, including:
[0142] In response to a mobile terminal request sent by the wireless mobile terminal based on a remote procedure call service, determining a group alias corresponding to the mobile terminal request;
[0143] During the launch of the second-class service, the mobile terminal request is sent to the first-class service based on the group alias;
[0144] During the launch of the first-class service, the mobile terminal request is sent to the second-class service based on the group alias.
[0145] It can be seen that by implementing this optional embodiment, the group alias of the mobile terminal request can be determined based on the remote procedure call service, and then different services can be accessed based on the group alias, thereby ensuring the processing efficiency of the mobile terminal request.
[0146] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0147] Since the various functional modules of the grayscale publishing device of the exemplary embodiment of the present application correspond to the steps of the exemplary embodiment of the grayscale publishing method described above, for details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the grayscale publishing method described above in the present application.
[0148] See also Figure 6 , Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0149] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0150] like Figure 6 As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. Various programs and data required for system operation are also stored in RAM 603. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0151] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0152] In particular, according to an embodiment of the present application, the process described with reference to the flowchart above can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains 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 section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the method and apparatus of the present application are executed.
[0153] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0154] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 the present application, a 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, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0155] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a 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 or flow chart, and the combination of the boxes in the block diagram or flow chart 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.
[0156] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0157] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
Claims
1. A grayscale release method, characterized in that: include: In response to the grayscale release requirements, the real-time traffic is sent to the first-class service, and the second-class service is launched; wherein the first-class service is used to call the first-class sub-service to process the real-time traffic according to the first-class sub-service call address and the first-class message queue sent by the remote procedure call service; When the second-class service is online, the real-time traffic is sent to the second-class service, and the first-class service is online; wherein, the second-class service is used to call the second-class sub-service to process the real-time traffic based on the second-class sub-service call address and the second-class message queue sent by the remote procedure call service.
2. The method according to claim 1, characterized in that Also includes: The server resources are divided into a plurality of services; wherein the plurality of services include the first type of services and the second type of services.
3. The method according to claim 1, characterized in that Also includes: A first service address corresponding to the first type of service and a second service address corresponding to the second type of service are configured in the proxy server; wherein the proxy server is used to forward the real-time traffic according to the target script.
4. The method according to claim 3, characterized in that Also includes: During the online launch of the second type of service, if the service address corresponding to the real-time traffic belongs to the second service address, modifying the service address corresponding to the real-time traffic according to the first service address; During the online process of the first type of service, if the service address corresponding to the real-time traffic belongs to the first service address, the service address corresponding to the real-time traffic is modified according to the second service address.
5. The method according to claim 1, characterized in that Also includes: After the first type of service is online, the real-time traffic is distributed to the first type of service and the second type of service.
6. The method according to claim 1, characterized in that Also includes: In response to a mobile terminal request, during the online process of the second type of service, sending the mobile terminal request to the first type of service; During the online process of the first type of service, the mobile terminal request is sent to the second type of service.
7. The method according to claim 6, characterized in that In response to a mobile terminal request, during the online process of the second type of service, sending the mobile terminal request to the first type of service; During the online process of the first type of service, sending the mobile terminal request to the second type of service includes: In response to a mobile terminal request sent by the wireless mobile terminal based on the remote procedure call service, determining a group alias corresponding to the mobile terminal request; During the online process of the second type of service, the mobile terminal request is sent to the first type of service based on the group alias; During the online process of the first type of service, the mobile terminal request is sent to the second type of service based on the group alias.
8. A grayscale publishing device, characterized in that: include: The first traffic directional sending unit is used to send the real-time traffic to the first class service and launch the second class service in response to the grayscale release demand; wherein the first class service is used to call the first class sub-service to process the real-time traffic according to the first class sub-service call address and the first class message queue sent by the remote procedure call service; The second traffic directional sending unit is used to send the real-time traffic to the second type of service and launch the first type of service after the second type of service is launched; wherein the second type of service is used to call the second type of sub-service to process the real-time traffic based on the second type of sub-service call address and the second type of message queue sent by the remote procedure call service.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.