CN117319473A - Service remote calling method, device, equipment and storage medium - Google Patents

Service remote calling method, device, equipment and storage medium Download PDF

Info

Publication number
CN117319473A
CN117319473A CN202311330366.0A CN202311330366A CN117319473A CN 117319473 A CN117319473 A CN 117319473A CN 202311330366 A CN202311330366 A CN 202311330366A CN 117319473 A CN117319473 A CN 117319473A
Authority
CN
China
Prior art keywords
service
vpn client
vpn
micro
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311330366.0A
Other languages
Chinese (zh)
Inventor
张道福
杨波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN202311330366.0A priority Critical patent/CN117319473A/en
Publication of CN117319473A publication Critical patent/CN117319473A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a service remote call method, a device, equipment and a storage medium, which are applied to a first VPN client in a local development environment, relate to the technical field of computers and comprise the following steps: acquiring a call request sent by a first micro service in the local development environment and aiming at a second micro service, and judging whether the current network condition accords with a preset direct transmission condition or not; if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second micro-service runs based on the call request to generate a corresponding call result and sends the call result to the second VPN client; the target container network is located in a target server; and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service. In this way, through the interworking of the development environment and the container network, micro-service remote invocation can be realized.

Description

Service remote calling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for remotely invoking a service.
Background
The most common architecture for program development is a micro-service architecture at present, and the most common program deployment scheme is containerized deployment, but the container network is independent and cannot be communicated with the development network, so that a micro-service started by a developer can fail when the micro-service started by the container is remotely invoked. The situation is unfavorable for a developer to debug programs and solve problems, and local codes are required to be deployed in a container to verify the problems and solve the problems, so that the development efficiency is greatly reduced.
Virtual private networks (VPNs, virtual Private Network) are almost the most effective solution to two non-interworking networks, but traditional VPN implementations such as IPSec (Internet Protocol Security, i.e. internet security protocol), L2TP (Layer 2Tunneling Protocol, i.e. Layer two tunneling protocol), openVPN (virtual private channel), etc. have various problems of high charges, inability to self-host depending on public networks, complex configuration, unsafe, limited support systems, inability to open the whole network segment, etc., while wireboard (a lightweight virtual private network protocol) has a safer encryption means, higher performance, more convenient configuration, support of more platform systems, has been considered the safest, easiest to use and simplest VPN solution in the industry. It is also more complicated to construct a VPN network directly using wireboards. Therefore, for the micro service rack, how to reduce the networking difficulty in the operation of remotely calling the container service in the development environment needs to be solved.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a service remote invocation method, apparatus, device, and storage medium, capable of remotely invoking a container service in a development environment in a micro-service architecture. The specific scheme is as follows:
in a first aspect, the present application discloses a service remote invocation method applied to a first VPN client located in a local development environment, including:
acquiring a call request sent by a first micro service in the local development environment and aiming at a second micro service, and judging whether the current network condition accords with a preset direct transmission condition or not;
if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server;
and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service.
Optionally, after the determining whether the current network condition meets the preset direct transmission condition, the method further includes:
and if not, sending the calling request to a VPN server located in the target server, so that the VPN server sends the calling request to a second VPN client located in the target container network.
Optionally, the obtaining the call result sent by the second VPN client and sending the call result to the first micro service includes:
and acquiring the calling result sent by the second VPN client through the VPN server, and sending the calling result to the first micro-service.
Optionally, before the step of obtaining the call request for the second micro service sent by the first micro service in the local development environment, the method further includes:
deploying a VPN server to the target server through a preset container state management command;
acquiring the first VPN client from a preset download address, and installing the first VPN client to a local development environment;
deploying the second VPN client to a target container network in the target server through the container state management command; the target container network comprises a plurality of containers, and each container is used for providing corresponding micro services;
registering the first VPN client and the second VPN client into the VPN server.
Optionally, the deploying the VPN server to the target server through a preset container state management command includes:
creating a server side file catalog and creating a yaml file of the target VPN server side;
executing a preset container creation command to run the yaml file so as to deploy the target VPN server to the target server.
Optionally, the registering the first VPN client and the second VPN client to the VPN server includes:
acquiring a first login network address and a second login network address of the first VPN client and the second VPN client through a preset service starting command;
and registering the first VPN client and the second VPN client into the VPN server based on the first login network address and the second login network address.
Optionally, the first micro-service and the second micro-service are registered with a target service registry.
In a second aspect, the present application discloses a service remote invocation apparatus applied to a first VPN client located in a local development environment, including:
the request acquisition module is used for acquiring a call request which is sent by the first micro service in the local development environment and aims at the second micro service, and judging whether the current network condition accords with a preset direct transmission condition or not;
the request transmission module is used for sending the call request to a second VPN client side positioned in the target container network through a preset virtual network channel if the call request is in accordance with the request; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server;
and the result acquisition module is used for acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service.
In a third aspect, the present application discloses an electronic device comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the service remote calling method.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program which, when executed by a processor, implements the foregoing service remote invocation method.
In the application, a call request sent by a first micro service in the local development environment and aiming at a second micro service is obtained, and whether the current network condition accords with a preset direct transmission condition is judged; if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server; and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service. That is, through interaction between the first client and the second client, invocation between the first micro-service and the second micro-service is achieved. Therefore, the novel network intercommunication scheme which does not need extra equipment, has no extra cost, is flexible and simple to configure, supports offline independent deployment and has simple and safe management can effectively solve the problem that the local service cannot remotely call the container network micro-service in the process of developing the micro-service.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a service remote invocation method disclosed in the present application;
FIG. 2 is a schematic diagram of a registry of the present disclosure;
FIG. 3 is a schematic diagram of a specific service remote invocation method disclosed in the present application;
fig. 4 is a flowchart of a specific VPN client and service deployment method disclosed in the present application;
fig. 5 is a yaml file schematic diagram of a specific target VPN server disclosed in the present application;
fig. 6 is a yaml file schematic diagram of a specific second VPN client disclosed in the present application;
fig. 7 is a schematic diagram of a specific VPN client registration method disclosed in the present application;
FIG. 8 is a schematic diagram of a service remote invocation apparatus disclosed in the present application;
fig. 9 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The embodiment specifically introduces a safe and convenient service remote calling method. Referring to fig. 1, an embodiment of the present application discloses a service remote invocation method applied to a first VPN client located in a local development environment, including:
step S11: and acquiring a call request sent by the first micro service in the local development environment and aiming at the second micro service, and judging whether the current network condition accords with a preset direct transmission condition.
In this embodiment, after the first VPN client located in the local development environment obtains the call request for the second micro service sent by the first micro service in the local development environment, it needs to determine whether the current network state meets a preset direct transmission condition, that is, whether a preset virtual network channel is established between the first VPN client and the second VPN client. When the first VPN client and the second VPN client are registered in the VPN server, if the network state is good, the first VPN client and the second VPN client are equivalent to be in the same network, and data information can be directly exchanged. The first VPN client and the first VPN client may be Tailscale (a virtual networking tool based on WireGuard) clients.
Step S12: if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server.
In this embodiment, if the call request is met, the call request is sent to the second VPN client located in the target container network through a preset virtual network channel. After the judging whether the current network condition accords with the preset direct transmission condition, the method further comprises the following steps: and if not, sending the calling request to a VPN server located in the target server, so that the VPN server sends the calling request to a second VPN client located in the target container network. After the second VPN client receives the call request, the call request is sent to a second micro service, and the second micro service operates based on the call request to generate a corresponding call result and sends the call result to the second VPN client; the target container network is located in a target server. Wherein, as shown in fig. 2, the first micro service and the second micro service are registered in a target service registry. The VPN server may be a Headscale (a service end of a third party open-source version of Tailscale). The target service registry may be a condul.
Step S13: and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service.
In this embodiment, if the network condition is relatively good, the call result sent by the second VPN client may be obtained through the preset virtual network channel, and the call result is sent to the first micro service. If the network condition is not good, the step of obtaining the call result sent by the second VPN client and sending the call result to the first micro service includes: and acquiring the calling result sent by the second VPN client through the VPN server, and sending the calling result to the first micro-service.
In this embodiment, as shown in fig. 3, a call request sent by a first micro service in the local development environment and aiming at a second micro service is obtained, and whether the current network condition meets a preset direct transmission condition is determined; if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server; and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service. That is, through interaction between the first client and the second client, invocation between the first micro-service and the second micro-service is achieved. Therefore, the novel network intercommunication scheme which does not need extra equipment, has no extra cost, is flexible and simple to configure, supports offline independent deployment and has simple and safe management can effectively solve the problem that the local service cannot remotely call the container network micro-service in the process of developing the micro-service.
wireguard has a secure encryption means, extremely high performance, very convenient configuration, support for more platform systems, and is considered the safest, easiest to use, and simplest VPN solution in the industry. However, it is still more complicated to directly use a wireless to construct a VPN network, and this embodiment will specifically introduce a VPN client end configuration method, so that remote invocation of container services in a development environment can be more conveniently implemented. Referring to fig. 4, an embodiment of the present application discloses a specific VPN client and service deployment method, including:
step S21: and deploying the VPN server to the target server through a preset container state management command.
In this embodiment, the deploying, by the preset container state management command, the VPN server to the target server includes: creating a server file directory and creating YAML (YAML Ain't Markup Language, i.e., YAML is not a markup language) files for the target VPN server; executing a preset container creation command to run the yaml file so as to deploy the target VPN server to the target server. Wherein, the development environment can be a windows system. That is, a Headscale is deployed on a linux server through a docker-compound, a file directory is created, and yaml files of the target VPN server are created. And executing a deployment command, namely a dock-component up-d, so as to deploy the VPN server to the target server. The yaml file of the target VPN server is shown in fig. 5.
Step S22: and acquiring the first VPN client from a preset download address, and installing the first VPN client to a local development environment.
In this embodiment, the download address of the installer is http://10.20.178.189:8080/windows, the installer is downloaded and then installed according to the prompt, the registry variable is configured after the installation, and then the client program is run to install the first VPN client to the local development environment.
Step S23: deploying the second VPN client to a target container network in the target server through the container state management command; the target container network comprises a plurality of containers, and each container is used for providing corresponding micro services.
In this embodiment, a tailscale client is deployed on a linux server through a docker-component in a container network dm-net, a file directory is created, and yaml files of a second VPN client are created. And executing a deployment command, namely a dock-component up-d, to deploy the second VPN client to a target container network in the target server. Wherein the target container network comprises a plurality of containers, and each container is used for providing corresponding micro services. Wherein, yaml file of the second VPN client is shown in fig. 6.
Step S24: registering the first VPN client and the second VPN client into the VPN server.
In this embodiment, the registering the first VPN client and the second VPN client to the VPN server includes: acquiring a first login network address and a second login network address of the first VPN client and the second VPN client through a preset service starting command; and registering the first VPN client and the second VPN client into the VPN server based on the first login network address and the second login network address. That is, a command as shown in fig. 7 is executed on the linux server, and the tailscale client node is registered to the Headscale. After deployment of both the server and the client is completed, the development environment may launch a first micro-service, and the server launches a second micro-service using a dock, both of which are registered on the same service registration center. And checking the effect of the first micro-service for remotely calling the second micro-service. And opening network intercommunication, wherein the first micro-service calls the second micro-service to realize normal call, and the development environment machine can directly ping the IP (Internet Protocol ) of the container corresponding to the second micro-service.
Therefore, in this embodiment, a vpn is created by using the tailscale client and the head scale server, and the container network and the development network are opened through the vpn, so that the micro service of the development environment can be normally called. The method has the advantages that the method is simple in operation, the intercommunication between the local development environment and the container network can be realized, the problem that the local service of the micro-service architecture cannot be remotely called in the container network in the development process can be effectively solved, and the full penetration of a call chain is realized, so that the micro-service development efficiency is improved.
As described with reference to fig. 8, the embodiment of the present application further correspondingly discloses a service remote invocation apparatus, which is applied to a first VPN client located in a local development environment, and includes:
the request acquisition module 11 is configured to acquire a call request for a second micro service sent by a first micro service in the local development environment, and determine whether a current network condition meets a preset direct transmission condition;
a request transmission module 12, configured to send the call request to a second VPN client located in the target container network through a preset virtual network channel if the call request is in accordance with the request; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server;
and the result obtaining module 13 is configured to obtain the call result sent by the second VPN client, and send the call result to the first micro service.
In this embodiment, a call request for a second micro service sent by a first micro service in the local development environment is obtained, and whether the current network condition meets a preset direct transmission condition is determined; if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server; and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service. That is, through interaction between the first client and the second client, invocation between the first micro-service and the second micro-service is achieved. Therefore, the novel network intercommunication scheme which does not need extra equipment, has no extra cost, is flexible and simple to configure, supports offline independent deployment and has simple and safe management can effectively solve the problem that the local service cannot remotely call the container network micro-service in the process of developing the micro-service.
In some specific embodiments, the service remote invocation device may further include:
and the request sending module is used for sending the calling request to the VPN server side positioned in the target server if the calling request does not accord with the calling request, so that the VPN server side sends the calling request to a second VPN client side positioned in the target container network.
In some specific embodiments, the result obtaining module 13 may specifically include:
and the calling result acquisition unit is used for acquiring the calling result sent by the second VPN client through the VPN server and sending the calling result to the first micro service.
In some specific embodiments, the service remote invocation device may further include:
the server end management module is used for deploying the VPN server end to the target server through a preset container state management command;
the client installation module is used for acquiring the first VPN client from a preset download address and installing the first VPN client to a local development environment;
a client deployment module for deploying the second VPN client to a target container network in the target server through the container state management command; the target container network comprises a plurality of containers, and each container is used for providing corresponding micro services;
and the client registration module is used for registering the first VPN client and the second VPN client into the VPN server.
In some specific embodiments, the service end configuration module may specifically include:
the file creating unit is used for creating a server side file catalog and creating a yaml file of the target VPN server side;
and the file running unit is used for executing a preset container creation command to run the yaml file so as to deploy the target VPN server to the target server.
In some specific embodiments, the client registration module may specifically include:
the network acquisition unit is used for acquiring a first login network address and a second login network address of the first VPN client and the second VPN client through a preset service start command;
and the website registration unit is used for registering the first VPN client and the second VPN client into the VPN server based on the first login network address and the second login website.
Further, the embodiment of the present application further discloses an electronic device, and fig. 9 is a block diagram of the electronic device 20 according to an exemplary embodiment, where the content of the figure is not to be considered as any limitation on the scope of use of the present application.
Fig. 9 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement the relevant steps in the service remote invocation method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and computer programs 222, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the service remote invocation method performed by the electronic device 20 as disclosed in any of the embodiments previously described.
Further, the application also discloses a computer readable storage medium for storing a computer program; wherein the computer program, when executed by the processor, implements the previously disclosed service remote invocation method. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing has outlined the detailed description of the preferred embodiment of the present application, and the detailed description of the principles and embodiments of the present application has been provided herein by way of example only to facilitate the understanding of the method and core concepts of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A service remote invocation method, applied to a first VPN client located in a local development environment, comprising:
acquiring a call request sent by a first micro service in the local development environment and aiming at a second micro service, and judging whether the current network condition accords with a preset direct transmission condition or not;
if yes, the calling request is sent to a second VPN client side in the target container network through a preset virtual network channel; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server;
and acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service.
2. The service remote invocation method according to claim 1, wherein after said determining whether the current network condition meets the preset direct transfer condition, further comprising:
and if not, sending the calling request to a VPN server located in the target server, so that the VPN server sends the calling request to a second VPN client located in the target container network.
3. The service remote invocation method of claim 2, wherein the obtaining the invocation result sent by the second VPN client and sending the invocation result to the first micro service comprises:
and acquiring the calling result sent by the second VPN client through the VPN server, and sending the calling result to the first micro-service.
4. The method for remote invocation of services according to claim 1, wherein before obtaining the invocation request for the second micro-service sent by the first micro-service in the local development environment, further comprises:
deploying a VPN server to the target server through a preset container state management command;
acquiring the first VPN client from a preset download address, and installing the first VPN client to a local development environment;
deploying the second VPN client to a target container network in the target server through the container state management command; the target container network comprises a plurality of containers, and each container is used for providing corresponding micro services;
registering the first VPN client and the second VPN client into the VPN server.
5. The service remote invocation method according to claim 4, wherein said deploying a VPN server to said target server through a preset container state management command comprises:
creating a server side file catalog and creating a yaml file of the target VPN server side;
executing a preset container creation command to run the yaml file so as to deploy the target VPN server to the target server.
6. The service remote invocation method of claim 4, wherein said registering said first VPN client and said second VPN client into said VPN server comprises:
acquiring a first login network address and a second login network address of the first VPN client and the second VPN client through a preset service starting command;
and registering the first VPN client and the second VPN client into the VPN server based on the first login network address and the second login network address.
7. The service remote invocation method of any of claims 1-6, wherein the first micro-service and the second micro-service are registered with a target service registry.
8. A service remote invocation apparatus for use with a first VPN client located in a local development environment, comprising:
the request acquisition module is used for acquiring a call request which is sent by the first micro service in the local development environment and aims at the second micro service, and judging whether the current network condition accords with a preset direct transmission condition or not;
the request transmission module is used for sending the call request to a second VPN client side positioned in the target container network through a preset virtual network channel if the call request is in accordance with the request; the second VPN client sends the calling request to the second micro service, and the second micro service runs based on the calling request to generate a corresponding calling result and sends the corresponding calling result to the second VPN client; the target container network is located in a target server;
and the result acquisition module is used for acquiring the calling result sent by the second VPN client and sending the calling result to the first micro service.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the service remote invocation method of any one of claims 1 to 7.
10. A computer readable storage medium for storing a computer program which when executed by a processor implements the service remote invocation method of any of claims 1 to 7.
CN202311330366.0A 2023-10-13 2023-10-13 Service remote calling method, device, equipment and storage medium Pending CN117319473A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311330366.0A CN117319473A (en) 2023-10-13 2023-10-13 Service remote calling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311330366.0A CN117319473A (en) 2023-10-13 2023-10-13 Service remote calling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117319473A true CN117319473A (en) 2023-12-29

Family

ID=89296973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311330366.0A Pending CN117319473A (en) 2023-10-13 2023-10-13 Service remote calling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117319473A (en)

Similar Documents

Publication Publication Date Title
CN106844137B (en) Server monitoring method and device
EP3782061B1 (en) System and method to securely execute datacenter management operations remotely
US9137105B2 (en) Method and system for deploying at least one virtual network on the fly and on demand
US8156564B2 (en) Discovering network services
EP2939367B1 (en) Automatic configuration of an endpoint
US20110292942A1 (en) Router, information processing device and program
WO2016145747A1 (en) Smart gateway functional plug-in management method, client terminal and system
US11226883B2 (en) Secure method for managing a virtual test platform
US6715143B1 (en) Method for installing software components at a user-terminal, related devices and related software module
CN107835257B (en) Session management method and device
CN113037761B (en) Login request verification method and device, storage medium and electronic equipment
US20240045657A1 (en) System architecture for implementing dds communication based on autosar, communication method, and device
CN110995829A (en) Instance calling method and device and computer storage medium
CN115150113A (en) Method for accessing intranet application and related equipment
CN116436671B (en) Method, system, device and medium for Kubernetes cluster access in private network
CN117319473A (en) Service remote calling method, device, equipment and storage medium
US20230101920A1 (en) Proxy ssh public key authentication in cloud environment
CN113407234B (en) Cross-platform and cross-browser operation and maintenance access method, system and storage medium
CN106533716B (en) A kind of management method and system of northbound interface
CN105763667B (en) A kind of method and device realizing Hadoop host and finding automatically
CN114070734A (en) Cloud platform adaptation framework, method, equipment and storage medium
US20140348158A1 (en) Provisioning vpn phones
CN114928664B (en) Network tunnel establishment method and device, storage medium and electronic equipment
CN114466011B (en) Metadata service request method, device, equipment and medium
US11902230B1 (en) Generating and managing message correction and retraction history from a chat server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination