Cross-cloud forwarding method, apparatus, device, and computer readable storage medium

By introducing the highest priority servlet interceptor in the zuul gateway, it is directly forwarded to the private cloud based on the identification information of the access request, solving the problem that the zuul gateway cannot forward directly across the cloud, and achieving efficient resource utilization and simplified cross-cloud forwarding process.

WO2025156712A1PCT designated stage Publication Date: 2025-07-31SHANGHAI QINGGAN INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/124409
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-24
Filing Date
2024-10-12
Publication Date
2025-07-31

AI Technical Summary

Technical Problem

The existing zuul gateway cannot directly forward to the private cloud based on the requested information, resulting in complex cross-cloud forwarding mode and high resource consumption.

Method used

The highest priority servlet interceptor is introduced into the zuul gateway, which is directly generated and forwarded to the gateway of the private cloud by parsing the identification information in the access request, avoiding redirection through the platform cloud's micro-server.

Benefits of technology

The cross-cloud forwarding process is simplified, resource consumption and development and maintenance difficulties are reduced, and computing power is enjoyed with a unified entrance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024124409_31072025_PF_FP_ABST
    Figure CN2024124409_31072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a cross-cloud forwarding method, an apparatus, a device, and a computer readable storage medium. The method is applied to a gateway of a platform cloud. The method comprises: receiving a first access request from a user terminal, wherein the first access request comprises identification information of a cloud to be accessed; on the basis of the identification information of the cloud to be accessed, determining that an access target of the first access request is a private cloud; when the access target is the private cloud, generating a second access request on the basis of the first access request; and directly forwarding the second access request to a gateway of the private cloud.
Need to check novelty before this filing date? Find Prior Art

Description

Cross-cloud forwarding method, apparatus, device, and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure is based on and claims the priority of a Chinese patent application with application number 202410103961.9, application date January 24, 2024, and invention name “Cross-cloud forwarding method, apparatus, device and computer-readable storage medium”. The entire content of the Chinese patent application is hereby incorporated into this disclosure by reference. Technical Field

[0003] The present disclosure relates to the field of communication technologies, and in particular to a cross-cloud forwarding method, apparatus, device, and computer-readable storage medium. Background Art

[0004] With the continuous development of cloud services, user requirements have become more diverse. While maintaining a unified entrance, it is also necessary to ensure exclusive use of cloud computing power without being affected by other customers. For exclusive computing power, users generally require independent deployment or private deployment, that is, users complete requests by accessing the private cloud. Maintaining a unified entrance requires the gateway service to have the ability to forward requests to their respective clouds based on different users.

[0005] In related technologies, taking the Zuul gateway (Zuul is the microservice gateway in Spring Cloud) as an example, when the gateway service forwards Hypertext Transfer Protocol (Http) requests to a standalone or privately deployed cloud, it needs to distinguish them based on the current user's identity. However, the Zuul gateway can only forward requests based on the request path matching, and cannot forward requests based on the information in the request. The above process can be understood as the Zuul gateway parsing the request path, determining the function type to which the request belongs, matching the corresponding microserver in the cloud platform based on the function type of the request (microservers are distinguished by their processing capabilities or functions), and forwarding the request to the microserver. The microserver then determines whether forwarding to the private cloud is necessary based on the information in the request. If so, the microserver forwards the request to the private cloud's gateway. The Zuul gateway cannot directly forward requests to the private cloud's gateway based on the information in the request. This cross-cloud forwarding model is complex and consumes a lot of resources.

[0006] Summary of the Invention

[0007] The embodiments of the present disclosure provide a cross-cloud forwarding method, apparatus, device, and computer-readable storage medium, which reduce resource consumption.

[0008] The technical solution of the embodiment of the present disclosure is implemented as follows:

[0009] In a first aspect, an embodiment of the present disclosure provides a cross-cloud forwarding method, which is applied to the gateway of a platform cloud; the method includes: receiving a first access request from a user terminal; wherein the first access request includes identification information of the access cloud; determining, based on the identification information of the access cloud, that the access target of the first access request is a private cloud; in the case that the access target is a private cloud, generating a second access request based on the first access request; and directly sending the second access request to the gateway of the private cloud.

[0010] In a second aspect, an embodiment of the present disclosure provides a cross-cloud forwarding device, which is applied to the gateway of a platform cloud; the device includes at least one interceptor and a forwarding component; the interceptor with the highest priority among the at least one interceptor is used to receive a first access request from a user terminal; wherein the first access request includes identification information of the access cloud; based on the identification information of the access cloud, it is determined that the access target of the first access request is a private cloud; in the case that the access target is a private cloud, a second access request is generated based on the first access request; the forwarding component is used to directly transmit the second access request to the gateway of the private cloud.

[0011] In a third aspect, an embodiment of the present disclosure provides a cross-cloud forwarding device, the device comprising: a memory for storing an executable computer program; and a processor for implementing the cross-cloud forwarding method of the first aspect above when executing the executable computer program stored in the memory.

[0012] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing a computer program for implementing the cross-cloud forwarding method of the first aspect when executed by a processor.

