CN115604132A - Remote control method and device for server, electronic equipment and readable storage medium - Google Patents

Remote control method and device for server, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115604132A
CN115604132A CN202211215620.8A CN202211215620A CN115604132A CN 115604132 A CN115604132 A CN 115604132A CN 202211215620 A CN202211215620 A CN 202211215620A CN 115604132 A CN115604132 A CN 115604132A
Authority
CN
China
Prior art keywords
server
virtual terminal
identifier
control
instruction
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
CN202211215620.8A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211215620.8A priority Critical patent/CN115604132A/en
Publication of CN115604132A publication Critical patent/CN115604132A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/22Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The embodiment of the invention provides a remote control method and device of a server, electronic equipment and a readable storage medium, which are applied to a virtual terminal, wherein the method comprises the following steps: receiving a first instruction sent by the control equipment; determining a first identifier in an interface of the virtual terminal in response to the first instruction; executing the server control command based on the first identifier to acquire corresponding server operation data; and sending the server operation data to the control equipment so that the control equipment displays the server operation data to a user. By the method, the remote server is monitored at any time, the running data of the server is automatically acquired, and the server is monitored, so that the remote monitoring cost of the server is reduced, the efficiency of managing the server is improved, and the cost of manually repairing the server is reduced.

Description

Remote control method and device for server, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of server technologies, and in particular, to a remote control method and apparatus for a server, an electronic device, and a readable storage medium.
Background
Server automation is an integrated data center management solution that can implement components across physical, virtual, storage, etc. The method brings great changes to the testing and operation and maintenance efficiency, and simultaneously puts new requirements on the stability of the IT network. The current server automation precondition must ensure that the server Operating System (OS) network is connected. Once the server is in a network interruption condition, the server cannot be automatically remotely controlled, and further centralized management cannot be performed. Therefore, how to solve the intelligent control when the server OS is not networked becomes a problem that needs to be solved at present.
When the server OS does not have a network, the monitoring can be carried out only through an external high-definition camera. And analyzing the image through the captured image of the display screen, extracting effective information and monitoring the state of the server in real time.
However, the prior art relies on high-definition camera equipment, is high in cost and relatively environment-dependent, and cannot achieve automatic acquisition of server data and remote supervision on a server.
Disclosure of Invention
The embodiment of the invention provides a remote control method and device for a server, electronic equipment and a readable storage medium, which can realize automatic acquisition of server data and remote supervision on the server, reduce the cost of remote monitoring of the server, reduce the damage of the server caused by network disconnection and the like, and save the labor cost.
In a first aspect, an embodiment of the present invention provides a remote control method for a server, which is applied to a virtual terminal, where the virtual terminal is configured to display operation data of the server, the virtual terminal is arranged in a control device, and the control device is configured to remotely control the server, and the method includes:
receiving a first instruction sent by the control equipment, wherein the first instruction carries a server control command;
responding to the first instruction, determining a first identifier in an interface of the virtual terminal, wherein the first identifier is used for indicating server operation data corresponding to the server control command;
executing the server control command based on the first identifier to acquire corresponding server operation data;
and sending the server operation data to the control equipment so that the control equipment displays the server operation data to a user.
Optionally, the executing the server control command based on the first identifier to obtain corresponding server operation data includes:
determining a cursor position based on the first identifier;
inputting a first control instruction at the cursor position, the control instruction being used to instruct a server to execute the server control command;
and executing the first control instruction to obtain server operation data corresponding to the server control command.
Optionally, the executing the first control instruction to obtain server operation data corresponding to the server control command includes:
executing the first control instruction, and acquiring an interface screenshot of the virtual terminal;
circularly traversing the first identifiers in the interface screenshot until the two first identifiers are found in the interface screenshot, and ending the circulation;
and extracting data between the two first identifiers in the interface screenshot to obtain server operation data generated in the process of executing the control instruction by the server.
Optionally, the determining a cursor position based on the first identifier includes:
acquiring a first position of an image control in an interface of the virtual terminal, wherein the image control is used for packaging the operation data and method of the server;
acquiring a second position of the first identifier in an interface of the virtual terminal;
calculating the relative position of the first identifier in the image control according to the first position and the second position;
determining a cursor position based on the relative position and the length of the first identifier.
Optionally, before determining the first identifier in the interface of the virtual terminal, the method further includes:
acquiring a combo box control and a target key in the virtual terminal, wherein the target key is used for unlocking an interface of the virtual terminal in a display interface of the control equipment;
and inputting the target key in the combo box control so as to unlock the interface of the virtual terminal.
In a second aspect, an embodiment of the present invention provides a remote control method for a server, which is applied to a control device, where a virtual terminal is arranged in the control device, the virtual terminal is used to display operation data of the server, and the control device is used to remotely control the server, and the method includes:
receiving a server control request, wherein the server control request carries a server identifier and a server control command;
starting a virtual terminal corresponding to a server identifier according to the corresponding relation between the server identifier and the virtual terminal identifier, wherein the server identifier corresponds to the virtual terminal identifier one by one;
and sending a first instruction to the virtual terminal, wherein the first instruction carries the server control command, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the server control command.
Optionally, the starting, according to the correspondence between the server identifier and the virtual terminal identifier, the virtual terminal corresponding to the server identifier includes:
calculating the optimal thread number according to the core number, the thread waiting time and the thread running time of the control equipment;
distributing threads for the server control request according to the optimal thread number;
and starting the virtual terminal corresponding to the server identifier by using the thread.
Optionally, the control device is provided with at least one virtual terminal, and one virtual terminal is used for displaying the operation data of one server.
In a third aspect, an embodiment of the present invention provides a remote control apparatus for a server, where the apparatus is applied to a virtual terminal, the virtual terminal is used to display operation data of the server, the virtual terminal is arranged in a control device, and the control device is used to remotely control the server, and the apparatus includes:
a first instruction receiving module, configured to receive a first instruction sent by the control device, where the first instruction carries a server control command;
a first identifier determining module, configured to determine, in response to the first instruction, a first identifier in an interface of the virtual terminal, where the first identifier is used to indicate server operation data corresponding to the server control command;
the data acquisition module is used for executing the server control command based on the first identifier and acquiring corresponding server operation data;
and the operation data sending module is used for sending the server operation data to the control equipment so that the control equipment displays the server operation data to a user.
In a fourth aspect, an embodiment of the present invention provides a remote control apparatus for a server, which is applied to a control device, where a virtual terminal is disposed in the control device, the virtual terminal is used to display operation data of the server, and the control device is used to remotely control the server, and the apparatus includes:
the request receiving module is used for receiving a server control request, and the server control request carries a server identifier and a server control command;
the virtual terminal starting module is used for starting the virtual terminal corresponding to the server identifier according to the corresponding relation between the server identifier and the virtual terminal identifier, and the server identifier corresponds to the virtual terminal identifier one by one;
and the first instruction sending module is used for sending a first instruction to the virtual terminal, the first instruction carries the server control command, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the server control command.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including: a processor and a memory, the processor executing a computer program stored in the memory implementing the method of remote control of a server according to the first or second aspect.
In a sixth aspect, the embodiment of the present invention provides a readable storage medium, in which computer instructions are stored, and when executed by a processor, the computer instructions implement the remote control method of the server according to the first aspect or the second aspect.
The embodiment of the invention has the following advantages:
the application provides a remote control method of a server. The method comprises the steps that a first instruction sent by control equipment is received at a virtual terminal, a first identifier is determined in an interface of the virtual terminal in response to the first instruction, a server control command is executed based on the first identifier, corresponding server operation data are obtained, and finally the server operation data are sent to the control equipment, so that the control equipment displays the server operation data to a user. The method and the system realize automatic acquisition and supervision of the server operation data, reduce the cost of remote monitoring of the server, reduce the risk of server damage caused by network problems and save the labor cost.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor.
FIG. 1 is a flow chart illustrating a remote control method embodiment of a server of the present invention;
fig. 2 is a flowchart illustrating an embodiment of a remote control method applied to a server of a virtual terminal according to the present invention;
FIG. 3 is a flow chart of an embodiment of a method for obtaining server operating data according to the present invention;
FIG. 4 is a flow chart illustrating an embodiment of a remote control method of the present invention applied to a server of a control device;
fig. 5 is a block diagram showing an embodiment of a remote control apparatus applied to a server of a virtual terminal;
FIG. 6 is a block diagram of an embodiment of a remote control apparatus applied to a server of a control device;
fig. 7 shows a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In addition, it should be noted that, in the embodiments of the present application, the processes related to acquiring various data are performed under the premise of complying with the policy of the data protection regulation corresponding to the country of the location, and obtaining the authorization given by the owner of the corresponding device.
Server automation is an integrated data center management solution that can implement components across physical, virtual, storage, etc. The method brings great changes to the testing and operation and maintenance efficiency, and simultaneously puts new requirements on the stability of the IT network. The current server automation precondition must ensure that the server Operating System (OS) network is connected. Once the server is in a network interruption condition, the server cannot be automatically remotely controlled, and further centralized management cannot be performed. Therefore, how to solve the intelligent control when the server OS is not networked becomes a problem that needs to be solved at present.
When the server OS does not have a network, the monitoring can be carried out only through an external high-definition camera. And analyzing the image through the captured image of the display screen, extracting effective information and monitoring the state of the server in real time.
However, the prior art relies on high-definition camera equipment, is high in cost and relatively environment-dependent, and cannot automatically acquire and monitor server data, so that when a network failure occurs, maintenance is performed more manually. However, the manual work is not all 24 hours, so that once serious problems occur in the period, the result can be saved.
In order to solve the above problem, the present application provides a method for remotely controlling a server, in which a virtual terminal receives a first instruction sent by a control device, and in response to the first instruction, a location of a first identifier is determined in an interface of the virtual terminal, then operation data requested by a user is obtained based on the first identifier, and finally the operation data is sent to the control device, so that the control device displays the operation data to the user. The method and the system realize remote automatic supervision on the server, reduce the cost of real-time monitoring on the server, solve the problem of automatic script failure caused by network problems in automatic testing, reduce the damage probability of the server and save the labor cost.
Referring to fig. 1, a flowchart of an embodiment of a remote control method for a server according to the present invention is shown, where a virtual terminal is used to display operation data of the server, and the virtual terminal is disposed in a control device, and the control device is used to remotely control the server, and the method may include:
101. the control equipment receives a server control request, wherein the server control request carries a server identifier and a server control command.
102. According to the corresponding relation between the server identification and the virtual terminal identification, the control equipment starts the virtual terminal corresponding to the server identification, and the server identification corresponds to the virtual terminal identification one by one.
103. The control device sends a first instruction to the virtual terminal, wherein the first instruction carries a server control command, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the server control command.
104. And the virtual terminal receives a first instruction sent by the control equipment, wherein the first instruction carries a server control command.
105. And responding to the first instruction, determining a first identifier in an interface of the virtual terminal, wherein the first identifier is used for indicating server operation data corresponding to the server control command.
106. And executing the server control command based on the first identifier to acquire corresponding server operation data.
107. And the virtual terminal sends the operation data to the control equipment so that the control equipment displays the operation data to a user.
The remote control method of the server provided by the embodiment of the application is used for automatically acquiring and monitoring data of the remote server, and when a technician wants to acquire certain data of the server, the data can be automatically acquired by the method shown in fig. 1, so that the server can be monitored.
In the method provided by the embodiment of the application, a control device receives a server control request, wherein the server control request carries a server identifier and a server control command, then the control device starts a virtual terminal corresponding to the server identifier according to a corresponding relation between the server identifier and the virtual terminal identifier, the server identifier corresponds to the virtual terminal identifier one to one, then the control device sends a first instruction to the virtual terminal, the first instruction carries a data type of a user request, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the data type.
The control device is configured to remotely control the server, for example, a Baseboard Management Controller (BMC) or an electronic device with a BMC (Baseboard Management Controller), and the control device is provided with a Virtual terminal, for example, a KVM (Kernel-based Virtual Machine) Virtual Machine, which can simulate a terminal device and is used to display operation data of the server, and is similar to a small program and an application that can monitor server data in real time. For example, the control device is an electronic device capable of performing information interaction, such as a mobile phone and a computer, and can control the server and realize information interaction with the server, the virtual terminal is an application, an applet and the like on the electronic device and can display operation data of the service area, and a technician can obtain data information of the required server by sending a request to the applet through the mobile phone.
After the virtual terminal receives a first instruction sent by the control device, in response to the first instruction, the virtual terminal determines the position of a first identifier in an interface thereof, where the first identifier is used to indicate operating data corresponding to a data type in a server control request, and after the position of the first identifier is determined, because the first identifier may indicate the data type of the operating data required by the user, and the acquired operating data of a certain type also has a corresponding control instruction, the operating data required by the user request may be acquired by executing the corresponding control instruction according to the position of the first identifier, for example, when information of a local host needs to be acquired, the local host information is indicated by positioning at two ends of the local host information in a Linux system, [ localhost root ] to ] so that the position of the identifier [ localhost root ] may be determined by an image or text recognition method, and then the local host information acquisition instruction may be executed to acquire the local information required by the user request. And finally, the virtual terminal returns the operation data requested by the user to the control equipment and presents the operation data to the client, so that the automatic acquisition and monitoring of the server data are realized.
By the method of the embodiment shown in fig. 1, the position of the operation data requested by the user can be obtained by determining the position of the identifier in the virtual terminal interface by utilizing the interaction between the control device and the server and the virtual terminal arranged in the control device and used for displaying the operation data of the server, and then the operation data requested by the user is obtained and returned to the control device to present the operation data.
Referring to fig. 2, there is shown a flow chart of an embodiment of a remote control method of a server of the present invention, which is applied to a Virtual Terminal (Virtual Terminal, VT), which is a Terminal virtualized on a personal electronic device and software written for this purpose, the purpose of the Virtual Terminal being to enable connection of the personal electronic device and its user with a mainframe computer or server. The remote control method described in fig. 2 is implemented in the virtual terminal, and thus, the remote control of a plurality of servers is realized by a plurality of terminals without being limited by the number of electronic devices.
The virtual terminal is used for displaying the operation data of the server, the virtual terminal is arranged in the control equipment, and the control equipment is used for remotely controlling the server.
The method can comprise the following steps:
201. and receiving a first instruction sent by the control equipment.
The first instruction is an instruction of a user request sent by a control device, the first instruction carries a server control command, and the server control command is used for executing a server control request, namely the user request.
202. And responding to the first instruction, and determining the position of a first identifier in an interface of the virtual terminal, wherein the first identifier is used for indicating the operation data corresponding to the data type.
The identifier is a symbol used to identify an entity, and in the embodiment of the present application, the identifier is used to indicate server operation data corresponding to a server control command, the identifier corresponds to a server control command, and the server control command corresponds to server operation data, and then the identifier is also used to indicate a user to request the corresponding server operation data, for example, the identifier [ localhost @root- ] is used to indicate to execute a control instruction of "obtaining local host information", and it also indicates the location of the local host information. The first identifier is used for indicating a server control command corresponding to a user request, and when the user requests to acquire a certain type of running data, the position of the first identifier corresponding to the control command for acquiring the certain type of running data needs to be determined, and the position of the first identifier, that is, the position of the running data requested by the user, is acquired.
In the embodiment of the application, the first identifier corresponding to the server control command can be matched through a full-interface image recognition method or a character recognition method, and the position of the first identifier can also be determined through a character analysis method.
By using the identifier which is a symbol with the data type indication function, the calculation amount is reduced and the operation efficiency of the virtual terminal is improved in the data acquisition process.
203. And executing the server control command based on the first identifier to acquire corresponding server operation data.
The first identifier may be used to instruct the server to execute a corresponding server control command according to step 202, so that after the position of the first identifier is obtained, the server control command carried in the first instruction may be executed, so as to obtain the operation data of the corresponding server.
204. And sending the operation data to the control equipment so that the control equipment displays the operation data to a user.
And after the operation data requested by the user is acquired, returning the operation data to the control equipment, presenting the operation data to the control equipment for display, and completing the control request of the server, wherein the operation data is similar to the operation data of the mobile phone app, and then sending the operation data to the mobile phone for presentation on a mobile phone screen.
Optionally, the step 203 of executing the server control command based on the first identifier to obtain corresponding server operation data may include:
step 2031, determining a cursor position based on the first identifier.
Step 2032, inputting a first control instruction at the cursor position, where the control instruction is used to instruct the server to execute the server control command.
Step 2033, executing the first control instruction to obtain the server operation data.
The cursor is used to indicate the location of text entry, i.e. when you enter a text in a text box or in a program, there is always a cursor to show where you will enter the text.
The first identifier is used for indicating execution of a server control command, and after the position of the first identifier is obtained, the position of the cursor can be determined according to the position of the first identifier, so that the first control command is input at the cursor, and then the first control command is executed, and server operation data corresponding to the server control command is obtained.
The input position of the control instruction is determined through the cursor, and the input position plays a role in indicating, is helpful for clearly displaying the server operation data and the identifier, and helps technicians to better understand the server architecture.
Optionally, the executing of the first control instruction in step 2033 to obtain the server operation data corresponding to the server control command may include:
step 20331, executing the first control instruction, and acquiring an interface screenshot of the virtual terminal.
Step 20332, loop traversing the first identifiers in the interface screenshot, and ending the loop until two first identifiers are found in the interface screenshot.
Step 20333, extracting data between the two first identifiers in the interface screenshot to obtain server operation data generated in the process of executing the control instruction by the server.
And executing the first control instruction, and acquiring the server operation data corresponding to the server control command by using an image recognition method.
As shown in step 202, the identifier is used to indicate a server running data corresponding to a user request, when the virtual terminal is located in the Linux system, the first identifier may also be referred to as a first Linux identifier, and the server running data is identified by two identical identifiers from the beginning to the end, for example, the local host information exists in the Linux system in the form of "[ localhost @ root- ] or" [ localhost @ root- "where the local host information exists in the Linux system, and then by finding the two first identifiers, the server running data corresponding to the server control command, that is, the running data corresponding to the user request, may be obtained by obtaining data between the two first Linux identifiers.
Meanwhile, in the interface of the virtual terminal of the Linux system, data is generally updated from top to bottom, so that traversal from bottom to top is required to obtain the latest server operation data corresponding to the server control command.
Exemplarily, referring to fig. 3, a flowchart of an embodiment of the method for acquiring server operation data shown in steps 20331 to 20333 is shown, in which a current interface of the virtual terminal of the Linux system is taken as a first frame picture, the first identifier is traversed from bottom to top until a first Linux identifier is acquired, then a second first Linux identifier is acquired, if a second first Linux identifier is not traversed, the interface picture of the nth frame virtual terminal is continuously intercepted from bottom to top until the second first Linux identifier is traversed, where N is an integer and is greater than or equal to 2, and data between two coordinates is acquired according to coordinates (X0, Y0) and (X1, Y1) of the two first Linux identifiers, where the data between the two coordinates is the server operation data corresponding to the server control command.
The server running data is obtained in the Linux system through a Linux identifier method, the virtual terminal command execution process is simplified, the traversal sequence from bottom to top is realized, the timeliness of the automatically obtained server running data is further ensured, and the remote service time supervision is ensured.
Optionally, the determining a cursor position based on the first identifier in step 2031 may include:
step 20311, acquiring a first position of an image control in the interface of the virtual terminal, where the image control is used to encapsulate the operation data and method of the server.
Step 20312, acquiring a second position of the first identifier in the interface of the virtual terminal.
Step 20313, calculating the relative position of the first identifier in the image control according to the first position and the second position.
Step 20314, determining the cursor position according to the relative position and the length of the first identifier.
In the embodiment of the application, the server is packaged in a corresponding virtual terminal by a unified control, the unified control may refer to an image (video) control, the image (video) control is used for storing the running data of the server, and the virtual terminal may also display the running data of the server by the image (video) control.
The first position refers to the position of the video control in the interface of the virtual terminal, and the second position refers to the position of the first identifier in the interface of the virtual terminal.
Because the server packages the image controls uniformly in the virtual terminal, it is necessary to determine the relative position of the first identifier in the image control to input a control instruction in the control to execute a server control command, and based on the idea, steps 20311 to 20313 calculate the relative position of the first identifier in the image control by obtaining the position of the image control and the position of the first identifier in the virtual terminal interface. Considering that the cursor is usually located at the end of the identifier, it is the coordinates of the cursor, plus the length of said first identifier.
Optionally, before determining the first identifier in the interface of the virtual terminal in step 1, the method further includes:
acquiring a combo box control and a target key in the virtual terminal, wherein the target key is used for unlocking an interface of the virtual terminal in a display interface of the control equipment;
and inputting the target key in the combo box control so as to unlock the interface of the virtual terminal.
For example, taking linux system as an example, after the virtual terminal is started, all operable controls may be obtained through a show _ color _ controller command, and a combobox combo box control is obtained by triggering a click event of a keyboard button through a click method. Clicking sendMessage information in the combined frame, entering a login interface, obtaining a target key of the server corresponding to the first instruction according to the corresponding relation between the server and the virtual terminal, wherein the target key can comprise a user name and a password exemplarily, and then inputting the user name and the password of the server into the login interface of the user name and the password so as to unlock the screen and enter the interface of the virtual terminal, namely the virtual interface of the server.
Referring to fig. 4, a flowchart of an embodiment of a remote control method for a server according to the present invention is shown, and is applied to a control device, where a virtual terminal is arranged in the control device, the virtual terminal is used to display operation data of the server, and the control device is used to remotely control the server, and the method includes:
step 301, receiving a server control request, where the server control request carries a server identifier and a server control command.
Step 302, according to the corresponding relationship between the server identifier and the virtual terminal identifier, starting the virtual terminal corresponding to the server identifier, wherein the server identifier corresponds to the virtual terminal identifier one to one.
Step 303, sending a first instruction to the virtual terminal, where the first instruction carries the server control command, and the first instruction is used to trigger the virtual terminal to obtain server operation data corresponding to the server control command.
The server control request refers to a request for performing certain control operation on a server, such as data reading, data resetting and the like, the server identifier is used for starting a virtual terminal corresponding to the server according to the identifier, and errors of server operation data caused by the fact that a plurality of request tasks for different servers are executed on one virtual terminal are avoided when the server control request occurs; the server control command refers to a command corresponding to a control operation executed on the server.
One end of the control equipment mainly executes the allocation of the request task and controls the starting of the virtual terminal, and sends the server control instruction to the virtual terminal for execution.
Optionally, the starting the virtual terminal corresponding to the server identifier according to the correspondence between the server identifier and the virtual terminal identifier in step 302 includes:
and step 3021, calculating the optimal thread number according to the core number, the thread waiting time and the thread running time of the control equipment.
And step 3022, allocating threads to the server control request according to the optimal thread number.
And step 3023, starting the virtual terminal corresponding to the server identifier by using the thread.
The allocation of the server control request task is performed at the control device side, which involves the problem of the operation efficiency of the control device, and therefore, the optimal number of threads needs to be calculated to ensure the optimal operation efficiency of the controller.
The optimal thread number is calculated according to the core number of the CPU of the control device, the thread waiting time and the thread running time, and the allowed number of the semaphores (semaphores) can be calculated according to the following formula:
V=M×T(1+WC),
wherein V identifies the optimal thread number, W represents the thread waiting time, C identifies the thread running time, M represents the CPU kernel number of the control equipment, and T represents the number of virtual terminals.
When the control equipment distributes thread number, the principle of first-in first-out is adopted for the server control request. The number of threads allocated for the first time at most must not exceed the optimal number of threads, and the remaining threads continue to wait. When there is a thread release, the new thread is continued to be added, so as to achieve the best performance of the controller.
Optionally, at least one virtual terminal is disposed at one end of the control device, and one virtual terminal is used for displaying the operation data of one server.
The electronic equipment such as Windows equipment and the like only has 1 terminal, so that multi-terminal control cannot be realized, multi-terminal control can be performed through a plurality of ttys (Teletypes) by means of a Linux virtual terminal, and an xWindows service needs to be installed, so that graphical interface control of the Linux equipment is realized, and further control of a multi-terminal remote server is realized.
In summary, the present application provides a remote control method of a server. The method comprises the steps that a first instruction sent by control equipment is received at a virtual terminal, a first identifier is determined in an interface of the virtual terminal in response to the first instruction, a server control command is executed based on the first identifier, corresponding server operation data are obtained, and finally the server operation data are sent to the control equipment, so that the control equipment displays the server operation data to a user. The method and the system have the advantages that the automatic acquisition and supervision of the server operation data are realized, the cost of remote monitoring of the server is reduced, the risk of damage to the server caused by network problems is reduced, meanwhile, the labor cost is saved, and the efficiency of managing the server is improved.
Meanwhile, at one end of the control equipment, the virtual terminal corresponding to the server is started and the first instruction is sent to the virtual terminal by receiving the server control request, so that technicians can acquire the running data of the remote server through the control equipment at any time and manage the running data, the loss caused by the failure of automatic testing caused by server accidents such as network disconnection is prevented, the efficiency of managing the server is improved, and the cost of manually repairing the server is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those of skill in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the embodiments of the invention.
Referring to fig. 5, a block diagram of a remote control apparatus of a server according to an embodiment of the present invention is shown, and is applied to a virtual terminal, where the virtual terminal is used to display operation data of the server, and is disposed in a control device, and the control device is used to remotely control the server, and the apparatus 400 may include:
a first instruction receiving module 401, configured to receive a first instruction sent by the control device, where the first instruction carries a server control command;
a first identifier determining module 402, configured to determine, in response to the first instruction, a first identifier in an interface of the virtual terminal, where the first identifier is used to indicate server operation data corresponding to the server control command;
a data obtaining module 403, configured to execute the server control command based on the first identifier, and obtain corresponding server operation data;
an operation data sending module 404, configured to send the server operation data to the control device, so that the control device displays the server operation data to a user.
Optionally, the data acquiring module may include:
a cursor position determination module to determine a cursor position based on the first identifier;
a first control instruction input module, configured to input a first control instruction at the cursor position, where the control instruction is used to instruct a server to execute the server control command;
and the first control instruction execution module is used for executing the first control instruction and acquiring the server operation data corresponding to the server control instruction.
Optionally, the first control instruction execution module may include:
the screenshot submodule is used for executing the first control instruction and acquiring an interface screenshot of the virtual terminal;
the first identifier traversal submodule is used for circularly traversing the first identifiers in the interface screenshot until the circulation is ended when two first identifiers are found in the interface screenshot;
and the server operation data extraction submodule is used for extracting data between the two first identifiers in the interface screenshot to obtain server operation data generated in the process that the server executes the control instruction.
Optionally, the cursor position determining module may include:
the first position acquisition sub-module is used for acquiring a first position of an image control in an interface of the virtual terminal, and the image control is used for packaging the operation data and method of the server;
the second position acquisition submodule is used for acquiring a second position of the first identifier in an interface of the virtual terminal;
a first identifier relative position calculation submodule, configured to calculate a relative position of the first identifier in the image control according to the first position and the second position;
and the cursor determining submodule is used for determining the position of the cursor according to the relative position and the length of the first identifier.
Optionally, the apparatus may further include:
a key obtaining module, configured to obtain a combo box control and a target key in the virtual terminal, where the target key is used to unlock an interface of the virtual terminal in a display interface of the control device;
and the interface unlocking module is used for inputting the target key in the combo box control so as to unlock the interface of the virtual terminal.
Referring to fig. 6, a block diagram of an embodiment of a remote control apparatus for a server according to the present invention is shown, and is applied to a control device, where a virtual terminal is disposed in the control device, the virtual terminal is used to display operation data of the server, and the control device is used to remotely control the server, and the apparatus 500 may include:
a request receiving module 501, configured to receive a server control request, where the server control request carries a server identifier and a server control command;
a virtual terminal starting module 502, configured to start a virtual terminal corresponding to a server identifier according to a correspondence between the server identifier and a virtual terminal identifier, where the server identifier corresponds to the virtual terminal identifier one to one;
a first instruction sending module 503, configured to send a first instruction to the virtual terminal, where the first instruction carries the server control command, and the first instruction is used to trigger the virtual terminal to obtain server operation data corresponding to the server control command.
Optionally, the virtual terminal starting module may include:
the optimal thread number calculation submodule is used for calculating the optimal thread number according to the core number, the thread waiting time and the thread running time of the control equipment;
the thread distribution submodule is used for distributing threads for the server control request according to the optimal thread number;
and the virtual terminal starting submodule is used for starting the virtual terminal corresponding to the server identifier by using the thread.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The present application also provides a remote control system of a server, the system including a remote control device applied to a server of a virtual terminal and a remote control device applied to a server of a control device, the system performing a remote control method of a server as shown in fig. 1.
Fig. 7 is a block diagram illustrating an electronic device 600 for remote control of a server according to an embodiment of the present invention. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the electronic device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the remote control method of the server described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 606 provides power to the various components of electronic device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 600.
The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 600 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 600 is in an operational mode, such as a call mode, a recording mode, and a voice information processing mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the electronic device 600. For example, the sensor component 614 may detect an open/closed state of the electronic device 600, the relative positioning of components, such as a display and keypad of the apparatus 600, the sensor component 614 may also detect a change in position of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, orientation or acceleration/deceleration of the electronic device 600, and a change in temperature of the electronic device 600. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the electronic device 600 and other devices in a wired or wireless manner. The electronic device 600 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic elements for performing a remote control method of the above-described server.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the electronic device 600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, in which instructions, when executed by a processor of an electronic device (server or terminal), enable the processor to perform the remote control method of the server shown above.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for the remote control method, apparatus, electronic device and storage medium of the server, and specific examples are applied herein to explain the principle and implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A remote control method of a server is applied to a virtual terminal, the virtual terminal is used for displaying operation data of the server, the virtual terminal is arranged in a control device, the control device is used for remotely controlling the server, and the method comprises the following steps:
receiving a first instruction sent by the control equipment, wherein the first instruction carries a server control command;
responding to the first instruction, determining a first identifier in an interface of the virtual terminal, wherein the first identifier is used for indicating server operation data corresponding to the server control command;
executing the server control command based on the first identifier to acquire corresponding server operation data;
and sending the server operation data to the control equipment so that the control equipment displays the server operation data to a user.
2. The method of claim 1, wherein executing the server control command based on the first identifier to obtain corresponding server operational data comprises:
determining a cursor position based on the first identifier;
inputting a first control instruction at the cursor position, the control instruction being used to instruct a server to execute the server control command;
and executing the first control instruction, and acquiring server operation data corresponding to the server control command.
3. The method according to claim 2, wherein the executing the first control instruction to obtain the server operation data corresponding to the server control command comprises:
executing the first control instruction to obtain an interface screenshot of the virtual terminal;
circularly traversing the first identifiers in the interface screenshot until the two first identifiers are found in the interface screenshot, and ending the circulation;
and extracting data between the two first identifiers in the interface screenshot to obtain server operation data generated in the process of executing the control instruction by the server.
4. The method of claim 2, wherein determining the cursor position based on the first identifier comprises:
acquiring a first position of an image control in an interface of the virtual terminal, wherein the image control is used for packaging the operation data and method of the server;
acquiring a second position of the first identifier in an interface of the virtual terminal;
calculating the relative position of the first identifier in the image control according to the first position and the second position;
determining a cursor position based on the relative position and the length of the first identifier.
5. The method of claim 1, wherein prior to determining the first identifier in the interface of the virtual terminal, the method further comprises:
acquiring a combo box control and a target key in the virtual terminal, wherein the target key is used for unlocking an interface of the virtual terminal in a display interface of the control equipment;
and inputting the target key in the combo box control so as to unlock the interface of the virtual terminal.
6. A remote control method of a server is applied to a control device, a virtual terminal is arranged in the control device and used for displaying operation data of the server, the control device is used for remotely controlling the server, and the method comprises the following steps:
receiving a server control request, wherein the server control request carries a server identifier and a server control command;
starting a virtual terminal corresponding to a server identifier according to the corresponding relation between the server identifier and the virtual terminal identifier, wherein the server identifier corresponds to the virtual terminal identifier one by one;
and sending a first instruction to the virtual terminal, wherein the first instruction carries the server control command, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the server control command.
7. The method according to claim 6, wherein the starting the virtual terminal corresponding to the server identifier according to the correspondence between the server identifier and the virtual terminal identifier comprises:
calculating the optimal thread number according to the core number, the thread waiting time and the thread running time of the control equipment;
distributing threads for the server control request according to the optimal thread number;
and starting the virtual terminal corresponding to the server identifier by using the thread.
8. The method according to claim 6, characterized in that the control device is provided with at least one virtual terminal, one virtual terminal being used for displaying the operating data of one server.
9. A remote control device of a server is applied to a virtual terminal, the virtual terminal is used for displaying operation data of the server, the virtual terminal is arranged in a control device, the control device is used for remotely controlling the server, and the device comprises:
a first instruction receiving module, configured to receive a first instruction sent by the control device, where the first instruction carries a server control command;
a first identifier determining module, configured to determine, in response to the first instruction, a first identifier in an interface of the virtual terminal, where the first identifier is used to indicate server operation data corresponding to the server control command;
the data acquisition module is used for executing the server control command based on the first identifier and acquiring corresponding server operation data;
and the operating data sending module is used for sending the server operating data to the control equipment so as to enable the control equipment to display the server operating data to a user.
10. The remote control device of the server is characterized by being applied to control equipment, wherein a virtual terminal is arranged in the control equipment, the virtual terminal is used for displaying the operation data of the server, the control equipment is used for remotely controlling the server, and the remote control device comprises:
the request receiving module is used for receiving a server control request, and the server control request carries a server identifier and a server control command;
the virtual terminal starting module is used for starting the virtual terminal corresponding to the server identifier according to the corresponding relation between the server identifier and the virtual terminal identifier, and the server identifier corresponds to the virtual terminal identifier one by one;
and the first instruction sending module is used for sending a first instruction to the virtual terminal, wherein the first instruction carries the server control command, and the first instruction is used for triggering the virtual terminal to acquire server operation data corresponding to the server control command.
11. An electronic device, comprising: a processor and a memory, the processor executing a computer program stored in the memory implementing the method of any one of claims 1 to 8.
12. A readable storage medium, wherein instructions in the storage medium, when executed by a processor of an apparatus, enable the apparatus to perform the method of any of method claims 1 to 8.
CN202211215620.8A 2022-09-30 2022-09-30 Remote control method and device for server, electronic equipment and readable storage medium Pending CN115604132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211215620.8A CN115604132A (en) 2022-09-30 2022-09-30 Remote control method and device for server, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211215620.8A CN115604132A (en) 2022-09-30 2022-09-30 Remote control method and device for server, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115604132A true CN115604132A (en) 2023-01-13

Family

ID=84845932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211215620.8A Pending CN115604132A (en) 2022-09-30 2022-09-30 Remote control method and device for server, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115604132A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095152A (en) * 2023-03-08 2023-05-09 杭州半云科技有限公司 Multi-terminal-based multi-screen communication collaboration method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095152A (en) * 2023-03-08 2023-05-09 杭州半云科技有限公司 Multi-terminal-based multi-screen communication collaboration method

Similar Documents

Publication Publication Date Title
EP2998899A1 (en) Method and apparatus for running application program
CN109308241B (en) Method and device for monitoring starting process of application program, terminal equipment and storage medium
CN108965611B (en) Shooting interface switching method, device, equipment and storage medium
CN112764563A (en) Multi-screen control method, device and system, electronic equipment and storage medium
EP3236355A1 (en) Method and apparatus for managing task of instant messaging application
CN115604132A (en) Remote control method and device for server, electronic equipment and readable storage medium
CN113238763A (en) Application deployment method, device, storage medium and program product
CN115129573A (en) Program operation monitoring method and device, electronic equipment and storage medium
CN115576645A (en) Virtual processor scheduling method and device, storage medium and electronic equipment
CN113377664A (en) Model testing method and device, electronic device and storage medium
CN112256563A (en) Android application stability testing method and device, electronic equipment and storage medium
CN109491655B (en) Input event processing method and device
CN110865823A (en) Pre-installed application control method, pre-installed application control device and storage medium
CN106354595B (en) Mobile terminal, hardware component state detection method and device
CN116360979A (en) Memory allocation method and device, electronic equipment and readable storage medium
CN114661606A (en) Program debugging method and device, electronic equipment and storage medium
CN110874143B (en) Sensor data acquisition method, intelligent terminal, storage medium and electronic equipment
CN114461360A (en) Thread control method, thread control device, terminal and storage medium
CN110162302B (en) Data processing method, device, electronic equipment and storage medium
CN114860242A (en) Compiling method, compiling device and storage medium
CN109739763B (en) Code segment operation method, device, terminal and storage medium
CN113407368B (en) Process management method and device and electronic equipment
CN114531493B (en) Request processing method and device, electronic equipment and storage medium
CN112363917B (en) Application program debugging exception processing method and device, electronic equipment and medium
CN112506628B (en) Agent program management method, device, computer equipment and storage medium

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