CN113190292B - Method and device for remotely executing functions on multiple servers - Google Patents

Method and device for remotely executing functions on multiple servers Download PDF

Info

Publication number
CN113190292B
CN113190292B CN202110579042.5A CN202110579042A CN113190292B CN 113190292 B CN113190292 B CN 113190292B CN 202110579042 A CN202110579042 A CN 202110579042A CN 113190292 B CN113190292 B CN 113190292B
Authority
CN
China
Prior art keywords
rpc
server
module
function
server module
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.)
Active
Application number
CN202110579042.5A
Other languages
Chinese (zh)
Other versions
CN113190292A (en
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.)
Dilu Technology Co Ltd
Original Assignee
Dilu Technology 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 Dilu Technology Co Ltd filed Critical Dilu Technology Co Ltd
Priority to CN202110579042.5A priority Critical patent/CN113190292B/en
Publication of CN113190292A publication Critical patent/CN113190292A/en
Application granted granted Critical
Publication of CN113190292B publication Critical patent/CN113190292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for executing functions on a plurality of servers remotely, wherein an RPC client module is deployed on a server for realizing a control function, and an RPC server module is deployed on a server for realizing a service function; for each RPC server module, the RPC server module binds the IP and the port of the server where the RPC server module is located, exposes the bound IP and port of the RPC server module and exposes the function of the server where the RPC server module is located, and the RPC server module circularly waits for the parameter instruction transmitted by the RPC client module and executes the corresponding function after receiving the parameter instruction; for each RPC client module, the RPC client module binds the IP and the port of the server to be controlled and transmits a parameter instruction to the RPC server module corresponding to the server to be controlled, and the RPC server module corresponding to the server to be controlled is controlled to execute the function exposed by the RPC server module; therefore, the remote control of the server only deploying the RPC client module to all other servers is realized.

Description