[0013] The present disclosure provides a cross-cloud forwarding method, apparatus, device, and computer-readable storage medium. According to the solution provided by the present disclosure, the method is applied to the gateway of the platform cloud; the method includes: receiving a first access request from a user end; wherein the first access request includes identification information of the access cloud; determining, based on the identification information of the access cloud, that the access target of the first access request is a private cloud; if the access target is the private cloud, generating a second access request based on the first access request; and directly sending the second access request to the gateway of the private cloud. The underlying servlet interceptor of the cloud platform gateway (e.g., the Zuul gateway) will be executed before the interceptor of the Zuul gateway itself. As the interceptor with the highest priority, it can receive the first access request first. The present disclosure adds this method to the Zuul gateway. Based on the servlet interceptor receiving the first access request, it can obtain the identification information of the access cloud in the first access request, thereby determining whether the user end wants to access the private cloud. If so, regenerating the second access request based on the first access request, and then sending the second access request directly to the gateway of the private cloud, without forwarding through the micro server of the platform cloud, that is, without transit, the request is directly forwarded to the gateway of the private cloud. When the present disclosure determines whether the user terminal wants to access the private cloud, the Zuul gateway does not need to forward the request to the microserver of the cloud platform, nor does it need the microserver of the cloud platform to forward the request. The cross-cloud forwarding mode is simple and reduces resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] FIG1 is a schematic diagram of an interaction process provided by an embodiment of the present disclosure;

[0015] FIG2 is a flowchart of optional steps of a cross-cloud forwarding method provided by an embodiment of the present disclosure;

[0016] FIG3 is a flowchart of optional steps of another cross-cloud forwarding method provided by an embodiment of the present disclosure;

[0017] FIG4 is a flowchart of optional steps of another cross-cloud forwarding method provided by an embodiment of the present disclosure;

[0018] FIG5 is a flowchart of optional steps of another cross-cloud forwarding method provided by an embodiment of the present disclosure;

[0019] FIG6 is a schematic diagram of another interaction process provided by an embodiment of the present disclosure;

[0020] FIG7 is a schematic diagram of an optional structure of a cross-cloud forwarding device provided by an embodiment of the present disclosure;

[0021] FIG8 is a schematic diagram of the composition structure of a cross-cloud forwarding device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. It should be understood that some of the embodiments described here are only used to explain the technical solutions of the present disclosure and are not used to limit the technical scope of the present disclosure.

[0023] In order to better understand the cross-cloud forwarding method provided in the embodiments of the present disclosure, before introducing the technical solution of the embodiments of the present disclosure, the application background and related technologies are first explained.

[0024] The current mainstream implementation model in the cloud is the microservice model, and the popular development framework is the cloud-based Spring Cloud development framework. Spring Cloud's microservice development framework mainly includes gateway services, registration center services, specific services for business implementation, Feign components (a functional component that can process requests), etc. Among them, the gateway service can be used as the API Gateway in the microservice architecture. The API Gateway is a microservice gateway that can achieve high-performance Http forwarding, multi-tenant management, API access permission control, etc. It supports dynamic routing and filtering functions. The API Gateway provides a unified access point (also called an interface) for services in the microservice architecture. The client first sends an Http request to the gateway service, which forwards the request to the specific microservice for processing.

[0025] When the gateway service forwards HTTP requests to a standalone or privately deployed cloud, it needs to distinguish them based on the current user's ID. However, the Zuul gateway can only forward requests based on the request path, not the information in the request. In other words, the Zuul gateway needs to forward the request to the corresponding microserver based on the function type corresponding to the request (which can also be understood as the request path) (corresponding to the above Zuul gateway can only forward requests based on the request path matching). The microserver then determines that the user request accesses the private cloud based on the information in the request, and the microserver forwards the request to the private cloud gateway (corresponding to the above Zuul gateway cannot forward requests based on the information in the request). In this case, it becomes very difficult to achieve such forwarding requirements.

[0026] To achieve the above forwarding effect, those skilled in the art may think of: processing in the proxy layer (for example, nginx component), but the user identification is encrypted information, usually stored in an encrypted string, and the nginx component cannot complete the decryption. The nginx component is a web server that can be used for load balancing and reverse proxy. Nginx is written in C language, and a C language runtime environment needs to be installed when running nginx; Zuul is implemented in Java language, and mainly provides gateway services for Java services. In other words, the nginx component is a component before the entire zuul gateway. Before the request reaches the zuul gateway to execute the complex forwarding logic, the nginx component receives the request, but the identification information about the cloud environment is encrypted information, and the nginx component before the zuul gateway cannot be decrypted. Therefore, the solution of using the nginx component for cross-cloud forwarding does not work.

[0027] To achieve the above forwarding effect, those skilled in the art can also think of: relying on the microserver that processes the request to complete the request redistribution through the Feign component according to the information in the request. In this mode, the Feign component is after the Zuul gateway. The Feign component is a component in the microserver. The Zuul gateway in the cloud platform is required to forward the request to the corresponding microserver according to the function type corresponding to the request, and then the Feign component in the microserver forwards the request to the gateway of the private cloud.

[0028] Exemplarily, as shown in Figure 1, Figure 1 is a schematic diagram of an interaction process provided by an embodiment of the present disclosure. The cross-cloud forwarding process in the relevant technology is explained from the interaction process between the terminal, the cloud platform and the private cloud. If the request initiated by the terminal (that is, the user end) is a platform cloud user access, the request initiated by the user end is sent to the gateway of the platform cloud. The gateway forwards the request to the corresponding microserver according to the function type corresponding to the request (Figure 1 takes microservice 1 in the platform cloud as an example for explanation). If the request initiated by the terminal is for private cloud user access, the request initiated by the user end is first sent to the gateway of the platform cloud. In the first scenario, the gateway forwards the request to the corresponding microserver according to the function type corresponding to the request (microservice 1 in the platform cloud is used as an example in Figure 1). Then, microservice 1 in the platform cloud determines that it needs to be forwarded to the private cloud, and microservice 1 in the platform cloud forwards the request to the gateway of the private cloud. Then, the gateway forwards the request to the corresponding microserver according to the function type corresponding to the request (microservice 1 in the private cloud is used as an example in Figure 1). In the second scenario, the gateway forwards the request to the corresponding microserver according to the function type corresponding to the request (microservice 2 in the platform cloud is used as an example in Figure 1). Then, microservice 2 in the platform cloud determines that it needs to be forwarded to the private cloud, and microservice 2 in the platform cloud forwards the request to the gateway of the private cloud. Then, the gateway forwards the request to the corresponding microserver according to the function type corresponding to the request (microservice 2 in the private cloud is used as an example in Figure 1).

