Full-link gray release method, system and device, storage medium and program product
By grouping tenants according to database database information and analyzing the tenant group information to match the grayscale shunt rules in the request, the full-link dyeing transmission is realized, and the problem of not being able to achieve full-link grayscale release under the microservice architecture is solved, ensuring the stability of the production environment and the flexibility of the grayscale range.
Patent Information
- Application Number
- CN202411778426.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-25
AI Technical Summary
The existing technology cannot realize full-link grayscale release of links and databases under the microservice architecture, resulting in stability problems and difficult to control the grayscale range during service upgrade.
By grouping tenants according to database partition information, and analyzing the tenant group information to match the grayscale shunt rules in the request, the full-link dyeing is realized and load balancing forwarding is performed to ensure that the grayscale tenant group only requests grayscale shunt instances.
It realizes full-link grayscale release of links and databases, ensures the stability of the production environment, and makes the grayscale range flexible and controllable.
Smart Images

Figure CN119697268A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a full-link grayscale publishing method, system, device, storage medium and program product. Background Art
[0002] With the rapid growth of users and businesses, service updates and iterations are becoming faster and faster, and the requirements for service stability are becoming higher and higher, which poses a more severe test for R&D personnel and system upgrade methods. Based on the comprehensive consideration of system stability and rapid iteration, grayscale release is generally used to iterate and upgrade services.
[0003] At present, the grayscale release methods in the industry are mostly for a single microservice. Even if multiple microservices are considered, they are only grayscale for the request link, without grayscale design at the data level. In actual production and use, the dependencies between services under the microservice architecture are intricate, and the grayscale release of a single microservice cannot meet actual needs. In addition, the service upgrade process is often accompanied by the update of the database table structure and the update of the table data during the grayscale process. It is necessary to implement the full-link grayscale release of the link and the database at the same time.
[0004] Therefore, the above existing grayscale release methods are obviously still inconvenient and defective in use, and are in urgent need of further improvement. How to create a full-link grayscale release method that can realize links and databases has become a goal that the industry urgently needs to improve. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method for implementing full-link grayscale publishing of links and databases, which at least partially solves the problems existing in the prior art.
[0006] In a first aspect, an embodiment of the present invention provides a full-link grayscale publishing method, including:
[0007] Receive a tenant request and parse tenant group information in the tenant request context; the tenant group information is obtained by grouping tenants according to database sub-database information and is passed in the context as a diversion identifier;
[0008] Match the tenant group information in the tenant request with the grayscale diversion rule. After a successful match, restore the grayscale identifier trafficGroup to the context of the tenant request for full-link coloring transmission;
[0009] Load balancing is performed based on whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, the grayscale diversion version of the diversion instance corresponding to the current request is forwarded to enter the grayscale diversion instance of the corresponding microservice, and the grayscale diversion instance is connected to the grayscale database; if it does not exist, the main instance of the corresponding microservice is entered, and the main instance is connected to the main database.
[0010] According to a specific implementation method of an embodiment of the present invention, grouping tenants according to database sub-library information includes: defining tenants using the same data source as a tenant group according to the tenant sub-library of the database; wherein a data source includes one or more database connections, and each database connection corresponds to a different label, indicating that it is applicable to different tenant levels.
[0011] According to a specific implementation manner of the embodiment of the present invention, the tenant group information is preset into the tenant login token as a diversion identifier and is transmitted in the context.
[0012] According to a specific implementation method of an embodiment of the present invention, the grayscale diversion rules are directly placed in the database for page viewing, and the grayscale diversion rules are also placed in the Ingress object and container environment variables corresponding to the microservice in the form of annotations, and finally stored in ETCD and the registration center for acquisition and use when the grayscale diversion rules are matched.
[0013] According to a specific implementation of an embodiment of the present invention, the grayscale diversion rule includes: grayscale by tenant group, with dimensions as units, one dimension has one or more data sources, and each data source corresponds to a tenant group.
[0014] According to a specific implementation method of an embodiment of the present invention, when load balancing is performed based on whether the grayscale identifier trafficGroup in the context of the tenant request exists, if the grayscale identifier trafficGroup does not exist, or there is no diversion instance of the grayscale diversion version corresponding to the current request, the specific rules are matched once according to the diversion priority of each type, and then the main instance of the corresponding microservice is entered.
[0015] According to a specific implementation of the embodiment of the present invention, the grayscale splitting is also switched in and out with one key;
[0016] Before switching on, the master instance is connected to both the main database and the grayscale database, and the grayscale shunt instance is connected to the grayscale database. After switching on, the binding between the master instance and the grayscale database is disconnected, and the master instance is only connected to the main database, and the grayscale shunt instance is only connected to the grayscale database.
[0017] In a second aspect, an embodiment of the present invention provides a full-link grayscale publishing system, including:
[0018] A request parsing module is configured to receive a tenant request and parse tenant group information in the tenant request context; the tenant group information is obtained by grouping tenants according to database sub-library information and is transmitted in the context as a diversion identifier;
[0019] A matching coloring module is configured to match the tenant group information in the tenant request with the grayscale diversion rule. After a successful match, the grayscale identifier trafficGroup is restored to the context of the tenant request to perform full-link coloring transmission;
[0020] The load balancing forwarding module is configured to perform load balancing based on whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, the grayscale diversion version of the diversion instance corresponding to the current request is forwarded to enter the grayscale diversion instance of the corresponding microservice, and the grayscale diversion instance is connected to the grayscale database; if it does not exist, the master instance of the corresponding microservice is entered, and the master instance is connected to the master database.
[0021] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0022] at least one processor; and,
[0023] a memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor implements the full-link grayscale publishing method described in any one of the first aspect or any one of the implementations of the first aspect.
[0025] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by at least one processor, the at least one processor executes the full-link grayscale publishing method in the aforementioned first aspect or any implementation of the first aspect.
[0026] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the full-link grayscale publishing method in the aforementioned first aspect or any implementation method of the first aspect is implemented.
[0027] The present invention groups tenants according to database sub-library information. Each tenant data only accesses the corresponding database instance and requests grayscale diversion according to the tenant group. The grayscale tenant group will only request the grayscale diversion instance. The present invention takes into account multiple microservices and can realize the full-link grayscale of the link and the database, ensuring the stability of the production environment and the flexible and controllable grayscale range. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0029] Figure 1 A schematic diagram of a full-link grayscale publishing method flow provided by an embodiment of the present invention;
[0030] Figure 2 A tenant mapping relationship diagram established based on a tenant sub-library strategy provided in an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of determining a corresponding database connection for a tenant provided in an embodiment of the present invention;
[0032] Figure 4 A grayscale splitting switching-in and switching-out flow chart provided in an embodiment of the present invention;
[0033] Figure 5 A module schematic diagram of a full-link grayscale publishing system provided by an embodiment of the present invention.
[0034] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0036] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0037] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present invention, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0038] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0039] The present invention provides a full-link grayscale publishing method based on containerized deployment, in which tenants are grouped according to database partition information. Each tenant data only accesses the corresponding database instance, and grayscale diversion is requested according to the tenant group. The grayscale tenant group only requests the grayscale diversion instance. In terms of operation, all microservices can be grayscaled with one click, including configuration, database and mirror, and one-click switching of traffic and one-click upgrade are supported.
[0040] The full process design of tenant group grayscale is as follows:
[0041] (1) Initial state: The production environment includes tenant groups A, B, and C, which use data sources a, b, and c respectively, with version V1. Tenant group A is selected for grayscale.
[0042] (2) Based on the production environment, the tenant group grayscale environment is copied. Its image and configuration are consistent with the production environment, and the data source is a.
[0043] (3) Cut the traffic of grayscale tenant group A into the grayscale environment.
[0044] (4) Upgrade the grayscale environment to version V2, including YMS configuration, image, and database a. Grayscale tenant group A uses the new version for business verification.
[0045] (5) After the grayscale environment verification is passed, the production environment is upgraded to version V2, databases b and c are updated, and the image and configuration are upgraded. At this point, all tenant groups ABC use the new version.
[0046] (6) The traffic of tenant group A is switched back to the production environment and the grayscale environment is destroyed. The same set of instances as BC is used, including images and configurations. However, each tenant group still uses its own database instance.
[0047] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0048] like Figure 1 As shown, an embodiment of the present invention provides a full-link grayscale publishing method, including:
[0049] Step 110: Ingress Controller receives the tenant request (front-end request) and parses the tenant group information in the tenant request context. The tenant group information is obtained by grouping the tenants according to the database sub-library information on the setting side and is passed in the context as a diversion identifier.
[0050] In the settings, tenants using the same data source are defined as a tenant group according to the tenant sub-library of the database; considering the scenario of supporting the graying of two data sources at the same time, a layer of dimension concept is abstracted to associate the dimension with multiple tenant groups. The graying of the tenant group is based on the dimension. There can be multiple data sources under one dimension, and each data source corresponds to a tenant group.
[0051] Figure 2 This is a tenant mapping relationship diagram established based on the tenant database sub-strategy in an embodiment of the present invention, such as Figure 2 As shown in the figure, based on the tenant database partitioning strategy, a tenant mapping relationship is established, and the data source connection actually allocated to the tenant. A logical data source contains one or more database connections, and each database connection corresponds to a different label, indicating that it is applicable to different tenant levels. Each database connection can be set with a different weight. Based on the allocation algorithm, the higher the weight, the greater the probability that the database will be allocated. The database partitioning strategy specifies the strategy for partitioning for tenants of different levels.
[0052] Figure 3 A schematic diagram of determining a corresponding database connection for a tenant provided by an embodiment of the present invention, such as Figure 3 As shown in the figure, the database is divided into groups according to the tenants, and the corresponding database connection is determined for the service according to the tenant ID. For the same database connection, the number of database connections can be saved and resource utilization can be improved by switching catalogs.
[0053] In an embodiment of the present invention, as a preferred solution, the above tenant group information is preset into the tenant login token and passed in the context as a diversion identifier. In this way, the tenant query information can be decoupled from the user authentication center. For example, the user authentication center (such as Youhutong) manages all tenant group information. When the user logs in, the tenant group information of the current tenant is preset into the login token and passed in the context. When the grayscale diversion matching obtains the tenant group information, it is directly obtained from the context, thereby being decoupled from the user authentication center.
[0054] In the embodiment of the present invention, grayscale diversion can also be switched in and out with one click. During the switching in and out process, operations involving front-end and back-end traffic and data source binding are involved. The entire process should be carried out in a certain order, and if a link fails, there should be a corresponding rollback mechanism to ensure atomicity. Figure 4 As shown, before the switch-in, the master instance is connected to both the main database and the grayscale database, and the grayscale shunt instance is connected to the grayscale database; after the switch-in, the binding between the master instance and the grayscale database is disconnected, the master instance is only connected to the main database, and the grayscale shunt instance is only connected to the grayscale database.
[0055] Next, go to step 120: match the tenant group information in the tenant request with the grayscale diversion rule. After the match is successful, restore the grayscale identifier trafficGroup to the context of the tenant request for full-link coloring transmission.
[0056] Among them, the grayscale diversion rules are obtained during matching. As in the embodiment of the present invention, the decoupling of grayscale diversion rules from pipeline management services and databases is achieved. For example, when a microservice turns on grayscale diversion, its grayscale diversion rules are not only directly placed in the database for page viewing, but also placed in the Ingress object and container environment variables corresponding to the microservice in the form of annotations, and finally stored in ETCD and the registration center, so that the grayscale diversion rules can be obtained and used when matching, without relying on databases and pipeline management services.
[0057] It should be noted that the grayscale diversion rules in the embodiment of the present invention include: grayscale by tenant group, with dimension as the unit, one dimension has one or more data sources, and each data source corresponds to a tenant group.
[0058] In an embodiment of the present invention, after a successful match, the grayscale identifier trafficGroup is restored to the context of the tenant request, and full-link coloring is transmitted. For example, after the full-domain service is based on the unified technology stack of YMS (UFIDA Middleware Service Framework), the key information of the tenant group grayscale is placed in the context and transmitted based on YMS, including the tenant group information and grayscale identifier traffic_group as mentioned above, where the tenant group is the basis for judging the first hop of the diversion, and traffic_gourp is used as the basis for subsequent diversion forwarding. Its functions and transmission methods are mainly as follows:
[0059] (1) Link coloring: Trafficgroup is a unified context field. When cookies or headers cannot be transmitted throughout the entire link, the trafficgroup corresponding to the specified cookie or header can be guaranteed to be transmitted in the context, thereby achieving the purpose of full link coloring.
[0060] (2) When REST is the traffic entry point, the ingress controller puts the trafficgroup into the request header and adds it to the YMS context to start full-link transmission;
[0061] For the event center scenario, the event center obtains the traffic group from the context and puts it into the event body. When consuming events, the event body is parsed and the traffic group is put into the request header for context transfer.
[0062] Next, go to step 130: perform load balancing based on whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, forward the diversion instance of the grayscale diversion version corresponding to the current request to enter the grayscale diversion instance of the corresponding microservice, and the grayscale diversion instance is connected to the grayscale database; if it does not exist, enter the main instance of the corresponding microservice, and the main instance is connected to the main database.
[0063] In the embodiment of the present invention, RPC is used for load balancing. RPC performs client load balancing according to app.version to achieve the purpose of traffic diversion. The value of app.version is trafficgroup.
[0064] It should be noted that, in the embodiment of the present invention, when a tenant group grayscale diversion instance is created, traffic alignment is forcibly set. The grayscale identifier trafficgroup used when this instance is deployed is used as the basis, and subsequent traffic is forcibly colored as the traffic group identifier corresponding to the instance to ensure that the grayscale traffic is only in the grayscale diversion instance, and non-grayscale traffic will not go to the grayscale diversion instance, thereby realizing grayscale traffic alignment of the tenant group.
[0065] In the embodiment of the present invention, preferably, all REST requests are forwarded by Ingress, and RPC requests are forwarded by IRIS (UFIDA RPC framework).
[0066] In the embodiment of the present invention, when load balancing is performed based on whether the grayscale identifier trafficGroup in the context of the tenant request exists, the trafficGroup is matched to see whether there is an instance of the same version. If so, it is directly forwarded. If the grayscale identifier trafficGroup does not exist, or there is no diversion instance of the grayscale diversion version corresponding to the current request, the specific rules are matched once according to the diversion priority of each type, and then the main instance of the corresponding microservice is entered. The specific rules are obtained from Ingress, the registration center, and the YMS console respectively.
[0067] In summary, the full-link grayscale publishing method of the present invention solves the following key problems:
[0068] (1) How to achieve fast matching and forwarding when thousands of tenants are grayed out at the same time?
[0069] (2) How to store the diversion rules so that they are stable, reliable and decoupled from each other;
[0070] (3) When the entire link is grayscaled, what is the basis for grayscale forwarding and ensuring the transmission of context?
[0071] (4) The grayscale traffic of the tenant group cannot be downgraded to the primary instance, and the traffic of all links must be aligned;
[0072] (5) Grayscale traffic forwarding for tenant groups;
[0073] (6) How to ensure the atomicity of traffic switching in and out?
[0074] (7) How to implement database grayscale.
[0075] A full-link grayscale publishing method of the present invention groups tenants according to database sub-library information. Each tenant data only accesses the corresponding database instance and requests grayscale diversion according to the tenant group. The grayscale tenant group only requests the grayscale diversion instance. The present invention takes into account multiple microservices and can realize the full-link grayscale of links and databases, ensuring the stability of the production environment and the flexible and controllable grayscale range.
[0076] refer to Figure 5 As shown, the embodiment of the present invention further provides a full-link grayscale publishing system 200, including:
[0077] The request parsing module 210 is configured to receive a tenant request and parse tenant group information in the tenant request context; the tenant group information is obtained by grouping tenants according to database sub-database information and is transmitted in the context as a diversion identifier;
[0078] The matching coloring module 220 is configured to match the tenant group information in the tenant request with the grayscale diversion rule. After the match is successful, the grayscale identifier trafficGroup is restored to the context of the tenant request to perform full-link coloring transmission;
[0079] The load balancing forwarding module 230 is configured to perform load balancing based on whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, the diversion instance of the grayscale diversion version corresponding to the current request is forwarded to enter the grayscale diversion instance of the corresponding microservice, and the grayscale diversion instance is connected to the grayscale database; if it does not exist, the master instance of the corresponding microservice is entered, and the master instance is connected to the master database.
[0080] The above-mentioned full-link grayscale release system and grayscale release method correspond to each other and will not be repeated here.
[0081] See also Figure 6 The embodiment of the present invention further provides an electronic device 50, the electronic device comprising:
[0082] at least one processor; and,
[0083] a memory communicatively connected to the at least one processor; wherein,
[0084] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the full-link grayscale publishing method in the aforementioned method embodiment.
[0085] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the full-link grayscale publishing method in the aforementioned method embodiment.
[0086] An embodiment of the present invention also provides a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the full-link grayscale publishing method in the aforementioned method embodiment is implemented.
[0087] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device 50 suitable for implementing an embodiment of the present invention. Figure 6 As shown, the electronic device 50 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 50 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0088] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0089] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present invention are executed.
[0090] It should be noted that the computer-readable medium of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0091] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A full-link grayscale publishing method, characterized in that: include: Receive tenant requests and parse tenant group information in the tenant request context; The tenant group information is obtained by grouping tenants according to database sub-database information, and is transmitted in the context as a diversion identifier; Match the tenant group information in the tenant request with the grayscale diversion rule. After a successful match, restore the grayscale identifier trafficGroup to the context of the tenant request for full-link coloring transmission; Load balancing is performed based on whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, the grayscale shunting instance corresponding to the current request is forwarded to the grayscale shunting instance of the corresponding microservice, and the grayscale shunting instance is connected to the grayscale database; If it does not exist, the master instance of the corresponding microservice is entered, and the master instance is connected to the master database.
2. The full-link grayscale publishing method according to claim 1 is characterized in that: The method of grouping tenants according to database partition information includes: defining tenants using the same data source as a tenant group according to the database tenant partition; wherein a data source includes one or more database connections, and each database connection corresponds to a different label, indicating that it is applicable to different tenant levels.
3. The full-link grayscale publishing method according to claim 1 is characterized in that: The tenant group information is preset into the tenant login token and is passed in the context as a diversion identifier; And / or, the grayscale diversion rules are directly placed in the database for page viewing, and the grayscale diversion rules are also placed in the Ingress object and container environment variables corresponding to the microservice in the form of annotations, and finally stored in ETCD and the registration center for use when the grayscale diversion rules are matched.
4. The full-link grayscale publishing method according to claim 1 is characterized in that: The grayscale diversion rules include: grayscale by tenant group, with dimensions as units, one dimension has one or more data sources, and each data source corresponds to a tenant group.
5. The full-link grayscale publishing method according to claim 1 is characterized in that: When load balancing is performed based on whether the grayscale identifier trafficGroup in the context of the tenant request exists, if the grayscale identifier trafficGroup does not exist, or there is no diversion instance of the grayscale diversion version corresponding to the current request, the specific rules are matched once according to the diversion priority of each type, and then the main instance of the corresponding microservice is entered.
6. The full-link grayscale publishing method according to claim 1 is characterized in that: It also includes one-click switching in and out of grayscale splitting; Before switching on, the master instance is connected to both the master database and the grayscale database, and the grayscale offload instance is connected to the grayscale database; After switching in, disconnect the binding between the main instance and the grayscale database. The main instance is only connected to the main database, and the grayscale diversion instance is only connected to the grayscale database.
7. A full-link grayscale publishing system, characterized in that: include: A request parsing module, configured to receive a tenant request and parse tenant group information in the tenant request context; The tenant group information is obtained by grouping tenants according to database sub-database information, and is transmitted in the context as a diversion identifier; A matching coloring module is configured to match the tenant group information in the tenant request with the grayscale diversion rule. After a successful match, the grayscale identifier trafficGroup is restored to the context of the tenant request to perform full-link coloring transmission; The load balancing forwarding module is configured to perform load balancing according to whether the grayscale identifier trafficGroup in the context of the tenant request exists. If the grayscale identifier trafficGroup exists, the grayscale shunting version of the shunting instance corresponding to the current request is forwarded to the grayscale shunting instance of the corresponding microservice, and the grayscale shunting instance is connected to the grayscale database; If it does not exist, the master instance of the corresponding microservice is entered, and the master instance is connected to the master database.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor executes the full-link grayscale publishing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed by at least one processor, cause the at least one processor to execute the full-link grayscale publishing method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes computer program instructions, and when the computer program instructions are executed by a processor, the full-link grayscale publishing method according to any one of claims 1 to 6 is implemented.