Service tag-based routing gateway implementation method, system, electronic device and medium

By deploying additional sub-services with unique tags for tenants in the SASS environment, the problem of high deployment and maintenance costs for customized services is solved, enabling flexible customized service deployment, reducing costs and simplifying the maintenance process.

CN115589425BActive Publication Date: 2026-03-20PINMING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In the microservices scenario of the construction industry, the deployment and maintenance of customized services are costly and time-consuming, making it difficult for small and medium-sized enterprises to support them. Furthermore, the lack of mature operation and maintenance capabilities leads to troublesome private deployment and maintenance.

Method used

In a SASS environment, additional sub-services are deployed for tenants who require customized services, and these sub-services are tagged with unique labels. The API gateway determines whether a request is tagged with a unique label and prioritizes sending it to the corresponding sub-service or to the default service.

Benefits of technology

It reduces the deployment and maintenance costs of customized services, improves flexibility, meets customized needs without affecting the business of the default version, and simplifies the complexity of private deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115589425B_ABST
    Figure CN115589425B_ABST
Patent Text Reader

Abstract

The application relates to a service tag-based routing gateway implementation method and system, an electronic device and a medium, wherein the service tag-based routing gateway implementation method is used in an SASS environment, a sub-service is additionally deployed for a tenant requiring customized services in addition to a default service, and the sub-service is marked with an exclusive tag of the tenant; the method comprises the following steps: in the case that a tenant client initiates a business calling request to an API gateway, determining whether the request is specified with an exclusive tag; if yes, sending the request to a sub-service corresponding to the exclusive tag; if no, sending the request to the default service; through the application, the situation that both customized capabilities are required and private deployment is not intended can be met, the default version of the business is not affected, the cost is greatly reduced, flexibility is improved, and the problems that deployment and operation and maintenance of customized services are quite troublesome in the related art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of microservices, and in particular to a service label-based routing gateway implementation method and system, an electronic device and a medium. BACKGROUND

[0002] The current popular microservice system includes microservices, a service (SDS) that provides microservice registration and discovery, and an API gateway. Among them, the microservice obtains the API routing address of another microservice through the SDS to realize the communication between microservices, or the microservice communicates with another microservice through the SDS and the API gateway.

[0003] The internal business of enterprises in today's construction industry is diverse, and the rules are not the same. As a SASS version system, its business is difficult to cover all aspects, and large enterprises will have their own particularity, which requires customizing interfaces, businesses, etc. For the microservice scene, especially the microservice scene of the intelligent construction site system in the construction industry, because the standards of each enterprise are not unified, there may be different versions of services customized for different enterprises, which brings many challenges to the SASS version. In related technologies, customized services can only be deployed in a private way, which is costly and has a long delivery cycle, and small and medium-sized enterprises are difficult to support. Moreover, the construction enterprises themselves do not have mature operation and maintenance capabilities, which makes private deployment maintenance quite troublesome.

[0004] For the problem that the deployment and operation and maintenance of customized services in related technologies are quite troublesome, no effective solution has been proposed. SUMMARY

[0005] The embodiments of the present application provide a service label-based routing gateway implementation method and system, an electronic device and a medium to at least solve the problem that the deployment and operation and maintenance of customized services in related technologies are quite troublesome.

[0006] In a first aspect, the embodiments of the present application provide a service label-based routing gateway implementation method. In a SASS environment, a sub-service is additionally deployed for a tenant who needs customized services in addition to the default service, and the sub-service is labeled with an exclusive label of the tenant. The method comprises:

[0007] In the case that the tenant's client initiates a business call request to the API gateway, it is determined whether the request specifies an exclusive label. If yes, the request is sent to the sub-service corresponding to the exclusive label;

[0008] If no, the request is sent to the default service.

[0009] In some embodiments, before the sending the request to the sub-service corresponding to the exclusive tag, the method further comprises: determining whether the sub-service corresponding to the exclusive tag exists, so as to send the request to the sub-service if the sub-service exists.

[0010] In some embodiments, after the sending the request to the sub-service corresponding to the exclusive tag, the method comprises: determining whether there is a downstream service to be called, and if yes, continuously transmitting the request specified route into the request of the downstream service.

[0011] In some embodiments, the determining whether the request specifies an exclusive tag comprises: determining whether the request specifies an exclusive tag according to a service type and a tenant ID of the request, wherein an HTTP service specifies an exclusive tag through a request header, a Dubbo service specifies an exclusive tag through a transparent parameter, and the rest of the services specify an exclusive tag through an environment variable.

