CN114237693A - Gray scale publishing method, equipment and storage medium - Google Patents

Gray scale publishing method, equipment and storage medium Download PDF

Info

Publication number
CN114237693A
CN114237693A CN202111566492.7A CN202111566492A CN114237693A CN 114237693 A CN114237693 A CN 114237693A CN 202111566492 A CN202111566492 A CN 202111566492A CN 114237693 A CN114237693 A CN 114237693A
Authority
CN
China
Prior art keywords
user
service
request
gray
user request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111566492.7A
Other languages
Chinese (zh)
Inventor
葛弘康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202111566492.7A priority Critical patent/CN114237693A/en
Publication of CN114237693A publication Critical patent/CN114237693A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application discloses a gray level publishing method, equipment and a storage medium, which are applied to a micro service gateway, and the method can comprise the following steps: acquiring registration information of one or more service instances, wherein the registration information comprises application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance; acquiring a gray strategy, wherein the gray strategy is used for determining whether a user is a gray user and comprises one or more of a strategy based on user information and a strategy based on a region; receiving a user request of a user, wherein the user request comprises one or more of a user identifier, a region to which the user belongs and a request version; a first service instance satisfying the user request is determined based on the grayscale policy and the registration information, and the user request is forwarded to the first service instance. The embodiment of the application can dynamically set the gray strategy, ensures the stability of the production environment, and simultaneously can reduce the operation and maintenance cost by combining the front end gray and the back end gray.

Description

Gray scale publishing method, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a storage medium for issuing a gray scale.
Background
With the continuous development of science and technology, the updating and iteration speed of products in the computer industry is accelerated. The method has the advantages that smooth updating iteration of products can be guaranteed, user experience is guaranteed, and gray level releasing is carried out at the same time. Gray scale publication, also known as canary publication, refers to a publication mode that can make smooth transition between black and white. The purpose of gray release is to select part of users according to a certain strategy, enable the part of users to experience the application of the new version in advance, collect the feedback of the part of users to the application of the new version (such as leaving a message in the public, counting the indexes of product data or burying the data of user behaviors, including evaluating the functions, stability, performance and other indexes of the new version), and further decide to continue to enlarge the release range of the new version until the new version is upgraded or rolled back to the old version.
However, the existing gray release scheme in the prior art still has some defects, the existing commonly used gray release scheme generally adopts middleware (such as Nginx) to forward traffic, and branches users to a new version and an old version according to a policy, the specific implementation mode is that a Nginx configuration file is changed while a gray environment is deployed, and a Nginx server is restarted, which may affect the stability of a production environment, and in addition, because the forwarding rule of the Nginx server is fixed, the prior art cannot realize a dynamic gray policy adjustment, which brings great troubles to operation and maintenance; in addition, in the gray scale release scheme in the prior art, a front end entrance is often arranged at the front end and corresponds to the gray scale strategy, when the gray scale strategy changes, the front end entrance corresponding to the gray scale strategy also needs to be modified by operation and maintenance personnel together, so that the gray scale of the front end and the gray scale of the rear end are ensured to be compatible, otherwise, the situation that the front end entrance and the gray scale strategy of the rear end are not compatible may occur, so that the service cannot be normally provided, and the operation and maintenance complexity is increased. How to provide a gray scale release scheme capable of dynamically setting a gray scale strategy and ensuring the stability of a production environment is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a gray level publishing method, a device and a storage medium, which can dynamically set a gray level strategy, ensure the stability of a production environment, avoid the condition that a front-end page entrance is incompatible with a background interface, and reduce the operation and maintenance cost.
In a first aspect, an embodiment of the present application provides a gray scale publishing method, which may include:
the method comprises the steps that a micro service gateway obtains registration information of one or more service instances from a registration center, wherein the registration information comprises application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance; the micro service gateway acquires a gray strategy from a configuration center, wherein the gray strategy is used for determining whether a user is a gray user and comprises one or more of a strategy based on user information and a strategy based on a region; the micro service gateway receives a user request of a user, wherein the user request comprises one or more of a user identifier, a belonging area and a request version; and the micro service gateway determines a first service instance meeting the user request based on the gray level strategy and the registration information, and forwards the user request to the first service instance.
In the embodiment of the application, a micro-service architecture is formed by deploying three micro-services including a micro-service gateway, a configuration center and a registration center, and the three micro-services are utilized to separate the functions of an independent and complex Nginx server in the prior art, wherein the flow forwarding function of the Nginx server is mainly completed through the micro-service gateway, the configuration center mainly completes the gray level strategy setting and adjusting function of the Nginx server, and the registration center mainly completes the registration information functions of the Nginx server for storing and updating service instances, so that the gray level strategy can be dynamically set, and the stability of a production environment is ensured. When receiving a user request, the micro service gateway screens out a service instance meeting the user request by analyzing the request context in the user request according to the gray strategy acquired from the configuration center and the registration information acquired from the registration center, and finally forwards the user request to the service instance. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In one possible implementation, the micro service gateway receives a user request of a user, and includes: the micro service gateway receiving a first user request of the user, the first user request comprising one or more of the user identification, the affiliated region, and the request version; the microservice gateway determining whether the user is a grayscale user based on the first user request and the grayscale policy; when the user is a gray level user, the micro service gateway adds a gray level identifier in the first user request to obtain the user request; the gray scale identifier is used for identifying the user request as a gray scale user request.
In the embodiment of the application, when an application is opened and an application enters a loading page, a user request (namely, a first user request for judging whether the user is a gray level user) is sent, and the request context of the request can contain information such as user information, a region to which the user belongs, a request version, flow and the like, so that whether the user is the gray level user can be determined according to a policy based on the user information or a policy based on the region in a gray level policy, if the user is not the gray level user, the page can be continuously loaded, and a user request (which can be consistent with the first user request) can be sent in addition; if the user is a gray level user, jumping to a gray level page (i.e. performing front end gray level), and additionally sending a user request, wherein the user request carries a gray level identifier (the gray level identifier can be added on the basis of the previous user request). Through the mutual combination of the front-end and rear-end gray release, even if the gray strategy of the rear end changes after the front-end page entry (used for the front-end gray) is set, the front-end page entry does not need to be modified along with the gray strategy (in the prior art, when the gray strategy changes, the front-end page entry needs to be modified together), namely, the front-end page entry and the rear-end gray strategy do not need to be modified simultaneously, the condition that the front-end entry is incompatible with a background interface due to the respective modification can be avoided, and therefore the operation and maintenance cost is reduced.
In one possible implementation, the forwarding the user request to the first service instance includes: and when the user request carries the gray scale identification, the micro service gateway stores the gray scale identification in the head of the information of the user request and forwards the gray scale identification to the first service instance.
In the embodiment of the application, when the user request carries the gray scale identification, the request context information of the gray scale user always exists in the information header, the full link gray scale is realized from top to bottom, and the requirements of cross-link transmission and cross-instance transmission on the link gray scale are met. The access path of the request in the link can be reduced by realizing the gray level of the full link, and the user experience is effectively improved.
In one possible implementation, the determining, by the micro service gateway, a first service instance satisfying the user request based on the grayscale policy and the registration information includes: the micro service gateway judges whether the user is a gray level user or not based on the user identification, one or more of the region and the gray level identification in the user request and one or more of a user information-based strategy and a region-based strategy in the gray level strategy; and the micro service gateway determines the first service instance meeting the user request based on the judgment result, the request version in the user request and the application version of the service instance in the registration information.
In the embodiment of the application, based on the registration information of the user request and the service instance and the gray level strategy, the micro service gateway can determine the service instance meeting the user request from one or more service instances, so that the normal gray level release is guaranteed.
In one possible implementation manner, the determining, by the micro service gateway, the first service instance that satisfies the user request based on the determination result, the request version in the user request, and the application version of the service instance in the registration information includes: when the user is a gray-scale user, the micro service gateway determines a gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example; when the user is a non-gray level user, the micro service gateway determines a non-gray level instance meeting the request version in the user request from the one or more service instances according to the application version of the service instance in the registration information, and obtains the first service instance.
In the embodiment of the application, based on the user request, the registration information of the service instance and the gray level strategy, the micro service gateway determines the gray level instance for the gray level user, and determines the non-gray level instance for the non-gray level user.
In a possible implementation, the registration information further includes an application area of the service instance; the micro service gateway determines a first service instance meeting the user request based on the gray policy and the registration information, and the method comprises the following steps: the micro service gateway judges whether the user is a gray level user or not based on the user identification, one or more of the region and the gray level identification in the user request and one or more of a user information-based strategy and a region-based strategy in the gray level strategy; and the micro service gateway determines the first service instance meeting the user request based on the judgment result, the request version and the region of the user request, and the application version and the application region of the service instance in the registration information.
In the embodiment of the application, the registration information of the service instance further includes an application area of the service instance, that is, a certain service instance can only be tried in a certain area or some areas, and gray-scale users in different areas can be distributed on different service instances in a partitioning manner.
In a possible implementation manner, the determining, by the micro service gateway, the first service instance that satisfies the user request based on the determination result, the request version and the belonging area in the user request, and the application version and the application area of the service instance in the registration information, includes: when the user is a gray-scale user, the micro service gateway determines a gray-scale example meeting the request version and the belonging area in the user request from the one or more service examples according to the application version of the service example and the application area of the service example in the registration information to obtain the first service example; when the user is a non-gray level user, the micro service gateway determines a non-gray level example meeting the request version and the region to which the request version and the region belong in the user request from the one or more service examples according to the application version of the service example and the application region of the service example in the registration information, and obtains the first service example.
In the embodiment of the application, based on the user request, the registration information of the service instance and the gray level strategy, the micro service gateway determines the gray level instance for the gray level user, and determines the non-gray level instance for the non-gray level user.
In a second aspect, an embodiment of the present application provides a gray scale publishing method, applied to a configuration center, which may include:
configuring a grayscale policy for determining whether a user is a grayscale user, including one or more of a user information-based policy and a region-based policy; and sending the gray strategy to a micro service gateway.
In the embodiment of the application, the function of the Nginx server is separated through the micro-service architecture, so that the gray strategy can be dynamically set, and the stability of the production environment is ensured. The configuration center mainly completes the Nginx server gray strategy setting and adjusting function, dynamically sets the gray strategy through the configuration center, and dynamically issues the gray strategy. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In a possible implementation manner, the grayscale policy further includes a policy based on a grayscale identifier, where the policy based on the grayscale identifier is used to determine that a user request carrying the grayscale identifier is a request of a grayscale user.
In the embodiment of the application, the gray level policy set by the configuration center may further include a policy based on a gray level identifier, and when the user request carries the gray level identifier, the user request may be directly regarded as the request of the gray level user, so as to provide a gray level service for the user. In the full link, the gray scale identifier requested by the user can always have the head of the information, so that the full link gray scale is realized from top to bottom, and the requirements of cross-thread transmission and cross-instance transmission on the link gray scale are met. The cross-thread transmission can be understood that when a user request is responded and a certain service instance needs to be called, a plurality of threads are pulled up to complete the calling task, and calling relations can exist among the threads or with other threads, when calling is carried out among multiple threads, if gray scale identification is carried, the request can be regarded as a gray scale user request, and the determination is not needed through a micro-service gateway; the cross-instance transfer can be understood as a single-thread task that the micro service gateway calls a certain service instance or a certain service instance calls another service instance, when the certain service instance calls another service instance, if the calling request carries a gray scale identifier, the calling request can be regarded as a request of a gray scale user, and the determination is not needed through the micro service gateway. The access path of the request in the link can be reduced by realizing the gray level of the full link, and the user experience is effectively improved.
In a third aspect, an embodiment of the present application provides a gray scale publishing method, which is applied to a registry, and may include:
storing registration information of one or more service instances, wherein the registration information comprises one or more of application areas of the service instances and application versions of the service instances; and sending the registration information to a micro service gateway.
In the embodiment of the application, the function of the Nginx server is separated through the micro-service architecture, so that the gray strategy can be dynamically set, and the stability of the production environment is ensured. The registration center mainly completes the function of storing and updating the registration information of the service instance by the Nginx server, dynamically sets the gray strategy through the configuration center, dynamically issues the gray strategy, and registers and stores the registration information of the service instance through the registration center; receiving a user request through the micro service gateway, analyzing a request context in the request, screening out a service instance meeting the user request according to the gray strategy acquired from the configuration center and the registration information acquired from the registration center, and finally forwarding the user request to the service instance. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In a fourth aspect, an embodiment of the present application provides a micro service gateway device, which may include:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring registration information of one or more service instances from a registration center, and the registration information comprises application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance;
a second acquisition unit, configured to acquire a grayscale policy from the configuration center, where the grayscale policy is used to determine whether a user is a grayscale user, and includes one or more of a user information-based policy and a region-based policy;
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a user request of a user, and the user request comprises one or more of a user identifier, a belonging area and a request version;
and the processing unit is used for determining a first service instance meeting the user request based on the gray-scale strategy and the registration information and forwarding the user request to the first service instance.
In the embodiment of the application, the function of the Nginx server is separated through the micro-service architecture, so that the gray strategy can be dynamically set, and the stability of the production environment is ensured. The micro service gateway mainly completes the flow forwarding function of the Nginx server, analyzes the request context in the user request received by the receiving unit through the processing unit, screens out the service instance meeting the user request according to the gray level strategy acquired by the first acquiring unit and the second acquiring unit from the configuration center and the registration information acquired from the registration center, and finally forwards the user request to the service instance. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In a possible implementation manner, the receiving unit is specifically configured to: receiving a first user request of the user, the first user request comprising one or more of the user identification, the region to which the user belongs, and the request version; determining whether the user is a grayscale user based on the first user request and the grayscale policy; when the user is a gray level user, adding a gray level identifier in the first user request to obtain the user request; the gray scale identifier is used for identifying the user request as a gray scale user request.
In a possible implementation manner, the processing unit is specifically configured to: and when the user request carries the gray scale identification, storing the gray scale identification in the head of the information of the user request, and forwarding the gray scale identification to the first service instance.
In a possible implementation manner, the processing unit is specifically configured to: determining whether the user is a grayscale user based on one or more of the user identifier, the region to which the user belongs, and a grayscale identifier in the user request, and one or more of a user information-based policy and a region-based policy in the grayscale policy; and determining the first service instance meeting the user request based on the judgment result, the request version in the user request and the application version of the service instance in the registration information.
In a possible implementation manner, the processing unit is specifically configured to: when the user is a gray-scale user, determining a gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example; and when the user is a non-gray-scale user, determining a non-gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example.
In a possible implementation, the registration information further includes an application area of the service instance; the processing unit is specifically configured to: determining whether the user is a grayscale user based on one or more of the user identifier, the region to which the user belongs, and a grayscale identifier in the user request, and one or more of a user information-based policy and a region-based policy in the grayscale policy; and determining the first service instance meeting the user request based on the judgment result, the request version and the region of the user request, and the application version and the application region of the service instance in the registration information.
In a possible implementation manner, the processing unit is specifically configured to: when the user is a gray-scale user, determining a gray-scale example meeting the request version and the belonging area in the user request from the one or more service examples according to the application version of the service example and the application area of the service example in the registration information, and obtaining the first service example; and when the user is a non-gray level user, determining a non-gray level example meeting the request version and the region to which the request version and the non-gray level example belong in the user request from the one or more service examples according to the application version of the service example and the application region of the service example in the registration information, and obtaining the first service example.
In a fifth aspect, an embodiment of the present application provides a configuration center device, which may include:
a configuration unit for configuring a gray policy for determining whether a user is a gray user, including one or more of a user information-based policy and a region-based policy; and the sending unit is used for sending the gray strategy to the micro service gateway.
In the embodiment of the application, the function of the Nginx server is separated through the micro-service architecture, so that the gray strategy can be dynamically set, and the stability of the production environment is ensured. The configuration center mainly completes the Nginx server gray strategy setting and adjusting function, dynamically sets the gray strategy through the configuration center, and dynamically issues the gray strategy. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In a possible implementation manner, the grayscale policy further includes a policy based on a grayscale identifier, where the policy based on the grayscale identifier is used to determine that a user request carrying the grayscale identifier is a request of a grayscale user.
In a sixth aspect, an embodiment of the present application provides a registry apparatus, which may include:
the storage unit is used for storing registration information of one or more service instances, wherein the registration information comprises one or more of application areas of the service instances and application versions of the service instances; and the sending unit is used for sending the registration information to the micro service gateway.
In the embodiment of the application, the function of the Nginx server is separated through the micro-service architecture, so that the gray strategy can be dynamically set, and the stability of the production environment is ensured. The registration center mainly completes the function of storing and updating the registration information of the service instance by the Nginx server, dynamically sets the gray strategy through the configuration center, dynamically issues the gray strategy, and registers and stores the registration information of the service instance through the registration center; receiving a user request through the micro service gateway, analyzing a request context in the request, screening out a service instance meeting the user request according to the gray strategy acquired from the configuration center and the registration information acquired from the registration center, and finally forwarding the user request to the service instance. Different from the situation that Nginx configuration files need to be changed and Nginx servers need to be restarted when a gray level environment is deployed in the prior art, because micro services between micro service architectures are mutually independent and do not interfere with each other, a configuration center can dynamically update the gateway and service instance configuration and send the gateway to the micro service gateway, the whole server does not need to be restarted when a gray level strategy is dynamically set, and therefore the stability of a production environment can be guaranteed. Therefore, the embodiment of the application can dynamically set the gray strategy and ensure the stability of the production environment.
In a seventh aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor, and the processor is configured to support the electronic device to implement a corresponding function in the grayscale publishing method provided in any one of the first aspect, the second aspect, and the third aspect. The electronic device may also include a memory, coupled to the processor, that stores program instructions and data necessary for the electronic device. The electronic device may also include a communication interface for the electronic device to communicate with other devices or a communication network.
In an eighth aspect, the present invention provides a computer-readable storage medium for storing computer software instructions for use in a processor in an apparatus provided by any one of the above fourth, fifth and sixth aspects, the computer software instructions comprising a program designed to perform the above aspects.
In a ninth aspect, embodiments of the present application provide a chip system, where the chip system includes a processor, configured to enable a device to implement the functions recited in any one of the first aspect, the second aspect, and the third aspect, for example, to generate or process information recited in the gray scale publishing method. In one possible design, the system-on-chip further includes a memory for storing program instructions and data necessary for the device. The chip system may be constituted by a chip, or may include a chip and other discrete devices.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
Fig. 1 is a schematic diagram of a gray scale publishing method in the prior art;
fig. 2 is a schematic structural diagram of a gray scale publishing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a gray scale publishing method according to an embodiment of the present application;
fig. 4a is an application schematic diagram of a gray scale publishing method provided in an embodiment of the present application;
fig. 4b is a schematic application diagram of another gray scale publishing method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a micro service gateway device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a configuration center device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a registry apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As used in this specification, the terms "component," "module," "system," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computing device and the computing device can be a component. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between 2 or more computers. In addition, these components can execute from various computer readable media having various data structures stored thereon. The components may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., data from two components interacting with another component in a local system, distributed system, and/or across a network such as the internet with other systems by way of the signal).
First, some terms in the present application are explained so as to be easily understood by those skilled in the art.
(1) The micro-service architecture is a structural style, a complex application is divided into a plurality of independent and autonomous services, and the services interact with each other in a loose coupling mode. In the micro-service architecture, one micro-service is an independent entity, each micro-service can be independently deployed and upgraded, the micro-service and the micro-service communicate through a standard interface, and one micro-service example can be replaced by another implementation without influencing other micro-services. According to the gray scale publishing method in the embodiment of the application, the function separation of a single complex server in the prior art is carried out by utilizing the micro service architecture of the micro service gateway, the configuration center and the registration center, so that the dynamic setting of the gray scale strategy is realized, and the stability of the production environment is ensured.
First, the technical problems to be specifically solved by the present application are analyzed and presented. In the prior art, the scheme for gray scale distribution includes the following scheme one:
referring to fig. 1, fig. 1 is a schematic diagram of an architecture of a gray release method in the prior art, and a specific implementation manner generally adopts a middleware (such as a Nginx) to forward traffic, and branches a user to a new version and an old version according to a policy, where the specific implementation manner is to change a Nginx configuration file and restart a Nginx server while deploying a gray environment.
This solution has several disadvantages:
disadvantage 1: because the forwarding rule of the Nginx server is fixed, the stability of the production environment may be affected by restarting the Nginx server when the configuration file is changed, which causes that the prior art cannot realize a dynamic gray scale adjustment strategy and brings troubles to operation and maintenance.
And (2) disadvantage: the gray scale publishing scheme of the prior art sets a front end entrance at the front end, corresponding to the gray scale strategy. When the gray strategy changes, the front-end entrance corresponding to the gray strategy also needs to be modified together, so as to ensure that the front-end and rear-end gray are compatible, otherwise, the situation that the front-end entrance is not compatible with the rear-end gray strategy may occur, so that the service cannot be normally provided, and the operation and maintenance complexity is increased.
In order to solve the problem that the current gray level issuing scheme can not meet the actual use requirement, realize gray level strategy dynamic setting, guarantee production environment stability, can avoid avoiding the condition that front end page entry and backstage interface are incompatible simultaneously, reduce the fortune dimension cost, the shortcoming that the comprehensive consideration prior art exists, the technical problem that this application actually will solve includes following several aspects:
1. the grayscale publishing scheme based on the micro-service architecture (drawback 1 of scheme one). In the first scheme, because the forwarding rule of the nginnx server is fixed, the nginnx server needs to be restarted when the configuration file is changed, and the stability of the production environment may be affected, so that the prior art cannot realize a dynamic gray scale adjustment strategy, and brings much trouble to operation and maintenance. Therefore, a more reasonable grayscale publishing scheme based on a micro-service architecture is required to be provided, the micro-service architecture of the micro-service gateway, the configuration center and the registration center is deployed, the functions of the Nginx servers are separated through three micro-services, because the micro-services between the micro-service architectures are independent and do not interfere with each other, and the configuration center supports the characteristic of dynamically updating the gateway and the service instance configuration, the whole server does not need to be restarted when a grayscale policy is dynamically set, so that the stability of a production environment can be ensured.
2. Front and back end gray scale integration mechanism (drawback 2 of scheme one). In the first scheme, the gray scale publishing scheme in the prior art sets a front end entry at the front end, corresponding to the gray scale strategy. When the gray strategy is changed, the front-end entry corresponding to the gray strategy also needs to be modified. Therefore, a front-end and back-end gray level combination mechanism is needed to be added, when a user opens an application loading page, whether the user is a gray level user is judged, if the user is a gray level user, the user jumps to a gray level page (namely front-end gray level is carried out), through mutual combination of front-end and back-end gray level publishing, after a front-end page entry (used for front-end gray level) is set, even if a gray level strategy at the back end is changed, the front-end page entry does not need to be modified along with the gray level strategy, and therefore operation and maintenance cost is reduced.
In summary, the existing gray scale publishing scheme cannot meet the higher requirements of dynamic gray scale adjustment strategy and front and rear end gray scale combination in practical application. Therefore, the gray scale issuing method provided by the application is used for solving the technical problem.
Based on the technical problems presented above and the corresponding application scenarios in the present application, and also for facilitating understanding of the embodiments of the present application, the following description is made with reference to fig. 2 and 3. Referring to fig. 2 and fig. 3, fig. 2 is an architecture schematic diagram of a gray scale publishing method provided in an embodiment of the present application, where a micro service architecture is formed by deploying three micro services, namely, a micro service gateway, a configuration center, and a registration center, and functions of a single complex nginnx server in the prior art are separated by using the three micro services, where the micro service gateway mainly completes a traffic forwarding function of the nginnx server, the configuration center mainly completes a gray scale policy setting adjustment function of the nginnx server, and the registration center mainly completes a function of the nginnx server to store and update registration information of a service instance. Fig. 3 is a schematic flow chart of a gray scale publishing method according to an embodiment of the present application, where a micro service gateway is used as an action subject to comb the gray scale publishing method of the present application, and the micro service gateway needs to obtain a gray scale policy and registration information of a service instance, then receives a user request, analyzes a request context in the user request, determines a service instance satisfying the user request according to the gray scale policy and the registration information, and finally forwards the user request to the service instance. The gray scale publishing method will be described in the following with reference to fig. 2 and fig. 3 from the interaction of the micro service gateway, the configuration center, the registry, the service instance, and the user side, and referring to fig. 3, the gray scale publishing method in the present application may include the following steps S300 to S303:
step S300: the microservice gateway obtains registration information for one or more service instances from a registry.
Specifically, the micro service gateway may obtain registration information of one or more service instances from the registry, the registration information including one or more of an application area of the service instance, and an application version of the service instance, the one or more service instances including a grayscale instance and a non-grayscale instance. Referring to fig. 4a, fig. 4a is an application schematic diagram of a gray scale publishing method according to an embodiment of the present application, where a registry records and stores registration information of service instances when each service instance is started (e.g., step a in fig. 4 a), and sends the registration information to a microservice gateway. The registration information comprises an application area of the service instance, an application version of the service instance, a label of the service instance and the like, wherein the application area refers to an area where the service instance can be tried, the service instances in different application areas provide services for users belonging to different areas, and when the number of the users is large, the load can be effectively distributed on different service instances, so that the conditions of overload and breakdown of the users of the service instances are avoided, the user experience is guaranteed, and the operation and maintenance pressure is relieved; the microservice gateway can acquire the registration information from the registration center in a polling mode, and the specific way of acquiring the registration information can be long connection. For example, the registration information may include a region (region), a version (version), and a tag (tags), and when tags in the registration information of a certain service instance are gray, the service instance may be considered as a gray-scale instance. It should be noted that, based on the characteristic that each micro service in the micro service architecture is independent from each other and does not interfere with each other, when a service instance changes, such as an increase or decrease of the service instance, the registration center can update the registration information in time and send the updated registration information to the micro service gateway.
Step S301: the micro service gateway obtains the gray strategy from the configuration center.
Specifically, the microservice gateway may obtain a grayscale policy from the configuration center, the grayscale policy identifying whether the user is a grayscale user, including one or more of a user information-based policy and a region-based policy. That is, the setting of the grayscale policy can be completed by the configuration center according to the user information, the area, the flow rate, and other self-defined elements (as step B in fig. 4 a); the configuration center may also send the grayscale policy to the microservice gateway over a long connection. It should be noted that, based on the characteristic that each micro service in the micro service architecture is independent from each other and does not interfere with each other, when the gray level policy changes, for example, when a user in a certain area is added as a gray level user, the configuration center may send the adjusted gray level policy to the micro service gateway in time after adjusting the gray level policy, but it is not necessary to restart the three micro services of the micro service gateway, the configuration center, and the registration center at the same time, thereby implementing the dynamic gray level policy adjustment and ensuring the stability of the production environment.
In a possible implementation manner, the grayscale policy may further include a policy based on the grayscale identifier, and is used to determine that the user request carrying the grayscale identifier is a request of a grayscale user. For example, the policy based on the grayscale identification may be set to consider that the user is a grayscale user when the request context of the user request includes the grayscale identification (e.g., web), and provide the corresponding grayscale instance to the user to complete the service; while the user information based policy and the region based policy can be used to provide a basis for determining whether the user is a grayscale user when the user loads the page (as in step 1 in fig. 4 b), for example, the user information based policy and the region based policy can be set according to the user information (which may be ID), the region, the traffic, etc., specifically, the user whose head is 1010 of the user ID can be determined as a grayscale user, or a region or a user greater than the set traffic can be determined as a grayscale user, when the user loads the page, the user sends a user request (which may be used to determine whether the user is a grayscale user), the request context may include information of the user ID, the region, the traffic, etc., so the microservice gateway can determine the user request (i.e., the first user request) according to the user information based policy and the region based policy and when the user loads the page, determining whether the user is a grayscale user, if not, continuing to load the page (step 2.1 in fig. 4 b), and may additionally send a user request (which may coincide with the last user request); if the user is a grayscale user, the user jumps to the grayscale page (e.g. step 2.2 in fig. 4b, i.e. performing front-end grayscale), and may additionally send a user request (e.g. grayscale flag may be added on the basis of the last user request). Through the mutual combination of the front-end and rear-end gray release, even if the gray strategy of the rear end changes after the front-end page entry (used for the front-end gray) is set, the front-end page entry does not need to be modified along with the gray strategy (in the prior art, when the gray strategy changes, the front-end page entry needs to be modified together), namely, the front-end page entry and the rear-end gray strategy do not need to be modified simultaneously, and the situation that the front-end page entry is incompatible with a background interface due to the respective modification can be avoided.
Step S302: the micro service gateway receives a user request of a user.
Specifically, the micro service gateway may receive a user request from the user-side device, where the user request includes one or more of a user identifier, a region to which the user belongs, and a request version. After receiving the user request, the micro service gateway firstly analyzes the request context in the user request, and determines whether the user is a gray level user and the requirement of the user on a specific gray level example according to the information of the user identification, the request version, the affiliated area and the like in the request context.
In a possible implementation manner, receiving a user request of a user may be subdivided into receiving a first user request of the user, where the first user request includes one or more of the user identifier, the affiliated area, and the request version; determining whether the user is a grayscale user based on the first user request and the grayscale policy; when the user is a gray level user, adding a gray level identifier in the first user request to obtain the user request; the gray scale identifier is used for identifying the user request as a gray scale user request. Referring to fig. 4b, when the user loads the page, the user sends a user request (i.e., a first user request, which may be used to determine whether the user is a grayscale user), and the request context of the request may include information such as a user ID, a region, a traffic, and the like, so that the micro service gateway may determine whether the user is a grayscale user according to the policy based on the user information and the policy based on the region, and the user request (i.e., the first user request) when the user loads the page, and if the user is not a grayscale user, continue to load the page (as in step 2.1 in fig. 4 b), and may send another user request (which may be consistent with the previous user request); if the user is a grayscale user, the user jumps to the grayscale page (as in step 2.2 in fig. 4b, i.e. performing front-end grayscale), and may additionally send a user request carrying grayscale identifiers (the grayscale identifiers may be added on the basis of the previous user request, e.g. web). Through the mutual combination of the front-end and rear-end gray release, even if the gray strategy of the rear end changes after the front-end page entry (used for the front-end gray) is set, the front-end page entry does not need to be modified along with the gray strategy (in the prior art, when the gray strategy changes, the front-end page entry needs to be modified together), namely, the front-end page entry and the rear-end gray strategy do not need to be modified simultaneously, and the situation that the front-end page entry is incompatible with a background interface due to the respective modification can be avoided.
Step S303: and the micro service gateway determines a first service instance meeting the user request based on the gray level strategy and the registration information, and forwards the user request to the first service instance.
Specifically, the micro service gateway screens out a service instance meeting the user request based on the gray level policy acquired from the configuration center and the registration information acquired from the registration center, and then forwards the user request to the service instance meeting the user request for processing, so as to provide service for the user. If the user is a gray level user, the micro service gateway forwards the user request shunting of the gray level user to the gray level example; if the user is a non-gray user, the micro service gateway shunts the user request of the non-gray user to the corresponding non-gray example.
In a possible implementation mode, when the user request is a request of a gray level user, the request context information of the gray level user can be set in a full link, the request context information of the gray level user is always stored in an information header, full link gray level is realized from top to bottom, and the requirements of cross-thread transmission and cross-instance transmission on link gray level are met. The cross-thread transmission can be understood that when a user request is responded and a certain service instance needs to be called, a plurality of threads are pulled up to complete the calling task, calling relations can exist among the threads or with other threads, when calling is carried out among multiple threads, if gray scale identification is carried, the multi-thread transmission can be regarded as a gray scale user request, the service corresponding to the gray scale request is directly called, and the multi-thread transmission does not need to be determined through a micro-service gateway; the cross-instance transfer can be understood as a single-thread task that the micro service gateway calls a certain service instance or a certain service instance calls another service instance, when the certain service instance calls another service instance, if the calling request carries a gray scale identifier, the calling request can be regarded as a request of a gray scale user, and a service corresponding to the gray scale request is directly called without being determined by the micro service gateway. The access time of the request in the link can be reduced by realizing the gray level of the full link, and the user experience is effectively improved.
In conclusion, the method and the device solve the problems that a gray level strategy cannot be dynamically set, the stability of a production environment is influenced, a front-end inlet and a rear-end gray level strategy need to be separately and independently maintained, and the operation and maintenance complexity is increased in the conventional gray level release technology, can realize full-link gray level, and meet the requirements of part of service instances on cross-line transmission and cross-instance transmission on link gray level. Specifically, by deploying a micro-service architecture of a micro-service gateway, a configuration center and a registration center, the three micro-services are utilized to separate the functions of a single complex Nginx server in the prior art, and by means of the characteristics that the micro-services in the micro-service architecture are mutually independent and do not interfere with each other, the configuration center can dynamically update the gateway and the service instance configuration, and when a gray level strategy is dynamically set, the whole server does not need to be restarted, so that the stability of a production environment can be ensured; in addition, whether a user is a gray level user is judged when the user loads a page, and then the user jumps to a corresponding page, so that mutual combination of front-end and rear-end gray level publishing is realized, after a front-end page entry (used for front-end gray level) is set, even if a gray level strategy of a rear end is changed, the front-end page entry does not need to be modified along with the gray level strategy (in the prior art, when the gray level strategy is changed, the front-end page entry and the rear-end gray level strategy do not need to be modified simultaneously), namely, the front-end page entry and the rear-end gray level strategy do not need to be modified simultaneously, and the situation that the front-end entry is incompatible with a background interface due to respective modification can be avoided, so that the operation and maintenance cost is reduced; in addition, in the full link, the information header of the request context information of the gray level user is always arranged, so that the full link gray level is realized from top to bottom, and the requirements of cross-thread transmission and cross-instance transmission on the link gray level are met. Therefore, the gray level strategy is dynamically set, the stability of the production environment is guaranteed, meanwhile, the situation that a front-end page entrance is incompatible with a background interface can be avoided, the operation and maintenance cost is reduced, full-link gray level can be achieved, and the user experience is improved.
The method of the embodiments of the present application is explained in detail above, and the related apparatus of the embodiments of the present application is provided below.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a micro service gateway device provided in an embodiment of the present application, where the micro service gateway device 5 may include a first obtaining unit 501, a second obtaining unit 502, a receiving unit 503, and a processing unit 504, where details of each unit are as follows:
a first obtaining unit 501, configured to obtain registration information of one or more service instances from a registry, where the registration information includes an application version of a service instance;
a second obtaining unit 502, configured to obtain a grayscale policy from a configuration center, where the grayscale policy is used to identify whether a user is a grayscale user, and includes one or more of a user information-based policy and a region-based policy;
a receiving unit 503, configured to receive a user request of a user, where the user request includes one or more of a user identifier, a belonging area, and a request version;
a processing unit 504, configured to determine, based on the grayscale policy and the registration information, a first service instance that satisfies the user request, and forward the user request to the first service instance.
In a possible implementation manner, the receiving unit 503 is specifically configured to:
receiving a first user request of the user, the first user request comprising one or more of the user identification, the region to which the user belongs, and the request version;
determining whether the user is a grayscale user based on the first user request and the grayscale policy;
when the user is a gray level user, adding a gray level identifier in the first user request to obtain the user request; the gray scale identifier is used for identifying the user request as a gray scale user request.
In a possible implementation manner, the processing unit 504 is specifically configured to: and when the user request carries the gray scale identification, storing the gray scale identification in the head of the information of the user request, and forwarding the gray scale identification to the first service instance.
In a possible implementation manner, the processing unit 504 is specifically configured to:
determining whether the user is a grayscale user based on one or more of the user identifier, the region to which the user belongs, and a grayscale identifier in the user request, and one or more of a user information-based policy and a region-based policy in the grayscale policy;
and determining the first service instance meeting the user request based on the judgment result, the request version in the user request and the application version of the service instance in the registration information.
In a possible implementation manner, the processing unit 504 is specifically configured to:
when the user is a gray-scale user, determining a gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example;
and when the user is a non-gray-scale user, determining a non-gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example.
In a possible implementation, the registration information further includes an application area of the service instance;
the processing unit 504 is specifically configured to:
determining whether the user is a grayscale user based on one or more of the user identifier, the region to which the user belongs, and a grayscale identifier in the user request, and one or more of a user information-based policy and a region-based policy in the grayscale policy;
and determining the first service instance meeting the user request based on the judgment result, the request version and the region of the user request, and the application version and the application region of the service instance in the registration information.
In a possible implementation manner, the processing unit 504 is specifically configured to:
when the user is a gray-scale user, determining a gray-scale example meeting the request version and the belonging area in the user request from the one or more service examples according to the application version of the service example and the application area of the service example in the registration information, and obtaining the first service example;
and when the user is a non-gray level user, determining a non-gray level example meeting the request version and the region to which the request version and the non-gray level example belong in the user request from the one or more service examples according to the application version of the service example and the application region of the service example in the registration information, and obtaining the first service example.
It should be noted that, for the functions of each functional unit in the micro service gateway device 5 described in this embodiment, reference may be made to the related description of step S300 to step S303 in the method embodiment described in fig. 3, which is not described herein again.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a configuration center device provided in an embodiment of the present application, where the configuration center device 6 may include a configuration unit 601 and a sending unit 602, where details of each unit are as follows:
a configuration unit 601 configured to configure a grayscale policy, the grayscale policy being used to identify whether a user is a grayscale user, including one or more of a user information-based policy and a region-based policy;
a sending unit 602, configured to send the grayscale policy to a microservice gateway.
In a possible implementation manner, the grayscale policy further includes a policy based on a grayscale identifier, where the policy based on the grayscale identifier is used to determine that a user request carrying the grayscale identifier is a request of a grayscale user.
It should be noted that, for the functions of each functional unit in the configuration center device 6 described in the embodiment of the present application, reference may be made to the related description of step S300 to step S303 in the embodiment of the method described in fig. 3, which is not described herein again.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a registry apparatus provided in an embodiment of the present application, where the registry apparatus 7 may include a storage unit 701 and a sending unit 702, where details of each unit are as follows:
a storage unit 701, configured to store registration information of one or more service instances, where the registration information includes one or more of an application area of a service instance and an application version of the service instance;
a sending unit 702, configured to send the registration information to the micro service gateway.
It should be noted that, for the functions of each functional unit in the registry device 7 described in the embodiment of the present application, reference may be made to the related description of step S300 to step S303 in the method embodiment described in fig. 3, and details are not described herein again.
As a possible product form, the micro service gateway device, the configuration center device, or the registry center device according to the embodiment of the present application may be implemented by a general bus architecture.
As shown in fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 8 includes at least one processor 801, at least one memory 802, and at least one communication interface 803. In addition, the electronic device may further include general components such as an antenna, which will not be described in detail herein.
The processor 801 may be a general purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs according to the above schemes.
Communication interface 803 is used for communicating with other devices or communication Networks, such as ethernet, Radio Access Network (RAN), core network, Wireless Local Area Networks (WLAN), etc.
The Memory 802 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 802 is used for storing application program codes for executing the gray scale publishing method described above, and is controlled by the processor 801 to execute the application program codes. The processor 801 is used to execute application program code stored in the memory 802.
The memory 802 stores code that may perform the gray scale publishing method provided above in fig. 3, such as the microservice gateway obtaining registration information for one or more service instances from a registry, the registration information including application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance; the micro service gateway acquires a gray strategy from a configuration center, wherein the gray strategy is used for determining whether a user is a gray user and comprises one or more of a strategy based on user information and a strategy based on a region; the micro service gateway receives a user request of a user, wherein the user request comprises one or more of a user identifier, a belonging area and a request version; and the micro service gateway determines a first service instance meeting the user request based on the gray level strategy and the registration information, and forwards the user request to the first service instance.
The scope of the electronic device described in the present application is not limited thereto, and the structure of the electronic device may not be limited by fig. 8. The electronic device 8 may be a stand-alone device or may be part of a larger device. For example, the electronic device may be:
(1) a stand-alone integrated circuit IC, or chip, or system-on-chip or subsystem;
(2) a set of one or more ICs, which optionally may also include storage means for storing data, computer programs;
(3) an ASIC, such as a Modem (Modem);
(4) a module that may be embedded within other devices;
(5) receivers, terminals, smart terminals, cellular phones, wireless devices, handsets, mobile units, in-vehicle devices, network devices, cloud devices, artificial intelligence devices, and the like;
(6) others, and so forth.
As a possible product form, the electronic device according to the embodiment of the present application may be implemented by a general-purpose processor.
The general processor for realizing the function of the gray scale release method comprises a processing circuit and an input/output interface which is connected and communicated with the inside of the processing circuit.
In one design, a general purpose processor may be used to perform the functions of the grayscale distribution method of the previous method embodiments: the processing circuitry may be used to generate the various types of messages sent in the various steps of fig. 3, and/or other processes for performing the techniques described herein; the input-output interface may be used to send and receive messages for the various steps in fig. 3, and/or for other processes for the techniques described herein.
It should be noted that, for the functions of each functional unit in the electronic device 8 described in the embodiment of the present application, reference may be made to the related description of step S300 to step S303 in the embodiment of the method described in fig. 3, which is not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored, and when the computer program code is executed by the above-mentioned processor, the electronic device executes the method in any of the foregoing embodiments.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, and may specifically be a processor in the computer device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a magnetic disk, an optical disk, a Read-only memory (ROM) or a Random Access Memory (RAM).
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A gray scale issuing method characterized by comprising:
the method comprises the steps that a micro service gateway obtains registration information of one or more service instances from a registration center, wherein the registration information comprises application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance;
the micro service gateway acquires a gray strategy from a configuration center, wherein the gray strategy is used for determining whether a user is a gray user and comprises one or more of a strategy based on user information and a strategy based on a region;
the micro service gateway receives a user request of a user, wherein the user request comprises one or more of a user identifier, a belonging area and a request version;
and the micro service gateway determines a first service instance meeting the user request based on the gray level strategy and the registration information, and forwards the user request to the first service instance.
2. The method of claim 1, wherein the microservice gateway receives a user request from a user, comprising:
the micro service gateway receiving a first user request of the user, the first user request comprising one or more of the user identification, the affiliated region, and the request version;
the microservice gateway determining whether the user is a grayscale user based on the first user request and the grayscale policy;
when the user is a gray level user, the micro service gateway adds a gray level identifier in the first user request to obtain the user request; the gray scale identifier is used for identifying the user request as a gray scale user request.
3. The method of claim 2, wherein said forwarding the user request to the first service instance comprises:
and when the user request carries the gray scale identification, the micro service gateway stores the gray scale identification in the head of the information of the user request and forwards the gray scale identification to the first service instance.
4. The method of any of claims 1-3, wherein the micro service gateway determining a first service instance that satisfies the user request based on the grayscale policy and the registration information, comprising:
the micro service gateway judges whether the user is a gray level user or not based on the user identification, one or more of the region and the gray level identification in the user request and one or more of a user information-based strategy and a region-based strategy in the gray level strategy;
and the micro service gateway determines the first service instance meeting the user request based on the judgment result, the request version in the user request and the application version of the service instance in the registration information.
5. The method of claim 4, wherein the micro service gateway determining the first service instance that satisfies the user request based on the determination and the request version in the user request and the application version of the service instance in the registration information comprises:
when the user is a gray-scale user, the micro service gateway determines a gray-scale example meeting the request version in the user request from the one or more service examples according to the application version of the service example in the registration information to obtain the first service example;
when the user is a non-gray level user, the micro service gateway determines a non-gray level instance meeting the request version in the user request from the one or more service instances according to the application version of the service instance in the registration information, and obtains the first service instance.
6. The method of any of claims 1-3, wherein the registration information further comprises an application area of a service instance;
the micro service gateway determines a first service instance meeting the user request based on the gray policy and the registration information, and the method comprises the following steps:
the micro service gateway judges whether the user is a gray level user or not based on the user identification, one or more of the region and the gray level identification in the user request and one or more of a user information-based strategy and a region-based strategy in the gray level strategy;
and the micro service gateway determines the first service instance meeting the user request based on the judgment result, the request version and the region of the user request, and the application version and the application region of the service instance in the registration information.
7. The method of claim 6, wherein the micro service gateway determining the first service instance satisfying the user request based on the determination result and the request version and the belonging area in the user request and the application version and the application area of the service instance in the registration information, comprises:
when the user is a gray-scale user, the micro service gateway determines a gray-scale example meeting the request version and the belonging area in the user request from the one or more service examples according to the application version of the service example and the application area of the service example in the registration information to obtain the first service example;
when the user is a non-gray level user, the micro service gateway determines a non-gray level example meeting the request version and the region to which the request version and the region belong in the user request from the one or more service examples according to the application version of the service example and the application region of the service example in the registration information, and obtains the first service example.
8. A microservice gateway device, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring registration information of one or more service instances from a registration center, and the registration information comprises application versions of the service instances; the one or more service instances include a grayscale instance and a non-grayscale instance;
a second acquisition unit, configured to acquire a grayscale policy from the configuration center, where the grayscale policy is used to determine whether a user is a grayscale user, and includes one or more of a user information-based policy and a region-based policy;
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a user request of a user, and the user request comprises one or more of a user identifier, a belonging area and a request version;
and the processing unit is used for determining a first service instance meeting the user request based on the gray-scale strategy and the registration information and forwarding the user request to the first service instance.
9. An electronic device, comprising: a processor, a memory, and a communication interface; the processor is connected to the memory and the communication interface, wherein the network interface is configured to provide data communication functionality, the memory is configured to store program code, and the processor is configured to invoke the program code to cause the computer device to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-7.
CN202111566492.7A 2021-12-20 2021-12-20 Gray scale publishing method, equipment and storage medium Pending CN114237693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111566492.7A CN114237693A (en) 2021-12-20 2021-12-20 Gray scale publishing method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111566492.7A CN114237693A (en) 2021-12-20 2021-12-20 Gray scale publishing method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114237693A true CN114237693A (en) 2022-03-25

Family

ID=80759762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111566492.7A Pending CN114237693A (en) 2021-12-20 2021-12-20 Gray scale publishing method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114237693A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115408285A (en) * 2022-08-31 2022-11-29 北京发现角科技有限公司 Gray scale testing method and device, electronic equipment and storage medium
US11558254B1 (en) * 2022-06-23 2023-01-17 Kong Inc. Configuration hash comparison
CN115665230A (en) * 2022-10-17 2023-01-31 上海浦东发展银行股份有限公司 Non-intrusive application gray scale release control method
CN115688069A (en) * 2022-11-04 2023-02-03 江西五十铃汽车有限公司 System login request response method, device and equipment

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11558254B1 (en) * 2022-06-23 2023-01-17 Kong Inc. Configuration hash comparison
US11792077B1 (en) * 2022-06-23 2023-10-17 Kong Inc. Configuration hash comparison
US20230421442A1 (en) * 2022-06-23 2023-12-28 Kong Inc. Configuration hash comparison
US11996982B2 (en) * 2022-06-23 2024-05-28 Kong Inc. Configuration hash comparison
CN115408285A (en) * 2022-08-31 2022-11-29 北京发现角科技有限公司 Gray scale testing method and device, electronic equipment and storage medium
CN115408285B (en) * 2022-08-31 2023-06-20 北京发现角科技有限公司 Gray scale test method and device, electronic equipment and storage medium
CN115665230A (en) * 2022-10-17 2023-01-31 上海浦东发展银行股份有限公司 Non-intrusive application gray scale release control method
CN115688069A (en) * 2022-11-04 2023-02-03 江西五十铃汽车有限公司 System login request response method, device and equipment
CN115688069B (en) * 2022-11-04 2023-06-30 江西五十铃汽车有限公司 System login request response method, device and equipment