[0029] The forwarding mode in Figure 1 above is not only complex, but also prone to resource consumption. Since this distribution logic is scattered among many microservices, each microserver needs to be configured with a Feign component for forwarding requests, which makes maintenance very difficult.

[0030] The user end in the embodiments of the present disclosure is also the terminal. As used herein, the “terminal” is a terminal device configured to communicate via a wireless interface, which may be referred to as a “wireless communication terminal”, “wireless terminal” or “mobile terminal”. Examples of mobile terminals include, but are not limited to, satellite or cellular phones; Personal Communications System (PCS) terminals that can combine cellular radio telephones with data processing, fax and data communication capabilities; Personal Digital Assistant (PDA) that can include a radio telephone, a pager, Internet / Intranet access, a web browser, a notepad, a calendar and / or a Global Positioning System (GPS) receiver; and conventional laptop and / or palmtop receivers or other electronic devices that include a radiotelephone transceiver. A terminal may refer to an access terminal, user equipment (UE), a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent or a user device. The access terminal can be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a mobile phone, a laptop computer, a tablet computer, an e-book, a game console, a PDA, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal in a fifth generation mobile communication technology (5G) network, or a terminal in a future evolved public land mobile network (PLMN), etc.

[0031] The present disclosure provides a cross-cloud forwarding method, which is applied to a platform cloud gateway. As shown in FIG2 , FIG2 is a flowchart of the steps of the cross-cloud forwarding method provided by the present disclosure. The cross-cloud forwarding method includes the following steps:

[0032] S101. Receive a first access request from a user terminal; wherein the first access request includes identification information for accessing a cloud.

[0033] In the embodiment of the present disclosure, regardless of whether the user terminal is a platform cloud user or a private cloud user, the first access request initiated by the user terminal needs to be sent to the gateway of the platform cloud first, so that the gateway of the platform cloud receives the first access request from the user terminal. The first access request carries the user terminal's permission identifier, and the permission identifier is used to indicate whether the cloud that the user terminal can access is a platform cloud (the platform cloud can also be called a public cloud) or a private cloud. For example, the first access request can carry identification information of the access cloud (the identification information of the access cloud can indicate the user terminal's permission identifier), and the identification information of the access cloud can also be called identification information of the cloud environment, which includes the platform cloud and the private cloud.

[0034] In the embodiment of the present disclosure, the first access request may be an HTTP request.

[0035] In the embodiment of the present disclosure, taking the platform cloud gateway as the Zuul gateway as an example, the Zuul gateway itself includes multiple interceptors. In the related art, after the Zuul gateway receives the request from the user end, the interceptors at each level execute their corresponding functions, thereby allocating the request to the microserver in the platform cloud that matches its function type. For example, some requests are for payment orders, which are allocated to microservers with payment functions, and some requests are for searches, which are allocated to microservers with search functions. Each level of interceptors needs to be executed, which consumes resources and reduces processing efficiency. The present disclosure adds this method to the Zuul gateway. This method is based on the servlet interceptor. The servlet interceptor is a bottom-level interceptor with the highest priority and will be executed before the interceptor of Zuul itself. This solution is implemented based on the bottom-level servlet interceptor technology of SpringCloud's Zuul gateway. Since the bottom-level servlet interceptor of the Zuul gateway will be executed before the interceptor of the Zuul gateway itself, as the interceptor with the highest priority, it can receive the first access request initiated by the user end first and obtain the identification information of the access cloud in the first access request.

[0036] S102: Determine, based on the identification information of the access cloud, that the access target of the first access request is a private cloud.

[0037] In the embodiment of the present disclosure, after the platform cloud gateway receives the first access request, it determines whether the user terminal is a cloud platform user or a private cloud user based on the identification information of the access cloud carried in the first access request. The above judgment process can be implemented through the following two examples. The first example: when the forwarding target (which can be understood as the private cloud to be forwarded) is obtained according to the identification information of the access cloud carried in the first access request, it means that the access target of the first access request is a private cloud. When the forwarding target is not obtained according to the identification information of the access cloud carried in the first access request, it means that the access target of the first access request is a public cloud. The access target is a private cloud, which can also be understood as accessing an independently deployed or privatized cloud service. The second example: The identification information of the access cloud can be the identification information of the platform cloud or the identification information of the private cloud. It is directly determined whether the access target of the first access request is a private cloud or a public cloud based on the identification information of the access cloud and the pre-set correspondence.

[0038] For example, if the private cloud's identification information is represented as "Private Cloud" and the platform cloud's gateway is the Zuul gateway, the Zuul gateway's underlying servlet interceptor obtains "Private Cloud" based on the access cloud's identification information and determines that the user is a private cloud user. The first access request's target is the private cloud. The Zuul gateway's underlying servlet interceptor does not obtain "Private Cloud" based on the access cloud's identification information and determines that the user is a platform cloud user. The first access request's target is the platform cloud.

[0039] For example, if the platform cloud's identification information is "Public Cloud," the private cloud's identification information is "Private Cloud," and the platform cloud's gateway is the Zuul gateway, the access cloud's identification information is "Private Cloud." Based on a pre-set correspondence, the Zuul gateway's underlying servlet interceptor determines that the user is a private cloud user, indicating that the first access request's target is the private cloud. If the access cloud's identification information is "Public Cloud," the Zuul gateway's underlying servlet interceptor determines that the user is a platform cloud user, indicating that the first access request's target is the platform cloud.