[0012] In a second aspect, the embodiments of the present application provide a service tag-based routing gateway implementation system, in a SASS environment, a sub-service is additionally deployed for a tenant requiring customized services in addition to a default service, and the sub-service is marked with an exclusive tag of the tenant; the system comprises:

[0013] A determining module is configured to determine whether a request initiated by a client of a tenant to an API gateway specifies an exclusive tag;

[0014] A first sending module is configured to send the request to a sub-service corresponding to the exclusive tag if the request specifies the exclusive tag;

[0015] A second sending module is configured to send the request to the default service if the request does not specify the exclusive tag.

[0016] In some embodiments, in the first sending module, before the sending the request to the sub-service corresponding to the exclusive tag, it is further determined whether the sub-service corresponding to the exclusive tag exists, so as to send the request to the sub-service if the sub-service exists.

[0017] In some embodiments, in the first sending module, after the sending the request to the sub-service corresponding to the exclusive tag, it is further determined whether there is a downstream service to be called, and if yes, the request specified route is continuously transmitted into the request of the downstream service.

[0018] In some embodiments, in the determining module, the process of determining whether the request specifies a special label comprises: determining whether the request specifies a special label according to a service type of the request and a tenant ID, wherein an HTTP service specifies a special label through a request header, a Dubbo service specifies a special label through a transparent parameter, and the rest of the services specify a special label through an environment variable.

[0019] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the service label-based routing gateway implementation method.

[0020] In a fourth aspect, a storage medium is provided, wherein the storage medium stores a computer program, and the computer program is configured to perform the service label-based routing gateway implementation method when running.

[0021] Compared with the problem that deployment and operation and maintenance of a customized service are quite troublesome in the related art, the embodiments of the present application can deploy a customized developed sub-service for a tenant that needs a customized service in a SASS environment, the sub-service is labeled, when a client where the tenant is located calls a business, the sub-service that is customized and developed for the tenant is preferentially requested, thus, a situation that both needs a customized capability and does not want to be privately deployed can be met, and the default version of the business is not affected, the cost is greatly reduced, flexibility is improved, and the problem that deployment and operation and maintenance of a customized service are quite troublesome in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application, illustrate the illustrative embodiments of the present application and their description serve to explain the present application, and do not constitute improper limitations on the present application. In the drawings:

[0023] Figure 1 is an application environment schematic diagram of the service label-based routing gateway implementation method according to an embodiment of the present application;

[0024] Figure 2 is a schematic diagram of the service label-based routing gateway implementation method according to a first embodiment of the present application;

[0025] Figure 3 is a schematic diagram of a default service of a smart construction site business according to a second embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a customized service of a smart construction site business according to a second embodiment of the present application;

[0027] Figure 5is a schematic diagram of a service tag based routing gateway implementation method according to a third embodiment of the present application;

[0028] Figure 6 is a structural block diagram of a service tag based routing gateway implementation system according to a fourth embodiment of the present application;

[0029] Figure 7 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the objects, technical solutions and advantages of the present application clearer, the present application is described and explained below in connection with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0031] Obviously, the drawings in the following description are only some examples or embodiments of the present application, and for those of ordinary skill in the art, the present application can be applied to other similar scenarios without creative efforts based on these drawings. In addition, it can be understood that although the efforts made in this development process can be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some designs, manufacturing or production changes based on the technical content disclosed in the present application are only routine technical means, and should not be understood as insufficient disclosure of the present application.

[0032] In the present application, "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment that is not mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.

[0033] Unless otherwise defined, technical terms and scientific terms used in the present application shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terms "a", "an", "one", "this", and the like, as used in the present application, do not denote a limitation of quantity and can mean one or more. The terms "comprising", "containing", "having", and "including" and their variations, as used in the present application, are intended to cover the respective terms "consisting essentially of", "consisting of", and "consisting of" without excluding additional steps, materials, or elements. The terms "connected", "coupled", and "linked", as used in the present application, are not limited to direct connections, but can include indirect connections, unless otherwise defined. The term "plurality" means two or more. The term "and / or" describes an associated relationship between associated objects, and means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects. The terms "first", "second", "third", and the like, as used in the present application, are merely to distinguish similar objects, and do not represent a specific order of the objects.