Method and device for remotely executing functions on multiple servers
Technical Field
The invention relates to a method and a device for executing functions on a plurality of servers remotely, and belongs to the technical field of remote control.
Background
At present, a plurality of graphical remote tools are available on the market to realize that commands can be executed on other servers remotely, and the practical scene of the tool is that a certain server is manually controlled, a plurality of servers cannot be controlled in batches, and automation control cannot be performed. Currently available remote control tools are not very customizable, and if multiple servers are required to jointly test such a scenario, no suitable tools are available, RPC is an abbreviated form of remote procedure call (Remote Procedure Call). The RPC client program calls the function defined in the RPC server through the interface, the server can obtain the instruction of the client to execute the function and the parameter transmitted by the client, and finally execute the function and return a return value to the client. Thus, a method for implementing control of multiple servers by a client host may be developed based on RPC technology.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the method and the device for executing the functions on the servers remotely can realize the control of one host computer to the servers through the RPC technology in a customized way, and can execute the functions on the servers simultaneously.
The invention adopts the following technical scheme for solving the technical problems:
a method for remotely executing functions on a plurality of servers, the method comprising:
all servers are linked through the same local area network;
for all servers, according to the sequence of function starting, an RPC client module is deployed on a server only realizing a control function, an RPC server module is deployed on a server only realizing a service function, and the RPC client module and the RPC server module are deployed on the server both realizing the control function and the service function;
for each RPC server module, the RPC server module binds the IP and the port of the server where the RPC server module is located, exposes the bound IP and port of the RPC server module and exposes the function of the server where the RPC server module is located, and the RPC server module circularly waits for the parameter instruction transmitted by the RPC client module and executes the corresponding function after receiving the parameter instruction;
for each RPC client module, the RPC client module binds the IP and the port of the server to be controlled and transmits a parameter instruction to the RPC server module corresponding to the server to be controlled, and the RPC server module corresponding to the server to be controlled is controlled to execute the function exposed by the RPC server module;
therefore, the remote control of the server only deploying the RPC client module to all other servers is realized.
The device comprises an RPC client module and an RPC server module, wherein the RPC client module is deployed on a server for realizing a control function, and the RPC server module is deployed on the server for realizing a service function;
for each RPC server module, the RPC server module binds the IP and the port of the server where the RPC server module is located, exposes the bound IP and port of the RPC server module and exposes the function of the server where the RPC server module is located, and the RPC server module circularly waits for the parameter instruction transmitted by the RPC client module and executes the corresponding function after receiving the parameter instruction;
for each RPC client module, the RPC client module binds the IP and the port of the server to be controlled and transmits a parameter instruction to the RPC server module corresponding to the server to be controlled, and the RPC server module corresponding to the server to be controlled is controlled to execute the function exposed by the RPC server module;
therefore, the remote control of the server only deploying the RPC client module to all other servers is realized.
A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method of remotely executing functions on a plurality of servers when the computer program is executed.
A computer readable storage medium storing a computer program which when executed by a processor performs the steps of the method of remotely executing a function on a plurality of servers.
Compared with the prior art, the technical scheme provided by the invention has the following technical effects:
1. the invention aims at the problem that only one server can be remotely controlled at the same time, and the servers cannot communicate, realizes the control of one host computer to a plurality of server hosts through the RPC technology in a customized way, and can execute functions on a plurality of servers at the same time.
2. The invention can be used for the joint test scene of multiple services which does not belong to multiple services, and multiple hosts can be operated and controlled on one host.
Drawings
FIG. 1 is a block diagram of an embodiment of a method of remotely executing functions on multiple servers in accordance with the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below by referring to the drawings are exemplary only for explaining the present invention and are not to be construed as limiting the present invention.
The invention discloses a method and a device for simultaneously controlling a plurality of servers and sending instructions based on RPC technology.
The invention relates to a device for executing functions on a plurality of servers remotely, which mainly comprises the following two modules: an RPC Server module (RPC Server module) and an RPC Client module (RPC Client module);
the RPC Server module is an RPC Server terminal started on the controlled Server, all the RPC Server modules on the controlled Server need to bind the IP and the port of the Server, the RPC Server exposes the bound IP, port and function, the RPC Server always waits for the parameter transmitted by the RPC client module in a circulating way, and the corresponding function is executed after the parameter instruction of the RPC client module is received.
The RPC Client module is a Client to be executed on a host controlling other servers, the IP and the port of the Server to be controlled are bound, after the RPC Client module binds the IP and the port of the RPC Server to be controlled, the RPC Client module can be used for transmitting parameters to the RPC Server module to control the RPC Server module to execute the exposed function, and the control Server starts corresponding services through different parameters.
The invention discloses a method for executing functions on a plurality of servers remotely, which is realized by the following specific ideas:
all PC hosts in the system are linked through the same local area network, so that communication can be ensured. The controlled host is used as an RPC service end, RPC service is started at the appointed IP and port, the RPC service appoints a specific method which is exposed at the specific port, the method receives a character string parameter, and different commands are executed according to the content of the parameter.
The control host is used as an RPC client, creates an RPC link, uses IP and ports to link to the service of the RPC server host, and the RPC client object can execute the method exposed by the RPC server and control the server host by executing the parameter input by the method.
One host computer remotely controls a plurality of host computers, an RPC server end is required to be deployed on the controlled plurality of host computers, the control host computer deploys an RPC client end, and the client end links the plurality of RPC server ends and executes a corresponding method to send an instruction so as to control the plurality of host computers, so that the remote execution of commands on a plurality of servers can be realized.
As shown in fig. 1, a schematic diagram of an embodiment of the present invention is shown. There are five hosts and testing requires that responsive commands be executed on each of the 5 hosts to initiate a service.
The invention can be used for starting the RPC client service on the pc1, starting the RPC server and the RPC client service on the pc2, the pc3 and the pc4 and starting the RPC server service on the pc5, so that multiple hosts can be controlled in series at the same time, and the online test and other works of multiple servers can be performed.
There are five hosts, host pc1 for the operator to perform the test work. Four services server1, server2, server3, server4 on which the test work depends are deployed on pc2, pc3, pc4, pc5, respectively. pc2, pc3, pc4, pc5 all initiate the RPC service of the present invention. pc1, pc2, pc3, pc4 may all launch RPC clients in the present invention. pc1 indirectly controls the management of all services through control of pc 2.
When the RPC services of pc2 and pc3 are started, pc1 sends instructions to pc2 to let pc2 start server1 and server2.Pc2 will start its own server1 and send an instruction to Pc3 to let Pc3 start server2, and Pc3 starts server2 after receiving the instruction. Control of all services can be accomplished in a similar manner. Thus, all services deployed on other multiple hosts are started through one instruction.
The above embodiments are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereto, and any modification made on the basis of the technical scheme according to the technical idea of the present invention falls within the protection scope of the present invention.

Claims (4)

1. A method for remotely executing functions on a plurality of servers, the method comprising:
all servers are linked through the same local area network;
for all servers, according to the sequence of function starting, an RPC client module is deployed on a server only realizing a control function, an RPC server module is deployed on a server only realizing a service function, and the RPC client module and the RPC server module are deployed on the server both realizing the control function and the service function;
for each RPC server module, the RPC server module binds the IP and the port of the server where the RPC server module is located, exposes the bound IP and port of the RPC server module and exposes the function of the server where the RPC server module is located, and the RPC server module circularly waits for the parameter instruction transmitted by the RPC client module and executes the corresponding function after receiving the parameter instruction;
for each RPC client module, the RPC client module binds the IP and the port of the server to be controlled and transmits a parameter instruction to the RPC server module corresponding to the server to be controlled, and the RPC server module corresponding to the server to be controlled is controlled to execute the function exposed by the RPC server module;
therefore, the remote control of the server only deploying the RPC client module to all other servers is realized.
2. The device is characterized by comprising an RPC client module and an RPC server module, wherein the RPC client module is deployed on a server for realizing a control function, and the RPC server module is deployed on the server for realizing a service function;
for each RPC server module, the RPC server module binds the IP and the port of the server where the RPC server module is located, exposes the bound IP and port of the RPC server module and exposes the function of the server where the RPC server module is located, and the RPC server module circularly waits for the parameter instruction transmitted by the RPC client module and executes the corresponding function after receiving the parameter instruction;
for each RPC client module, the RPC client module binds the IP and the port of the server to be controlled and transmits a parameter instruction to the RPC server module corresponding to the server to be controlled, and the RPC server module corresponding to the server to be controlled is controlled to execute the function exposed by the RPC server module;
therefore, the remote control of the server only deploying the RPC client module to all other servers is realized.
3. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the steps of the method of remotely executing functions on a plurality of servers as claimed in claim 1.
4. A computer readable storage medium storing a computer program, which when executed by a processor performs the steps of a method of remotely executing a function on a plurality of servers as claimed in claim 1.
CN202110579042.5A 2021-05-26 2021-05-26 Method and device for remotely executing functions on multiple servers Active CN113190292B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110579042.5A CN113190292B (en) 2021-05-26 2021-05-26 Method and device for remotely executing functions on multiple servers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110579042.5A CN113190292B (en) 2021-05-26 2021-05-26 Method and device for remotely executing functions on multiple servers