[0040] It should be noted that the identification information of the platform cloud can be represented as "0", the identification information of the private cloud can be represented as "1", and the identification information of the access cloud can be "1" or "0". The embodiment of the present disclosure does not limit the specific form of the identification information of the access cloud. It can be agreed in advance by the terminal (that is, the user end) and the platform cloud gateway. As long as the platform cloud and the private cloud can be distinguished and the servlet interceptor of the Zuul gateway can identify and determine whether the user end is a cloud platform user or a private cloud user, the embodiment of the present disclosure does not limit this.

[0041] In some embodiments, the above S102 may also be implemented in the following manner: matching the identification information of the access cloud with a preset configuration rule to determine that the access target of the first access request is a private cloud.

[0042] In the disclosed embodiment, the preset configuration rule represents a request forwarding rule pre-set in the gateway of the platform cloud. The preset configuration rule may also be referred to as a preset cloud environment configuration rule. The highest priority interceptor in the gateway of the platform cloud (for example, the underlying servlet interceptor of the zuul gateway) matches the forwarding target (which may also be understood as the private cloud to be forwarded) based on the identification information of the access cloud and the preset configuration rule, indicating that the access target of the first access request is the private cloud.

[0043] In the disclosed embodiment, preset configuration rules are set in the highest-priority interceptor in the platform cloud's gateway. Upon receiving a first access request, the interceptor matches the access cloud identification information carried in the first access request with the preset configuration rules to determine whether the first access request is targeting a private cloud. This eliminates the need for each interceptor in the platform cloud's gateway to perform its own corresponding function; instead, requests are dispatched to the platform cloud's microservers that match their functional types, reducing resource consumption.

[0044] S103: When the access target is a private cloud, generate a second access request according to the first access request.

[0045] S104: Direct the second access request to the gateway of the private cloud.

[0046] In the disclosed embodiment, if the user is a platform cloud user, indicating that the access target is the platform cloud, the platform cloud gateway will assign the first access request to a microserver in the platform cloud based on the function type corresponding to the first access request. If the user is a private cloud user, indicating that the access target is the private cloud, the platform cloud gateway will regenerate a second access request based on the parameters in the first access request, thereby re-initiating a new request (i.e., the second access request) to the private cloud gateway.

[0047] In the embodiment of the present disclosure, since it is the forwarding component (HttpClient) that interacts with the gateway of the private cloud (sending and receiving information), and is not the interceptor with the highest priority for receiving the first access request and determining whether it is the private cloud, the interceptor with the highest priority also needs to generate a second access request in the forwarding format defined by the forwarding component based on the first access request, so that the forwarding component can directly send the second access request to the gateway of the private cloud without transit. The gateway of the platform cloud initiates a new request (i.e., a second access request) to the gateway of the private cloud, so that the gateway of the private cloud allocates the microservers in the private cloud based on the second access request, generates a response message, and sends the response message to the gateway of the platform cloud; the gateway of the platform cloud returns the request result to the user end based on the response message returned by the gateway of the private cloud, and the request result includes the microservers in the private cloud that are allocated.

[0048] In the embodiment of the present disclosure, when the access target is a private cloud, a second access request is constructed based on the first access request and the obtained forwarding target (which can be understood as the private cloud to be forwarded). The second access request is no longer sent to the next-level interceptor, nor is it sent to the microserver of the platform cloud. The second access request is sent directly to the gateway of the private cloud without forwarding through the microserver of the platform cloud, that is, without transit, and the request is forwarded directly to the gateway of the private cloud. The cross-cloud forwarding mode is simple and reduces resource consumption.

[0049] The present disclosure provides a cross-cloud forwarding method, apparatus, device, and computer-readable storage medium. According to the solution provided by the present disclosure, the method is applied to the gateway of the platform cloud; the method includes: receiving a first access request from a user; wherein the first access request includes identification information of the access cloud; determining, based on the identification information of the access cloud, that the access target of the first access request is a private cloud; if the access target is the private cloud, generating a second access request based on the first access request; and directly forwarding the second access request to the gateway of the private cloud. The underlying servlet interceptor of the cloud platform gateway (zuul gateway) is executed before the interceptor of the zuul gateway itself. As the interceptor with the highest priority, it can receive the first access request first. The present disclosure adds this method to the zuul gateway. Based on the servlet interceptor receiving the first access request, it can obtain the identification information of the access cloud in the first access request, thereby determining whether the user terminal wants to access the private cloud. If so, regenerating a second access request based on the first access request, and then forwarding the second access request directly to the gateway of the private cloud, without forwarding through the micro server of the platform cloud, that is, without transit, the request is directly forwarded to the gateway of the private cloud. When the present disclosure determines whether the user terminal wants to access the private cloud, the Zuul gateway does not need to forward the request to the microserver of the cloud platform, nor does it need the microserver of the cloud platform to forward the request. The cross-cloud forwarding mode is simple and reduces resource consumption.

[0050] In some embodiments, the platform cloud gateway includes at least one interceptor; after S101 in Figure 2, the cross-cloud forwarding method further includes S105. Based on Figure 2, as shown in Figure 3, Figure 3 is an optional step flow chart of another cross-cloud forwarding method provided in an embodiment of the present disclosure.

[0051] S105. When it is determined that the access target of the first access request is not a private cloud based on the identification information of the access cloud, the first access request is forwarded to the next interceptor, and the next interceptor allocates the microserver in the platform cloud based on the first access request.