[0034] The service tag-based routing gateway implementation method provided by the present application can be applied to an application environment as shown in Figure 1 Figure 1 is a schematic diagram of an application environment of the service tag-based routing gateway implementation method according to an embodiment of the present application, as shown in Figure 1 The terminal 102 and the server 104 communicate through a network. The server 104 pre-deploys a sub-service in addition to a default service for a tenant who needs customized services in a SASS environment, and marks the sub-service with an exclusive tag of the tenant. In the case that the tenant's terminal 102 initiates a business call request to the API gateway, the server 104 determines whether the request specifies an exclusive tag. If yes, the server 104 sends the request to the sub-service corresponding to the exclusive tag. If no, the server 104 sends the request to the default service. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0035] The present application provides a service tag-based routing gateway implementation method, Figure 2 is a schematic diagram of a service tag-based routing gateway implementation method according to a first embodiment of the present application, as shown in Figure 2 The flow includes the following steps:​

[0036] Step S201, in the case that a tenant's client initiates a service call request to the API gateway, it is determined whether the request specifies a special tag; if so, the request is sent to the sub-service corresponding to the special tag;

[0037] Step S202, if not, the request is sent to the default service.

[0038] Through the above steps S201 to S202, with respect to the problem that the deployment and operation and maintenance of the customized service are quite troublesome, the embodiment of the application deploys a sub-service specially developed for the tenant who needs a customized service in the SASS environment, and the sub-service is marked with a tag. When the tenant's client calls the service, it will preferentially request the sub-service specially developed for it. This can meet the situation of needing customization capability and not wanting to deploy privately, and does not affect the default version of the service, greatly reduces the cost, improves flexibility, and solves the problem of deployment and operation and maintenance of the customized service in the related art.

[0039] In some embodiments, Figure 3 is a schematic diagram of a default service of a smart construction site business according to the second embodiment of the application, Figure 4 is a schematic diagram of a customized service of a smart construction site business according to the second embodiment of the application, as Figure 3 and Figure 4 shown, the smart construction site business includes A service and B service, and tenants a and β consume the smart construction site service, wherein tenant β needs to customize B service (B1), and B1 has reached its special business needs. Therefore, in the entire request link, as long as the tenant's tag is met, the service with the tag will be preferentially requested.

[0040] In some embodiments, Figure 5 is a schematic diagram of a service tag-based routing gateway implementation method according to the third embodiment of the application, as Figure 5 shown, in the SASS environment, a sub-service is additionally deployed for a tenant who needs a customized service in addition to the default service, and the sub-service is marked with a special tag of the tenant. In the case that a tenant's client initiates a service call request to the API gateway, it is determined whether the request specifies a special tag. If no special tag is specified, the default service is requested. If a special tag is specified, it is determined whether the sub-service corresponding to the special tag exists. If it does not exist, the bottom service (the service without a tag is the default service, that is, the bottom service) is requested. If it exists, the request is sent to the sub-service corresponding to the special tag, and it is determined whether there is a downstream service to be called. If there is a downstream service to be called, the request specified by the routing is continuously transmitted to the request of the downstream service until the call is successful.

[0041] In some embodiments, the process of label setting includes setting a label for a service through an environment variable in the same cluster or different cluster, and the service without a label is a default service; the process of label filtering includes checking whether a label of a request is specified according to a request type; if not, the environment variable of the current service is used as the label; if not, a default label is not set; the process of label routing includes routing a request to a specific tenant label service according to a tenant of the request in a program, and here, each framework is adapted, and the request is continuously transmitted to a request of a downstream service; if there is no corresponding service, the request is routed to a default service without a label; if there is no label, the request is routed to a default service without a label.

[0042] In some embodiments, a bottom-up solution is also provided, if a request carries a label, and the label exists in all services in a service chain, the request is routed to the service with the label; if the request carries a label, and the label exists in some services in the service chain, the request is routed to the service with the label, otherwise, the request is routed to a service without a label; if the request carries a label, and there is no service with the label in the service chain, the request is routed to a service without a label; if the request carries no label, the request is routed to a service without a label, and a service with a label will not be requested.

[0043] Considering that the overall routing scheme involves multiple aspects, including HTTP requests, RPC requests, MQ messages, etc., the embodiments of the present application provide a general framework, including label setting, label filtering, and a bottom-up solution, but the label routing needs to be adapted to each different framework or middleware, such as specifying a label through a request header for an HTTP service, specifying a label through a transparent parameter for a Dubbo service, and specifying a label according to a tenant ID by default; among them, the HTTP and RPC methods are to provide a label when registering a service, and to select a service through a label when load balancing, and other frameworks can implement a label routing function according to needs to seamlessly access the overall service routing system. Further, for each framework mentioned above, the middleware needs to separately implement a label routing function, an SDK supporting each framework and middleware can be set to help each business to quickly access with zero configuration, and through the SDK, the business group can be updated and upgraded more quickly in the case of new feature support, and the business group does not need to be aware of the specific implementation.