Publications (2)

Publication Number Publication Date
CN113190292A CN113190292A (en) 2021-07-30
CN113190292B true CN113190292B (en) 2023-09-26

Family

ID=76985326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110579042.5A Active CN113190292B (en) 2021-05-26 2021-05-26 Method and device for remotely executing functions on multiple servers

Country Status (1)

Country Link
CN (1) CN113190292B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003084992A (en) * 2001-09-07 2003-03-20 Fujitsu Ltd Rpc connection program between client server
US6728788B1 (en) * 1999-12-16 2004-04-27 International Business Machines Corporation Method and system for converting a remote procedure call to a local procedure call when the service is on the same device as the calling client
CN1852209A (en) * 2006-05-31 2006-10-25 北京和利时***工程股份有限公司 Remote process transfering method and system in distribution type control system
CN104219329A (en) * 2014-09-28 2014-12-17 浪潮软件集团有限公司 Method for deploying service through content distribution in cluster server
CN108965312A (en) * 2018-07-30 2018-12-07 深圳高新兴物联科技有限公司 Remote invocation method, device, system and storage medium
CN111597061A (en) * 2020-05-25 2020-08-28 瑞斯康达科技发展股份有限公司 Method and device for remote procedure call of client or server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9009740B2 (en) * 2011-07-13 2015-04-14 Adobe Systems Incorporated Invocation of additional processing using remote procedure calls

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6728788B1 (en) * 1999-12-16 2004-04-27 International Business Machines Corporation Method and system for converting a remote procedure call to a local procedure call when the service is on the same device as the calling client
JP2003084992A (en) * 2001-09-07 2003-03-20 Fujitsu Ltd Rpc connection program between client server
CN1852209A (en) * 2006-05-31 2006-10-25 北京和利时***工程股份有限公司 Remote process transfering method and system in distribution type control system
CN104219329A (en) * 2014-09-28 2014-12-17 浪潮软件集团有限公司 Method for deploying service through content distribution in cluster server
CN108965312A (en) * 2018-07-30 2018-12-07 深圳高新兴物联科技有限公司 Remote invocation method, device, system and storage medium
CN111597061A (en) * 2020-05-25 2020-08-28 瑞斯康达科技发展股份有限公司 Method and device for remote procedure call of client or server

Also Published As

Publication number Publication date
CN113190292A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
CN108713309B (en) SD-WAN system, use method of SD-WAN system and related device
RU2533638C2 (en) Data configuration method and device
CN106713454B (en) A kind of method for connecting network and device
US20020111999A1 (en) System and method for remote control of software and an attached device
CN104468854A (en) Vertical converged framework constructing method and device
CN108268305A (en) For the system and method for virtual machine scalable appearance automatically
CN102647465B (en) File transfer protocol (FTP) data transmission method and device applied in stack system
CN112637931A (en) Method and device for establishing network connection
CN113190292B (en) Method and device for remotely executing functions on multiple servers
CN113472637A (en) LORA gateway
CN110602143B (en) Method, system and readable storage medium for realizing communication between PC (personal computer) end and remote equipment
CN103138961B (en) server control method, controlled server and central control server
US20060195834A1 (en) Method and system for availability checking on distributed objects
CN106899635B (en) Method and device for realizing fixed communication port of file transfer protocol data link
CN115001886A (en) Equipment control method and device and electronic equipment
CN102075532B (en) Method for penetrating through firewall
CN111343010A (en) Method and equipment for configuring storage IP network port
Großmann et al. Cloudless computing-a vision to become reality
CN106657219B (en) File based on smart machine uploads and method for down loading
CN101227378A (en) Communication service establishing method based on network storage and storage device thereof
CN106790325B (en) Method and system for accessing network equipment
KR20200081799A (en) The multiple virtual network communication system and method using virtual router
CN110650125B (en) Host device and method for mutual communication operation based on Pexpect
CN114363226B (en) Automatic testing method and system for equipment in complex network scene based on virtualization
CN115150394A (en) Distributed control system and synchronous transmission method of data in distributed control system

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
GR01 Patent grant
GR01 Patent grant