[0052] In the disclosed embodiment, the platform cloud's gateway includes multiple interceptors. The highest-priority interceptor in the platform cloud's gateway performs matching based on the identification information of the access cloud and preset configuration rules. If no forwarding target is matched (which can be understood as the private cloud to be forwarded), it means that the access target of the first access request is not a private cloud. The first access request is forwarded to the next interceptor, and the interceptors at each level in the platform cloud's gateway continue to perform their corresponding functions and allocate the request to the microserver in the platform cloud that matches its functional type. That is, the microserver in the platform cloud is allocated based on the functional type corresponding to the first access request. In the case where the access target is not a private cloud, the corresponding steps in the relevant technology are executed, which improves the applicable scenarios of request forwarding.

[0053] In some embodiments, after the above S104, the cross-cloud forwarding method also includes the following steps: receiving response information returned by the gateway of the private cloud; the response information includes the allocation result of the private cloud gateway to the microservers in the private cloud based on the second access request; based on the response information, returning the request result to the user end.

[0054] In an embodiment of the present disclosure, after the platform cloud gateway directly transmits the second access request to the private cloud gateway, the private cloud gateway allocates microservers in the private cloud based on the second access request. For example, the platform cloud gateway parses the function type of the second access request and allocates microservers that match the function type. For example, some requests are for payment orders and are allocated to microservers with payment functions, while some requests are for searches and are allocated to microservers with search functions. An allocation result is obtained, and the allocation result represents the allocated microservers in the private cloud. The private cloud gateway generates a response message based on the allocation result, parameter information included in the second access request (e.g., the corresponding platform cloud gateway, the user end, the first access request, etc.), and the processing result of the request by the allocated microserver (e.g., the payment interface, search results, etc.), and sends the response message to the platform cloud gateway. The platform cloud gateway receives the response message and returns the request result of the first access request to the user end based on the response message. The request result may be the allocated microserver, the processing result of the request, etc.

[0055] In the disclosed embodiment, the forwarding component in the platform cloud's gateway receives a response from the private cloud's gateway. This forwarding component then sends the response to the highest-priority interceptor. Based on the response, the highest-priority interceptor returns the request result to the user, completing the cross-cloud forwarding process. The entire cross-cloud forwarding process is performed by the platform cloud's gateway, bypassing the platform cloud's microservers. This reduces platform computing power and improves request processing efficiency.

[0056] In the disclosed embodiment, this method serves as an extension of the platform cloud gateway (zuul gateway) function, and the entire calling process is completely imperceptible to the caller (i.e., the user end). For the user end, it initiates a first access request to the platform cloud gateway to access the private cloud, and then receives the request result returned by the platform cloud gateway based on the first access request. For each access request sent by the user end with private cloud access rights, it is sent to the platform cloud gateway and initiates a request to the platform cloud gateway, thereby realizing the cross-cloud forwarding process, that is, the unification of the entrance, and also meeting the purpose of exclusive computing power.

[0057] In some embodiments, the platform cloud gateway includes at least one interceptor, a read-write module, and a forwarding component; based on the above Figure 2, as shown in Figure 4, Figure 4 is an optional step flow chart of another cross-cloud forwarding method provided in an embodiment of the present disclosure, and the cross-cloud forwarding method includes the following steps.

[0058] S201. Receive a first access request from a user terminal through an interceptor with the highest priority among at least one interceptor.

[0059] In an embodiment of the present disclosure, the gateway of the platform cloud includes at least one interceptor, and the cross-cloud forwarding method provided by the present disclosure is executed based on the interceptor with the highest priority (for example, the underlying servlet interceptor of the zuul gateway), and the first access request from the user end is received first by the interceptor with the highest priority.

[0060] It should be noted that the implementation process and technical effects achieved by S201 in FIG4 are consistent with those of S101 in FIG2 , and will not be described in detail here.

[0061] S202. Write the first access request into the request parameters of the interceptor with the highest priority through the read-write module; wherein the request parameters include path information, header information and login information, the path information represents the function type to which the request belongs, the path information corresponds to the function of the assigned microserver, the header information includes identification information for accessing the cloud, and the login information represents the cloud access rights of the user end.

[0062] In an embodiment of the present disclosure, after receiving the first access request, the read-write module writes the first access request to the location corresponding to the request parameter (Http Servlet Request) type set by the highest priority interceptor. The request parameters include but are not limited to path information, header information (header information) and login information (body information). Among them, the path information represents the function type to which the request belongs, and the path information corresponds to the function possessed by the assigned microserver. For example, the path information represents that the function type to which the request belongs is search, and according to the path information, it can be assigned to a microserver with a search function. The header information includes identification information for accessing the cloud. In one scenario, when the user terminal is a private cloud user, the highest priority interceptor can obtain the forwarding target (private cloud to be forwarded) from the header information; when the user terminal is a public cloud user, the highest priority interceptor cannot obtain the forwarding target from the header information. In another scenario, when the user terminal is a private cloud user, the header information includes the identification information of the private cloud, and the interceptor with the highest priority can determine from the header information that the access target of the first access request is the private cloud; when the user terminal is a public cloud user, the header information includes the identification information of the public cloud, and the interceptor with the highest priority can determine from the header information that the access target of the first access request is the public cloud. The body information is the user information of the user terminal itself, which represents the cloud access permission of the user terminal. The gateway of the platform cloud can determine whether the terminal (i.e., the user terminal) has cloud access permission based on the body information. If the login information indicates that the user terminal has cloud access permission, the highest priority interceptor in the gateway of the platform cloud determines whether the access target is a private cloud based on the header information; if the login information indicates that the user terminal does not have cloud access permission, the gateway of the platform cloud does not perform the cross-cloud forwarding step.

[0063] In the embodiment of the present disclosure, the request parameters also include format information (method information), and the format information is used to characterize the data format of the request.

[0064] S203: Determine, through the highest priority interceptor and based on the header information in the request parameters, that the access target of the first access request is the private cloud.

[0065] In the disclosed embodiment, after writing the request parameters, the header information in the request parameters is read by the read-write module, and then the interceptor with the highest priority determines whether the access target of the first access request is a private cloud based on the header information in the request parameters.

[0066] For example, taking the case where the platform cloud gateway is the Zuul gateway, the first access request is an Http request, and the interceptor with the highest priority is the servlet interceptor, a method for forwarding requests based on information in the Http request is used. When the target of the request is a cloud service that is independently deployed or privately deployed, the servlet interceptor determines the information in the request and can forward the request to the target cloud environment (corresponding to forwarding the first access request to the private cloud) according to the configuration (corresponding to the preset configuration rules). The implementation steps of this technology are as follows: Add this method in the Zuul gateway. This method is based on the underlying servlet interceptor and will be executed before the interceptor of Zuul itself. When the servlet interceptor receives the Http request (corresponding to the first access request), it will match the forwarding rules in the configuration (corresponding to the preset configuration rules) based on the information in the request, such as the parameters in the header, and obtain the forwarding target (the private cloud to be forwarded). If the forwarding target is not obtained, no logical processing is performed, and the Http request is simply forwarded to the next interceptor for continued execution. When the forwarding target is obtained, forwarding processing will begin.

[0067] It should be noted that the implementation process and technical effects achieved by S203 in FIG4 are consistent with those of S102 in FIG2 , and are not described in detail here.

[0068] S204. Through the interceptor with the highest priority, when the access target is a private cloud, a second access request corresponding to the forwarding component is generated according to the request parameters.

[0069] In the embodiment of the present disclosure, the path information, header information (header information), login information (body information) and format information (method information) in the request parameters are read by the reading and writing module, and the interceptor with the highest priority reconstructs the request parameter information of the forwarding format defined by the forwarding component according to the request parameters and the obtained forwarding target (the private cloud to be forwarded), and generates a second access request so that the forwarding component can directly send the second access request to the gateway of the private cloud without transit.

[0070] It should be noted that the implementation process and technical effects achieved by S204 in FIG4 are consistent with those of S103 in FIG2 , and are not described in detail here.

[0071] S205: The second access request is directly sent to the gateway of the private cloud through the forwarding component.

[0072] For example, taking the platform cloud gateway as the zuul gateway, the first access request as the Http request, the interceptor with the highest priority as the servlet interceptor, and the forwarding component as the HttpClient, the forwarding processing process includes: obtaining request information from the request parameters of the servlet interceptor (Http Servlet Request parameters), using the path information, header information, method information, body information and the obtained forwarding target in the Http Servlet Request, reconstructing the Http Request request parameter information of the Http Client, and the Http Client initiating a new Http request to the target cloud environment (corresponding to the forwarding component directly sending the second access request to the gateway of the private cloud).

[0073] It should be noted that the implementation process and technical effects achieved by S205 in FIG4 are consistent with those of S104 in FIG2 , and are not described in detail here.

[0074] In the disclosed embodiment, the servlet interceptor preferentially receives the Http request from the user end, and the read-write module writes the Http request into the Http Servlet Request parameter of the servlet interceptor. The servlet interceptor determines whether the access target of the Http request is a private cloud based on the header information in the Http Servlet Request parameter, and when the forwarding target (the private cloud to be forwarded) is obtained, the Http Request parameter information of the Http Client is rebuilt based on the Http Servlet Request parameter, and a new Http request is generated. Then, the new Http request is directly sent to the gateway of the private cloud through the Http Client without the need for transit, thereby reducing resource consumption. This solution implements cross-cloud forwarding through the gateway of the platform cloud and the gateway of the private cloud, without the need for the microserver of the platform cloud, thereby reducing the redundancy of the code. Moreover, the cross-cloud forwarding solution is configurable and can be configured on the servlet interceptor in the zuul gateway of the platform cloud. The cross-cloud forwarding process is simple, which reduces the difficulty of development and maintenance.

[0075] In some embodiments, based on FIG. 4 above, as shown in FIG. 5 , FIG. 5 is an optional step flow chart of another cross-cloud forwarding method provided in an embodiment of the present disclosure. After S205 in FIG. 4 above, the cross-cloud forwarding method also includes S206-S208.

[0076] S206: Receive response information returned by the private cloud gateway through the forwarding component.

[0077] S207. Write the response information into the response parameter of the interceptor with the highest priority through the read-write module.

[0078] In the embodiment of the present disclosure, the reading and writing module writes the response information received by the forwarding component into the location corresponding to the response parameter (Http Servlet Response) according to the type of the response parameter (Http Servlet Response) set by the interceptor with the highest priority.

[0079] S208: The interceptor with the highest priority returns the request result to the user terminal based on the response parameter, and the first access request is no longer forwarded to the next interceptor.

[0080] In the embodiment of the present disclosure, after the response parameters are written, the response parameters are read by the read-write module, and then the interceptor with the highest priority generates a request result according to the response parameters and returns the request result to the user end.

[0081] For example, taking the case where the interceptor with the highest priority is the servlet interceptor and the forwarding component is HttpClient, after HttpClient receives the return information (corresponding to the response information), the reading module obtains the information from the Http Response of the Http Client and writes it into the response parameter (Http Servlet Response) of the servlet interceptor. The servlet interceptor returns this request and no longer forwards the Http request to the next interceptor for execution, thereby improving processing efficiency and reducing resource consumption.

