Business processing method and device, server and storage medium
By analyzing and converting client requests in the proxy server of the first cluster, generating a request to adapt to the second cluster, and sending the request to the second cluster, the problem of being difficult to implement transparent proxy in multi-cluster deployment scenarios is solved, and the client's unaware service processing is realized, and resource consumption is reduced.
Patent Information
- Application Number
- CN202311523921.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-16
AI Technical Summary
In multi-cluster deployment scenarios, it is difficult for the prior art to implement transparent proxying, especially when the client needs to adapt to the explicit commands related to the new cluster, resulting in opaque resource processing and high resource consumption.
By receiving the client's request in the proxy server of the first cluster, analyzing the cluster identity in the request, and calling the corresponding conversion service for processing, generating a request adapted to the second cluster, and sending the request to the second cluster, thereby realizing service processing for the second cluster.
It realizes that when the client is unaware, the service request processing of services in the second cluster is supported, which reduces the client's processing resource consumption and reduces changes to the client-side configuration, effectively implements transparent proxy in multi-cluster deployment scenarios.
Smart Images

Figure CN120017709A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a business processing method, device, server and storage medium. Background Art
[0002] With the popularity of cloud native technology, applications can generally be split into multiple parts and deployed in different containers to achieve higher scalability, flexibility, and reliability. As the scale of applications continues to expand, if the container resources of a single cluster are not enough to meet the demand, the application can also be expanded and deployed in the container resources of a new cluster to form a multi-cluster deployment.
[0003] In this multi-cluster deployment scenario, a multi-cluster proxy approach can be used to centrally handle services such as creation, update, and deletion of container resources in multiple clusters. In the multi-cluster proxy approach, you can define authentication information for new clusters through custom resources, and expand container resources for new clusters. However, this approach usually requires the client to adapt explicit commands related to the new cluster to support services for container resources in the new cluster, making it difficult to effectively implement transparent proxy. Summary of the invention
[0004] The present application provides a service processing method, device, server and storage medium for effectively implementing a transparent proxy in a multi-cluster deployment scenario.
[0005] In a first aspect, the present application provides a business processing method, which is applied to a proxy server in a cloud computing system. The proxy server belongs to a first cluster. The method includes: since the first request carries a first identifier indicating the first cluster, the proxy server can receive the first request from the client. And since the first request also carries a second identifier of a second cluster that executes the business corresponding to the first request, after the proxy server parses the first request, it can call a conversion service corresponding to the second identifier to process the first request to obtain a second request. Among them, the second request carries a third identifier indicating the business corresponding to the first request. Furthermore, the proxy server can send a second request to the second cluster to request the second cluster to execute the business indicated by the third identifier.
[0006] In the present technical solution, since the first request initiated by the client can directly carry the second identifier of the second cluster for executing the corresponding service, the proxy server can call the conversion service corresponding to the second cluster according to the second identifier, and obtain the second request adapted to the second cluster for executing the corresponding service, thereby avoiding the problem of generating a protocol adaptation request when the client switches to access a new cluster (e.g., the second cluster), and reducing the processing resource consumption of the client. In addition, since the conversion process from the first request to the second request is implemented by the proxy server in the first cluster, the client does not need to perceive the request conversion process when switching to access different clusters. Therefore, the present application can realize the conversion of the request protocol without adapting the second cluster on the client side, thereby reducing the configuration changes on the client side. Based on this, the proxy server can request the second cluster to execute the corresponding service based on the second request, and support the request processing of the service in the second cluster without the client's perception. Therefore, the present application can effectively realize transparent proxy in multi-cluster deployment scenarios.
[0007] In a possible implementation manner, the header of the first request includes the second identifier.
[0008] In one possible implementation, a proxy server is configured with a protocol buffer and a remote procedure call service; the protocol buffer includes multiple first call information; the multiple first call information corresponds one-to-one to the identifiers of multiple clusters, and the identifiers of the multiple clusters correspond one-to-one to the multiple protocol conversion services in the first cluster; calling the conversion service corresponding to the second identifier to process the first request to obtain a second request, specifically including: determining the target first call information corresponding to the second identifier from the multiple first call information in the protocol buffer; calling the protocol conversion service corresponding to the target first call information through the remote procedure call service, and processing the first request to obtain the second request.
[0009] In one possible implementation, the first cluster stores multiple configuration information; the multiple configuration information corresponds one-to-one to the identifiers of the multiple clusters; the configuration information includes attribute information and connection information of the cluster; the method also includes: sending a third request carrying a second identifier to the business server of the first cluster; the third request is used to request the configuration information corresponding to the second identifier; receiving the configuration information corresponding to the second identifier; generating a message carrying the configuration information corresponding to the second identifier; the message is sent to the second cluster before or after the second request.
[0010] In a possible implementation, the method for sending the second request to the second cluster specifically includes: establishing a connection with the second cluster based on configuration information corresponding to the second identifier, and sending the second request to the second cluster through the connection.
[0011] In one possible implementation, the proxy server is also configured with multiple cluster access services; the multiple cluster access services correspond one-to-one to the identifiers of the multiple clusters; the cluster access service is used to support the proxy server to access the cluster; the method also includes: determining the target cluster access service corresponding to the second identifier from the multiple cluster access services; based on the target cluster access service, processing the second request to obtain a processed second request; and sending the processed second request to the second cluster through the connection.
[0012] In a possible implementation, when there are multiple target cluster access services, based on the target cluster access service, a method for processing the second request to obtain a processed second request specifically includes: serially calling multiple target cluster access services to process the second request to obtain a processed second request.
[0013] In a possible implementation, the protocol buffer of the proxy server also includes multiple second call information; the multiple second call information corresponds one-to-one to the identifiers of the multiple clusters, and the identifiers of the multiple clusters correspond one-to-one to the multiple data format conversion services in the first cluster; the method also includes: receiving a business processing response from the second cluster; the business processing response carries a second identifier, and second response data indicating the business processing result; parsing the business processing response, and determining the second call information corresponding to the second identifier in the protocol buffer as the target second call information; calling the data format conversion service corresponding to the target second call information through a remote procedure call service to process the second response data, and obtain first response data that conforms to the data format corresponding to the first cluster; sending a rewritten post-processing response to the client; the rewritten post-processing response carries the first response data.
[0014] In a second aspect, the present application provides a resource processing device, which is applied to a proxy server in a cloud computing system, and the proxy server belongs to a first cluster. The device includes: a receiving unit, a parsing unit, a calling unit and a sending unit; the receiving unit is used to receive a first request from a client; the first request carries a first identifier indicating the first cluster, and a second identifier of a second cluster that executes a business corresponding to the first request; the parsing unit is used to parse the first request, and the calling unit is used to call a conversion service corresponding to the second identifier to process the first request to obtain a second request; the second request carries a third identifier indicating the business corresponding to the first request; the sending unit is used to send the second request to the second cluster; the second request is used to request the second cluster to execute the business indicated by the third identifier.
[0015] In a possible implementation manner, the header of the first request includes the second identifier.
[0016] In one possible implementation, a proxy server is configured with a protocol buffer and a remote procedure call service; the protocol buffer includes multiple first call information; the multiple first call information corresponds one-to-one to the identifiers of multiple clusters, and the identifiers of the multiple clusters correspond one-to-one to the multiple protocol conversion services in the first cluster; a calling unit is specifically used to: determine the target first call information corresponding to the second identifier from the multiple first call information in the protocol buffer; call the protocol conversion service corresponding to the target first call information through the remote procedure call service, and process the first request to obtain a second request.
[0017] In one possible implementation, the first cluster stores multiple configuration information; the multiple configuration information corresponds one-to-one to the identifiers of the multiple clusters; the configuration information includes attribute information and connection information of the cluster; the device also includes: a generating unit; a sending unit, which is also used to send a third request carrying a second identifier to the business server of the first cluster; the third request is used to request the configuration information corresponding to the second identifier; the receiving unit, which is also used to receive the configuration information corresponding to the second identifier; the generating unit, which is used to generate a message carrying the configuration information corresponding to the second identifier; the message is sent to the second cluster before or after the second request.
[0018] In a possible implementation manner, the sending unit is specifically configured to: establish a connection with the second cluster based on the configuration information corresponding to the second identifier, and send the second request to the second cluster through the connection.
[0019] In one possible implementation, the proxy server is also configured with multiple cluster access services; the multiple cluster access services correspond one-to-one to the identifiers of the multiple clusters; the cluster access service is used to support the proxy server to access the cluster; the device also includes: a determination unit and a processing unit; the determination unit is used to determine the target cluster access service corresponding to the second identifier from the multiple cluster access services; the processing unit is used to process the second request based on the target cluster access service to obtain a processed second request; the sending unit is also used to send the processed second request to the second cluster through the connection.
[0020] In a possible implementation, the processing unit is specifically configured to: serially call multiple target cluster access services to process the second request to obtain a processed second request.
[0021] In a possible implementation, the protocol buffer of the proxy server further includes a plurality of second call information; the plurality of second call information corresponds one-to-one to the identifiers of the plurality of clusters, and the identifiers of the plurality of clusters correspond one-to-one to the plurality of data format conversion services in the first cluster;
[0022] The receiving unit is also used to receive a business processing response from the second cluster; the business processing response carries a second identifier and second response data indicating a business processing result; the parsing unit is also used to parse the business processing response, and determine the second call information corresponding to the second identifier in the protocol buffer as the target second call information; the calling unit is also used to process the second response data by calling the data format conversion service corresponding to the target second call information through the remote procedure call service, and obtain first response data that conforms to the data format corresponding to the first cluster; the sending unit is also used to send a rewritten post-processing response to the client; the rewritten post-processing response carries the first response data.
[0023] In a third aspect, the present application provides a proxy server, which may include: a memory and a processor, the memory being used to store a computer program, the processor being used to call the computer program to execute the operating steps of the method in the first aspect or any possible implementation of the first aspect.
[0024] It should be noted that the memory and processor described in this application can be integrated on a single chip or can be separately arranged on different chips. This application does not limit the type of memory and the arrangement of the memory and the processor.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program runs on a proxy server, the proxy server executes the operating steps of the method in the first aspect or any possible implementation of the first aspect.
[0026] In a fifth aspect, the present application provides a computer program product, which, when running on a proxy server, enables the operation steps of the method in the first aspect or any possible implementation of the first aspect to be executed.
[0027] It can be understood that any of the proxy servers or computer-readable storage media or computer program products provided above are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of a container management system provided in an embodiment of the present application;
[0029] Figure 2 A schematic diagram of another container management system provided in an embodiment of the present application;
[0030] Figure 3 A schematic diagram of the structure of a cloud computing system provided in an embodiment of the present application;
[0031] Figure 4 A schematic diagram of a business processing flow provided in an embodiment of the present application;
[0032] Figure 5 A schematic diagram of the structure of a proxy server provided in an embodiment of the present application;
[0033] Figure 6 A flowchart of a business processing method provided in an embodiment of the present application;
[0034] Figure 7 A flowchart of another business processing method provided in an embodiment of the present application;
[0035] Figure 8 A schematic diagram of the structure of a business processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects rather than to limit a specific order.
[0037] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0038] The following is a brief introduction to the terms and technologies involved in the embodiments of the present application to facilitate the reader's understanding.
[0039] Multi-cluster proxy is an important concept that has developed rapidly in the cloud native and container fields in recent years. With the popularization of cloud native technology, applications can generally be split into multiple parts and deployed in different containers to achieve higher scalability, flexibility, and reliability. As the scale of applications continues to expand, when the container resources of a single cluster are not enough to meet the demand, the application can be expanded and deployed in the container resources of a new cluster to form a multi-cluster deployment.
[0040] In this multi-cluster deployment scenario, a multi-cluster proxy can be used to simplify management, deployment, and communication in a multi-cluster environment. A multi-cluster proxy can be understood as a centralized method that allows users to easily manage multiple distributed clusters without having to configure and operate each cluster independently, thereby reducing management complexity and improving efficiency.
[0041] Multi-cluster proxy can provide unified policy management to ensure the consistency of permissions and access control across clusters. Multi-cluster proxy can also support application deployment and migration capabilities between different cloud computing service providers and support hybrid cloud architecture to better meet business needs. In addition, multi-cluster proxy can also effectively manage resources and performance, optimize resource allocation and load balancing, and improve system stability and reliability.
[0042] In multi-cluster proxies, technologies such as virtual private network (VPN), software defined network (SDN), and service mesh can be used to support cross-cluster network connections to solve network communication problems between clusters.
[0043] With the development of multi-cluster agents, important trends and innovations such as cluster federation, hybrid cloud, and container orchestration engines have gradually been proposed.
[0044] Cluster Federation is a method of managing multiple clusters. It supports organizing multiple independent clusters into a logically unified whole, realizing cross-cluster resource sharing, management and scheduling, supporting the deployment and migration of applications between different clusters, and thus making better use of resources. Cluster Federation can realize cross-cluster deployment, resource sharing and utilization, policy and access control, high availability, flexibility and scalability, etc.
[0045] Cluster federation allows users to easily deploy applications between different clusters without having to worry about the differences in the underlying infrastructure, thus achieving cross-cluster deployment. Cluster federation can share and manage resources between multiple clusters, achieve resource sharing and utilization, and avoid resource waste. Cluster federation can unify management policies and access control to ensure that the same security and access rules are applied in multiple clusters. Cluster federation can achieve fault tolerance and fault recovery of applications between multiple clusters, improving the availability and stability of applications. In addition, cluster federation can provide flexible deployment and expansion options, and can increase or decrease the number of clusters according to needs, with flexibility and scalability.
[0046] In some embodiments of the present application, a cluster may run multiple containerized applications managed by a container orchestration engine such as a container cluster management system (Kubernetes, K8s). K8s is a platform for orchestrating and managing containers, which can support automated deployment, expansion, and operation of containers running applications, i.e., management of containerized applications. K8s can also support tasks such as load balancing, fault recovery, and dynamic scaling.
[0047] In some embodiments of the present application, the container can be built by a containerization platform such as an application container engine (Docker). Docker can encapsulate an application and its dependencies in a portable container to achieve consistency and portability of the application. The Docker container can be understood as a lightweight, independent and executable software package. The software package can include application code, runtime, system tools, libraries and settings to ensure the same behavior in different environments.
[0048] like Figure 1 As shown, it is a schematic diagram of the architecture of a container management system provided by an embodiment of the present application. The container management system may include K8s and Docker. K8s can be built on Docker to manage and orchestrate containers generated by Docker to support more efficient deployment and operation of containerized applications in a distributed environment.
[0049] For example, K8s can manage and orchestrate scheduled containers through the Cluster Scheduler. Scheduled containers are containers generated by Docker. Docker can support the orchestration of containers through the Managed Base OS, and can support the management of containers running in the cluster through the Node Container Manager. For example, monitoring container status and handling container events.
[0050] like Figure 2 As shown, it is a schematic diagram of the architecture of another container management system provided by an embodiment of the present application. The container management system may include a client, an application programming interface (API) service (API Server), a distributed component of the master node, a webhook extension component, and an extended distributed key value (ETCD). Among them, the API Server, the distributed component of the master node, and the webhook extension component belong to K8s.
[0051] The client can call the K8s API Server (Kube-apiserver) through the K8s command line tool (Kubernetes-Controller, Kubectl).
[0052] Kube-apiserver can be used as the front end of the control plane to manage interfaces for cluster configuration, application deployment, and status monitoring, and supports interaction with the cluster through the Representational State Transfer API (Restful API) to handle REST operations. For example, Kube-apiserver can have functions such as API processing, authentication and authorization, resource object storage, API version control, event notification, and admission control.
[0053] The API processing function is used to process API requests from user clients, command line tools, and other components. These API requests can be used to request operations such as create, read, update, and delete (CRUD) on resource objects to implement CRUD of resource objects. Resource objects can be container groups (Pod) and services (Service), etc., which can also be understood as container resources.
[0054] The authentication and authorization functions can support verifying the user's identity and decide whether to allow API requests to perform specific operations based on the permission policy.
[0055] The resource object storage function can support storing resource objects in the cluster in backend storage such as ETCD through persistence or serialization to ensure the consistency and reliability of the cluster status.
[0056] The API versioning feature can support identifying different versions of an API so that new functionality can be introduced without breaking existing functionality.
[0057] The event notification function can publish event notifications when resource objects change, allowing other components to respond to the changes. For example, the distributed components of the master node can respond and perform operations corresponding to the event.
[0058] The admission control function can be used to support the creation and modification of restricted resource objects, thereby ensuring the security and consistency of the cluster.
[0059] Webhook can be understood as a mechanism in K8s for automatically executing specific operations or responses, which is used to trigger custom external operations when specific events occur. Webhook can generally be divided into two types: admission webhook and mutating webhook.
[0060] Admission Webhook can execute custom logic before or after the K8s API server processes requests for creating, updating, or deleting resource objects, so as to support users to perform operations such as admission control and default value injection through custom logic to meet specific business needs.
[0061] Mutating Webhook can trigger modification operations on resource object creation or update requests before they reach the K8s API server, so as to achieve more advanced automation and customization. The modification operation can be used to automatically inject auxiliary containers, automatically set labels, etc.
[0062] Currently, in the multi-cluster proxy mode, you can define the authentication information of the new cluster through custom resources, and expand the container resources of the new cluster. This method mainly focuses on container management under multiple clusters, and requires that the expanded new cluster be included in the sub-cluster management through explicit commands. It is impossible to directly use the Restful API to connect to the new cluster, and you can only migrate the workload to the new cluster, which is difficult to effectively meet the requirements of transparent proxy.
[0063] Moreover, this method can generally support the expansion and deployment of clusters in mainstream container as a service (CaaS) platforms and standard K8s platforms, but it is difficult to support the expansion and deployment of non-standard K8s clusters, such as clusters that introduce custom authentication and certificate encryption rules. In addition, it is generally not compatible with different versions of platforms such as K8s, and upper-level users need to perceive the differences between different versions and implement compatible solutions.
[0064] Therefore, this method, which requires adapting relevant explicit commands on the client side, is difficult to effectively implement transparent proxy.
[0065] To this end, an embodiment of the present application provides a business processing method, device, server and storage medium. The method provided by the present application may include: after a proxy server of a first cluster receives a first request from a client, it may call a protocol conversion service corresponding to the second cluster in the first cluster when determining that the first request includes an association relationship between a first URL and a second cluster, convert a first URL that conforms to the URL protocol corresponding to the first cluster into a second URL that conforms to the URL protocol corresponding to the second cluster, and send a second request carrying the second URL to the second cluster so that the second cluster processes resources.
[0066] Based on this, when a new cluster (such as a second cluster) needs to be expanded and deployed, this application can support the client's access to the second cluster through the first cluster that has established a connection with the client without making any adaptation related to the second cluster on the client, thereby realizing resource processing. Compared with the method that requires the client to adapt to explicit commands related to the new cluster, this application can realize the expanded deployment of the second cluster without changing the relevant configuration in the client. Therefore, this application can be used to effectively implement transparent proxy in multi-cluster deployment scenarios.
[0067] The service processing method is applied to a proxy server of a first cluster in a cloud computing system. The cloud computing system provided by an embodiment of the present application is described below.
[0068] Figure 3 A schematic diagram of a cloud computing system provided in an embodiment of the present application. The cloud computing system includes a client 10, a proxy server 21 belonging to a first cluster 20, and a second cluster 30. The client 10 can establish a connection with the proxy server 21. The proxy server 21 belongs to the first cluster 20 and can access a business server (or business node) in the first cluster 20. Furthermore, the proxy server 21 can establish a connection with a business server in the second cluster 30.
[0069] In a multi-cluster environment, the first cluster 20 may be considered as a primary cluster, and the second cluster 30 may be considered as a member cluster or a backup cluster, etc. The service servers in the first cluster 20 and the second cluster 30 may run containerized applications.
[0070] The client 10 may be used to send a business processing request to the proxy server 21, such as a request for querying, creating, updating or deleting container resources.
[0071] The proxy server 21 can receive business processing requests from the client 10, and forward the business processing requests to the corresponding cluster based on the configured processing logic, protocol buffers (ProtoBuf) and remote procedure call services, etc., to query, create, update or delete resources.
[0072] ProtoBuf is a lightweight data serialization and structured data exchange format that supports efficient serialization and deserialization of data between different applications by defining the message format of the data structure. That is, it can quickly convert structured data into byte streams, saving storage space and network transmission bandwidth.
[0073] The remote procedure call service may be Google Remote Procedure Call (GRPC), which may transmit data based on ProtoBuf serialization and Hypertext Transfer Protocol Version 2 (HTTP / 2), and support remote communication between different applications on different servers.
[0074] Based on ProtoBuf, GRPC can serialize structured data into a compact binary format, reduce data transmission overhead, and achieve efficient serialization. GRPC supports multiple programming languages such as Java and Python, which enables applications in different languages to communicate with each other. GRPC uses the HTTP / 2 protocol to support bidirectional streaming, which can support the simultaneous sending and receiving of multiple messages between the client and the server, improving concurrency performance. GRPC uses ProtoBuf to define interfaces and services, automatically generates client and server code, and reduces development workload. GRPC can support the expansion and replacement of underlying codecs, load balancers and other components, and has pluggable features to meet different business needs.
[0075] The embodiment of the present application provides an efficient, flexible and cross-language communication solution through the combination of ProtoBuf and GRPC, which can meet the data exchange and remote call requirements in different application scenarios.
[0076] Optionally, the proxy server 21, the service nodes in the first cluster 20, and the service nodes in the second cluster 30 may be terminals, servers, or other types of electronic devices with corresponding reading and writing functions.
[0077] When the proxy server 21, the service nodes in the first cluster 20 and the service nodes in the second cluster 30 are terminals, the terminal and the client 10 can be personal computers such as desktops, tablet computers and laptops, or remote terminals, user terminals (terminal equipment, TE) and mobile devices, etc., and can also be wireless terminals in industrial control (industrial control), wireless terminals in remote medical (remote medical), etc.
[0078] This application does not limit the form of the terminal. The device for implementing the function of the terminal can be a terminal, or a device that can support the terminal to implement the function, such as a chip system. The device can be installed in the terminal or used in conjunction with the terminal. In the embodiment of this application, the chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0079] It should be noted that Figure 3 The cloud computing system shown is only an example, and does not limit the system architecture to which the business processing method provided in the embodiment of the present application is applicable. For example, the cloud computing system may include multiple clients 10. For another example, the cloud computing system may include multiple second clusters 30.
[0080] In one embodiment, based on Figure 3 When the cloud computing system shown in the figure implements the business processing method provided by the present application, specifically, the proxy process of the proxy server 21 for the request and response can be as follows Figure 4 shown. Figure 4 A schematic diagram of a business processing flow provided for this application.
[0081] like Figure 4 As shown, the client 10 may be a client that can establish a connection with a standard K8s cluster. For example, the client 10 may be configured with client libraries such as Client-go and / or Client-java, and / or command line tools such as Kubectl. The client library and command line tools may be used to support the client to initiate requests such as creation, deletion, update, and query of container resources.
[0082] The proxy server 21 can be used to provide Kube-apiserver, support forwarding requests to the second cluster, and call conversion services in HTTP requests.
[0083] The conversion services of multiple non-standard K8s clusters (or privatized clusters) such as cluster 1, cluster 2, ..., cluster N can be configured on the business node of the first cluster. The first cluster can be a standard K8s cluster. The conversion service can include protocol conversion services and data format conversion services, etc., to resolve the differences between non-standard K8s clusters and standard K8s clusters. The protocol conversion service can be used to process the conversion of the Uniform Resource Locator (URL). The data format conversion service can be used to process the conversion of the data format.
[0084] The second cluster can be any non-standard K8s cluster among multiple non-standard K8s clusters such as cluster 1, cluster 2, ..., cluster N, etc.
[0085] The client 10 may initiate a request to the proxy server 21 through a client library or a command line tool. The proxy server 21 may receive the request from the client 10, call the corresponding protocol conversion service to process the request, and forward the processed request to the second cluster 30. After the second cluster 30 performs the processing operation corresponding to the request, it may return a response to the proxy server 21. The proxy server 21 may receive the response from the second cluster 30, call the corresponding data format conversion service to process the response, and forward the processed response to the client 10. The client 10 may receive the response from the proxy server 21 to confirm that the processing is completed.
[0086] Figure 5 The hardware structure diagram of a proxy server 21 provided in an embodiment of the present application is shown in FIG. The proxy server 21 may include a processor 2101, a memory 2102, and a transceiver 2103. The processor 2101, the memory 2102, and the transceiver 2103 may be interconnected via a bus 2104.
[0087] The processor 2101 may be one or more CPUs. In the case where the processor 2101 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 2101 may be used to read data stored in the memory 2102, execute service call operations, etc. Figure 4 The call conversion service shown processes the request and response, performs forwarding operations, etc.
[0088] The memory 2102 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a portable read-only memory (CD-ROM). The memory 2102 is used to store the call information of the conversion service, etc.
[0089] The transceiver 2103 is used to receive / send data in response to instructions from the processor 2101 and the memory 2102 .
[0090] The embodiment of the present application does not limit the number of these components. For example, the proxy server 21 may include one or more processors 2101. In another example, the proxy server 21 may include one or more memories 2102 and the like.
[0091] The following, combined Figure 3 The cloud computing system architecture shown illustrates the business processing method provided in the embodiment of the present application. Figure 6 A flowchart of a business processing method provided in an embodiment of the present application. Figure 6 The method shown can be applied to Figure 3 The proxy server of the first cluster in the cloud computing system is shown. Figure 6 The proxy server in the method shown may specifically include Figure 5 As shown in the parts. Figure 6 As shown, the business processing method may include: S101-S104.
[0092] It should be noted that the staff can build the API Server in the proxy server in advance, insert the conversion service call logic, insert the proxy forwarding logic and start the API Server.
[0093] Building an API Server can be based on the design rules of the Kube-apiserver component in K8s, and extending a new API to handle proxy requests about the new cluster. For example, a custom resource for the configuration information of a new cluster (such as the second cluster) can be added to the original K8s resource definition. The configuration information of the new cluster may include cluster attribute information and connection information. The cluster attribute information may include the name, type, and version of the cluster. In K8s, the connection information can be stored in the Kubeconfig file, which may include information such as the connection address, connection method, cluster authentication method, and Transport Layer Security (TLS) certificate. In addition, the custom resource can be extended to the K8s native API interface to obtain a new cluster interface. The configuration information of the new cluster can be stored in the main cluster (such as the first cluster). In addition, the main cluster can add the default configuration of the new cluster, which can be configured at startup to support access by the K8s client. The client can access the new cluster through the new cluster interface.
[0094] Exemplarily, the URL included in the K8s native API interface may be "{k8s-origin-api-endpoints}". On this basis, the expanded new cluster interface may be " / apis / clusteragent / v1alpha1 / clusters / {cluster_name} / proxy / {k8s-origin-api-endpoints}". Among them, " / apis / clusteragent / v1alpha1 / clusters / {cluster_name} / proxy / " is the prefix added to the URL in the new cluster interface. "{cluster_name}" is the name of the new cluster. That is, the association between the called interface and the new cluster can be represented by the prefix of the URL. Based on this, when the client accesses the new cluster, if it is determined that the new cluster is not included in the deployed original cluster, it can add a prefix to the URL in the request, that is, access the new cluster through the new cluster interface. For example, the client can add a prefix to the URL in the request through an external URL redirection or rewriting mechanism.
[0095] Inserting the conversion service call logic means inserting the call logic of the customized conversion service into the processing of the request (such as HTTP request). For example, the content and interface for communicating with the conversion service can be agreed upon based on Protobuf, and the conversion service can be called across processes using the remote procedure call service. The conversion service can be used to resolve the differences between the new cluster and the standard K8s cluster in terms of URL request and data format (or data structure). For example, the conversion service can be processed in HTTP requests and responses to ensure that the data structure of the HTTP request and response matches the cluster requirements.
[0096] For example, the conversion service can support the processing method of the standard Webhook in K8s. The proxy server can convert the request body into the admission review (AdmissionReview) structure corresponding to the standard Webhook in K8s, and then call the conversion service to implement customized logic and transformation in the request processing process.
[0097] Inserting proxy forwarding logic can be done by inserting middleware that is used to shield the differences between the new cluster and the standard K8s cluster into the proxy server. For example, if the new cluster uses a custom certificate encryption and decryption method, you can insert certificate encryption and decryption middleware to process the request during the proxy forwarding process, so that the request is forwarded to the new cluster. You can also insert middleware for flow control or advanced permission management to implement access control functions, etc.
[0098] After the relevant logic configuration is completed, you can set the monitoring port in the proxy server and start the API Server to support client access to the new cluster and implement business processing.
[0099] S101. The client sends a first request to the proxy server.
[0100] Corresponding to the process of S101 , the proxy server receives a first request from the client.
[0101] The first request carries a first identifier indicating the first cluster and a second identifier of the second cluster that executes the service corresponding to the first request.
[0102] In one possible manner, the first identifier may be used to uniquely identify the first cluster, and is used to support routing the first request to a proxy server of the first cluster. For example, the first identifier may be an Internet Protocol (IP) address or a port identifier of the first cluster.
[0103] In one possible manner, the service corresponding to the first request may be to deploy, delete, update or query container resources in the second cluster. The container resources may be dependencies, function libraries, environments and configurations required for the application to run.
[0104] In one possible manner, the header of the first request may include a second identifier. The second identifier may be used to uniquely identify the second cluster, and is used to support the proxy server in determining the second cluster that executes the service corresponding to the first request. For example, the second identifier may be a name or an IP address of the second cluster.
[0105] Exemplarily, the first request may include a URL for indicating an interface in the second cluster. The service corresponding to the first request is the service executed when the interface is called. Since the client is not adapted to the protocol requirements of the second cluster, the URL of the interface may be generated by the client based on the URL syntax rules corresponding to the first cluster. Further, in order to indicate the association between the URL of the interface and the second cluster, the header of the first request may include the second identifier of the second cluster. Alternatively, the prefix portion of the URL of the interface may also include the second identifier of the second cluster.
[0106] In one implementation, the client may be deployed with relevant configuration information such as a protocol for connecting to the first cluster. When it is necessary to process the container resources in the second cluster, the client may carry a first identifier in the first request based on the relevant adaptation information with the first cluster to send the first request to the proxy server of the first cluster. In addition, in order to indicate the second cluster that executes the corresponding business, the client may also carry a second identifier in the first request. Accordingly, the proxy server may receive the first request from the client.
[0107] S102: The proxy server parses the first request and obtains a second identifier.
[0108] In one achievable manner, since the first request is generated by the client based on a protocol adapted to the first cluster, the proxy server of the first cluster may parse the first request to obtain the second identifier of the second cluster.
[0109] In one possible manner, if the first request does not include the second identifier of the second cluster, it can indicate that the first request is directed to the first cluster, that is, the cluster that executes the service for which the first request is intended is the first cluster, and there is no need to convert the first request. In this case, the proxy server can directly forward the first request to the service server of the first cluster. For example, the proxy server can add the default information of the first cluster to the context of the first request and forward it through the corresponding service.
[0110] In one possible manner, the service server (or service node) of the first cluster may store multiple configuration information corresponding to the identifiers of multiple clusters. The configuration information may include attribute information and connection information of the cluster. The second cluster may be any one of the multiple clusters.
[0111] Based on this, after the proxy server parses the first request to obtain the second identifier, it can obtain the configuration information of the second cluster from the business server of the first cluster based on the second identifier of the second cluster, and add the configuration information of the second cluster to the context of the first request for subsequent processing.
[0112] Specifically, the proxy server may send a third request carrying the second identifier to the business server of the first cluster. The third request may be used to request configuration information corresponding to the second identifier, that is, the configuration information of the second cluster. Accordingly, the business server of the first cluster may receive the third request from the proxy server, and parse the third request to obtain the second identifier. Furthermore, the business server of the first cluster may read the configuration information corresponding to the second identifier from the multiple configuration information, and send the configuration information corresponding to the second identifier to the proxy server. Accordingly, the proxy server may receive the configuration information corresponding to the second identifier, and generate a message carrying the configuration information corresponding to the second identifier. The message may be sent to the second cluster before or after the second request.
[0113] It is understandable that during the transmission of the first request, the proxy server may store the context information of the first request. The context information may include background information and environmental data of the first request, etc., and may be used to describe the purpose and route of the first request, etc. The message generated by the proxy server based on the above process may be carried in the context information of the first request, so that the relevant service or device in the transmission process of the first request can obtain the configuration information of the second cluster, thereby supporting the conversion of the first request into the second request, and forwarding the second request to the second cluster, etc.
[0114] S103: The proxy server calls the conversion service corresponding to the second identifier to process the first request to obtain a second request.
[0115] The second request carries a third identifier indicating the service corresponding to the first request.
[0116] In one possible manner, the third identifier may be used to indicate an interface in the second cluster. The interface may be used to execute the service corresponding to the first request. For example, the third identifier may be a URL that complies with the grammatical rules of the second cluster.
[0117] In one possible manner, the first cluster may be configured with multiple protocol conversion services corresponding to multiple clusters. When the first request needs to be processed by protocol conversion, the proxy server may call the protocol conversion service corresponding to the second cluster in the first cluster through a message queue or an API call, and convert the first request into a second request that complies with the protocol corresponding to the second cluster.
[0118] In one implementation, a proxy server may be configured with a protocol buffer and a remote procedure call service. The protocol buffer may include multiple first call information. The multiple first call information may correspond one-to-one to the identifiers of multiple clusters, and the identifiers of multiple clusters may correspond one-to-one to the multiple protocol conversion services in the first cluster. Based on this, after the proxy server parses the first request and obtains the cluster identifier of the second cluster, it may query the first call information corresponding to the second identifier of the second cluster in the protocol buffer, and determine the queried first call information corresponding to the second identifier of the second cluster as the target first call information. Furthermore, the proxy server may call the protocol conversion service corresponding to the target first call information in the business server of the first cluster through the remote procedure call service to process the first request and obtain the second request.
[0119] Exemplarily, a query operation of a container carried by a first interface is preset in the first cluster. The first interface can be implemented based on the K8s native query method label selector (labelSelector), which is used to query the container resources corresponding to the specified label in the first cluster. Usually, a key-value pair is defined after "labelSeletor", representing the label name and label value respectively. The specific description of the URL pointing to the first interface is " / api / v1 / nodes?labelSelector=label name=label value".
[0120] The second cluster is configured with a second interface having the same function as the first interface, and the description of the URL pointing to the second interface is defined as " / api / v1 / label name / label value / nodes". The second interface is used to query container resources corresponding to a specified label in the second cluster.
[0121] In this case, the preset label name can be "namespaces" and the label value can be "manage". Then the first request can include " / api / v1 / nodes?labelSelector=namespace=manage", which is used to query the container resources belonging to "manage" under the namespace (namespaces). The second request converted from the first request can include " / api / v1 / namespaces / manage / nodes". " / api / v1 / namespaces / manage / nodes" can also be understood as the second identifier, which complies with the URL syntax rules corresponding to the second cluster.
[0122] In one possible manner, the proxy server may replace the URL in the first request with the converted URL to obtain a second request.
[0123] It should be understood that the difference between the URL in the first request and the URL in the second request is that the field encoding structure is different, and can be used to locate the same resource in the second cluster.
[0124] Based on this, this application can implement customized request conversion logic by introducing protocol conversion services to target the differences between different clusters, so as to support protocol conversion and compatibility processing between different clusters, making the business logic more flexible and avoiding modifications to core components or large-scale code changes.
[0125] In another exemplary embodiment, in combination with the example in S101, when the second identifier of the second cluster is in the prefix part of the URL of the interface, the proxy server can delete the prefix of the URL of the interface in the first request, and replace the URL of the interface with the third identifier to obtain the second request. Based on this, it is possible to avoid the identification error that is easily caused by forwarding the prefix to the second cluster during proxy forwarding.
[0126] Based on this, this application can support the creation of custom resources and extend them to the K8S native API interface, so as to flexibly expand the new API interface and adapt to different business scenarios and needs.
[0127] S104: The proxy server sends a second request to the second cluster.
[0128] The second request may be used to request the second cluster to execute the service indicated by the third identifier.
[0129] In one possible manner, the proxy server may establish a connection with the second cluster based on the connection information of the second cluster, and send a second request carrying the second URL to the second cluster through the connection. Correspondingly, the second cluster may receive the second request from the proxy server, parse the second request to obtain the third identifier, and process the service indicated by the third identifier. For example, the second cluster may call the interface corresponding to the third identifier to execute the service indicated by the third identifier, that is, the service corresponding to the first request.
[0130] Optionally, the second cluster may also have a corresponding proxy. The proxy server of the first cluster may initialize a virtual client connected to the proxy of the second cluster based on the connection information of the second cluster. The virtual client may send a second request carrying a third identifier to the proxy of the second cluster.
[0131] It should be noted that the proxy server may be configured with multiple cluster access services corresponding to the identifiers of multiple clusters. The cluster access service may be used to support the proxy server to access the cluster. That is, the cluster access service may be used to shield the difference between the second cluster and the first cluster. Before sending the second request to the second cluster, the proxy server may also query the cluster access service corresponding to the cluster identifier of the second cluster from the multiple cluster access services.
[0132] If no cluster access service corresponding to the cluster identifier of the second cluster is found, it may indicate that the second cluster has no custom rules set, and there are no other differences between the second cluster and the first cluster. In this case, the proxy server may directly send the second request to the second cluster.
[0133] If the cluster access service corresponding to the cluster identifier of the second cluster is queried, it can indicate that the second cluster is set with custom rules such as custom certificate encryption and decryption and / or custom permission verification. In this case, the proxy server determines the cluster access service corresponding to the cluster identifier of the second cluster as the target cluster access service, and processes the second request based on the target cluster access service to obtain the processed second request, so as to shield the difference between the second cluster and the first cluster, so that the second request can be sent to the second cluster. Based on this, the proxy server can send the processed second request to the second cluster through the connection with the second cluster.
[0134] Based on this, this application can achieve difference shielding between different clusters by deploying middleware in the proxy server, so that the proxy layer can automatically identify and process the custom connection method and authentication method used by the cluster, which can reduce the coupling between clusters and improve the compatibility of the system.
[0135] In a possible manner, when there are multiple target cluster access services, the proxy server may serially call the multiple target cluster access services to process the second request to obtain the processed second request.
[0136] Based on the description in S101-S104 above, the present application deploys the proxy server of the first cluster as a transparent proxy layer, that is, deploys the proxy server of the main cluster connected to the standard K8s client as a transparent proxy layer, which can support any standard K8S client to connect to any CaaS cluster (such as the second cluster), and there is no need to modify the client code, which can effectively implement transparent proxy in a multi-cluster environment. In addition, the present application stores the relevant configuration in the main cluster, avoiding the introduction of an external database to store configuration information, which can simplify the complexity of deployment and maintenance. Therefore, the present application can support the K8S client to directly access the new cluster based on the default configuration, and has good compatibility with the client.
[0137] In summary, this application can significantly improve the availability, flexibility and compatibility of cloud computing systems in multi-cluster environments through multi-cluster transparent proxies, custom conversion services and cluster difference shielding logic, thereby supporting efficient and consistent processing of containerized applications in multi-cluster environments.
[0138] In one embodiment, when the proxy server receives a service processing response corresponding to the second request from the second cluster, Figure 7 As shown, the business processing method provided in the embodiment of the present application also includes: S201-S205.
[0139] S201. The second cluster sends a service processing response to the proxy server.
[0140] Corresponding to the process of S201 , the proxy server receives a service processing response from the second cluster.
[0141] The business processing response may carry a second identifier and second response data indicating a business processing result.
[0142] In one possible manner, after receiving the second request from the proxy server, the proxy end of the second cluster can parse the second request to obtain the third identifier, and notify the service server of the second cluster to process the service indicated by the third identifier to obtain the second response data. Furthermore, the proxy end of the second cluster can send a service processing response carrying the second response data to the proxy server of the first cluster. Correspondingly, the proxy server can receive the service processing response carrying the second response data from the second cluster.
[0143] Exemplarily, in combination with the description in S103, when the third identifier is “ / api / v1 / namespaces / manage / nodes”, the second response data may be a container information list of container resources belonging to “manage” in the second cluster.
[0144] S202: The proxy server parses the service processing response to obtain a second identifier.
[0145] In a possible manner, the service processing response may include the cluster identifier of the second cluster. The proxy server may parse the service processing response to obtain the cluster identifier of the second cluster.
[0146] S203: The proxy server determines the second calling information corresponding to the second identifier in the protocol buffer as the target second calling information.
[0147] It should be noted that the protocol buffer of the proxy server may also include multiple second call information corresponding to the identifiers of multiple clusters. The multiple second call information may correspond to multiple data format conversion services configured in the first cluster. The data format conversion service may convert data that does not conform to the data format rules of the first cluster into data that conforms to the data format rules of the first cluster.
[0148] In a possible manner, the proxy server may query the protocol buffer for the second call information corresponding to the cluster identifier of the second cluster, and determine the second call information corresponding to the second cluster in the protocol buffer as the target second call information.
[0149] S204: The proxy server calls the data format conversion service corresponding to the target second call information through the remote procedure call service to process the second response data, and obtains first response data that conforms to the data format corresponding to the first cluster.
[0150] In one possible manner, the proxy server may call the data format conversion service corresponding to the target second call information in the business server of the first cluster through the remote procedure call service to process the second response data and obtain the first response data in the data format corresponding to the first cluster.
[0151] Exemplarily, in combination with the description in S103, a namespace private field "metadata.namespace=manage" is added to the container metadata of the preset second cluster. This private field is used to indicate that the container belongs to "manage". However, the container metadata of the first cluster does not contain this namespace private field. In this case, the proxy server can call the data format conversion service corresponding to the second cluster, delete the field "metadata.namespace=manage" included in the container metadata in the second response data, and obtain the first response data that conforms to the data format corresponding to the first cluster.
[0152] Based on this, this application can implement customized response conversion logic by introducing data format conversion services to target the differences between different clusters, so as to support data conversion and compatibility processing between different clusters, making business logic more flexible and avoiding modifications to core components or large-scale code changes.
[0153] S205: The proxy server sends a rewritten post-processing response to the client.
[0154] The rewritten post-processing response may carry the first response data.
[0155] In one possible implementation, the proxy server can rewrite the response based on the first response data, obtain a rewritten post-processing response carrying the first response data, and send the rewritten post-processing response to the client. Correspondingly, the client can receive the rewritten post-processing response from the proxy server and determine that the processing of the requested resource is completed.
[0156] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0157] The embodiment of the present application can divide the functional modules of the proxy server according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0158] Combined with the above Figure 6 and Figure 7 , describes in detail the service processing method provided according to the embodiment of the present application, and will now be combined with Figure 8 , describing a business processing device provided according to an embodiment of the present application.
[0159] Figure 8 The structure diagram of a service processing device 40 provided in an embodiment of the present application is shown in FIG. The service processing device 40 can be used to execute Figure 6 and Figure 7 The business processing method shown in . The business processing device 40 can be applied to a proxy server in a cloud computing system. The proxy server can belong to a first cluster. The business processing device 40 can include: a receiving unit 4001, a parsing unit 4002, a calling unit 4003 and a sending unit 4004.
[0160] For example, combined with Figure 6, the receiving unit 4001 can be used to execute S101; the parsing unit 4002 can be used to execute S102; the calling unit 4003 can be used to execute S103, and the sending unit 4004 can be used to execute S104. The receiving unit 4001 is used to receive a first request from a client; the first request carries a first identifier indicating a first cluster, and a second identifier of a second cluster that executes a service corresponding to the first request. The parsing unit 4002 is used to parse the first request, and the calling unit 4003 is used to call a conversion service corresponding to the second identifier to process the first request to obtain a second request; the second request carries a third identifier indicating a service corresponding to the first request. The sending unit 4004 is used to send a second request to the second cluster; the second request is used to request the second cluster to execute the service indicated by the third identifier.
[0161] In a possible implementation manner, the header of the first request includes the second identifier.
[0162] In one possible implementation, the proxy server is configured with a protocol buffer and a remote procedure call service; the protocol buffer includes multiple first call information; the multiple first call information corresponds one-to-one to the identifiers of multiple clusters, and the identifiers of the multiple clusters correspond one-to-one to the multiple protocol conversion services in the first cluster; the calling unit 4003 is specifically used to: determine the target first call information corresponding to the second identifier from the multiple first call information in the protocol buffer; call the protocol conversion service corresponding to the target first call information through the remote procedure call service, and process the first request to obtain the second request.
[0163] In a possible implementation, the first cluster stores multiple configuration information; the multiple configuration information and the identifiers of the multiple clusters have a one-to-one correspondence; the configuration information includes attribute information and connection information of the cluster; the device also includes: a generating unit 4005. The sending unit 4004 is further used to send a third request carrying a second identifier to the service server of the first cluster; the third request is used to request the configuration information corresponding to the second identifier; the receiving unit 4001 is further used to receive the configuration information corresponding to the second identifier; the generating unit 4005 is used to generate a message carrying the configuration information corresponding to the second identifier; the message is sent to the second cluster before or after the second request.
[0164] In a possible implementation manner, the sending unit 4004 is specifically configured to: establish a connection with the second cluster based on the configuration information corresponding to the second identifier, and send the second request to the second cluster through the connection.
[0165] In one possible implementation, the proxy server is also configured with multiple cluster access services; the multiple cluster access services correspond one-to-one to the identifiers of the multiple clusters; the cluster access service is used to support the proxy server to access the cluster; the device also includes: a determination unit 4006 and a processing unit 4007; the determination unit 4006 is used to determine the target cluster access service corresponding to the second identifier from the multiple cluster access services; the processing unit 4007 is used to process the second request based on the target cluster access service to obtain a processed second request; the sending unit 4004 is also used to send the processed second request to the second cluster through the connection.
[0166] The specific implementation of each module in the service processing device 40 can refer to the content of the above method embodiment, which will not be described in detail here. Figure 5 In this embodiment, the service processing device 40 may be Figure 5 In the proxy server 21, part or all of the above-mentioned modules such as the receiving unit 4001, the parsing unit 4002, the calling unit 4003 and the sending unit 4004 can also be implemented by the processor 2101.
[0167] It should be understood that the service processing device 40 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. Implementation by software Figure 6 and Figure 7 When the business processing method is shown, the business processing device 40 and its various modules can also be software modules.
[0168] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer execution instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0169] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A business processing method, characterized in that: A proxy server applied to a cloud computing system, wherein the proxy server belongs to a first cluster, and the method comprises: receiving a first request from a client; the first request carrying a first identifier indicating the first cluster and a second identifier of a second cluster executing a service corresponding to the first request; parsing the first request, calling a conversion service corresponding to the second identifier to process the first request, and obtaining a second request; the second request carries a third identifier indicating a service corresponding to the first request; The second request is sent to the second cluster; the second request is used to request the second cluster to execute the service indicated by the third identifier.
2. The service processing method according to claim 1, characterized in that: The header of the first request includes the second identifier.
3. The service processing method according to claim 1 or 2, characterized in that: The proxy server is configured with a protocol buffer and a remote procedure call service; the protocol buffer includes a plurality of first call information; the plurality of first call information corresponds one-to-one with identifiers of a plurality of clusters, and the identifiers of the plurality of clusters correspond one-to-one with a plurality of protocol conversion services in the first cluster; The calling of the conversion service corresponding to the second identifier to process the first request to obtain a second request includes: Determine the target first call information corresponding to the second identifier from the multiple first call information in the protocol buffer; The protocol conversion service corresponding to the target first call information is called through the remote procedure call service, and the first request is processed to obtain the second request.
4. The service processing method according to claim 2, characterized in that: The first cluster stores a plurality of configuration information; the plurality of configuration information corresponds to identifiers of the plurality of clusters in a one-to-one correspondence; the configuration information includes attribute information and connection information of the cluster; the method further includes: Sending a third request carrying the second identifier to the service server of the first cluster; the third request is used to request configuration information corresponding to the second identifier; receiving configuration information corresponding to the second identifier; Generate a message carrying configuration information corresponding to the second identifier; and send the message to the second cluster before or after the second request.
5. The service processing method according to any one of claims 1 to 4, characterized in that: The sending the second request to the second cluster includes: A connection with the second cluster is established based on the configuration information corresponding to the second identifier, and the second request is sent to the second cluster through the connection.
6. The service processing method according to claim 5, characterized in that: The proxy server is also configured with a plurality of cluster access services; the plurality of cluster access services correspond one-to-one to the identifiers of the plurality of clusters; the cluster access services are used to support the proxy server to access the clusters; The method further comprises: Determine a target cluster access service corresponding to the second identifier from the multiple cluster access services; Accessing the service based on the target cluster, processing a second request after the second request is processed; The processed second request is sent to the second cluster through the connection.
7. The service processing method according to claim 6, characterized in that: When the number of the target cluster access services is multiple, the processing of the second request after the second request is processed based on the target cluster access services includes: A plurality of the target cluster access services are serially called to process the second request to obtain a processed second request.
8. The service processing method according to any one of claims 1 to 7, characterized in that: The protocol buffer of the proxy server also includes a plurality of second call information; the plurality of second call information corresponds one-to-one to the identifiers of the plurality of clusters, and the identifiers of the plurality of clusters correspond one-to-one to the plurality of data format conversion services in the first cluster; the method also includes: receiving a service processing response from the second cluster; the service processing response carries the second identifier and second response data indicating a service processing result; Parsing the business processing response, and determining the second call information corresponding to the second identifier in the protocol buffer as the target second call information; Invoking a data format conversion service corresponding to the target second call information through a remote procedure call service to process the second response data, so as to obtain first response data conforming to a data format corresponding to the first cluster; Sending a rewritten post-processing response to the client; the rewritten post-processing response carries the first response data.
9. A service processing device, characterized in that: A proxy server applied to a cloud computing system, the proxy server belonging to a first cluster, the device comprising: a receiving unit, a parsing unit, a calling unit and a sending unit; The receiving unit is configured to receive a first request from a client; the first request carries a first identifier indicating the first cluster and a second identifier of a second cluster that executes a service corresponding to the first request; The parsing unit is used to parse the first request, and the calling unit is used to call the conversion service corresponding to the second identifier to process the first request to obtain a second request; the second request carries a third identifier indicating the service corresponding to the first request; The sending unit is used to send the second request to the second cluster; the second request is used to request the second cluster to execute the service indicated by the third identifier.
10. The service processing device according to claim 9, characterized in that: The header of the first request includes the second identifier.
11. The service processing device according to claim 9 or 10, characterized in that: The proxy server is configured with a protocol buffer and a remote procedure call service; the protocol buffer includes a plurality of first call information; the plurality of first call information corresponds one-to-one with the identifiers of a plurality of clusters, and the identifiers of the plurality of clusters correspond one-to-one with the plurality of protocol conversion services in the first cluster; the calling unit is specifically used to: Determine the target first call information corresponding to the second identifier from the multiple first call information in the protocol buffer; The protocol conversion service corresponding to the target first call information is called through the remote procedure call service, and the first request is processed to obtain the second request.
12. The service processing device according to claim 10, characterized in that: The first cluster stores a plurality of configuration information; the plurality of configuration information corresponds to the identifiers of the plurality of clusters in a one-to-one correspondence; the configuration information includes attribute information and connection information of the cluster; the device further includes: a generating unit; The sending unit is further used to send a third request carrying the second identifier to the service server of the first cluster; the third request is used to request configuration information corresponding to the second identifier; The receiving unit is further configured to receive configuration information corresponding to the second identifier; The generating unit is configured to generate a message carrying configuration information corresponding to the second identifier; the message is sent to the second cluster before or after the second request.
13. The service processing device according to any one of claims 9 to 12, characterized in that: The sending unit is specifically used for: A connection with the second cluster is established based on the configuration information corresponding to the second identifier, and the second request is sent to the second cluster through the connection.
14. The service processing device according to claim 13, characterized in that: The proxy server is also configured with a plurality of cluster access services; the plurality of cluster access services correspond one-to-one to the identifiers of the plurality of clusters; the cluster access services are used to support the proxy server to access the clusters; the device further comprises: a determination unit and a processing unit; The determining unit is configured to determine a target cluster access service corresponding to the second identifier from among the multiple cluster access services; The processing unit is configured to process the second request after the second request is processed based on the target cluster access service; The sending unit is further configured to send the processed second request to the second cluster through the connection.
15. The service processing device according to claim 14, characterized in that: The processing unit is specifically used for: A plurality of the target cluster access services are serially called to process the second request to obtain a processed second request.
16. The service processing device according to any one of claims 9 to 15, characterized in that: The protocol buffer of the proxy server also includes a plurality of second call information; the plurality of second call information corresponds one-to-one to the identifiers of the plurality of clusters, and the identifiers of the plurality of clusters correspond one-to-one to the plurality of data format conversion services in the first cluster; The receiving unit is further configured to receive a service processing response from the second cluster; the service processing response carries the second identifier and second response data indicating a service processing result; The parsing unit is further used to parse the business processing response, and determine the second call information corresponding to the second identifier in the protocol buffer as the target second call information; The calling unit is further configured to call a data format conversion service corresponding to the target second calling information through a remote procedure call service to process the second response data, so as to obtain first response data in a data format corresponding to the first cluster; The sending unit is further used to send a rewriting post-processing response to the client; the rewriting post-processing response carries the first response data.
17. A server, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to implement the business processing method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a proxy server, the service processing method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Middleware management method and device
CN120909667A