[0044] The embodiments of the present application also provide a service label-based routing gateway implementation system, Figure 6 is a structural block diagram of the service label-based routing gateway implementation system according to the fourth embodiment of the present application, like Figure 6As shown, in the SASS environment, a sub-service is additionally deployed outside the default service for a tenant requiring customized service, and the sub-service is labeled with the exclusive label of the tenant; the system comprises a determination module 61, a first sending module 62 and a second sending module 63, wherein:

[0045] The determination module 61 is configured to determine whether the request is specified with the exclusive label in the case that the tenant on the client initiates a business calling request to the API gateway; the first sending module 62 is configured to send the request to the sub-service corresponding to the exclusive label in the case that the request is specified with the exclusive label; and the second sending module 63 is configured to send the request to the default service in the case that the request is not specified with the exclusive label.

[0046] In some embodiments, in the first sending module 62, before the request is sent to the sub-service corresponding to the exclusive label, it is further determined whether the sub-service corresponding to the exclusive label exists, so as to send the request to the sub-service in the case that the sub-service exists.

[0047] In some embodiments, in the first sending module 62, after the request is sent to the sub-service corresponding to the exclusive label, it is further determined whether there is a downstream service to be called, and if yes, the routing specified by the request is continuously transmitted into the request of the downstream service.

[0048] In some embodiments, in the determination module 61, the process of determining whether the request is specified with the exclusive label comprises: determining whether the request is specified with the exclusive label according to the service type and the tenant ID of the request, wherein the HTTP service specifies the exclusive label through the request header, the Dubbo service specifies the exclusive label through the transparent parameter, and the rest of the services specify the exclusive label through the environment variable.

[0049] In combination with the above-mentioned service label-based routing gateway implementation method in the embodiments, the embodiments of the present application can provide a storage medium for implementation. The storage medium has a computer program stored thereon; the computer program is executed by a processor to implement any one of the above-mentioned service label-based routing gateway implementation methods.

[0050] In one embodiment, a computer device is provided, which can be a terminal. The computer device comprises a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is configured to communicate with external terminals through network connections. The computer program, when executed by the processor, implements a service tag based routing gateway implementation method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0051] In one embodiment, Figure 7 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, as Figure 7 shown, an electronic device is provided, which can be a server, and the internal structure diagram thereof can be as Figure 7 shown. The electronic device comprises a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is configured to provide computing and control capabilities, the network interface is configured to communicate with external terminals through network connections, the internal memory is configured to provide an environment for running the operating system and the computer program, the computer program, when executed by the processor, implements a service tag based routing gateway implementation method, and the database is configured to store data.

[0052] Those skilled in the art can understand that Figure 7 the structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device can comprise more or fewer components than those shown in the diagram, or combine certain components, or have a different arrangement of components.

[0053] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0054] Those skilled in the art should understand that, for the sake of brevity, not all possible combinations of the technical features in the above-mentioned embodiments are described, and as long as the combinations of the technical features do not contradict each other, they should be considered as falling within the scope of the present disclosure.

[0055] The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A method for implementing a routing gateway based on service tags, characterized in that, In a SASS environment, sub-services are pre-deployed in addition to the default services for tenants who require customized services, and the sub-services are tagged with the tenant's unique label. The method is applied to the microservice scenario of a smart construction site system in the construction industry, and the method includes: When a tenant's client initiates a business call request to the API gateway, determine whether the request specifies a unique tag; if so, send the request to the sub-service corresponding to the unique tag. If not, then send the request to the default service; The method also includes a general framework, including tag setting, tag filtering, and a fallback solution. The tag routing is adapted to different frameworks or middleware. HTTP services are specified through request headers, and Dubbo services are specified through pass-through parameters. By default, it is specified based on the tenant ID. HTTP and RPC methods provide tags during service registration, and load balancing filters services through tags. Middleware of other frameworks implements tag routing functionality as needed, seamlessly integrating with the overall service routing system. Middleware needs to implement tag routing separately and set up SDKs that support various frameworks and middleware to enable rapid integration of various businesses with zero configuration. The process of setting the label includes: in the same cluster or different clusters, setting labels for services through environment variables; services without labels are the default services. The tag filtering process includes: checking whether a tag has been specified for the request based on the request type; if not specified, the current service's environment variables are used as the tag; if none are specified, no tag is set by default. The tag routing process includes: the program requests the service with the specific tenant tag based on the tenant of the request. This will adapt to various frameworks and continuously pass through the route specified by the request to the requests of downstream services; if there is no corresponding service, it routes to the fallback service without a tag; if there is no tag, it routes to the default service without a tag. The fallback solution includes: when sending the request to the default service, if the request carries a tag and the tag exists in all service links, then the service is routed to the tagged service; if the request carries a tag and some services in the service links contain the tag, then services that contain the tag are matched first, otherwise services without the tag are matched; if the request carries a tag and there are no tagged services in the service links, then the request is routed to the service without the tag; if the request carries no tag, then the request is routed to the service without the tag.