[0082] The following describes an exemplary application of the embodiments of the present disclosure in a practical application scenario.

[0083] Based on Figure 1 above, as shown in Figure 6, Figure 6 is a schematic diagram of another interaction process provided by an embodiment of the present disclosure. From the interaction process between the terminal, cloud platform and private cloud, the implementation method of cross-cloud forwarding based on the Zuul gateway provided by the present disclosure is explained. If the request initiated by the terminal (that is, the user end) is for platform cloud user access, the request initiated by the user end is sent to the gateway of the platform cloud. The gateway forwards the request to the corresponding microserver based on the function type corresponding to the request (Figure 6 takes microservice 1 in the platform cloud as an example for explanation). If the request initiated by the terminal is for private cloud user access, the request initiated by the user end is first sent to the gateway of the platform cloud. In the first scenario, the gateway determines that the private cloud needs to be forwarded based on the identification information of the cloud accessed in the request. The gateway forwards the request to the gateway of the private cloud, and then the gateway forwards the request to the corresponding microserver based on the function type corresponding to the request (microservice 1 in the private cloud is used as an example in Figure 6); the second scenario: the gateway determines that the private cloud needs to be forwarded based on the identification information of the cloud accessed in the request. The gateway forwards the request to the gateway of the private cloud, and then the gateway forwards the request to the corresponding microserver based on the function type corresponding to the request (microservice 2 in the private cloud is used as an example in Figure 6).

[0084] The cross-cloud forwarding implementation method based on the Zuul gateway provided in Figure 6 above is applicable to scenarios that require cloud platform computing power and hybrid applications of public and private clouds. By forwarding requests between the platform cloud gateway and the private cloud gateway, there is no need to pass through the platform cloud's microserver, which reduces the redundancy of the code. Moreover, the cross-cloud forwarding method is a configurable cross-cloud forwarding technology that can be configured on the highest priority interceptor in the platform cloud's gateway. The cross-cloud forwarding process is simple, reducing the difficulty of development and maintenance. For the user side, it interacts with the platform cloud's gateway and sends all its access requests to the platform cloud's gateway. The platform cloud's gateway then executes the cross-cloud forwarding process and receives the request results returned by the platform cloud's gateway. The platform cloud's gateway has a unified cross-cloud forwarding processing mode, and the user side uses a unified entrance to meet the exclusive computing power of the unified entrance.

[0085] In order to implement the cross-cloud forwarding method of the embodiment of the present disclosure, the embodiment of the present disclosure also provides a cross-cloud forwarding device, as shown in Figure 7. Figure 7 is an optional structural diagram of a cross-cloud forwarding device provided by the embodiment of the present disclosure. The cross-cloud forwarding device 70 is applied to the gateway of the platform cloud; the cross-cloud forwarding device 70 includes: at least one interceptor and a forwarding component 702; the interceptor 701 with the highest priority among the at least one interceptor is used to receive the first access request from the user end; wherein the first access request includes identification information of the access cloud; according to the identification information of the access cloud, it is determined that the access target of the first access request is a private cloud; in the case that the access target is a private cloud, a second access request is generated according to the first access request; the forwarding component 702 is used to directly send the second access request to the gateway of the private cloud.

[0086] In some embodiments, the interceptor 701 with the highest priority is also used to match the identification information of the access cloud with the preset configuration rules to determine that the access target of the first access request is the private cloud.

[0087] In some embodiments, the gateway of the platform cloud includes at least one interceptor;

[0088] The interceptor 701 with the highest priority is also used to forward the first access request to the next interceptor when it is determined, based on the identification information of the access cloud, that the access target of the first access request is not a private cloud, and the next interceptor allocates the microservers in the platform cloud based on the first access request.

[0089] In some embodiments, the forwarding component 702 is further configured to receive a response message returned by the private cloud gateway; the response message includes a result of the private cloud gateway allocating the micro servers in the private cloud based on the second access request;

[0090] The interceptor 701 with the highest priority is also used to return the request result to the user end based on the response information.

[0091] In some embodiments, the platform cloud gateway further includes a read-write module 703;

[0092] The read-write module 703 is configured to write the first access request into the request parameters of the interceptor 701 with the highest priority; wherein the request parameters include path information, header information and login information, the path information represents the functional type to which the request belongs, the path information corresponds to the function possessed by the assigned microserver, the header information includes identification information for accessing the cloud, and the login information represents the cloud access rights of the user end.

[0093] In some embodiments, the interceptor 701 with the highest priority is further configured to generate a second access request corresponding to the forwarding component 702 based on the request parameters when the access target is a private cloud;

[0094] The forwarding component 702 is further configured to directly send the second access request to the gateway of the private cloud.

[0095] In some embodiments, the forwarding component 702 is further configured to receive a response message returned by the private cloud gateway;

[0096] The read / write module 703 is further configured to write the response information into the response parameter of the interceptor 701 with the highest priority;

[0097] The interceptor 701 with the highest priority is also used to return the request result to the user end based on the response parameter, and no longer forward the first access request to the next interceptor.

[0098] It should be noted that the cross-cloud forwarding device provided in the above embodiment only uses the division of the above-mentioned program modules as an example when performing cross-cloud forwarding. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the cross-cloud forwarding device provided in the above embodiment and the cross-cloud forwarding method embodiment belong to the same concept. The specific implementation process and beneficial effects are detailed in the method embodiment and will not be repeated here. For technical details not disclosed in the embodiment of this device, please refer to the description of the method embodiment of this disclosure for understanding.

[0099] In an embodiment of the present disclosure, Figure 8 is a schematic diagram of the composition structure of the cross-cloud forwarding device proposed in the embodiment of the present disclosure. As shown in Figure 8, the cross-cloud forwarding device 80 proposed in the embodiment of the present disclosure includes a processor 801 and a memory 802 for storing an executable computer program. The processor 801 is used to execute the executable computer program stored in the memory 802 to implement the cross-cloud forwarding method provided in the embodiment of the present disclosure.

[0100] In some embodiments, the cross-cloud forwarding device 80 may further include a communication interface 803 and a bus 804 for connecting the processor 801 , the memory 802 and the communication interface 803 .

[0101] In the embodiment of the present disclosure, the processor 801 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor functions may also be other, and the embodiment of the present disclosure does not specifically limit this.

[0102] In the embodiment of the present disclosure, the bus 804 is used to connect the communication interface 803, the processor 801 and the memory 802 to achieve mutual communication between these devices.

[0103] Memory 802 is used to store executable computer programs and data. The executable computer programs include computer operating instructions. Memory 802 may include high-speed RAM memory or non-volatile memory, such as at least two disk drives. In practical applications, memory 802 may be volatile memory, such as random-access memory (RAM); or non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or a combination of the above types of memory, and provides executable computer programs and data to processor 801.

[0104] In addition, the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional modules.

[0105] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0106] An embodiment of the present disclosure provides a computer-readable storage medium storing a computer program for implementing the cross-cloud forwarding method of any of the above embodiments when executed by a processor.

[0107] Exemplarily, the program instructions corresponding to a cross-cloud forwarding method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to a cross-cloud forwarding method in the storage medium are read or executed by an electronic device, a cross-cloud forwarding method as in any of the above embodiments can be implemented.

[0108] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0109] The present disclosure is described with reference to the implementation flow diagrams and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flow diagram and / or block diagram can be implemented by computer program instructions, as well as the combination of the processes and / or boxes in the flow diagram and / or block diagram. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flow diagram and / or one or more boxes in the block diagram.

[0110] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in implementing one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0112] The above are only preferred embodiments of the present disclosure and are not intended to limit the scope of protection of the present disclosure.

Claims

1. A cross-cloud forwarding method, which is applied to the gateway of the platform cloud; the method includes: Receiving a first access request from the user terminal; wherein, the first access request includes identification information of the accessed cloud; Determining that the access target of the first access request is a private cloud according to the identification information of the accessed cloud; Generating a second access request according to the first access request when the access target is a private cloud; Directly sending the second access request to the gateway of the private cloud.

2. The method according to claim 1, wherein, The determining that the access target of the first access request is a private cloud according to the identification information of the accessed cloud includes: Matching the identification information of the accessed cloud with a preset configuration rule to determine that the access target of the first access request is a private cloud.

3. The method according to claim 1, wherein, The gateway of the platform cloud includes at least one interceptor; the method further includes: When it is determined that the access target of the first access request is not a private cloud according to the identification information of the accessed cloud, forwarding the first access request to the next interceptor, and allocating micro-servers in the platform cloud based on the first access request through the next interceptor.

4. The method according to claim 1, wherein After directly sending the second access request to the gateway of the private cloud, the method further includes: Receiving response information returned by the gateway of the private cloud; the response information includes the allocation result of the micro-servers in the private cloud based on the second access request by the gateway of the private cloud; Returning a request result to the user terminal based on the response information.

5. The method according to any one of claims 1-4, wherein The gateway of the platform cloud includes at least one interceptor and a read-write module; The receiving the first access request from the user terminal includes: Receiving the first access request from the user terminal through the interceptor with the highest priority among the at least one interceptor; The method further includes: Writing the first access request into the request parameters of the interceptor with the highest priority through the read-write module; wherein, the request parameters include path information, header information, and login information, the path information represents the functional type to which the request belongs, the path information corresponds to the functions of the allocated micro-servers, the header information includes the identification information of the accessed cloud, and the login information represents the cloud access permission of the user terminal.

6. The method according to claim 5, wherein The gateway of the platform cloud further includes a forwarding component; generating a second access request according to the first access request; Directly sending the second access request to the gateway of the private cloud includes: Through the interceptor with the highest priority, when the access target is a private cloud, generating a second access request corresponding to the forwarding component according to the request parameters; Directly sending the second access request to the gateway of the private cloud through the forwarding component.

7. The method according to claim 6, wherein Receiving response information returned by the gateway of the private cloud; Returning a request result to the user terminal based on the response information includes: Receiving the response information returned by the gateway of the private cloud through the forwarding component; Writing the response information into the response parameters of the interceptor with the highest priority through the read-write module; Based on the response parameter, the interceptor with the highest priority returns the request result to the client, and no longer forwards the first access request to the next interceptor.

8. A cross-cloud forwarding device, which is applied to the gateway of a platform cloud; the device includes at least one interceptor and a forwarding component; The interceptor with the highest priority among the at least one interceptor is used to receive a first access request from the client; wherein, The first access request includes identification information of the accessed cloud; according to the identification information of the accessed cloud, it is determined that the access target of the first access request is a private cloud; In the case where the access target is a private cloud, a second access request is generated according to the first access request; The forwarding component is used to directly send the second access request to the gateway of the private cloud.

9. A cross-cloud forwarding device, the device includes: A memory for storing an executable computer program; A processor, when executing the executable computer program stored in the memory, implements the method according to any one of claims 1-7.

10. A computer-readable storage medium, storing a computer program, which when executed by a processor, implements the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Gateway access method, mobile terminal and computer storage medium

    CN112261047A

  • Access request access control method and device, computer equipment and storage medium

    CN113542384A

  • Communication method, device and system

    CN113691575A

  • Private cloud access method and device, equipment and storage medium

    CN116886431A

  • System and method for message broker migration in an application environment migration

    US20220300357A1