Communication method and device between local area network and public cloud, and computing equipment
By deploying the proxy side in the LAN and the public cloud, simulating the registry and server side, the problem of remote calls between the LAN and the public cloud is solved, and efficient and low-cost remote calls are achieved without modifying user code.
Patent Information
- Application Number
- CN202211019333.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2042-08-24
AI Technical Summary
Since the public cloud middleware service cannot be directly accessed on the LAN, the remote calls of the service between the LAN and the public cloud are not interoperable, affecting the local development and self-test of the LAN.
By deploying the LAN proxy in the LAN, deploying the public cloud proxy in the public cloud, and using the LAN proxy to simulate the registry service and the public cloud server, it realizes remote calls from the LAN client to the public cloud server.
It realizes remote calls to services in public cloud by the LAN, reduces deployment costs, avoids modification of user code, achieves zero intrusion of user code, and improves the lightweight access capabilities of the LAN to public cloud services.
Smart Images

Figure CN115567521B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to service calling technology, and more particularly, to a communication method and apparatus, and computing device between a local area network and a public cloud. Background Art
[0002] Many industries are gradually undergoing digital transformation. To save costs, enterprises will choose the public cloud model. However, for security reasons, public cloud middleware services cannot be directly accessed in the LAN. However, public cloud middleware services are indispensable in the remote calling process of services between the public cloud and the LAN. As a result, the remote calling of services between the public cloud and the LAN is not interoperable, which affects the local development and self-testing of the LAN. For example, the middleware of the registration center in the public cloud stores the IP address of the public cloud server of a certain service. When the client in the LAN calls the service, it needs to know the IP address of the public cloud server. Since the client cannot directly access the public cloud middleware service, the LAN cannot call the service, which affects the local work of the LAN. Summary of the invention
[0003] One or more embodiments of this specification describe a communication method and apparatus, as well as a computing device, between a local area network and a public cloud, which can implement remote calls from a local area network to services in a public cloud.
[0004] According to a first aspect, a communication method between a local area network and a public cloud is provided, wherein a local area network agent and a local area network client are deployed in the local area network; a public cloud agent, a public cloud server and a registration center server are deployed in the public cloud, and the public cloud server is a server that provides a preset public cloud service; the method is executed by the local area network agent, and the method includes:
[0005] When the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud, the registration center server is simulated to receive a first subscription request sent by the local area network client for the preset public cloud service; wherein the registration center server stores the IP address of the public cloud server that publishes the preset public cloud service;
[0006] Sending the first subscription request to the registration center server through the public cloud proxy;
[0007] After receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, obtain the public cloud server IP address in the first subscription response data packet, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address;
[0008] Modify the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and send the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server;
[0009] When the first calling request is received, the first calling request is sent to the corresponding public cloud service end through the public cloud proxy end according to the first mapping relationship, so as to implement the calling of the preset public cloud service.
[0010] According to a second aspect, a communication method between a local area network and a public cloud is provided, wherein a local area network agent and a local area network server providing a preset local area network service are deployed in the local area network, and a public cloud agent, a registration center server and a public cloud client are deployed in the public cloud; the method is executed by the public cloud client, and the method includes:
[0011] When the public cloud client in the public cloud calls a preset local area network service provided by the local area network server in the local area network, sending a second subscription request for the preset local area network service to the registration center server;
[0012] Receive a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service;
[0013] A second call request for the preset LAN service is sent to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to implement the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
[0014] According to a third aspect, a communication device between a local area network and a public cloud is provided, wherein a local area network agent and a local area network client connected to the local area network agent are deployed in the local area network, and the local area network client is a client corresponding to a preset local area network service; a public cloud agent, a public cloud service and a registration center service are deployed in the public cloud, and the public cloud agent is connected to the public cloud service and the registration center service respectively, and the public cloud service is a service providing a preset public cloud service, and the local area network agent is connected to the public cloud agent; the device is applied to the local area network agent, and the device comprises:
[0015] A first receiving module, configured to simulate the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service when the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud; wherein the registration center server stores the IP address of the public cloud server that publishes the preset public cloud service;
[0016] A first sending module, used for sending the first subscription request to the registration center server through the public cloud proxy end;
[0017] A second receiving module is used to obtain the public cloud server IP address in the first subscription response data packet after receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address;
[0018] A second sending module is used to modify the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and send the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server;
[0019] The first calling module is used to send the first calling request to the corresponding public cloud service end through the public cloud proxy end according to the first mapping relationship when the first calling request is received, so as to realize the calling of the preset public cloud service.
[0020] According to a fourth aspect, a communication device between a local area network and a public cloud is provided, wherein a local area network agent and a local area network server providing a preset local area network service are deployed in the local area network, and the local area network server is connected to the local area network agent; a public cloud agent, a registration center server and a public cloud client are deployed in the public cloud, and the public cloud agent is connected to the public cloud client and the registration center server respectively, and the public cloud client is a client corresponding to the preset public cloud service; the public cloud agent is connected to the local area network agent; the device is applied to the public cloud client, and the device includes:
[0021] A third sending module is used to send a second subscription request for the preset local area network service to the registration center server when the public cloud client in the public cloud calls the preset local area network service provided by the local area network server in the local area network;
[0022] A third receiving module is used to receive a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service;
[0023] A fourth sending module is used to send a second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to realize the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
[0024] According to a fifth aspect, a computing device is provided, which includes: at least one memory and at least one processor; the at least one memory is used to store a machine-readable program; the at least one processor is used to call the machine-readable program to execute the method provided in the first aspect or the second aspect.
[0025] The communication method and device between the local area network and the public cloud, and the computing device provided in the embodiments of this specification, each or in combination, has at least the following technical effects:
[0026] (1) The process of the LAN client calling the preset public cloud service is implemented based on the LAN agent deployed in the LAN and the public cloud agent deployed in the public cloud. In the calling process, the LAN agent simulates the registration center server so as to receive the first subscription request of the LAN client for the preset public cloud service. The LAN agent simulates the public cloud server and can receive the first call request of the LAN client for the preset public cloud service, and then complete the forwarding of the request and the call of the service, that is, the LAN client corresponding to the preset LAN service in the LAN calls the preset public cloud service provided by the public cloud server in the public cloud. Since the LAN agent can simulate the registration center server, it is not necessary to deploy the registration center server middleware in the LAN. Since there is no need to deploy middleware in the LAN, the deployment cost is relatively low. Since the LAN agent is deployed locally in the LAN, the lightweight local access to the public cloud service is achieved.
[0027] (2) Since the method provided in the embodiments of this specification is implemented based on a local area network agent deployed in a local area network and a public cloud agent deployed in a public cloud, it can solve the remote call problem as a transparent proxy method without modifying the user code, thus achieving zero intrusion on the user code. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 It is a flowchart of a communication method between a local area network and a public cloud in one embodiment of this specification;
[0030] Figure 2 It is a schematic diagram of an implementation method of a public cloud in a first deployment architecture in an embodiment of this specification;
[0031] Figure 3 It is a schematic diagram of another implementation of a public cloud in a first deployment architecture in an embodiment of this specification;
[0032] Figure 4 It is a flowchart of a communication method between a local area network and a public cloud in one embodiment of this specification;
[0033] Figure 5 It is a schematic diagram of an implementation method of a public cloud in a second deployment architecture in an embodiment of this specification;
[0034] Figure 6 It is a schematic diagram of another implementation of a public cloud in a second deployment architecture in an embodiment of this specification;
[0035] Figure 7 is a structural block diagram of a communication device between a local area network and a public cloud in one embodiment of this specification;
[0036] Figure 8 It is a structural block diagram of a communication device between a local area network and a public cloud in one embodiment of this specification. DETAILED DESCRIPTION
[0037] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0038] In the scenario of remote service calls between the LAN and the public cloud, since the public cloud's middleware services cannot be directly accessed in the LAN, and the public cloud's middleware services are indispensable, it will affect the local work of the LAN.
[0039] According to the first aspect, the embodiment of this specification provides a deployment architecture for implementing a preset local area network service in a local area network to call a preset public cloud service in a public cloud. The deployment architecture can be called a first deployment architecture, including: a local area network agent and a local area network client are deployed in the local area network; a public cloud agent, a public cloud service end and a registration center service end are deployed in the public cloud, and the public cloud service end is a service end that provides the preset public cloud service; the registration center service end stores the IP address of the public cloud service end that publishes the preset public cloud service. More specifically, a LAN agent and a LAN client connected to the LAN agent are deployed in the LAN, and the LAN client is a client corresponding to the preset LAN service; a public cloud agent, a public cloud server and a registration center server are deployed in the public cloud, and the public cloud agent is connected to the public cloud server and the registration center server respectively, and the public cloud server is a server that provides the preset public cloud service, and the registration center server stores the IP address of the public cloud server that publishes the preset public cloud service; the LAN agent is connected to the public cloud agent.
[0040] Based on the above deployment architecture, the LAN agent can receive the first subscription request of the LAN client for the preset public cloud service by simulating the registration center server, and the LAN agent can receive the first call request of the LAN client for the preset public cloud service by simulating the public cloud server, and then complete the forwarding of the request and the call of the service, that is, realize the LAN client corresponding to the preset LAN service in the LAN calling the preset public cloud service provided by the public cloud server in the public cloud.
[0041] According to the second aspect, the embodiment of this specification provides a deployment architecture for realizing that the preset public cloud service in the public cloud calls the preset LAN service in the LAN. The deployment architecture can be called the second deployment architecture, including: a LAN agent and a LAN service that provides the preset LAN service are deployed in the LAN, and a public cloud agent, a registration center service and a public cloud client are deployed in the public cloud. More specifically, a LAN agent and a LAN service that provides the preset LAN service are deployed in the LAN, and the LAN service is connected to the LAN agent; a public cloud agent, a registration center service and a public cloud client are deployed in the public cloud, and the public cloud agent is connected to the public cloud client and the registration center service respectively, and the public cloud client is the client corresponding to the preset public cloud service; the public cloud agent is connected to the LAN agent.
[0042] Based on the above deployment architecture, during the publishing process of the preset LAN service, the public cloud agent will modify the IP address of the LAN server that publishes the preset LAN service to the IP address of the public cloud agent itself, so that it can receive the second call request from the public cloud client for the preset LAN service, and then complete the forwarding of the request and the call of the service, that is, realize the public cloud client corresponding to the preset public cloud service in the public cloud calling the preset LAN service provided by the LAN server in the LAN.
[0043] In summary, in order to achieve remote interoperability of services between a LAN and a public cloud, an overall system architecture can be formed based on the above two deployment architectures: a LAN agent, a LAN client, and a LAN server are deployed in the LAN, and a public cloud agent, a registration center server, a public cloud client, and a public cloud server are deployed in the public cloud. Among them, the LAN agent is connected to the public cloud agent, the LAN agent is connected to the LAN client and the LAN server, and the public cloud agent is connected to the registration center server, the public cloud client, and the public cloud server. The LAN client and the LAN server both correspond to the preset LAN service, and the public cloud client and the public cloud server both correspond to the preset public cloud service. The registration center server stores the IP address of the public cloud server that publishes the preset public cloud service and the IP address of the public cloud agent corresponding to the preset LAN service.
[0044] That is, through this system architecture, it is possible for the LAN client corresponding to the preset LAN service in the LAN to call the preset public cloud service provided by the public cloud server in the public cloud, and for the public cloud client corresponding to the preset public cloud service in the public cloud to call the preset LAN service provided by the LAN server in the LAN.
[0045] According to the first aspect, based on the first deployment architecture, a specific implementation of the communication method between the local area network and the public cloud provided in the embodiment of this specification is described.
[0046] Figure 1 1 is a flow chart of a method for communication between a local area network and a public cloud in one embodiment of the present invention. The method is applied to a local area network proxy terminal, that is, the method is executed by the local area network proxy terminal. Figure 1 The method comprises the following steps S102 to S110:
[0047] S102, when the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud, simulating the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service;
[0048] S104, sending the first subscription request to the registration center server through the public cloud proxy;
[0049] S106. After receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, obtain the public cloud server IP address in the first subscription response data packet, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address;
[0050] S108, modifying the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and sending the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server;
[0051] S110. When the first call request is received, the first call request is sent to the corresponding public cloud server through the public cloud proxy according to the first mapping relationship to implement the call to the preset public cloud service.
[0052] In the above communication process, first, the LAN agent simulates the registration center server, so that the LAN agent can receive the first subscription request sent by the LAN client for the preset public cloud service, and then send the first subscription request to the registration center server through the public cloud agent, so as to obtain the public cloud server IP address corresponding to the preset public cloud service and complete the subscription process. Then, the LAN agent modifies the public cloud server IP address in the first subscription response data packet to the LAN agent IP address to simulate the public cloud server, so that the LAN agent can receive the first call request of the LAN client for the preset public cloud service, and then send the first call request to the public cloud server through the public cloud agent. The public cloud server that receives the first call request will perform corresponding operations according to its own processing logic, so as to realize the call of the preset public cloud service. It can be seen that the LAN agent and the public cloud agent form a communication link between the LAN and the public cloud, realizing the LAN's access to the registration center server in the public cloud, and then completing the call to the preset public cloud service in the public cloud.
[0053] The following statement Figure 1 How the various steps are performed.
[0054] S102, when the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud, simulating the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service;
[0055] It is understandable that the purpose of the first subscription request is to obtain the IP address of the public cloud server that provides the preset public cloud service, and the destination of sending the first subscription request is the registration center server in the public cloud. However, since the LAN client and the registration center server cannot communicate directly with each other, in step S102, the LAN proxy simulates the registration center server so that it can receive the first subscription request sent by the LAN client.
[0056] In a specific implementation, the simulation of the registration center server to receive the first subscription request sent by the local area network client for the preset public cloud service may specifically include: specifying the feedback address of the addressing component as the local area network proxy IP address to simulate the registration center server.
[0057] Among them, the addressing component is the Acvip component.
[0058] Among them, the function of the addressing component is to feed back the IP address of the registration center server to the registration center client, and the registration center client can be deployed on the device where the LAN client and the public cloud client are located. Since the addressing component feeds back the IP address of the registration center server to the registration center client, the LAN client can obtain the IP address of the registration center server and then send the first subscription request to the IP address. However, here the feedback address of the addressing component is specified as the LAN proxy IP address, so the addressing component will feed back the LAN proxy IP address as the IP address of the registration center server to the registration center client, so that the IP address obtained by the LAN client is actually the LAN proxy IP address, so the first subscription request will be sent to the LAN proxy corresponding to the LAN proxy IP address. It can be seen that by specifying the feedback address of the addressing component as the LAN proxy IP address, the simulation of the registration center server can be realized.
[0059] The LAN proxy terminal in the embodiments of this specification can be implemented by the software sofaproxy-agent.
[0060] S104, sending the first subscription request to the registration center server through the public cloud proxy;
[0061] That is to say, after receiving the first subscription request, the LAN agent will send the first subscription request to the public cloud agent, and then the public cloud agent will send the first subscription request to the registration center server, so that the first subscription request is sent to the registration center server in the public cloud.
[0062] Next, the registration center server that receives the first subscription request will learn which preset public cloud service needs to be called based on the first subscription request, and then obtain the public cloud server IP address corresponding to the preset public cloud service, and then form a first subscription response data packet based on the public cloud server IP address, and send the first subscription response data packet to the public cloud agent, and then the public cloud agent will feed back the first subscription response data packet to the local area network agent.
[0063] S106. After receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, obtain the public cloud server IP address in the first subscription response data packet, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address;
[0064] It is understandable that, after receiving the first subscription response data packet, the local area network agent parses the first subscription response data packet to obtain the public cloud server IP address, and then saves the mapping relationship between the preset public cloud service and the public cloud server IP address, that is, the above-mentioned first mapping relationship.
[0065] It is understandable that the public cloud server that publishes the preset public cloud service may include multiple servers, so there may be multiple public cloud server IP addresses in the first subscription response data packet, thus forming a mapping relationship between a preset public cloud service and multiple public cloud server IP addresses.
[0066] S108, modifying the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and sending the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server;
[0067] That is, the LAN agent modifies the public cloud server IP address in the first subscription response data packet to the LAN agent's own IP address, and then sends the first subscription response data packet with the modified IP address to the LAN client. After the LAN client parses the first subscription response data packet, it obtains the LAN agent's IP address.
[0068] It is understandable that after receiving the IP address, the local area network client completes the subscription process and then proceeds to the calling process. First, the local area network client generates a first calling request for the preset public cloud service.
[0069] It is understandable that the destination of the first call request is the public cloud server, but because the IP address received by the LAN client is the IP address of the LAN proxy, the destination of the first call request becomes the LAN proxy. That is, when the LAN proxy modifies the IP address in the first subscription response data packet to its own IP address, it realizes the simulation of the public cloud server, so that the LAN proxy can receive the first call request sent by the LAN client.
[0070] S110. When the first call request is received, the first call request is sent to the corresponding public cloud server through the public cloud proxy according to the first mapping relationship to implement the call to the preset public cloud service.
[0071] That is to say, when the local area network agent receives the first call request, it can use the first mapping relationship stored previously to find the true destination of the first call request, that is, the public cloud server IP address, and then send the first call request to the public cloud agent according to the public cloud server IP address, and then the public cloud agent sends the first call request to the public cloud server.
[0072] In a specific implementation, the step of sending the first call request to the corresponding public cloud server through the public cloud proxy according to the first mapping relationship in S110 may specifically include:
[0073] After receiving the first call request, parsing the first call request to obtain a preset public cloud service to be called;
[0074] Searching for the public cloud server IP address corresponding to the preset public cloud service from the first mapping relationship;
[0075] Placing the IP address of the public cloud server in the first call request;
[0076] The first call request is sent to the public cloud proxy end, so that the public cloud proxy end sends the first call request to the corresponding public cloud server end according to the public cloud server end IP address in the first call request.
[0077] That is to say, after receiving the first call request, the local area network proxy end parses the first call request to find out which preset public cloud service is called, and then searches for each public cloud server IP address corresponding to the service from the first mapping relationship, selects a public cloud server IP address, and then places the selected public cloud server IP address in the first call request, and sends the first call request to the local area network proxy end. After receiving the first call request, the local area network proxy end will send the first call request to the public cloud server corresponding to the public cloud server IP address in the first call request. The public cloud server end that receives the first call request will perform corresponding operations according to the public cloud server end's own processing logic, thereby realizing the call to the preset public cloud service.
[0078] In one embodiment, see Figure 2 A specific implementation of the public cloud part in the first deployment architecture may include: the public cloud proxy end and the public cloud service end are both deployed in the user virtual private cloud in the public cloud, and the registration center service end is deployed in the middleware virtual private cloud in the public cloud. The public cloud proxy end may be implemented by the software sofaproxy.
[0079] In one embodiment, see Figure 3Another implementation of the public cloud part in the first deployment architecture may include: the public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal, the registration center service terminal and the first proxy sub-terminal are deployed in the middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud service terminal are deployed in the user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud service terminal are connected through the second proxy sub-terminal. The first proxy sub-terminal may be implemented by the software sofaproxy, and the second proxy sub-terminal may be implemented by the software sofaproxy-agent.
[0080] Among them, the second proxy sub-end and the public cloud service end are both deployed in the user virtual private cloud, while the registration center service end and the first proxy sub-end are deployed in the middleware virtual private cloud.
[0081] Among them, in the process of the LAN client in the LAN calling the preset public cloud service provided by the public cloud server in the public cloud, the first call request sent by the LAN proxy will be forwarded to the public cloud server through the first proxy sub-end and the second proxy sub-end in sequence. It can be seen that the first call request sent by the LAN proxy will first be sent to the first proxy sub-end, the first proxy sub-end will send the first call request to the second proxy sub-end, and the second proxy sub-end will send the first call request to the public cloud server. It can be seen that in both implementations, the process of the LAN client calling the preset public cloud service is basically the same as the above-mentioned process of S102~S110.
[0082] Among them, the processing logic of the second proxy sub-end in the latter implementation is similar to the processing logic of the public cloud proxy end in the former implementation, which will be introduced in detail below.
[0083] Among them, the first proxy sub-end can perform traffic statistics on each client when receiving a service call request for each client, and perform billing based on the statistical traffic. That is, the first proxy sub-end can perform traffic statistics on each client, and then perform billing based on the statistical traffic. It can be seen that this implementation method adds the provision of traffic and billing statistics services compared to the previous implementation method.
[0084] Regardless of the implementation method adopted by the public cloud, the deployment of the LAN part remains unchanged, that is, the LAN includes a LAN proxy, a LAN client, and a LAN server, and the LAN proxy is connected to the LAN client and the LAN server respectively.
[0085] For example, the LAN is an office network, the preset LAN service is service A, and the preset public cloud service is service B. The LAN proxy is implemented by the software sofaproxy-agent, and the public cloud proxy is implemented by the software sofaproxy. The public cloud server corresponding to service B publishes service B to the registration center server in advance, and when publishing service B, the public cloud server IP address is also sent to the registration center server. Therefore, the registration center server stores the public cloud server IP address that publishes service B. The process of the LAN client corresponding to service A calling service B provided by the public cloud server includes the following steps:
[0086] The feedback address of the addressing component Acvip is designated as the LAN proxy IP address. At this time, the LAN client regards the LAN proxy as the registration center server, and therefore sends the first subscription request to the LAN proxy. The LAN proxy forwards the first subscription request to the public cloud proxy, and the second proxy software sends the first subscription request to the registration center server. When the registration center server receives the first subscription request, it searches for the IP address corresponding to the preset public cloud service in the first subscription request, generates a first subscription response data packet based on the public cloud server IP address found, and returns it to the public cloud proxy. The public cloud proxy returns the first subscription response data packet to the LAN proxy. The LAN proxy parses and serializes the first subscription response data packet to obtain the public cloud server IP address, and then saves the mapping relationship between the preset public cloud service and the public cloud server IP address, replaces the public cloud server IP address in the first subscription response data packet with the LAN proxy IP address, and returns the first subscription response data packet with the modified IP address to the LAN client. After receiving the first subscription response data packet, the LAN client generates a first call request and sends the first call request to the LAN proxy. The LAN proxy parses and deserializes the first call request to obtain which preset public cloud service needs to be called, then searches for the public cloud server IP address corresponding to the preset public cloud service, selects a corresponding public cloud server IP address and places it in the header of the first call request, and then sends the first call request to the public cloud proxy. The public cloud proxy obtains the IP address from the header of the first call request, and then sends the first call request to the public cloud server corresponding to the IP address. Service B in the public cloud server that receives the first call request performs corresponding operations, thereby completing the call of the LAN client corresponding to service A in the office network to service B provided by the public cloud server in the public cloud.
[0087] Among them, the LAN proxy can be connected to the public cloud proxy in the public cloud through the public network load balancing, and the LAN proxy can use two-way certificates to authenticate and encrypt data.
[0088] Among them, the public cloud proxy can add verification of the IP address and MAC address of the LAN proxy, limiting access to specific IP addresses.
[0089] Among them, the LAN agent usually only acts as an agent for one environment, such as a development environment or a test environment. The public cloud agent verifies the environment that the LAN agent acts as an agent to avoid horizontal unauthorized interference between the test environment and the development environment.
[0090] Among them, every request sent from the public cloud to the local area network must be parsed, and only RPC requests are forwarded, while other types of requests are ignored.
[0091] The public cloud in the embodiments of this specification generally refers to a cloud that is provided by a third-party cloud vendor for users to use. Generally, services can be provided through the public network, and a free or low-cost shared resource service can be provided.
[0092] Among them, the office network in the embodiments of this specification is an office network within the public network, and is generally not interconnected with the public cloud for security reasons.
[0093] The addressing component Acvip in the embodiment of this specification is a component in SOFAStack that provides service addressing for each middleware. For example, the registration center client first needs to access Acvip to obtain the IP address of the registration center server, and then establish a connection with the registration center server.
[0094] Among them, the development environment and the test environment can be deployed on the public cloud. The method provided in the embodiment of this specification can realize remote calling and intercommunication between local services and public cloud services, reduce the cost of establishing dedicated lines between the local area network and the public cloud, and avoid the security issues of dedicated lines.
[0095] For example, a service for the CICD test environment is deployed in the public cloud. Through the method provided in the embodiments of this specification, the linke in the office network can be interconnected with the public cloud, and the test case verification of the CICD component in the office network can be realized, which saves the deployment cost of linke in the public cloud. It is not necessary to open a dedicated line between the office network and the public cloud, which reduces the cost and avoids the security problem of the office network being invaded due to the public network virtual private cloud being hacked.
[0096] Moreover, the method provided in the embodiment of this specification does not need to deploy a set of gateways in the local area network and the office network, so it is not necessary to change the RPC load balancing of the remote call to the gateway load balancing, that is, it is not necessary to modify the business proxy. It is also not necessary to reconfigure the API for each RPC request interface in the gateway, because the method provided in the embodiment of this specification provides a transparent proxy method, and no additional configuration of the interface is required.
[0097] The communication method between a local area network and a public cloud provided in the embodiments of this specification is implemented based on a local area network proxy terminal deployed in the local area network and a public cloud proxy terminal deployed in the public cloud. Specifically, when the LAN client in the LAN calls the preset public cloud service provided by the public cloud server in the public cloud, the LAN agent implements the call of the preset public cloud service by the LAN client by executing the following steps: the LAN agent simulates the registration center server, so that it can receive the first subscription request sent by the LAN client for the preset public cloud service, and send the first subscription request to the registration center server through the public cloud agent; after receiving the first subscription response data packet obtained by the public cloud agent from the registration center server, obtain the public cloud server IP address in the first subscription response data packet, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address; modify the public cloud server IP address in the first subscription response data packet to the LAN agent IP address, and send the first subscription response data packet with the modified IP address to the LAN client, so that the LAN client will send the first call request for the preset public cloud service to the LAN agent. When the LAN proxy receives the first call request, it sends the first call request to the corresponding public cloud server through the public cloud proxy according to the first mapping relationship to realize the call of the preset public cloud service. It can be seen that in this process, the LAN proxy simulates the registration center server so as to receive the first subscription request of the LAN client for the preset public cloud service. The LAN proxy simulates the public cloud server and can receive the first call request of the LAN client for the preset public cloud service, and then complete the forwarding of the request and the call of the service, that is, the LAN client corresponding to the preset LAN service in the LAN calls the preset public cloud service provided by the public cloud server in the public cloud.
[0098] Since the LAN agent can simulate the registration center server, there is no need to deploy the registration center server middleware in the LAN. Since there is no need to deploy middleware in the LAN, the deployment cost is relatively low. Moreover, since the method provided in the embodiments of this specification is based on the LAN agent deployed in the LAN and the public cloud agent deployed in the public cloud, it can solve the remote call problem as a transparent proxy method without modifying the user code, that is, achieving zero intrusion of the user code. In addition, since the LAN agent is deployed locally in the LAN, lightweight local access to public cloud services is achieved.
[0099] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0100] According to the second aspect, based on the above-mentioned second deployment architecture, a specific implementation method of the communication method between the local area network and the public cloud provided in the embodiment of this specification is described.
[0101] Figure 4 FIG. 1 is a flow chart of a method for communicating between a local area network and a public cloud in one embodiment of the present invention. The method is applied to a public cloud client, that is, the method is executed by the public cloud client. Figure 4 The method comprises the following steps S202 to S206:
[0102] S202: When the public cloud client in the public cloud calls a preset local area network service provided by the local area network server in the local area network, a second subscription request for the preset local area network service is sent to the registration center server;
[0103] S204, receiving a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service;
[0104] S206. Send a second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to implement the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
[0105] In the above communication process, the public cloud proxy pre-stores a second mapping relationship between the preset LAN service and the LAN server IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy IP address corresponding to the preset LAN service. The public cloud client sends a second subscription request for the preset LAN service to the registration center server. After receiving the second subscription request, the registration center server searches for the public cloud proxy IP address corresponding to the preset LAN service, and then generates a second subscription response data packet based on the public cloud proxy IP address, and returns it to the public cloud client, thus completing the subscription process. The public cloud client then generates a second call request for the preset LAN service. Since the received IP address is the IP address of the public cloud proxy, the destination of the second call request is the public cloud proxy. When the public cloud proxy receives the second call request, it knows which preset LAN service needs to be called, and then searches for the LAN server IP address corresponding to the preset LAN service from the second mapping relationship, places the found LAN server IP address in the second call request, and sends the second call request to the LAN proxy. When the LAN proxy receives the second call request, it will send the second call request to the corresponding LAN server according to the LAN server IP address in the second call request. The LAN server that receives the second call request will perform corresponding operations according to the LAN server's own processing logic, thereby realizing the call to the preset LAN service.
[0106] The following statement Figure 4 How the various steps are performed.
[0107] S202: When the public cloud client in the public cloud calls a preset local area network service provided by the local area network server in the local area network, a second subscription request for the preset local area network service is sent to the registration center server;
[0108] In the specific implementation, before the public cloud client executes S202, it is necessary to complete the publishing operation of the preset LAN service. Specifically, the LAN service end sends a publishing request for the preset LAN service to the public cloud agent end through the LAN agent end, and the publishing request includes the IP address of the LAN server end that publishes the preset LAN service. When the public cloud agent end receives the publishing request, it parses the publishing request to obtain the LAN server end IP address. Then, the mapping relationship between the preset LAN service and the corresponding LAN server end IP address is saved, and the mapping relationship is the second mapping relationship. Then, the public cloud agent end modifies the LAN server end IP address in the publishing request to the public cloud agent end IP address, and then sends the publishing request with the modified IP address to the registration center server end, so that the registration center server end will store the public cloud agent end IP address corresponding to the preset LAN service.
[0109] It can be seen that through the above-mentioned publishing process of the preset LAN service, the public cloud agent end can pre-save the second mapping relationship between the preset LAN service and the LAN server IP address that publishes the preset LAN service, and the registration center server end pre-saves the public cloud agent end IP address corresponding to the preset LAN service.
[0110] That is to say, the process of obtaining the second mapping relationship in the public cloud agent and the public cloud agent IP address corresponding to the preset LAN service in the registration center server may include: when the public cloud agent receives the publishing request for the preset LAN service forwarded by the LAN agent from the LAN server, the public cloud agent parses the publishing request, obtains the LAN server IP address, and saves the second mapping relationship between the preset LAN service and the LAN server IP address, so that the public cloud client saves the second mapping relationship; the public cloud agent modifies the LAN server IP address in the publishing request to the public cloud agent IP address, and sends the publishing request for modifying the IP address to the registration center server, so that the registration center server stores the public cloud agent IP address corresponding to the preset LAN service.
[0111] In step S202, the public cloud client sends a second subscription request for the preset local area network service to the registration center server. When the registration center server receives the second subscription request, it searches for the IP address corresponding to the preset local area network service, and then obtains the public cloud proxy IP address corresponding to the preset local area network service. Then, a second subscription response data packet is generated according to the public cloud proxy IP address, and the second subscription response data packet is returned to the public cloud client, and the subscription process ends.
[0112] S204, receiving a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service;
[0113] That is, the public cloud client receives the second subscription response data packet returned by the registration center server, parses the second subscription response data packet, and obtains the public cloud proxy IP address in the second subscription response data packet.
[0114] S206. Send a second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to implement the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
[0115] That is to say, after obtaining the IP address, the public cloud client enters the calling process. First, a second calling request for the preset LAN service is generated. The second calling request should be sent to the LAN server, but because the IP address received by the public cloud client is the public cloud proxy IP address, the public cloud client will send the second calling request to the public cloud proxy corresponding to the public cloud proxy IP address.
[0116] When the public cloud proxy receives the second call request, it searches the second mapping relationship for the real destination of the second call request, that is, the IP address of the LAN server that publishes the preset LAN service. After finding a LAN server IP address, the LAN server IP address is placed in the second call request, and then the second call request is sent to the LAN proxy. When the LAN proxy receives the second call request, it sends the second call request to the corresponding LAN server according to the LAN server IP address in the second call request. The LAN server that receives the second call request will perform corresponding operations according to its own processing logic, and then complete the call to the preset LAN service.
[0117] For example, the process of a public cloud client corresponding to service B in the public cloud calling service A provided by a local area network server in an office network may include:
[0118] The LAN server sends a publishing request for service A to the LAN proxy, and the LAN proxy sends the publishing request to the public cloud proxy. The public cloud proxy parses and serializes the publishing request, obtains the LAN server IP address for publishing service A, saves the second mapping relationship between service A and the LAN server IP address, modifies the LAN server IP address in the publishing request to the public cloud proxy IP address, and then sends the publishing request with the modified IP address to the registration center server. When the registration center server receives the publishing request, the public cloud proxy IP address corresponding to service A in the publishing request is saved. In order to quickly find the original LAN server IP address, a tag can also be added to the publishing request to record the original LAN server IP address and publish it to the registration center server. This completes the publishing process of service A. When the public cloud client needs to subscribe to service A, the public cloud client sends a second subscription request to the registration center server, and the registration center server returns a corresponding IP address to the public cloud client. This completes the subscription process. The public cloud client generates a second call request. Since the registration center server returns the public cloud proxy IP address to the public cloud client, the second call request is sent to the public cloud proxy. After receiving the second call request, the public cloud proxy parses the second call request to find out which preset LAN service needs to be called. Then, the corresponding LAN server IP address is searched according to the preset LAN service that needs to be called, and the found LAN server IP address is placed in the header of the second call request, and the second call request is sent to the LAN proxy. The LAN proxy will forward the second call request to the corresponding LAN server according to the LAN server IP address in the header. Service A of the LAN server that receives the second call request performs corresponding operations, and the call of service A provided by the LAN server in the office network by the public cloud client corresponding to service B in the public cloud is completed.
[0119] By comparison, it is found that the process of the public cloud client calling service A is similar to the process of the LAN client calling service B. The difference is that when the public cloud client calls service A, the public cloud side does not need to simulate the feedback address of the registration center server and the specified addressing component, while when the LAN client calls service B, the office network side needs to simulate the feedback address of the registration center server and the specified addressing component.
[0120] In specific implementation, the above steps S202 to S206 are applicable to an implementation of the public cloud in the second deployment architecture. Figure 5 In this implementation, the public cloud proxy and the public cloud client are both deployed in the user virtual private cloud in the public cloud, and the registration center server is deployed in the middleware virtual private cloud in the public cloud.
[0121] Similarly, the above steps S202 to S206 are also applicable to another implementation of the public cloud in the second deployment architecture. Figure 6 In another implementation, the public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal; the registration center service terminal and the first proxy sub-terminal are deployed in a middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud client are deployed in a user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud client are connected through the second proxy sub-terminal.
[0122] Since the public cloud proxy end is further divided in the latter implementation, the second mapping relationship can be stored in the second proxy sub-end of the public cloud proxy end, and the registration center server end can pre-store the second proxy sub-end IP address corresponding to the preset LAN service.
[0123] In the publishing process, the LAN server sends a publishing request for service A to the LAN proxy, and the LAN proxy sends the publishing request to the first proxy sub-end. The first proxy sub-end parses and serializes the publishing request, obtains the LAN server IP address for publishing service A, saves the second mapping relationship between service A and the LAN server IP address, modifies the LAN server IP address in the publishing request to the second proxy sub-end IP address, and then sends the second mapping relationship to the second proxy sub-end for saving. Then, the first proxy sub-end sends the publishing request with the modified IP address to the registration center server. When the registration center server receives the publishing request, the second proxy sub-end IP address corresponding to service A in the publishing request is saved.
[0124] Moreover, the second subscription response data packet includes the second proxy sub-end IP address corresponding to the preset LAN service. The sending of the second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address in S206 may specifically include: the public cloud client sends the second call request for the preset LAN service to the second proxy sub-end corresponding to the second proxy sub-end IP address, so that the second proxy sub-end searches for the LAN service end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN service end IP address in the second call request, and sends the second call request to the corresponding LAN service end through the first proxy sub-end and the LAN proxy end, so as to realize the call to the preset LAN service.
[0125] Therefore, the public cloud client sends a second subscription request for the preset local area network service to the registration center server. When the registration center server receives the second subscription request, it will search for the IP address corresponding to the preset local area network service, and then obtain the second proxy sub-end IP address corresponding to the preset local area network service. Then, a second subscription response data packet is generated according to the second proxy sub-end IP address, and the second subscription response data packet is returned to the public cloud client, and the subscription process ends. The public cloud client receives the second subscription response data packet returned by the registration center server, parses the second subscription response data packet, and obtains the second proxy sub-end IP address in the second subscription response data packet. A second call request for the preset local area network service is generated, and the public cloud client sends the second call request to the second proxy sub-end corresponding to the second proxy sub-end IP address. When the second proxy sub-end receives the second call request, it searches for the real destination of the second call request from the second mapping relationship, that is, the local area network service end IP address that publishes the preset local area network service. After finding a local area network service end IP address, the local area network service end IP address is placed in the second call request, and then the second call request is sent to the first proxy sub-end. After receiving the second call request, the first proxy sub-end sends it to the LAN proxy end. When the LAN proxy end receives the second call request, it will send the second call request to the corresponding LAN server end according to the LAN server end IP address in the second call request. The LAN server end that receives the second call request will perform corresponding operations according to its own processing logic, thereby completing the call to the preset LAN service.
[0126] Among them, the call request in the embodiments of this specification is actually an RPC request. RPC is the Remote Procedure Call Protocol, which is a protocol that requests services from a remote computer program through a network without having to understand the underlying network technology.
[0127] Wherein, a long connection is established between the LAN proxy terminal and the first proxy sub-terminal to achieve network intercommunication.
[0128] In an embodiment of the present specification, a LAN agent based on a LAN and a public cloud agent based on an office network implements a call of a public cloud client in a public cloud to a preset LAN service in a LAN. The specific process includes: the public cloud client sends a second subscription request for the preset LAN service to the registration center server, and when the public cloud client receives a second subscription response data packet returned by the registration center server for the second subscription request, the public cloud client generates a second call request and sends the second call request to the public cloud agent. In this way, the public cloud agent searches for the LAN server IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server IP address in the second call request, and sends the second call request to the corresponding LAN server through the LAN agent to implement the call of the preset LAN service. During the publishing process of the preset LAN service, the public cloud proxy end will modify the IP address of the LAN server end that publishes the preset LAN service to the IP address of the public cloud proxy end itself, so that it can receive the second call request of the public cloud client for the preset LAN service, and then complete the forwarding of the request and the call of the service, that is, realize the public cloud client corresponding to the preset public cloud service in the public cloud calling the preset LAN service provided by the LAN server end in the LAN.
[0129] Similarly, since there is no need to deploy middleware in the local area network, the deployment cost is relatively low. Moreover, since the method provided in the embodiments of this specification is implemented based on the local area network proxy terminal deployed in the local area network and the public cloud proxy terminal deployed in the public cloud, as a transparent proxy method, it can solve the remote call problem without modifying the user code, that is, achieving zero intrusion of the user code.
[0130] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0131] According to a third aspect, an embodiment of the present invention provides a communication device between a local area network and a public cloud, wherein a local area network agent and a local area network client connected to the local area network agent are deployed in the local area network, and the local area network client is a client corresponding to a preset local area network service; a public cloud agent, a public cloud service and a registration center service are deployed in the public cloud, and the public cloud agent is respectively connected to the public cloud service and the registration center service, and the public cloud service is a service that provides a preset public cloud service, and the registration center service stores an IP address of a public cloud service that publishes the preset public cloud service; the local area network agent is connected to the public cloud agent;
[0132] The device is applied to the local area network agent, see Figure 7 , the device comprises:
[0133] A first receiving module, configured to simulate the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service when the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud;
[0134] A first sending module, used for sending the first subscription request to the registration center server through the public cloud proxy end;
[0135] A second receiving module is used to obtain the public cloud server IP address in the first subscription response data packet after receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address;
[0136] A second sending module is used to modify the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and send the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server;
[0137] The first calling module is used to send the first calling request to the corresponding public cloud service end through the public cloud proxy end according to the first mapping relationship when the first calling request is received, so as to realize the calling of the preset public cloud service.
[0138] In one embodiment, the first receiving module is specifically used to: specify the feedback address of the addressing component as the IP address of the local area network proxy terminal to simulate the registration center server terminal.
[0139] In one embodiment, the first calling module includes:
[0140] A first parsing unit, configured to parse the first calling request after receiving the first calling request, and obtain a preset public cloud service to be called;
[0141] A first search unit, configured to search the first mapping relationship for a public cloud server IP address corresponding to the preset public cloud service;
[0142] A first placement unit, configured to place the IP address of the public cloud server in the first call request;
[0143] The first sending unit is used to send the first call request to the public cloud proxy end, so that the public cloud proxy end sends the first call request to the corresponding public cloud server end according to the public cloud server end IP address in the first call request.
[0144] In one embodiment, the public cloud proxy end and the public cloud service end are both deployed in a user virtual private cloud in the public cloud, and the registration center service end is deployed in a middleware virtual private cloud in the public cloud.
[0145] In one embodiment, the public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal, the registration center server terminal and the first proxy sub-terminal are deployed in a middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud server terminal are deployed in a user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud server terminal are connected through the second proxy sub-terminal; wherein, in the process of the local area network client in the local area network calling the preset public cloud service provided by the public cloud server terminal in the public cloud, the first call request sent by the local area network proxy terminal is forwarded to the public cloud server terminal through the first proxy sub-terminal and the second proxy sub-terminal in sequence.
[0146] In a fourth aspect, an embodiment of the present invention provides a communication device between a local area network and a public cloud, wherein a local area network agent and a local area network server providing a preset local area network service are deployed in the local area network, and the local area network server is connected to the local area network agent; a public cloud agent, a registration center server and a public cloud client are deployed in the public cloud, and the public cloud agent is connected to the public cloud client and the registration center server respectively, and the public cloud client is a client corresponding to the preset public cloud service; the public cloud agent is connected to the local area network agent; the device is applied to the public cloud client, see Figure 8 , the device comprises:
[0147] A third sending module is used to send a second subscription request for the preset local area network service to the registration center server when the public cloud client in the public cloud calls the preset local area network service provided by the local area network server in the local area network;
[0148] A third receiving module is used to receive a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service;
[0149] A fourth sending module is used to send a second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to realize the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
[0150] In one embodiment, the public cloud proxy and the public cloud client are both deployed in a user virtual private cloud in the public cloud, and the registration center server is deployed in a middleware virtual private cloud in the public cloud.
[0151] In one embodiment, the process of obtaining the second mapping relationship in the public cloud agent and the public cloud agent IP address corresponding to the preset LAN service in the registration center server includes: when the public cloud agent receives the publishing request for the preset LAN service forwarded by the LAN agent from the LAN server, the public cloud agent parses the publishing request to obtain the LAN server IP address, saves the second mapping relationship between the preset LAN service and the LAN server IP address, so that the second mapping relationship is saved in the public cloud client; the public cloud agent modifies the LAN server IP address in the publishing request to the public cloud agent IP address, and sends the publishing request for modifying the IP address to the registration center server, so that the registration center server stores the public cloud agent IP address corresponding to the preset LAN service.
[0152] In one embodiment, the public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal; the registration center service terminal and the first proxy sub-terminal are deployed in a middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud client are deployed in a user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud client are connected through the second proxy sub-terminal; wherein the second subscription response data packet includes the second proxy sub-terminal IP address corresponding to the preset local area network service; the fourth sending module includes:
[0153] The second sending unit is used to send a second call request for the preset LAN service to the second proxy sub-end corresponding to the IP address of the second proxy sub-end, so that the second proxy sub-end searches for the LAN server IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server IP address in the second call request, and sends the second call request to the corresponding LAN server through the first proxy sub-end and the LAN proxy end to realize the call of the preset LAN service; wherein, the second proxy sub-end in the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server IP address that publishes the preset LAN service, and the registration center server pre-stores the second proxy sub-end IP address corresponding to the preset LAN service.
[0154] In one embodiment, the first proxy sub-end is used to perform traffic statistics on each client upon receiving a service call request for the client, and to charge for the traffic counted.
[0155] In a fifth aspect, an embodiment of the present invention provides a computing device. The device includes: at least one memory and at least one processor, wherein:
[0156] The at least one memory is used to store a machine-readable program;
[0157] The at least one processor is used to call the machine-readable program to execute the method provided by the first aspect or the second aspect.
[0158] It is to be understood that the structures illustrated in the embodiments of this specification do not constitute specific limitations on the devices of the embodiments of this specification. In other embodiments of the specification, the above-mentioned device may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0159] Since the information interaction, execution process, etc. between the modules in the above-mentioned devices and systems are based on the same concept as the method embodiments of this specification, the specific contents can be found in the description of the method embodiments of this specification and will not be repeated here.
[0160] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0162] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A communication method between a local area network and a public cloud, wherein a local area network agent and a local area network client are deployed in the local area network; a public cloud agent, a public cloud server and a registration center server are deployed in the public cloud, and the public cloud server is a server that provides a preset public cloud service; The method is executed by the local area network agent, and the method includes: When the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud, the registration center server is simulated to receive a first subscription request sent by the local area network client for the preset public cloud service; wherein the registration center server stores the IP address of the public cloud server that publishes the preset public cloud service; Sending the first subscription request to the registration center server through the public cloud proxy; After receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, obtain the public cloud server IP address in the first subscription response data packet, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address; Modify the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and send the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server; When the first calling request is received, the first calling request is sent to the corresponding public cloud service end through the public cloud proxy end according to the first mapping relationship, so as to implement the calling of the preset public cloud service.
2. The method according to claim 1, wherein: The simulating the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service includes: The feedback address of the addressing component is designated as the IP address of the local area network proxy terminal to simulate the registration center server terminal.
3. The method according to claim 1, wherein: The step of sending the first call request to the corresponding public cloud server through the public cloud proxy according to the first mapping relationship includes: After receiving the first call request, parsing the first call request to obtain a preset public cloud service to be called; Searching for the public cloud server IP address corresponding to the preset public cloud service from the first mapping relationship; Placing the IP address of the public cloud server in the first call request; The first call request is sent to the public cloud proxy end, so that the public cloud proxy end sends the first call request to the corresponding public cloud server end according to the public cloud server end IP address in the first call request.
4. The method according to claim 1, wherein: The public cloud proxy end and the public cloud service end are both deployed in a user virtual private cloud in the public cloud, and the registration center service end is deployed in a middleware virtual private cloud in the public cloud.
5. The method according to claim 1, wherein: The public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal, the registration center server terminal and the first proxy sub-terminal are deployed in a middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud server terminal are deployed in a user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud server terminal are connected via the second proxy sub-terminal; Among them, in the process of the local area network client in the local area network calling the preset public cloud service provided by the public cloud server in the public cloud, the first calling request sent by the local area network agent is forwarded to the public cloud server through the first agent sub-end and the second agent sub-end in sequence.
6. A communication method between a local area network and a public cloud, wherein a local area network agent and a local area network server providing a preset local area network service are deployed in the local area network, and a public cloud agent, a registration center server and a public cloud client are deployed in the public cloud; The method is performed by the public cloud client, and the method includes: When the public cloud client in the public cloud calls a preset local area network service provided by the local area network server in the local area network, sending a second subscription request for the preset local area network service to the registration center server; Receive a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service; Sending a second call request for the preset LAN service to the public cloud proxy corresponding to the public cloud proxy IP address, so that the public cloud proxy searches for the LAN server IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server IP address in the second call request, and sends the second call request to the corresponding LAN server through the LAN proxy to implement the call of the preset LAN service; Among them, the public cloud proxy terminal pre-stores the second mapping relationship between the preset LAN service and the LAN server IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy terminal IP address corresponding to the preset LAN service.
7. The method according to claim 6, characterized in that The public cloud proxy end and the public cloud client end are both deployed in the user virtual private cloud in the public cloud, and the registration center service end is deployed in the middleware virtual private cloud in the public cloud.
8. The method according to claim 7, characterized in that The process of obtaining the second mapping relationship in the public cloud agent and the public cloud agent IP address corresponding to the preset LAN service in the registration center server includes: when the public cloud agent receives the publishing request for the preset LAN service forwarded by the LAN agent from the LAN server, the public cloud agent parses the publishing request, obtains the LAN server IP address, and saves the second mapping relationship between the preset LAN service and the LAN server IP address, so that the public cloud agent saves the second mapping relationship; the public cloud agent modifies the LAN server IP address in the publishing request to the public cloud agent IP address, and sends the publishing request for modifying the IP address to the registration center server, so that the registration center server stores the public cloud agent IP address corresponding to the preset LAN service.
9. The method according to claim 6, characterized in that The public cloud proxy terminal includes a first proxy sub-terminal and a second proxy sub-terminal; the registration center service terminal and the first proxy sub-terminal are deployed in a middleware virtual private cloud in the public cloud; the second proxy sub-terminal and the public cloud client are deployed in a user virtual private cloud in the public cloud, and the first proxy sub-terminal and the public cloud client are connected via the second proxy sub-terminal; The second subscription response data packet includes the second proxy sub-end IP address corresponding to the preset local area network service; the sending of the second call request for the preset local area network service to the public cloud proxy end corresponding to the public cloud proxy end IP address includes: Sending a second call request for the preset LAN service to the second proxy sub-end corresponding to the IP address of the second proxy sub-end, so that the second proxy sub-end searches for the LAN server IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server IP address in the second call request, and sends the second call request to the corresponding LAN server through the first proxy sub-end and the LAN proxy end, so as to realize the call of the preset LAN service; Among them, the second proxy sub-end in the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server IP address that publishes the preset LAN service, and the registration center server pre-stores the second proxy sub-end IP address corresponding to the preset LAN service.
10. The method according to claim 9, characterized in that The first proxy sub-end can perform traffic statistics on each client upon receiving a service call request from the client, and charge for the traffic counted.
11. A communication device between a local area network and a public cloud, wherein a local area network agent and a local area network client connected to the local area network agent are deployed in the local area network, and the local area network client is a client corresponding to a preset local area network service; a public cloud agent, a public cloud service and a registration center service are deployed in the public cloud, and the public cloud agent is connected to the public cloud service and the registration center service respectively, and the public cloud service is a service that provides a preset public cloud service, and the local area network agent is connected to the public cloud agent; The device is applied to the local area network agent, and the device includes: A first receiving module, configured to simulate the registration center server to receive a first subscription request sent by the local area network client for the preset public cloud service when the local area network client in the local area network calls the preset public cloud service provided by the public cloud server in the public cloud; wherein the registration center server stores the IP address of the public cloud server that publishes the preset public cloud service; A first sending module, used for sending the first subscription request to the registration center server through the public cloud proxy end; A second receiving module is used to obtain the public cloud server IP address in the first subscription response data packet after receiving the first subscription response data packet obtained and sent by the public cloud proxy from the registration center server, and save the first mapping relationship between the preset public cloud service and the public cloud server IP address; A second sending module is used to modify the public cloud server IP address in the first subscription response data packet to the local area network proxy IP address, and send the first subscription response data packet with the modified IP address to the local area network client, so that the local area network client sends the first call request for the preset public cloud service to the local area network proxy simulating the public cloud server; The first calling module is used to send the first calling request to the corresponding public cloud service end through the public cloud proxy end according to the first mapping relationship when the first calling request is received, so as to realize the calling of the preset public cloud service.
12. A communication device between a local area network and a public cloud, wherein a local area network agent and a local area network server providing a preset local area network service are deployed in the local area network, and the local area network server is connected to the local area network agent; a public cloud agent, a registration center server and a public cloud client are deployed in the public cloud, and the public cloud agent is connected to the public cloud client and the registration center server respectively, and the public cloud client is a client corresponding to the preset public cloud service; The public cloud proxy terminal is connected to the local area network proxy terminal; The device is applied to the public cloud client, and the device includes: A third sending module is used to send a second subscription request for the preset local area network service to the registration center server when the public cloud client in the public cloud calls the preset local area network service provided by the local area network server in the local area network; A third receiving module is used to receive a second subscription response data packet returned by the registration center server in response to the second subscription request; wherein the second subscription response data packet includes the public cloud proxy IP address corresponding to the preset local area network service; A fourth sending module is used to send a second call request for the preset LAN service to the public cloud proxy end corresponding to the public cloud proxy end IP address, so that the public cloud proxy end searches for the LAN server end IP address corresponding to the preset LAN service according to the second mapping relationship, places the found LAN server end IP address in the second call request, and sends the second call request to the corresponding LAN server end through the LAN proxy end to realize the call of the preset LAN service; wherein the public cloud proxy end pre-stores the second mapping relationship between the preset LAN service and the LAN server end IP address that publishes the preset LAN service, and the registration center server pre-stores the public cloud proxy end IP address corresponding to the preset LAN service.
13. A computing device, the device comprising: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; and the at least one processor is used to call the machine-readable program to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Communication method, apparatus and device
CN108600326A
Cross-cloud service calling processing method, gateway server and requester server
CN110636115A