2. The method according to claim 1, characterized in that, Before sending the request to the sub-service corresponding to the exclusive tag, the method further includes: determining whether the sub-service corresponding to the exclusive tag exists, so as to send the request to the sub-service if the sub-service exists.

3. The method according to claim 1, characterized in that, After sending the request to the sub-service corresponding to the exclusive tag, the method includes: determining whether there are any downstream services to be called; if so, continuously passing through the route specified by the request to the requests of the downstream services.

4. The method according to claim 1, characterized in that, The process of determining whether the request specifies a unique label includes: determining whether the request specifies a unique label based on the service type and tenant ID of the request, wherein the HTTP service specifies the unique label through the request header, the Dubbo service specifies the unique label through the pass-through parameters, and the other services specify the unique label through environment variables.

5. A service tag-based routing gateway implementation system, characterized in that, In a SASS environment, sub-services are pre-deployed in addition to the default services for tenants who require customized services, and the sub-services are tagged with the tenant's unique label. The system is applied to the microservice scenario of smart construction site systems in the construction industry. The system includes: The determination module is used to determine whether a specific tag is specified in a business call request initiated by the client of the tenant to the API gateway. The first sending module is used to send the request to the sub-service corresponding to the exclusive tag when the request specifies an exclusive tag; The second sending module is used to send the request to the default service if the request does not specify a special tag; The system also includes a general framework, including tag settings, tag filtering, and fallback solutions. The tag routing is adapted to different frameworks or middleware. HTTP services are specified through request headers, and Dubbo services are specified through pass-through parameters. By default, it is specified based on the tenant ID. HTTP and RPC methods provide tags during service registration, and load balancing filters services through tags. Middleware of other frameworks implements tag routing functionality as needed, seamlessly integrating with the overall service routing system. Middleware needs to implement tag routing separately and configure SDKs that support various frameworks and middleware to enable rapid integration of various businesses with zero configuration. The process of setting the label includes: in the same cluster or different clusters, setting labels for services through environment variables; services without labels are the default services. The tag filtering process includes: checking whether a tag has been specified for the request based on the request type; if not specified, the current service's environment variables are used as the tag; if none are specified, no tag is set by default. The tag routing process includes: the program requests the service with the specific tenant tag based on the tenant of the request. This will adapt to various frameworks and continuously pass through the route specified by the request to the requests of downstream services; if there is no corresponding service, it routes to the fallback service without a tag; if there is no tag, it routes to the default service without a tag. The fallback solution includes: when sending the request to the default service, if the request carries a tag and the tag exists in all service links, then the service is routed to the tagged service; if the request carries a tag and some services in the service links contain the tag, then services that contain the tag are matched first, otherwise services without the tag are matched; if the request carries a tag and there are no tagged services in the service links, then the request is routed to the service without the tag; if the request carries no tag, then the request is routed to the service without the tag.

6. The system according to claim 5, characterized in that, In the first sending module, before sending the request to the sub-service corresponding to the exclusive tag, it is also determined whether the sub-service corresponding to the exclusive tag exists, so that if the sub-service exists, the request is sent to the sub-service.

7. The system according to claim 5, characterized in that, In the first sending module, after sending the request to the sub-service corresponding to the exclusive tag, it is also determined whether there are downstream services to be called. If so, the route specified by the request is continuously passed through to the requests of the downstream services.

8. The system according to claim 5, characterized in that, In the determining module, the process of determining whether the request specifies a unique tag includes: determining whether the request specifies a unique tag based on the service type and tenant ID of the request, wherein the HTTP service specifies the unique tag through the request header, the Dubbo service specifies the unique tag through the pass-through parameters, and the other services specify the unique tag through environment variables.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the service tag-based routing gateway implementation method according to any one of claims 1 to 4.

10. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the service tag-based routing gateway implementation method according to any one of claims 1 to 4 at runtime.

Citation Information

Patent Citations

  • Micro-service calling method and device, equipment and storage medium

    CN114385386A