Grayscale release method and related equipment based on ESOP system
By deploying grayscale and formal unit clusters in the ESOP system and forwarding service requests using marker fields, the problem of the system front and backend simultaneous transformation in the existing technology requires full release, and tenant-level resource isolation and system performance improvement are achieved.
Patent Information
- Application Number
- CN202210447442.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-04-26
AI Technical Summary
The existing technology needs to be released and effective when the front and backend of the system is simultaneously transformed, resulting in the introduction of bugs in the release of new functions, which will have an impact on all tenants, resulting in the expansion of the scope of the bug impact, and the system service performance declines, affecting the overall performance.
By deploying grayscale unit clusters and formal unit clusters in the ESOP system, and physical resource isolation is performed through intermediate programs, the request is forwarded to the corresponding unit cluster using the tag fields in the business request, and grayscale release or official release is supported at the tenant-based level.
Resource isolation between unit clusters and tenants is realized, correlation between tenants is reduced, disaster recovery capabilities of the applied ESOP system and overall performance of the system are improved, and release risks are reduced.
Smart Images

Figure CN114840222B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a grayscale publishing method and related equipment based on an ESOP system. Background Art
[0002] The existing way of releasing new functions requires that all functions be released to take effect when the release involves the simultaneous transformation of the front-end and back-end of the system, that is, full release is carried out after the testing and pre-release environment is confirmed. If the release of a new function introduces a bug, it will affect all tenants, causing the scope of the bug to expand, and after completing the business of some tenants that will cause the system service performance to decline, it will have an adverse impact on the business of other tenants, thereby affecting the overall performance of the system. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application provide a grayscale release method and device based on the ESOP system, an electronic device, and a computer-readable storage medium.
[0004] According to one aspect of an embodiment of the present application, a grayscale release method based on an ESOP system is provided, including: obtaining a business request, the business request containing a tag field, the tag field corresponding to the grayscale release requirement of the tenant, including a grayscale field or a formal field, indicating whether the current business request needs to be forwarded to a grayscale environment; forwarding the business request to a unit cluster corresponding to the tag field through a preset forwarding rule, wherein the unit cluster is used to collect the business requests, and the unit clusters corresponding to different tag fields are independent of each other; receiving the execution result returned by the service layer of the unit cluster after executing the business request.
[0005] In another exemplary embodiment, the method further includes: pre-deploying a unit cluster in the ESOP system, wherein the unit cluster includes a grayscale unit cluster and a formal unit cluster, and the grayscale unit cluster and the formal unit cluster are physically isolated from each other through an intermediate program, and the intermediate program includes middleware or external services.
[0006] In another exemplary embodiment, forwarding the service request to the unit cluster corresponding to the tag field through a preset forwarding rule includes: adding a traffic tag corresponding to the tag field to the service request; forwarding the service request to the corresponding unit cluster pre-deployed through the traffic tag and the forwarding rule.
[0007] In another exemplary embodiment, the business request is forwarded to the unit cluster corresponding to the tag field through a preset forwarding rule, including: if the traffic mark contained in the business request is a grayscale traffic mark, the business request is forwarded to the grayscale unit cluster; if the traffic mark contained in the business request is a formal traffic mark, the business request is forwarded to the formal unit cluster.
[0008] In another exemplary embodiment, the business request also includes a configuration file. Before receiving the execution result returned by the service layer of the unit cluster after executing the business request, the method also includes: routing the business request to the service layer in the unit cluster through the service identifier and tenant identifier included in the configuration file.
[0009] In another exemplary embodiment, the tag field included in the business request corresponds to the grayscale release requirement in the middle-office instruction issued by the tenant; wherein, if the grayscale release requirement is a grayscale requirement, the tag field is a grayscale field; if the grayscale release requirement is a non-grayscale requirement, the tag field is a formal field.
[0010] In another exemplary embodiment, the service layer in the grayscale unit cluster is deployed using a containerized deployment strategy.
[0011] According to one aspect of an embodiment of the present application, a grayscale publishing device based on an ESOP system is provided, including: a receiving module, used to obtain a business request, the business request contains a tag field, the tag field corresponds to the grayscale publishing requirement of the tenant, including a grayscale field or a formal field, indicating whether the current business request needs to be forwarded to a grayscale environment; a distribution module, used to forward the business request to a unit cluster corresponding to the tag field through a preset forwarding rule, wherein the unit cluster is used to collect the business requests, and the unit clusters corresponding to different tag fields are independent of each other; a publishing module, used to receive the execution result returned by the service layer of the unit cluster after executing the business request.
[0012] According to one aspect of an embodiment of the present application, an electronic device includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the grayscale release method based on the ESOP system.
[0013] According to one aspect of an embodiment of the present application, a computer-readable storage medium stores computer-readable instructions thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer executes the grayscale release method based on the ESOP system.
[0014] In the technical solution provided in the embodiments of the present application, the business request is forwarded to the unit cluster corresponding to the tag field contained in the business request and corresponding to the tenant's grayscale release requirements, so as to support grayscale release or formal release at the tenant-based level. The unit clusters are independent of each other, and their independence can reduce the connection between tenants and achieve resource isolation, thereby improving the disaster recovery capability of the applied ESOP system and the overall performance of the system.
[0015] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0017] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0018] Figure 2 yes Figure 1 A schematic diagram of the structure of a tenant terminal and an ESOP system in an exemplary embodiment in the implementation environment of the illustrated embodiment;
[0019] Figure 3 is a flowchart of a grayscale publishing method shown in an exemplary embodiment of the present application;
[0020] Figure 4 yes Figure 3 A schematic diagram of a service architecture of an analog front end used in an exemplary embodiment of the illustrated embodiment;
[0021] Figure 5 is a flowchart of a grayscale publishing method shown in an exemplary embodiment of the present application;
[0022] Figure 6 yes Figure 3 Step S200 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0023] Figure 7 yes Figure 3 A schematic diagram of a service architecture of a simulated backend applied in the illustrated embodiment in an exemplary embodiment;
[0024] Figure 8 yes Figure 3Step S200 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0025] Fig. 9 It is a backend script logic diagram of a grayscale publishing method shown in an exemplary embodiment of the present application;
[0026] Fig.10 is a block diagram of a grayscale publishing device shown in an exemplary embodiment of the present application;
[0027] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0031] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0032] In the related art, ESOP (Employee Stock Ownership Plan) is a new form of equity, which means that the company grants the company's stocks or equity to the company's operators (executives, core employees, employees, etc.), making them shareholders of the company to obtain the rights to share the company's profits and participate in the company's business decisions. Compared with the equity incentive system that uses company stocks as the target to provide long-term incentives to the company's employees, ESOP is an organizational form in which the company's employees personally invest in equity or stocks and then entrust the company to manage them uniformly. It involves a wide range of areas and is relatively loose in terms of system. ESOP also has the following advantages: employees have the dual identities of workers and shareholders, which unifies the interests of employees and the interests of the company; it helps to optimize the corporate equity structure; it can be effectively applied to corporate financing and expansion; it provides an internal trading market for the stocks of non-publicly held companies, etc.
[0033] Grayscale release refers to a release method that can smoothly transition between black and white. The grayscale release process can include defining goals, selecting strategies, screening users, deploying systems, publishing summaries, and improving products. Among them, the selected strategies include user scale, release frequency, functional coverage, rollback strategies, operational strategies, and new and old system deployment strategies; screening users includes screening user characteristics, user numbers, user common functions, user scope, etc.; deploying systems includes deploying new systems, deploying user behavior analysis systems (webanalytics), setting diversion rules, operating data analysis, and fine-tuning diversion rules; and publishing summaries include publishing user behavior analysis reports, user questionnaires, collecting social media opinions, and forming a list of product function improvements.
[0034] A / B testing can be performed on it for the release of new features of the system. That is, some tenants of the system continue to use product feature A, and some tenants start using product feature B. If the tenants have no objection to B, then the scope is gradually expanded and all tenants are migrated to B. In this way, when the system needs to release new features, grayscale release is applied to obtain feedback from tenants, to find and fill in the gaps, and to roll back when major problems are found.
[0035] Through the grayscale release mentioned above, problems can be discovered and adjusted at the initial grayscale stage to ensure that the impact of the problem does not expand further. This can avoid certain release risks, reduce the scope of impact of product iteration and upgrade, and quickly obtain user feedback, improve product functions, improve product quality, and avoid inconvenience to users caused by service suspension and release.
[0036] However, the existing method of releasing new functions through grayscale release requires full release to take effect when it involves simultaneous transformation of the front-end and back-end of the system, that is, full release is carried out after the testing and pre-release environment is confirmed. If the release of new functions introduces bugs, it will affect all tenants, causing the scope of the bug to expand. After completing the business of some tenants that will cause the system service performance to decline, it will also have an adverse impact on the business of other tenants, thereby affecting the overall performance of the system.
[0037] In order to solve the above problems, the embodiments of the present application propose a grayscale release method, device, electronic device and storage medium based on the ESOP system, and these embodiments will be described in detail below.
[0038] First see Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a terminal 10 and a server 20, and the terminal 10 and the server 20 communicate with each other through a wired or wireless network. After receiving the service request sent by the terminal 10, the server 20 distributes the traffic according to the tag field corresponding to the grayscale release requirement contained in the service request, forwards it to the unit cluster corresponding to the above tag field to execute the service request for grayscale release or formal release, and obtains the returned execution result, and transmits the obtained execution result to the terminal 10 for display.
[0039] See also Figure 2 , Figure 2 is Figure 1 In the implementation environment shown, a schematic diagram of the structure of the tenant terminal and the ESOP system in an exemplary embodiment of the grayscale release method application is shown, and the ESOP system is deployed with a simulation front end and a simulation back end and a unified access layer connecting the simulation front end and the simulation back end. The tenant terminal sends a business request to the ESOP system, the simulation front end obtains the business request, and the service contained in the simulation front end distributes the business request through the tag field contained in the business request. After being distributed to the unified access layer, the business requests with different tag fields are forwarded to the unit cluster corresponding to the tag field in the simulation back end according to the forwarding rules in the unified access layer, and the business request is executed in the simulation back end for grayscale release or formal release to obtain the execution result, and finally the obtained execution result is transmitted to the tenant terminal for display.
[0040] Compared with the grayscale release solution of the prior art, the grayscale release method provided by this implementation environment can realize grayscale release based on tenants as the basic level, reduce the connection between tenant businesses, and improve the disaster recovery capability of the applied ESOP system and the overall performance of the system.
[0041] It should be noted that Figure 1The terminal 10 in the implementation environment shown can be any electronic device such as a smart phone, tablet, laptop, computer, etc.; the server 20 server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content delivery Network, CdN), as well as big data and artificial intelligence platforms, and there is no restriction here.
[0042] Figure 3 is a flowchart of a grayscale release method based on an ESOP system shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown in Figure 1 The server 20 in the embodiment shown is specifically implemented. In other implementation environments, the method may be implemented by devices in other implementation environments, and this embodiment does not limit this.
[0043] like Figure 3 As shown, in an exemplary embodiment, the grayscale release method may include steps S100 to S300, which are described in detail as follows:
[0044] Step S100, obtaining a business request, the business request includes a tag field, the tag field corresponds to the tenant's grayscale release requirements, including a grayscale field or a formal field, indicating whether the current request needs to be forwarded to the grayscale environment.
[0045] When a tenant has a release requirement for grayscale release or formal release, a business request will be generated and issued. The tenant's grayscale release requirement will be obtained before sending the business request. The different tag fields contained in different business requests are obtained based on the different grayscale release requirements of each tenant. After obtaining, they can be pre-added and stored in the session (time domain) object of the business request in the form of fields or other forms. When a tenant generates a business request, the business request will carry tenant information containing the session object. The session object is usually used to store user information, which has the characteristic of not easily losing data and can keep user information on the server for access from pages on any device at any time.
[0046] For example, in this embodiment, the tenant may include a company registered in the ESOP system. There are two types of ESOP users under the tenant, namely, administrator users and employee users. The corresponding identifiers of users in the ESOP system are unique. When a user requests to log in, the ESOP system will set whether the user needs grayscale according to the grayscale setting field of the tenant to which the user belongs, and the setting information is saved in the session.
[0047] Step S200: forwarding the service request to a unit cluster corresponding to the tag field according to a preset forwarding rule.
[0048] In this embodiment, after receiving the service request sent by the tenant terminal, the ESOP system will obtain the tenant information in the service request, extract the session object contained in the tenant information, and then query the session object to obtain the tag field corresponding to the service request. When it is confirmed that the value of the tag field contained in the service request requires grayscale, the service request containing the grayscale field is forwarded to the unit cluster corresponding to the tag field according to the forwarding rules preset by the ESOP system.
[0049] It should be noted that the unit clusters corresponding to different tag fields are independent of each other, that is, the unit cluster corresponding to the grayscale field and the unit cluster corresponding to the formal field are independent of each other. In this way, the association between tenants can be reduced, and the impact between business requests can be avoided when executing business requests of different tenants, thereby realizing resource isolation between unit clusters and between tenants.
[0050] Step S300: receiving an execution result returned by the service layer of the unit cluster after executing the business request.
[0051] In this embodiment, a service layer is separately deployed in each unit cluster of the ESOP system, and a plurality of services are packaged in the service layer for executing business requests. After the unit cluster receives the forwarded business request, it will route the business request to the service layer for execution. If it is a business request corresponding to a grayscale field, the service layer of the unit cluster will execute the database change. After the execution of the business request is completed, the corresponding execution result is obtained and returned to the tenant terminal. Among them, the unit cluster corresponds to the tag field and the unit clusters corresponding to different tag fields are independent of each other. Therefore, each unit cluster will only process the data of the tenant containing the corresponding tag field, that is, when a business request containing a grayscale tag is executed in the corresponding unit cluster, only the corresponding tenant database and the public library will be upgraded. When a business request containing a formal tag is executed in the corresponding unit cluster, only the non-grayscale tenant database will be upgraded.
[0052] From the above, it can be seen that in the grayscale release method based on the ESOP system provided in this embodiment, after receiving a business request, the tenant information in the business request is obtained, the session object contained in the tenant information is extracted, and then the session object is queried to obtain the tag field corresponding to the business request, and the business request is forwarded to the unit cluster corresponding to the above tag field according to the tag field, so as to support grayscale release or formal release at the tenant-based level, and each unit cluster is independent of each other, and the independence can reduce the connection between tenants. When the ESOP system executes business requests of different tenants, it can avoid the impact between each business request, so as to achieve resource isolation between unit clusters and between tenants, thereby improving the disaster recovery capability of the applied ESOP system and the overall performance of the system.
[0053] See also Figure 4 , Figure 4 yes Figure 2 In the structural diagram of the tenant terminal and ESOP system in which the grayscale publishing method is applied, a schematic diagram of the service architecture of the simulated front end of the ESOP system in an exemplary embodiment is shown.
[0054] In this embodiment, exemplarily, the service architecture of the simulated front-end pre-deployed in the ESOP system is deployed using k8s to deploy grayscale containers and formal containers corresponding to the grayscale release requirements. k8s stands for kubernetes, an open source container cluster management system that can realize the functions of automated deployment, automatic expansion and contraction, and maintenance of container clusters. It also has the characteristics of being portable (public cloud, private cloud, hybrid cloud, polymorphic cloud), scalable (modular, plug-in, mountable, combinable), and self-repairing (automatic deployment, automatic restart, automatic replication, automatic scaling), etc. Since the first letter of kubernetes is k, there are a total of 8 characters between the first and last letters, and the last letter is s, it is usually referred to as k8s.
[0055] In this embodiment, the above-mentioned simulation front end includes PHP and Node technology stacks. After the ESOP system receives the service request, it distributes the service request. First, the traffic is distributed through the PHP nginx access layer, and then the traffic is distributed through the reverse proxy at the code level after being transparently transmitted to the node access layer, and then distributed to the gray container or the formal container according to the tag field.
[0056] The above-mentioned technology stack is an IT term, which is a general term for a series of skill combinations that need to be mastered for a certain job or a certain position. Generally speaking, it refers to combining N technologies with each other (N>1) as an organic whole to achieve a certain purpose or function. It can also refer to the experience of mastering these technologies and using them together. The role of the technology stack in this application includes but is not limited to the traffic distribution function mentioned in the application content. Among them, php (Hypertext Preprocessor, Chinese name: hypertext preprocessor) is a general open source scripting language, and the php technology stack is a technology stack built with this general open source scripting language; in addition, the node technology stack is a technology stack built with Node.js, which is a Javascript runtime environment, or a Javascript language interpreter.
[0057] It should be noted that the nginx access layer of the PHP technology stack does not provide external access, such as Figure 4 The nginx access layer shown in the figure is not deployed in grayscale or formal mode, which prevents the business requests containing formal fields from being assigned to grayscale containers. The node access layer is deployed with grayscale nodes and formal nodes, corresponding to grayscale containers and formal containers, that is, grayscale containers correspond to grayscale nodes in the node access layer, and formal containers correspond to formal nodes in the node access layer. The formal nodes query the tag fields contained in the business requests, pass the business requests containing grayscale fields to the grayscale nodes, keep the business requests containing formal fields in the formal nodes, and distribute the business requests to grayscale containers or formal containers according to the tag fields.
[0058] In the service architecture of the above-mentioned simulation front end provided in this embodiment, after the simulation front end obtains the business request sent by the tenant terminal, the tag field can be obtained by pulling the company list of the tenant terminal that issued the business request. If the tag field of the tenant obtained from the list is a grayscale tag, the grayscale tag is written into the small text file (cookie) of the business request. The nginx access layer and the node access layer complete the traffic distribution of the business request according to the tag field and the cookie, and change the cmld-id of the CMLB route according to the env injected by the grayscale container and the formal container, and then forward the business request to the simulation back end through the unified access layer connected to the back end and the CMLB route. Among them, the env command is used to display the existing environment variables in the system and execute instructions in the defined environment. The CMLB route is a service gateway.
[0059] See also Figure 5 , Figure 5 yes Figure 4The service architecture of the analog front end shown in an exemplary embodiment, after receiving a service request containing a grayscale tag, a flowchart of a grayscale publishing method based on an ESOP system provided by the present application is implemented, such as Figure 5 As shown in FIG. 5 , it includes steps S501 to S506:
[0060] In step S501, the tenant terminal sends a service request to the nginx access layer.
[0061] In step S502, the nginx access layer transparently transmits the service request to the official node of the node access layer.
[0062] In step S503, the formal node queries the business request and obtains the grayscale mark included in the business request.
[0063] In step S504, the service request is transparently transmitted to the grayscale node according to the grayscale mark.
[0064] In step S505, the gray node forwards the business request to the service layer of the corresponding unit cluster to execute the business request.
[0065] In step S506, the execution result obtained by executing the business request is transmitted back to the Web server through each front-end service in turn, and the page data is generated in combination with the static resources and the execution result for return display, so as to realize data flow rollback, ensure the stability of the production environment, and reduce release accidents.
[0066] In the above embodiment, the simulation front end provided uses k8s to deploy the service architecture. K8s can realize the functions of automatic deployment, automatic expansion and contraction, maintenance, etc. of the container cluster, and it has the following characteristics: Fault migration, when a node is shut down or hangs up, the service on the node will be automatically transferred to another node, and all services will not be interrupted in this process; Resource scheduling, when the CPU and memory on the node are not enough, the node can be expanded, and the newly created pod (the smallest deployable computing unit created and managed in k8s) will be scheduled to the newly expanded node; Resource isolation, create three namespaces for development, operation and maintenance, and testing. After switching the context, the developer can only see all the pods in the development namespace, and cannot see the pods in the operation and maintenance namespace, so there will be no impact and no interference; Using docker containers, the processes do not affect each other. In this way, the isolation of tenants and their service resources in this embodiment can be better realized, and the association between tenants can be reduced, so there will be no impact and no interference.
[0067] In an exemplary embodiment of the present application, the tag field included in the business request sent by the tenant terminal corresponds to the grayscale release requirement in the middle platform instruction issued by the tenant. The tenant management page of the middle platform of the tenant terminal provides a grayscale switch setting function. The tenant issues the middle platform instruction through this function of the middle platform, and the middle platform instruction includes the grayscale release requirement. If the grayscale release requirement is a grayscale requirement, the tag field of the business request is a grayscale field. If the grayscale release requirement is a non-grayscale requirement, the tag field of the business request is a formal field. When the administrator or tenant logs in, the tag field set before will be stored in the tenant's session object, in preparation for the subsequent tenant to issue a business request for function release.
[0068] See also Figure 6 , Figure 6 yes Figure 3 The step S200 in the illustrated embodiment is a flow chart in an exemplary embodiment. Figure 6 As shown, step S200 may specifically include steps S201 to S202, and the service request is forwarded to the unit cluster corresponding to the tag field through the above steps, which are described in detail as follows:
[0069] Step S201, adding a traffic tag corresponding to the tag field to the service request.
[0070] The added traffic mark is used for traffic forwarding of the service request, and is applicable to the traffic forwarding rules in step S202. If the mark field is a grayscale field, a grayscale traffic mark is added to the service request. If the mark field is a formal field, a formal traffic mark is added to the service request. The traffic mark added to the service request is used for subsequent traffic forwarding in the unified access layer. For example, after adding traffic marks to service requests using the grayscale publishing method based on the ESOP system provided in this embodiment, service requests containing grayscale fields will carry a specific httphead (x-futu-client-grayflag=1) as a traffic mark, and service requests containing formal fields will also carry a specific httphead. The unified access layer will determine whether the service request needs to be released in grayscale or not based on the httphead, and then forward it based on the determination result.
[0071] Step S202: forwarding the service request to the corresponding pre-deployed unit cluster through traffic marking and forwarding rules.
[0072] In this embodiment, a unit cluster is pre-deployed in the ESOP system before obtaining a business request, wherein the grayscale unit cluster and the formal unit cluster are physically isolated from each other through an intermediate program, and the intermediate program includes middleware or external services.
[0073] The unit cluster in this embodiment uses the SET architecture design scheme. In the unit cluster architecture of this application, the central cluster is abandoned. Only the gray unit cluster and the formal unit cluster and the intermediate program, which are all sub-SETs, are deployed through the SET architecture design scheme. The SET architecture design is to solve the problem of a single large distributed cluster. Although it has a certain scalability through the internal split of the machine + cluster, with the further growth of business volume, the scale of the entire cluster becomes huge, which will reach a bottleneck at a certain point and cannot meet the scalability needs. In addition, problems occur in the core services of the large cluster, which will affect users of the entire network.
[0074] Under the SET architecture design, each unit cluster has the characteristic of only being responsible for the traffic processing within the unit. Combined with the intermediate program under the SET architecture design, traffic splitting and fault isolation can be achieved. In addition, each unit cluster only stores the transaction data generated by the unit in the early stage. Subsequently, bidirectional data synchronization can be performed through the intermediate program to achieve disaster recovery switching requirements, solve the scalability and disaster recovery problems encountered by the business, and support the rapid development of the system business.
[0075] like Figure 7 The service architecture diagram of the simulated backend of the grayscale publishing method based on the ESOP system that implements the present embodiment is shown, which shows the grayscale unit cluster and the formal unit cluster. The grayscale unit cluster and the formal unit cluster are physically isolated from each other through external services, such as rabbitmq (message queue), redis (cache), tdsql (distributed database), sba (Service Based Architecture) and other external services. That is, the same external services are deployed in the grayscale unit cluster and the formal unit cluster respectively for task execution within the unit cluster.
[0076] In addition, the intermediate program can also be middleware. The middleware under the SET architecture design can include RPC, KV, MQ, etc. Among them, RPC (Remote Procedure Call) calls the services closed in the cluster for cluster services; for non-cluster services, the existing routing logic is used; KV (Key-Value, distributed storage) supports data generation and query of unit clusters; MQ (Message Queue, message queue) supports message production and consumption of unit clusters. Middleware is a collection of common parts in the process of information system interaction and integration, shielding the underlying complex and common functions such as communication, interaction, and connection, and providing them in the form of products. When interacting, middleware can be directly used for connection and interaction, which can avoid a lot of code development and labor costs, and can also achieve the effect of physical resource isolation.
[0077] In this way, the forwarding of the service request in step S202 is specifically based on the pre-deployed grayscale unit cluster and formal unit cluster. If the traffic mark contained in the service request is a grayscale traffic mark, the service request is forwarded to the grayscale unit cluster; if the traffic mark contained in the service request is a formal traffic mark, the service request is forwarded to the formal unit cluster.
[0078] In this embodiment, the service layer in the grayscale unit cluster is deployed using a containerized (docker) deployment strategy. Docker is an open source engine that can easily create a lightweight, portable, self-sufficient container for any application. Docker is usually used for automated packaging and publishing of web applications; automated testing and continuous integration and publishing; deployment and adjustment of databases or other background applications in a service-oriented environment. At the same time, Docker can solve environmental configuration problems and isolate processes. The isolated processes are independent of the host operating system and other isolated processes, thereby ensuring that the allocated resources are isolated from each other between containers. Applying the docker deployment strategy to the deployment of the grayscale unit cluster in this embodiment further realizes the resource isolation of the grayscale unit cluster and the formal unit cluster, and the dockerized deployment facilitates capacity expansion and improves the performance of the system.
[0079] The five major advantages of Docker are sustainable deployment, support for version control, portability, isolation, and security. Sustainable deployment means that Docker can maintain consistency in different environments and maintain all configurations and dependencies inside the container. Therefore, the same container can be used from development to production, and the same container can be run on different instances. When performing upgrades during the product release cycle, you only need to make necessary changes to the Docker container, test it, and push the same changes to the existing container. This makes Docker very flexible, ensuring that there are no differences between environments or manual intervention, and also ensuring that developers no longer need to configure a set of environments that are identical to the production environment.
[0080] Supporting version control means that docker containers standardize the use of the environment to ensure environmental consistency between different developers and release cycles. Docker containers work like GIT (open source distributed version control system) repositories, which can receive submitted modifications to a docker image and perform version control. Suppose a component upgrade is performed, and this upgrade destroys the entire application environment, you can roll back to the previous version of the docker image in a few minutes. Compared with the general virtual machine backup and image creation process, docker is faster and can quickly replicate containers and achieve environmental redundancy.
[0081] Portability means that Docker containers can run in cloud servers or virtual machines, as long as the operating system running on the host supports Docker. In this way, containers running on a cloud service instance can be easily ported between various environments, such as to virtual machines, to achieve consistent functionality.
[0082] Isolation means that Docker ensures that each container has its own resources and is isolated from other containers. You can run completely different infrastructures for different applications, and ensure that each application only uses the resources allocated to them (CPU, memory, and disk space). Resource exhaustion usually leads to performance degradation or complete unavailability of other applications. With resource isolation, no specific application will occupy all available resources, improving the overall availability and stability of the service.
[0083] Security means that Docker mounts sensitive mount points of the host (such as / proc and / sys) as read-only in the container, and uses a copy-on-write file system to ensure that containers cannot read each other's data. It also restricts applications in the container from making system calls to the host, and is well compatible with security measures such as SELinux (Security-Enhanced Linux, a security subsystem) and AppArmor (Linux system security application). In addition, all Docker images on Docker's multi-port forwarder are digitally signed to ensure that the images used by users are complete and have not been modified by third parties. Since Docker containers are isolated and container resources are limited, even if an application is hacked or crashes, it will not affect applications running on other Docker containers.
[0084] It can be concluded that the docker deployment strategy is applied in the deployment of the grayscale unit cluster of this embodiment to implement the grayscale release method, further realize the resource isolation of the grayscale unit cluster and the formal unit cluster, and the docker deployment facilitates capacity expansion, improves the service performance and stability of the system, and ensures the sustainable development of the ESOP system and more possibilities.
[0085] See also Figure 8 , Figure 8 yes Figure 3 The step S200 in the illustrated embodiment is a flow chart in an exemplary embodiment. Figure 8 As shown, step S200 may further include step S203, and the service request is forwarded to the unit cluster corresponding to the tag field through the above steps, which is described in detail as follows:
[0086] Step S201, adding a traffic tag corresponding to the tag field to the service request.
[0087] If the tag field is a grayscale field, a grayscale traffic tag is added to the service request. If the tag field is a formal field, a formal traffic tag is added to the service request. The traffic tag added to the service request is used for subsequent traffic forwarding at the unified access layer.
[0088] Step S202: forwarding the service request to the corresponding pre-deployed unit cluster through traffic marking and forwarding rules.
[0089] In this embodiment, a unit cluster is pre-deployed in the ESOP system before obtaining a business request, wherein the grayscale unit cluster and the formal unit cluster are physically isolated from each other through an intermediate program, and the intermediate program includes middleware or external services.
[0090] The business request also includes a configuration file. After the business request is forwarded to the unit cluster in step S202, the grayscale release method of this embodiment also includes step S203, routing the business request to the service layer in the unit cluster through the service identifier and tenant identifier included in the configuration file.
[0091] After receiving the forwarded service request, each unit cluster obtains the configuration file contained therein, which includes identification information such as service ID and tenant ID (serviceid, appid), and routes the service request to each unit cluster separately deployed by the service ID. Figure 7 In the services in the service layer (esop2-service, esop2-assets) shown in the figure, the service identifier serviceid corresponds to the service requested by the business request, and the tenant identifier appid corresponds to the tenant and is unique.
[0092] As can be seen from the above, in the method provided in this embodiment, after the unified access layer receives the service request transmitted by the front-end service, the unified access layer forwards the traffic through the added traffic tag corresponding to the tag field, and the service request containing the grayscale traffic tag and the formal traffic tag is forwarded to the pre-deployed grayscale unit cluster and the formal unit cluster respectively, and the service request is routed to the service layer in the corresponding unit cluster based on the configuration file contained in the business request, and the business request is executed and the execution result is returned. At the same time, through the SET architecture grayscale unit cluster and formal unit cluster, grayscale unit cluster and formal unit cluster intermediate program and grayscale unit cluster container deployment strategy, resource isolation is ensured in many aspects, so as to achieve tenant-level service resource isolation and support grayscale release on a tenant basis, reduce the association between tenants, thereby improving the disaster recovery capability of the ESOP system of the application and maximizing the utilization of system resources.
[0093] In another embodiment of the present application, a backend script logic diagram of a grayscale release method of a backend service in an ESOP system production environment is provided, such as Fig. 9 As shown in , after db (business request), the corresponding business request is forwarded to the gray unit cluster and the formal unit cluster based on the tag field, and only the task script of the unit cluster is executed in each unit cluster, such as Fig. 9 The scheduled task script is executed in different unit clusters to only process the data of the company in this unit cluster. The queue consumption script consumes the tasks of the queue of this unit cluster, and supports the message production and consumption of each unit cluster through their respective middleware MQ. This reflects the actual application scenario. The grayscale release method provided by this application can be used to realize grayscale release by tenant through marking fields, and the physical resource isolation of the unit cluster and the resource isolation between tenants can be realized through the deployment of the unit cluster.
[0094] Furthermore, in this embodiment, when the queue consumption script consumes the task of the unit cluster queue, the task parameters corresponding to the task are first determined according to the task information. Specifically, the task information in this embodiment includes the target weight Tar_wei, task time Tar_tim and processing difficulty coefficient Tar_dic corresponding to the task target. Based on the above information, the task parameter Tar_par is determined as:
[0095] Tar_par=α·Tar_wei·e Tar_tim Tar_dic
[0096] Among them, α represents the task factor.
[0097] Afterwards, the tasks are sorted according to the task parameters, and the tasks are sent to the corresponding unit cluster queues in order, so that the queue consumption script can process the tasks in sequence based on the order in the unit cluster queue, thereby improving the efficiency of task processing.
[0098] Fig.10 FIG. 1 is a block diagram of a grayscale publishing device 1000 based on an ESOP system according to an exemplary embodiment of the present application. Fig.10 As shown, the device comprises:
[0099] The receiving module 1001 is used to obtain a business request, where the business request includes a tag field corresponding to the grayscale release requirement of the tenant, where the tag field includes a grayscale field or a formal field;
[0100] A distribution module 1002, configured to forward the service request to a unit cluster corresponding to the tag field according to a preset forwarding rule, wherein the unit clusters corresponding to different tag fields are independent of each other;
[0101] The publishing module 1003 is used to receive the execution result returned by the service layer of the unit cluster after executing the business request.
[0102] The device applies the grayscale release method provided in the present application. After receiving a business request, the receiving module 1001 is used to obtain the tenant information in the business request, and the session object is extracted from the tenant information, and then the session object is queried to obtain the tag field corresponding to the business request. Then, the distribution module 1002 forwards the business request to the unit cluster corresponding to the above tag field according to the tag field, thereby supporting grayscale release or formal release at the tenant-based level. In addition, each unit cluster is independent of each other, and the independence can reduce the association between tenants. When the ESOP system executes business requests of different tenants, the impact between each business request can be avoided, thereby realizing resource isolation between unit clusters and between tenants, thereby improving the disaster recovery capability of the applied ESOP system and the overall performance of the system.
[0103] In another exemplary embodiment, the apparatus further comprises:
[0104] A deployment module, used for pre-deploying a unit cluster in the ESOP system, wherein the unit cluster includes a grayscale unit cluster and a formal unit cluster, and the grayscale unit cluster and the formal unit cluster are physically isolated from each other through an intermediate program, and the intermediate program includes middleware or external services;
[0105] A marking unit, used to add a traffic mark corresponding to a marking field to a service request;
[0106] A forwarding unit, used for forwarding the service request to the grayscale unit cluster when the traffic mark included in the service request is a grayscale traffic mark; and forwarding the service request to the formal unit cluster when the traffic mark included in the service request is a formal traffic mark;
[0107] A routing unit is used to route business requests to the service layer in the unit cluster through the service identifier and tenant identifier contained in the configuration file;
[0108] The above deployment module is also used to deploy the service layer in the grayscale unit cluster using a containerized deployment strategy.
[0109] It should be noted that the grayscale publishing device provided in the above embodiment and the grayscale publishing method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In actual applications, the grayscale publishing device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0110] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the road condition refresh method provided in the above-mentioned embodiments.
[0111] Fig.11 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0112] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method in the above embodiment. In RAM 1103, various programs and data required for system operation are also stored. CPU 1101, ROM 1102 and RAM 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0113] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCd), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0114] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0115] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A 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. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0116] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0118] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the road condition refreshing method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0119] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A grayscale release method based on the ESOP system, characterized in that: The ESOP system is deployed with an analog front end, the analog front end includes an nginx access layer and a node access layer, the node access layer includes a formal node and a gray node, and there is a communication connection between the formal node and the nginx access layer and the gray node; the method includes: Call the nginx access layer to obtain the business request generated by the tenant when there is a grayscale release requirement or a formal release requirement, and transparently transmit the business request to the formal node, wherein the business request includes a tag field, and the tag field corresponds to the grayscale release requirement of the tenant, including a grayscale field or a formal field, indicating whether the current business request needs to be forwarded to the grayscale environment; When the tag field is the formal field, calling the formal node to forward the service request to the unit cluster corresponding to the formal field; When the tag field is the grayscale field, calling the formal node to transparently transmit the service request to the grayscale node, and calling the grayscale node to forward the service request to the unit cluster corresponding to the grayscale field; The execution result returned by the service layer of the receiving unit cluster after executing the business request, the unit cluster is deployed using a SET architecture and is used to collect the business request, and the unit clusters corresponding to different tag fields are independent of each other.
2. The grayscale release method according to claim 1, characterized in that: The method further comprises: A unit cluster is pre-deployed in the ESOP system, wherein the unit cluster includes a grayscale unit cluster and a formal unit cluster, and the grayscale unit cluster and the formal unit cluster are physically isolated from each other through an intermediate program, and the intermediate program includes middleware or external services.
3. The grayscale release method according to claim 1, characterized in that: The service request further includes a configuration file. Before receiving the execution result returned by the service layer of the unit cluster after executing the service request, the method further includes: The business request is routed to the service layer in the unit cluster through the service identifier and the tenant identifier included in the configuration file.
4. The grayscale release method according to claim 1, characterized in that: If the grayscale release requirement is a grayscale requirement, the tag field is the grayscale field; if the grayscale release requirement is a non-grayscale requirement, the tag field is the formal field.
5. The grayscale release method according to any one of claims 1 to 4, characterized in that: The service layer in the unit cluster corresponding to the grayscale field is deployed using a containerized deployment strategy.
6. A grayscale release device based on the ESOP system, characterized in that: The ESOP system is deployed with an analog front end, which includes an nginx access layer and a node access layer, and the node access layer includes a formal node and a gray node, and there is a communication connection between the formal node and the nginx access layer and the gray node; the device includes: A receiving module is used to call the nginx access layer to obtain a business request generated by a tenant when the tenant has a grayscale release requirement or a formal release requirement, and transparently transmit the business request to the formal node, wherein the business request includes a tag field, and the tag field corresponds to the grayscale release requirement of the tenant, including a grayscale field or a formal field, indicating whether the current business request needs to be forwarded to the grayscale environment; A distribution module, configured to, when the tag field is the formal field, call the formal node to forward the service request to the unit cluster corresponding to the formal field; when the tag field is the gray field, call the formal node to transparently transmit the service request to the gray node, and call the gray node to forward the service request to the unit cluster corresponding to the gray field; The publishing module is used to receive the execution result returned by the service layer of the unit cluster after executing the business request. The unit cluster is deployed using a SET architecture and is used to collect the business request. The unit clusters corresponding to different tag fields are independent of each other.
7. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the grayscale release method based on the ESOP system as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the grayscale release method based on the ESOP system as described in any one of claims 1-5.
Citation Information
Patent Citations
Partition-based application disaster recovery system
CN111181789A
Micro-service gray release method, device, equipment and system and storage medium
CN111953780A
Service gray level link control method and device, computer equipment and storage medium
CN113055492A