A service governance method and system
By dividing the public domain and functional domain in the cloud-native architecture and adopting a unified routing and hierarchical management approach, the problem of complex cross-domain interactions of microservices is solved, the availability and reliability of service governance are improved, and the management requirements of network architecture are adapted.
Patent Information
- Application Number
- CN202310997959.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-08-09
AI Technical Summary
In cloud-native architectures, the cross-domain interactions of microservices are complex, leading to difficulties in service governance. Existing technologies struggle to effectively address issues such as cross-domain access and cross-domain service registration and discovery, impacting system availability and reliability.
By dividing the domain into public domains and functional domains, the public domain is used to achieve unified routing and hierarchical management, automatically configure service instances, establish a hierarchical mechanism, implement cross-domain service governance strategies, and avoid direct data communication between multiple functional domains.
It improves the availability, reliability, and scalability of service governance, reduces operating costs, adapts to the management needs of network architecture, and simplifies the interaction process of cross-domain services.
Smart Images

Figure CN116866415B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a service governance method and system. Background Technology
[0002] In cloud technology, as network architecture evolves from early single-layer architectures to cloud-native architectures, microservices have become a crucial infrastructure for cloud-native architectures, and more and more enterprises and organizations are leveraging microservices for business operations. Microservices rationally break down large applications into individual services, thereby enabling agile software development, reducing coupling between systems, and allowing services to be deployed independently, start quickly, and scale dynamically, making the entire system more adaptable to current business development needs. However, as service decomposition progresses, because each service in a microservice is deployed independently and distributed, and each service's domain has different three elements (port, protocol, and domain name), cross-domain interactions become complex when cross-domain business scenarios are involved, and cross-domain issues inevitably arise. Therefore, how to implement service governance has become a pressing technical problem that needs to be solved. Summary of the Invention
[0003] To address the problems existing in the prior art, embodiments of this application provide a service governance method, apparatus, system, computing device, computer storage medium, and product containing computer programs. By dividing the system into public domains and functional domains, unified routing can be achieved using the public domain. This allows functional domains to communicate with the public domain only, avoiding various problems caused by manual configuration when communicating with multiple functional domains. This can significantly improve the availability and reliability of service governance capabilities and better adapt to the management needs of network architecture.
[0004] In a first aspect, embodiments of this application provide a service governance system, which includes multiple domains, one of which is a public domain and the remaining domains are functional domains. Each of the multiple domains contains at least one service instance, and each service instance sends a service invocation request to a service instance in a domain other than the domain where the service instance is located. The public domain is used to obtain the service invocation request initiated by the service instance and send the service invocation request to the domain where the service instance to be invoked by the service invocation request is located. Each functional domain is used to process the service request and return the processing result to the public domain.
[0005] In some possible implementations, the public domain includes: a capability gateway component, which, when the domain of the service instance to be invoked in the service invocation request is a functional domain, sends the service invocation request to the functional domain where the service instance to be invoked in the service invocation request is located, and receives the response result returned by the functional domain; a service governance component, which stores the service capabilities of each service instance in the functional domain, and the correspondence between the service capabilities of each service instance in each functional domain and the functional domain address; and a hierarchical management component, which receives the service capability information sent by the functional domain.
[0006] In some possible implementations, when the domain of the service instance to be invoked by the service invocation request is a public domain, the capability gateway component is also used to route the service invocation request to the service instance to be invoked.
[0007] In some possible implementations, the service governance component includes: a service registration module for registering the registration information of service instances within the public domain to the service directory; and a service registration module for registering the registration information of service instances within the functional domain to the service directory.
[0008] In some possible implementations, each functional domain includes: a capability gateway component for data interaction with the public domain, including receiving service scheduling requests sent by the public domain, routing the service scheduling requests to the service instances that need to be invoked, and returning the response results of the service scheduling requests to the functional domain; a service governance component for storing the service capabilities of each service instance in the functional domain; and a hierarchical management component for sending the addresses and ports of each service instance in the functional domain to the public domain.
[0009] In some possible implementations, the hierarchical management component is specifically used to: convert the addresses and ports of each service instance in the functional domain into the addresses and ports of the capability gateway component, and send the addresses and ports of the capability gateway component to the public domain.
[0010] In some possible implementations, the method for obtaining service call requests initiated by service instances includes: obtaining service call requests initiated by service instances in the public domain; or receiving service call requests initiated by service instances in the functional domain.
[0011] In some possible implementations, the service call request is sent to the domain where the service instance to be called resides, including: when the service call request is initiated by a service instance in a public domain, the service call request is sent to the functional domain to be called; when the service call request is initiated by a service instance in a functional domain, the service governance component is queried to determine the domain where the service instance to be called resides; if the domain where the service instance to be called resides is a public domain, the service call request is routed to the service instance to be called; if the domain where the service instance to be called resides is a functional domain, the service call request is sent to the functional domain where the service instance resides.
[0012] Secondly, embodiments of this application provide a service governance method applied to a public domain, which is a domain specified in the service governance system. The method includes: obtaining a service call request initiated by a service instance; obtaining service information corresponding to the service call request based on the service call request, the service information including IP and port; routing the service call request to a service address; receiving the response result of the service call request; and returning the response result to the service instance that initiated the service call request.
[0013] Thirdly, embodiments of this application provide a service governance apparatus, the apparatus comprising: an acquisition module, configured to acquire a service call request initiated by a service instance; a processing module, configured to acquire service information corresponding to the service call request based on the service call request, the service information including IP and port; the processing module is further configured to route the service call request to a service address; and the processing module is further configured to receive the response result of the service call request and return the response result to the service instance that initiated the service call request.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium including a computer-readable command that, when read and executed by a computer, causes the computer to perform the method described in the second aspect.
[0015] Fifthly, embodiments of this application provide a computing device, including a processor and a memory, wherein the memory stores computer program commands, which, when executed by the processor, perform the method described in the second aspect.
[0016] In a sixth aspect, embodiments of this application provide a product comprising a computer program that, when the computer program product is run on a processor, causes the processor to perform the method described in the second aspect. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the architecture of a service governance system provided in an embodiment of this application;
[0019] Figure 2 This is a schematic diagram of the architecture of a capability gateway component provided in an embodiment of this application;
[0020] Figure 3 This is a schematic diagram illustrating the operation of a domain-based consumption capability gateway component provided in an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of the structure of a service governance component provided in an embodiment of this application;
[0022] Figure 5 This is a schematic diagram illustrating the operation of a cross-domain consumption capability gateway component provided in an embodiment of this application;
[0023] Figure 6 This is a schematic diagram of a hierarchical management process provided in an embodiment of this application;
[0024] Figure 7 This is a flowchart illustrating a service governance method provided in an embodiment of this application;
[0025] Figure 8 This is a schematic diagram of a data interaction process provided in an embodiment of this application;
[0026] Figure 9 This is a schematic diagram of another data interaction process provided in an embodiment of this application;
[0027] Figure 10 This is a schematic diagram of the architecture of a service governance device provided in an embodiment of this application;
[0028] Figure 11 This is a schematic diagram of the architecture of a computing device provided in an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.
[0031] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.
[0032] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0033] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.
[0034] To facilitate understanding of the embodiments of this application, the following will provide further explanation and description with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0035] First, let me introduce the technical terms used in this application:
[0036] 1. A service is a fundamental unit in a distributed architecture, comprising one or a set of software functions. Its purpose is for different clients to obtain relevant data over the network without needing to concern themselves with the specific details of the underlying implementation. Taking a user service as an example, when a client calls the registration function of the user service, the registration information is written to the database, cached, and a message is sent to notify other systems that are interested in the registration event. However, the caller is unaware of the service's specific processing logic.
[0037] 2. Service registration refers to the process where a service instance is loaded into a container at startup, and its relevant information, such as service name, IP address, and port, is registered with the system. A heartbeat mechanism is used to periodically refresh the current service's status in the system to confirm that the service is in a normal state. When the service terminates, it is deleted from the registry.
[0038] 3. Service discovery refers to the use of a service directory to record service information so that other services can quickly find these registered services.
[0039] 4. Service routing, also known as request routing or routing, refers to configuring certain rules to direct certain traffic to certain specific servers.
[0040] 5. Service rate limiting, also known as request rate limiting, refers to limiting the traffic to prevent the server from being overwhelmed in certain scenarios or during certain periods, while the server itself has limited capacity.
[0041] Next, the technical solutions provided in the embodiments of this application will be introduced.
[0042] In microservices, services are typically deployed in a distributed manner, communicating with each other via remote procedure calls (RPC). Distributed systems refer to multiple computers collaborating through network connections to solve computational and storage problems that a single computer cannot handle, communicating with each other via RPC. To address cross-domain issues arising in a distributed microservice framework, service governance is necessary for each service within the microservices. The core concept of service governance is service self-consistency, and its ultimate goal is to comprehensively manage potential problems within the microservices of the microservice framework. Effective service governance improves service reliability, reduces operating costs, optimizes services, and becomes a crucial means of ensuring cloud service quality and security. Among the relevant technologies for service governance, those focusing on intra-domain service governance are primarily mature, with numerous research findings and successful practical examples. However, cross-domain service governance, such as cross-domain access, cross-domain service registration and discovery, and cross-domain traffic control, has not yet received sufficient attention and research. Cross-domain typically refers to clients and servers operating in different domains. However, cross-domain service governance is a key link in achieving service interoperability and service integration.
[0043] Cross-domain service governance requires addressing cross-domain interaction issues. Currently, there are typically two modes for implementing cross-domain interaction. The first is the pairwise communication mode, where the client (also known as the service consumer) can directly initiate service requests (also known as service call requests) to any service provider (also known as a service invocation request). However, in this implementation, since a single service call request may request multiple services in a distributed service, the client's demand may not match the number of application programming interfaces (APIs) available on the server. The client may need to initiate multiple requests to ultimately obtain complete data. For example, if a request needs to call three APIs, but these three APIs are provided by three different services, the client may need to initiate three requests to obtain complete data. Furthermore, multiple services may be distributed across different domains, requiring data interoperability between consumers and providers, i.e., pairwise communication between multiple domains. For example, a client (consumer) might initiate a request that requires calling three APIs, but these three APIs are provided by services (providers) in three different domains, each providing only one API. In this case, the client needs to communicate with each of the three services separately. For a single domain (e.g., the consumer's domain), it needs to expose multiple interfaces, which undoubtedly reduces security and convenience. The second approach is a hierarchical managed routing and forwarding model, where the service gateway is the sole node entering the system. The service gateway uniformly accepts all server requests and then forwards them to the servers. In this implementation, because the service gateway is a highly available component, resources must be invested in its separate development, deployment, and management upfront. Furthermore, the service gateway may cause unnecessary network hops, reducing service efficiency.
[0044] In view of this, this application provides a service governance method that uses a hierarchical and domain-based approach, including dividing the domain into public domains and functional domains. The public domain is used to implement hierarchical management, unified routing (cross-domain capability invocation mechanism), automated configuration of service instances, and hierarchical mechanisms for domains. This method can automatically implement service governance strategies within and across domains, allowing functional domains to connect with the public domain only. This avoids various problems caused by manual configuration when connecting multiple functional domains, significantly improving the availability and reliability of service governance capabilities and better adapting to the management needs of network architecture.
[0045] The technical solutions provided in the embodiments of this application will be further described below with reference to the accompanying drawings.
[0046] For example, Figure 1 This application provides a schematic diagram of a service governance system according to an embodiment of the present application. Figure 1As shown, the service governance system 100 can include multiple domains, one of which is designated as public domain 110, and the others as functional domains 120. Functional domain 120 includes n sub-functional domains, denoted as functional domain 121, ..., functional domain 12n. Each domain can include at least one service, and each service can provide specific service content (including service resources, etc.) by starting its corresponding service instance. Each service instance has its own IP address and port. When the requested resource is within the current domain, the request is a same-domain request; when the requested resource is not within the current domain, the request is a cross-domain request. When the request is a same-domain request, consumers within the same domain can consume the service capabilities provided within their own domain. When the request is a cross-domain request, consumers across domains can consume service capabilities provided by other domains, including public domain 110 and the other functional domains 12n, through public domain 110.
[0047] Public domain 110 can formulate service governance policies for services within public domain 110 and multiple functional domains 120. Public domain 110 includes a capability gateway component 111, a service governance component 112, and a hierarchical management component 113. The capability gateway component 111 is responsible for routing requests, security authentication, rate limiting, etc. The capability gateway in public domain 110 and the capability gateway components in functional domain 120 can work together to complete cross-domain request calls. It provides rich features for efficient service control. Service governance component 112 is mainly responsible for service registration, service catalog management, load balancing, and the formulation (or mechanisms) of service circuit breaking rules. It can maintain the service catalog and provide service status and detail queries, service topology, and other service lifecycle management functions, ensuring service reliability and stability. Hierarchical management component 1113 enables hierarchical and domain-specific management and communication scheduling. Functional domain 120 can use hierarchical management component 1113 to configure service capabilities and report status to public domain 110. The functions of each component are described in detail below.
[0048] Capability gateway component 111 is the executor in the system, which processes service call requests according to various rules (or mechanisms) specified in the system. For example, Figure 2 A schematic diagram of the structure of the capability gateway component provided in an embodiment of this application is shown. Figure 2As shown, the capability gateway component 111 may include a security authentication module 1111, a request routing module 1112, and a request rate limiting module 1113. The security authentication module 1111 can be used to perform security verification on consumer requests. For example, it can prevent malicious attacks and unauthorized access through methods such as Internet Protocol (IP) whitelists and Application Programming Interface (API) keys. The request routing module 1112 can be used to implement routing functions. Specifically, when the capability gateway component 111 receives a consumer request, it can distribute the request to multiple service instances according to a load balancing algorithm. The request routing module 1112 can forward the request to a specific service instance based on the request distribution information obtained from the load balancing algorithm, thereby achieving fast response and high availability. When the request is a cross-domain request, the request routing module 1112 can also route the request to the capability gateway component in the corresponding sub-functional domain 12n. The request rate limiting module 1113 can be used to implement rate limiting functions. Specifically, when the capability gateway component 111 receives a consumption request, it can limit the number of concurrent requests and the access volume within a time window to prevent system paralysis or service crashes due to excessive requests. For example, Figure 3 This illustration shows a schematic diagram of the operation of a domain-based consumption capability gateway component provided in an embodiment of this application. Figure 3 As shown, a consumer within the domain initiates a service call request, and the capability gateway component 111 receives the service call request from the consumer. The security authentication module 1111 performs security authentication on the service call request. After successful security authentication, the request routing module 1112 forwards the service call request to a specific service instance to respond to the service call request.
[0049] In addition, the capability gateway component 111 can also perform performance monitoring and logging functions. The capability gateway component 111 can monitor system performance, process status, network traffic, and other information in the current domain in real time. It can record the real-time monitored information in the logs of the current domain and query the information in the logs of the current domain. This helps to promptly detect problems in the domain (e.g., public domain 110, functional domain 120), thereby improving the system's operating efficiency and stability.
[0050] Capability gateway component 111 can also transmit data with various sub-functional domains within functional domain 120. Specifically, capability gateway component 111 can receive requests sent by capability gateway components in various sub-functional domains, and return responses to these requests to the capability gateway components in the sub-functional domains. In this way, a unified service entry point can be achieved through capability gateway module 111.
[0051] Service governance component 112 is primarily used to define rules, such as circuit breaker rules and load balancing rules. After defining rules, these rules can be synchronized to capability gateway component 111, allowing the capability gateway component to process call requests according to the rules defined in service governance component 112. Capability gateway component 111 can also actively query service governance component 112 to obtain specified rules when processing service call requests. Alternatively, service governance component 112 can distribute specified rules to capability gateway component 111 at fixed intervals (e.g., 30 seconds). For example... Figure 4 This is a schematic diagram of the structure of a service governance component provided in an embodiment of this application. For example... Figure 4As shown, the service governance component 112 may include a service catalog module 1121, a service registration module 1122, a service circuit breaker module 1123, and a load balancing module 1124. The service catalog module 1121 includes two types of service catalogs: the first type stores service information for services registered within the public domain 110, including service instances and the service capabilities provided by those instances; the second type stores service information for services registered in each sub-functional domain of functional domain 120, as well as the correspondence between service capabilities and functional domains. The service information may include service instances and the service capabilities provided by those instances. The service catalog stores service information and information about the instances providing the service. Multiple instances can exist. The service registration module 1122 can receive registration information from service instances within its own domain (public domain 110) and register the instance registration information to the service catalog module 1121. It can also receive registration information from service instances in other domains (each sub-functional domain 12n within functional domain 120) and register the instance registration information to the service catalog module 1121. The instance registration information can include the instance's IP address and port. When the registration information pertains to service instances within a sub-functional domain, it can be the address of the capability gateway for that sub-functional domain. Through the service registration module 1122 and the service discovery function, callers can find and obtain registered service information, ensuring reliable communication between services. Simultaneously, service registration and discovery reduce coupling between services, enhancing the scalability and flexibility of service governance. Through service registration and discovery, the system can automatically manage, maintain, and upgrade services, improving system availability and maintainability. Service registration and discovery also provide foundational support for functions such as fault recovery, load balancing, and traffic control. The service circuit breaker module 1123 can be used to define service circuit breaker rules, such as stopping calls to the service when the requested service becomes unavailable, times out, or the number of requests reaches a system-defined threshold. This prevents the entire system from crashing due to the unavailability of a single service. For example, if the proportion or number of service call failures reaches a fixed threshold (e.g., 10 times) within a fixed time window (e.g., 20 seconds, 30 seconds, etc.), subsequent requests to call the service will be rejected. After a certain period of time (e.g., 30 seconds), requests to call the service will be accepted again. If the request fails at this time, the system will continue to wait for a certain period of time (still 30 seconds). If the request is successful at this time, normal request calls will be resumed.The load balancing module 1124 can be used to formulate load balancing rules. For example, according to the load balancing algorithm, it can obtain the instances that are capable of providing services among the multiple instances required by the request. For example, instances 1, 2, and 3 can all provide the services required by the request. When instances 1, 2, and 3 are all idle, the load balancing module 1124 can randomly allocate an instance to the request. When only instance 3 is idle, instance 3 is directly allocated to the request.
[0052] The hierarchical management component 113 can be used to establish a hierarchical mechanism for domains, thereby enabling the management of different domains and services in a distributed system. Specifically, the hierarchical management component 113 can receive service capability information sent by each sub-functional domain in functional domain 120, and transmit the received service capability information to the service governance component 112, so as to realize the function of service capability registration for each sub-functional domain 12n in functional domain 120.
[0053] The above is an introduction to public domain 110. Next, we will introduce functional domain 120.
[0054] Please continue reading. Figure 1 ,like Figure 1 As shown, functional domain 120 includes n sub-functional domains, and each sub-functional domain 12n can have service governance policies defined. Each sub-functional domain 12n is equipped with a capability gateway component 1201, a service governance component 1202, and a hierarchical management component 1203.
[0055] The capability gateway component 1201 includes a security authentication module 1211, a request routing module 1212, and a request rate limiting module 1213. The functions of the security authentication module 1211, request routing module 1212, and request rate limiting module 1213 can be found in the descriptions of the security authentication module 111, request routing module 1112, and request rate limiting module 1113 in the capability gateway component 111 of the aforementioned public domain 110, and will not be repeated here. For example, Figure 5 This diagram illustrates the operation of a cross-domain consumption capability gateway component provided in an embodiment of this application. Figure 5As shown, a consumer initiates a service call request. Capability gateway component 111 in public domain 110 forwards this request to capability gateway component 1201 in the corresponding functional domain 12n. The security authentication module 1211 in capability gateway component 1201 performs security authentication on the service call request. After successful authentication, the request routing module 1212 routes the request to the corresponding service instance. The consumer can be a consumer within public domain 110, meaning the service call request was initiated by a consumer within the public domain. Alternatively, the consumer can be a consumer within a sub-functional domain, i.e., capability gateway component 111 in public domain 110 receives service call requests from capability gateway components in the sub-functional domain where the consumer resides, and then continues the aforementioned process.
[0056] Service governance component 1202 also includes a service catalog module, a service registration module, a service circuit breaker module, and a load balancing module. The service catalog module stores service information within the sub-functional domain in which it resides. The difference between the service catalog module in the sub-functional domain and the service catalog module 1121 in the public domain is that the service catalog module in the sub-functional domain only stores service information within its own sub-functional domain and does not store service information from other domains. The service registration module registers service information with the service catalog module. The functions of the service circuit breaker module and the load balancing module can be found in the descriptions of the aforementioned service circuit breaker module 1123 and load balancing module 1124, and will not be repeated here.
[0057] The hierarchical management component 1203 converts the addresses of service capability instances in sub-functional domains into capability gateway addresses and sends these addresses to the public domain 110. The service governance module 112 in the public domain 110 stores these capability gateway addresses, enabling functional domain 12n to receive requests based on them. In this way, the hierarchical management component 1203 registers the service capabilities of its sub-functional domain 12n with the public domain 110, allowing the public domain 110 to invoke these capabilities. This approach not only integrates the service capabilities of sub-functional domain 12n into the public domain 110 for management but also enhances the combination and reuse of service capabilities across domains (including functional domains 110 and 120), making service access between domains more convenient and promoting the stability of cross-domain services.
[0058] For example, please refer to Figure 6 , Figure 6 This is a schematic diagram of a hierarchical management process provided in an embodiment of this application. For example... Figure 6As shown, each service instance in sub-functional domain 12n registers its service information with service governance component 1202, which then sends the registered service information to hierarchical management component 1203. Upon receiving the service instance's registration information, hierarchical management component 1203 sends it to hierarchical management component 113 in public domain 110. Hierarchical management component 113 in public domain 110 receives the service instance registration information sent by hierarchical management component 1203 in sub-functional domain 12n and sends it to service governance component 112, which then registers the service instance information in sub-functional domain 12n. Thus, when a consumer request needs to invoke a service instance in sub-functional domain 12n, public domain 110 can correctly send the request to sub-functional domain 12n.
[0059] In this way, each sub-functional domain reports its service capabilities to the public domain through a hierarchical management component. The service governance component in the public domain then unifies the management and control of service capabilities within its own domain (i.e., the public domain) and functional domains (i.e., each sub-functional domain) (i.e., hierarchical management and unified routing). Finally, the capability gateway component routes requests. This approach ensures that each sub-functional domain only communicates with the public domain, without needing to communicate with other sub-functional domains in the system. This not only improves service processing efficiency but also reduces the complexity of cross-domain service systems. Simultaneously, each sub-functional domain can retain its own security controls and load balancing mechanisms, further enhancing service reliability.
[0060] The above is an introduction to the service governance system provided in the embodiments of this application. The following is a further introduction to a service governance method provided in the embodiments of this application through specific examples.
[0061] For example, Figure 7 This is a flowchart illustrating a service governance method provided in an embodiment of this application. This service governance method can be applied to... Figure 1 The public domain 110 in the service governance system 100 shown. For example... Figure 7 As shown, the process of this service governance method may include the following steps:
[0062] S701: Obtain the service call request initiated by the consumer, where the consumer is the initiator of the service call request (i.e., the service instance that initiated the service call request).
[0063] In this embodiment, the public domain can obtain service call requests issued by consumers. Since this embodiment uses a single service call request as an example for description, some modules in the data transmission process (such as circuit breaking, rate limiting, load balancing, etc.) are not described. For specific modules, please refer to the relevant descriptions in the service governance system described above.
[0064] In some possible embodiments, the consumer is a consumer in the public domain. Figure 8 This illustration shows a data interaction process according to an embodiment of this application. The specific business scenario involves a consumer in the public domain needing to call a service in functional domain 121. In this data interaction process, the consumer is a consumer in the public domain, and the service governance component 112 in the public domain 110 can directly obtain the service call request issued by the consumer.
[0065] In some possible embodiments, the consumer is a consumer within a functional domain. Figure 9 This illustration shows another data interaction process provided by an embodiment of this application. The specific business scenario is that a consumer in functional domain 121 needs to call a service in functional domain 122. In this data interaction process, the consumer is a consumer in sub-functional domain 121. Specifically, the consumer in sub-functional domain 121 initiates a service call request. This call request is sent to public domain 110 through capability gateway component 1201 in sub-functional domain 121. Capability gateway component 111 in public domain 110 receives the service call request and forwards it to service governance component 112.
[0066] S702: Based on the service call request, obtain the service information corresponding to the service call request, which includes the IP and port.
[0067] In this embodiment, after obtaining the service call request initiated by the consumer, the service information of the specific service to be called in the service call request can be queried through the service catalog module in the service governance component, and the IP address and port of the instance that can provide the service can be determined.
[0068] In some possible embodiments, the consumer is a consumer in the public domain. Please continue reading. Figure 8 If the service to be invoked in the service call request is provided by service instance 1 in functional domain 121, then after the service governance component 112 receives the service call request issued by the consumer, it queries the service catalog to obtain the instance (i.e., service instance 1) corresponding to the service to be invoked in the service call request, as well as the service information (i.e., the address of the capability gateway component in functional domain 121), such as IP and port.
[0069] In some possible embodiments, the consumer is a consumer within a functional domain. Please continue reading. Figure 9 After receiving a service call request from the capability gateway component 1201 in the sub-functional domain 121, the capability gateway component 111 queries the service directory. After querying the service directory, the service governance component 112 can obtain the service information corresponding to the instance that can provide the service, so that the capability gateway component 111 can process the service call request according to the service information.
[0070] S703: Route the service call request to the service address.
[0071] In this embodiment, after obtaining the service information corresponding to the service call request, the capability gateway component can send the service call request to the functional domain corresponding to the IP address and port contained in the service information, so that the functional domain can respond to the service call request. Specifically, the capability gateway component sends the service call request to the capability gateway component in the functional domain corresponding to the service information. For example, please refer to... Figure 8 The service to be invoked in the service invocation request is provided by service instance 1 in functional domain 121. Capability gateway component 111 obtains the IP and port of capability gateway component 1201 and sends the service invocation request to capability gateway component 1201 based on the obtained IP and port.
[0072] S704: Receive the response result of the service call request and return the response result to the consumer that initiated the service call request.
[0073] In this embodiment, the functional domain responds to the service call request and receives a response result. After receiving the response result, it returns it to the public domain. The public domain receives the response result and sends it to the consumer. For example, please refer to [link to example documentation]. Figure 8 In functional domain 121, capability gateway component 1201 receives a service call request sent by capability gateway component 111. After performing security authentication and other operations on the request, request routing module 1212 routes the request to service instance 1. Service instance 1 responds to the service call request and receives the response result. After receiving the response result, functional domain 121 sends this response result to capability gateway component 111 through capability gateway component 1201. Upon receiving the response result, capability gateway component 111 returns the response result to the consumer.
[0074] In some possible embodiments, the consumer is a consumer within a functional domain. In this case, after the public domain receives the response to the service call request, it returns the response to the functional domain that initiated the request. The capability gateway component within the functional domain receives the response and then returns it to the consumer. For details, please refer to... Figure 9 After receiving a service call request, the capability gateway component 1201 in functional domain 122 performs security authentication and other operations on the request. Then, the request routing module 1212 routes the request to service instance 1, which responds to the service call request and receives the response result. Upon receiving the response result, functional domain 122 sends it to capability gateway component 111 through capability gateway component 1201. After receiving the response result, capability gateway component 111 returns it to the consumer in functional domain 121.
[0075] The above is an introduction to the service governance method provided in the embodiments of this application. When requesting cross-domain access (i.e., cross-domain data interaction), there are generally two modes to achieve cross-domain interaction: pairwise communication mode and hierarchical management routing forwarding mode. As can be seen from the content described in the above embodiments, the solution provided in the embodiments of this application belongs to the hierarchical management routing forwarding mode. By dividing public domains and functional domains, hierarchical management, unified routing (i.e., cross-domain capability invocation mechanism), automatic configuration of service instances, and establishment of hierarchical mechanisms for domains, it can automatically implement service governance strategies within and across domains, avoid various problems caused by manual configuration, significantly improve the availability, reliability, and scalability of service governance capabilities, and better adapt to the management needs of network architecture.
[0076] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in some possible implementations, each step in the above embodiments may be selectively executed according to actual circumstances; it may be partially or fully executed, without limitation here. All or part of any feature of any embodiment of this application can be freely and arbitrarily combined without contradiction. The combined technical solutions are also within the scope of this application.
[0077] Based on the methods in the above embodiments, this application also provides a service governance apparatus.
[0078] For example, Figure 10 An apparatus for service governance is shown, which can be deployed on a computing device. For example... Figure 10 As shown, the service management device 1000 includes an acquisition module 1001 and a processing module 1002.
[0079] The acquisition module 1001 is used to acquire service call requests initiated by service instances. The processing module 1002 is used to acquire service information corresponding to the service call request, including IP address and port, based on the service call request. The processing module 1002 is also used to route the service call request to the service address. The processing module 1002 is further used to receive the response result of the service call request and return the response result to the service instance that initiated the service call request.
[0080] It should be understood that the above-described device is used to execute the methods in the above embodiments. The implementation principle and technical effect of the corresponding program modules in the device are similar to those described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, and will not be repeated here.
[0081] This application also provides a computing device 1100. For example... Figure 11 As shown, the computing device 1100 includes a bus 1102, a processor 1104, a memory 1106, and a communication interface 1108. The processor 1104, the memory 1106, and the communication interface 1108 communicate with each other via the bus 1102. The computing device 1100 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1100.
[0082] Bus 1102 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 11 The bus 1104 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 1104 may include a path for transmitting information between various components of the computing device 1100 (e.g., memory 1106, processor 1104, communication interface 1108).
[0083] The processor 1104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0084] The memory 1106 may include volatile memory, such as random access memory (RAM). The processor 1104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0085] The memory 1106 stores executable program code, and the processor 1104 executes the executable program code to implement the functions of the aforementioned acquisition module 1001 and processing module 1002, thereby implementing all or part of the steps of the method in the above embodiments. That is, the memory 1106 stores instructions for executing all or part of the steps in the method of the above embodiments.
[0086] Alternatively, the memory 1106 may store executable code, which the processor 1104 executes to implement the functions of the aforementioned service governance device 1000, thereby implementing all or part of the steps in the methods of the above embodiments. That is, the memory 1106 may store instructions for executing all or part of the steps in the methods of the above embodiments.
[0087] The communication interface 1108 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 1100 and other devices or communication networks.
[0088] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0089] Based on the methods in the above embodiments, this application provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0090] It is understood that the processor in the embodiments of this application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
[0091] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software commands. The software commands can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0092] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer commands. When the computer program commands are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer commands can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer commands can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0093] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.
Claims
1. A service governance system, characterized in that, The system comprises multiple domains, one of which is a public domain, and the remaining domains are functional domains. Each of the multiple domains contains at least one service instance, and each service instance sends service call requests to service instances in domains outside its own. The public domain is used to obtain service call requests initiated by service instances and send the service call requests to the domain where the service instance to be called by the service call request resides. The public domain includes: a capability gateway component, which, when the domain where the service instance to be called by the service call request resides is a functional domain, is used to send the service call request to the functional domain where the service instance to be called by the service call request resides, and to receive the response result returned by the functional domain; when the domain where the service instance to be called by the service call request resides is a public domain, the capability gateway component is also used to route the service call request to the service instance to be called; a service governance component, used to store a service catalog, the service catalog including the service capabilities of each service instance in the functional domain, and the correspondence between the service capabilities of each service instance in each functional domain and the functional domain address; and a hierarchical management component, used to receive service capability information sent by the functional domain. Each of the functional domains is used to process service requests and return the processing results to the public domain. Each functional domain includes a hierarchical management component, which is used to convert the addresses and ports of each service instance in the functional domain into the addresses and ports of the capability gateway component and send them to the public domain.
2. The system according to claim 1, characterized in that, The service governance components include: The service registration module is used to register the registration information of service instances within the public domain to the service directory; The service registration module is also used to register the registration information of service instances within the functional domain to the service directory.
3. The system according to claim 1, characterized in that, Each of the functional domains includes: The capability gateway component is used to interact with the public domain, including receiving service scheduling requests sent by the public domain, routing the service scheduling requests to the service instances that need to be invoked, and returning the response result of the service scheduling requests to the functional domain. The service governance component is used to store the service capabilities of each service instance in the functional domain. The hierarchical management component is used to send the addresses and ports of each service instance in the functional domain to the public domain.
4. The system according to claim 3, characterized in that, The hierarchical management component is specifically used for: The addresses and ports of each service instance in the functional domain are converted into the addresses and ports of the capability gateway component, and the addresses and ports of the capability gateway component are sent to the public domain.
5. The system according to any one of claims 1-4, characterized in that, The method for obtaining service call requests initiated by service instances includes: Retrieve service call requests initiated by service instances in the public domain; Alternatively, it can receive service call requests initiated by service instances within a functional domain.
6. The system according to claim 5, characterized in that, Sending the service invocation request to the domain where the service instance to be invoked by the service invocation request resides includes: When the service call request is initiated by a service instance in the public domain, the service call request is sent to the functional domain to be called. When the service call request is initiated by a service instance in a functional domain, the service governance component is queried to determine the domain of the service instance to be called by the service call request. If the domain of the service instance to be called by the service call request is a public domain, the service call request is routed to the service instance to be called. If the domain of the service instance to be called by the service call request is a functional domain, the service call request is sent to the functional domain of the service instance.
Citation Information
Patent Citations
Cross-subdomain communication operation and maintenance method, total operation and maintenance server and medium
CN110113188A