Similar Documents

Publication Publication Date Title
CN114237693A (en) Gray scale publishing method, equipment and storage medium
CN111061484B (en) Code compiling method, device, server, user terminal and readable medium
KR101736425B1 (en) Cloud computing enhanced gateway for communication networks
US10712915B2 (en) Information presentation using a client on a terminal
US11979686B2 (en) Method and system for software-defined camera and camera
CN108337127B (en) Application performance monitoring method, system, terminal and computer readable storage medium
JP2022519810A (en) Communication method, device, entity and computer readable storage medium
US11182210B2 (en) Method for resource allocation and terminal device
CN112565334B (en) Access method and device of Internet of things equipment and MQTT gateway
CN111858050A (en) Server cluster mixed deployment method, cluster management node and related system
CN109634683B (en) Short message operation framework configuration and pushing method and device based on enterprise expectation
CN111125604A (en) Page management method and device, terminal equipment and storage medium
US10078532B2 (en) Resource management method and device for terminal system among multiple operating systems
US20230163998A1 (en) Data processing method, device, electronic device and computer readable medium
CN114356367A (en) Intelligent firmware batch upgrading method, system and medium for terminal equipment
CN107148035B (en) Frequency band selection method and device and wireless equipment
CN102377793B (en) Flash interaction method and device based on mobile communication equipment terminal
CN113791799A (en) System upgrading method and device, computer readable storage medium and electronic equipment
CN104700217A (en) Method and system for collecting test data
CN117412269A (en) User identification card information loading method and device, storage medium and electronic equipment
CN113452776B (en) PaaS platform service scheduling method and device and PaaS platform
CN111182526A (en) Data updating method, mobile terminal and computer storage medium
CN115412993A (en) Relay discovery method, system, device and storage medium
CN113885969A (en) Embedded device, embedded software loading method and storage medium
CN112350856A (en) Distributed service sign-off method and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination