Disclosure of Invention
The embodiment of the invention aims to provide a control method and device of a cloud server, electronic equipment and a storage medium, so as to simplify the process of controlling a plurality of cloud servers and improve the control efficiency. The specific technical scheme is as follows:
In a first aspect, an embodiment of the present invention provides a control method for a cloud server, where the control method is applied to a terminal, and the terminal is connected with a plurality of servers in a communication manner through a browser, where a main control page and a plurality of sub pages are provided in the browser, and each sub page corresponds to a server identifier of one server, where the method includes:
after acquiring a plurality of server identifications and a plurality of control instructions input by a user, the main control page broadcasts the server identifications and the control instructions, wherein each server identification corresponds to at least one control instruction;
each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
Optionally, after the master control page obtains the plurality of server identifiers and the plurality of control instructions input by the user, the method further includes:
determining a control mode of a main control page, wherein the control mode comprises a multi-control mode and a single-control mode;
broadcasting a plurality of server identifications and a plurality of control instructions when the control mode of the main control page is a multi-control mode;
When the control mode of the main control page is a single control mode, selecting a target server identifier and at least one control instruction corresponding to the target server identifier from a plurality of server identifiers input by a user, and broadcasting the target server identifier and at least one control instruction corresponding to the target server identifier;
when the sub page corresponding to the target server identifier monitors the target server identifier and at least one control instruction corresponding to the target server identifier, the target server identifier and the at least one control instruction corresponding to the target server identifier are acquired, and the at least one control instruction corresponding to the target server identifier is sent to the target server identified by the target server identifier.
Optionally, the method further comprises:
after the main control page acquires preset parameters and control instructions corresponding to the preset parameters input by a user, broadcasting the preset parameters and the control instructions corresponding to the preset parameters, wherein the preset parameters are used for indicating all sub-pages to send the control instructions corresponding to the preset parameters to the corresponding servers;
after all the sub-pages monitor the preset parameters and the control instructions corresponding to the preset parameters, the control instructions corresponding to the preset parameters are respectively sent to the servers corresponding to the sub-pages.
Optionally, after obtaining the plurality of server identifiers and the plurality of control instructions input by the user, the main control page broadcasts the plurality of server identifiers and the plurality of control instructions, including:
after the main control page acquires a plurality of server identifications and a plurality of control instructions input by a user, broadcasting the server identifications and the control instructions through a first preset format;
when any sub page monitors a server identifier corresponding to the sub page and at least one control instruction corresponding to the server identifier, the method sends the at least one control instruction corresponding to the server identifier to a corresponding server, and comprises the following steps:
when any sub page monitors a server identifier corresponding to the sub page and at least one control instruction corresponding to the server identifier, converting the at least one control instruction corresponding to the server identifier into at least one control instruction in a second preset format; and sending at least one control instruction in a second preset format to the corresponding server.
Optionally, after the master control page obtains the plurality of server identifiers and the plurality of control instructions input by the user, the method further includes:
the method comprises the steps of obtaining a communication mode selected by a user, wherein the communication mode is used for representing a data interaction mode between a main control page and a sub page, and at least comprises the following steps: a broadcasting mode;
And when the communication mode selected by the user is a broadcasting mode, sending broadcasting instructions to all the sub-pages to instruct all the sub-pages to monitor the main control page.
In a second aspect, an embodiment of the present invention provides a control device of a cloud server, where the control device is applied to a terminal, and the terminal is connected with a plurality of servers in a communication manner through a browser, where a main control page and a plurality of sub pages are provided in the browser, and each sub page corresponds to a server identifier of one server, where the device includes:
the broadcasting module is used for broadcasting a plurality of server identifications and a plurality of control instructions after the main control page acquires the plurality of server identifications and the plurality of control instructions input by the user, wherein each server identification corresponds to at least one control instruction;
the monitoring module is used for monitoring the main control page by each sub-page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
Optionally, the apparatus further comprises:
the control mode determining module is used for determining a control mode of the main control page after the main control page acquires a plurality of server identifications and a plurality of control instructions input by a user, wherein the control mode comprises a multi-control mode and a single-control mode;
When the control mode of the main control page is a multi-control mode, triggering the broadcasting module to broadcast a plurality of server identifiers and a plurality of control instructions;
when the control mode of the main control page is a single control mode, triggering a broadcasting module to select a target server identifier and at least one control instruction corresponding to the target server identifier from a plurality of server identifiers input by a user, and broadcasting the target server identifier and at least one control instruction corresponding to the target server identifier;
and the monitoring module is also used for acquiring the target server identifier and at least one control instruction corresponding to the target server identifier when the sub page corresponding to the target server identifier monitors the target server identifier and the at least one control instruction corresponding to the target server identifier, and sending the at least one control instruction corresponding to the target server identifier to the target server identified by the target server identifier.
Optionally, the broadcasting module is further configured to:
after the main control page acquires preset parameters and control instructions corresponding to the preset parameters input by a user, broadcasting the preset parameters and the control instructions corresponding to the preset parameters, wherein the preset parameters are used for indicating all sub-pages to send the control instructions corresponding to the preset parameters to the corresponding servers;
And the monitoring module is also used for respectively sending the control instructions corresponding to the preset parameters to the servers corresponding to the sub pages after all the sub pages monitor the preset parameters and the control instructions corresponding to the preset parameters.
Optionally, the broadcasting module is specifically configured to:
after a plurality of server identifications and a plurality of control instructions input by a user are acquired by a main control page, broadcasting the plurality of server identifications and the plurality of control instructions through a first preset format;
the monitoring module is specifically used for:
when any sub page monitors a server identifier corresponding to the sub page and at least one control instruction corresponding to the server identifier, converting the at least one control instruction corresponding to the server identifier into at least one control instruction in a second preset format; and sending at least one control instruction in a second preset format to the corresponding server.
Optionally, the apparatus further comprises:
the communication mode acquisition module is used for acquiring a communication mode selected by a user, wherein the communication mode is used for representing a data interaction mode between a main control page and a sub page and at least comprises the following steps: a broadcasting mode;
an indication module for: and when the communication mode selected by the user is a broadcasting mode, sending broadcasting instructions to all the sub-pages to instruct all the sub-pages to monitor the main control page.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the control method of any cloud server when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements a control method of any one of the foregoing cloud servers.
In a fifth aspect, embodiments of the present invention further provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of controlling a cloud server as described in any one of the above.
The embodiment of the invention has the beneficial effects that:
according to the control method, the device, the electronic equipment and the storage medium of the cloud server, a main control page and a plurality of sub pages can be arranged in a browser, each sub page corresponds to a server identifier of a server, then the main control page broadcasts the plurality of server identifiers and the plurality of control instructions after acquiring the plurality of server identifiers and the plurality of control instructions input by a user, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved. Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In order to solve the problems in the prior art, the embodiment of the invention provides a control method, a control device, electronic equipment and a storage medium of a cloud server, so as to simplify the process of controlling a plurality of cloud servers and improve the control efficiency.
In the following, first, a control method of a cloud server according to an embodiment of the present invention is described, as shown in fig. 1, which is a flowchart of a first implementation of a control method of a cloud server according to an embodiment of the present invention, where the method is applied to a terminal, and the terminal is communicatively connected to a plurality of servers through a browser, where a main control page and a plurality of sub pages are provided in the browser, and each sub page corresponds to a server identifier of a server, where the method may include:
s110, after a main control page acquires a plurality of server identifications and a plurality of control instructions input by a user, broadcasting the server identifications and the control instructions, wherein each server identification corresponds to at least one control instruction;
s120, each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
In some examples, the servers are cloud servers, each cloud server is deployed with a VNC server (Virtual Network Computing server, virtual network computing server service), when a browser sends a command to the cloud server, the browser packages the command into a websocket format and sends the command to a websocket proxy service, and the websocket proxy service packages the command packaged into the websocket format according to an RFB (Remote Frame Buffer ) protocol, and then sends the packaged command to a VNC server component deployed on the cloud server, so as to implement communication between the browser and the cloud server. The browser is a browser running in various terminals, for example, a browser running in a mobile phone terminal, a computer terminal.
When the cloud server returns a message to the browser, the VNC server component deployed on the cloud server sends the message to be returned to the websocket proxy service, and then the websocket proxy component packages the message to be returned into a message in a websocket format and returns the message to the browser.
In some examples, the browser may be provided with a main control page and a sub-page, where the sub-page may be preset in the terminal, or may be regenerated after the main control page receives a plurality of control instructions, which may all be all possible.
In setting up the master page and the sub-pages, BFC (Block Formatting Context, block-level formatting context) may be employed to build the sub-pages and the master page. The iframe technique may also be employed to build sub-pages and master pages. The sub-page and the main control page can be displayed in the browser in the form of cards, for example, six card windows can be uniformly displayed in one browser window, and the 6 card windows are sub-pages. In some examples, the master page may be floatingly displayed in the browser window, the master page being movable in any position in the browser window.
In still other examples, after the sub-page and the main control page are established, in order to control multiple cloud servers at the same time, multiple server identifiers may be acquired first, and one server identifier is allocated to each sub-page, so as to establish a correspondence between each server identifier and the sub-page. Thus, when the sub page is sending information to the server, the information can be sent to the corresponding server based on the corresponding server identification.
After the correspondence between the sub-pages and the server identification is established. After a user inputs a plurality of server identifiers and control instructions corresponding to the server identifiers in a main control page, the main control page can acquire the plurality of server identifiers and the control instructions corresponding to the server identifiers input by the user, and then can broadcast the plurality of server identifiers and the plurality of control instructions.
In some examples, the master page may use a Broadcast Channel (broadcast channel) communication mechanism to broadcast the plurality of server identities and corresponding control instructions for the respective server identities; wherein the main control page and each sub page use the same communication channel, and when the communication channel is set, the following codes can be used for setting: constbc= new BroadcastChannel ('vnc Channel'); where 'vnc Channel' represents the communication Channel of the main page and the sub page.
In still other examples, after the communication channel is set, the data may be broadcast using the following code: bc. postmessage ('h'), wherein the parameter 'h' is broadcasted data.
After broadcasting a plurality of server identifiers and a plurality of control instructions, each sub-page can monitor the main control page, and after broadcasting the plurality of server identifiers and the control instructions corresponding to the server identifiers, each sub-page corresponds to a server identifier of a server, so that after one sub-page monitors the server identifier corresponding to the sub-page, at least one control instruction corresponding to the server identifier can be obtained, and then at least one control instruction corresponding to the server identifier can be sent to the server identified by the server identifier corresponding to the sub-page.
In some examples, the sub-page described above may be snooped with the following code:
bc.onmessage=function(e) {console.log('receive:',e);}
wherein onmessage is a monitor function, and e is data monitored by sub-page.
In some examples, the formats of the plurality of server identifications and the plurality of control instructions broadcast by the main control page may be the same as or different from the format of the at least one control instruction sent by the sub-page to the server, and when the formats of the plurality of server identifications and the plurality of control instructions broadcast by the main control page are different from the format of the at least one control instruction sent by the sub-page to the server, for example, after the main control page acquires the plurality of server identifications and the plurality of control instructions input by the user, the plurality of server identifications and the plurality of control instructions are broadcast in the first preset format; when any sub-page monitors the server identification corresponding to the sub-page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification can be converted into at least one control instruction in a second preset format; and then at least one control instruction in a second preset format is sent to the corresponding server.
For example, the master page described above may use json.string () function to convert the data { to: "server1, server2", cmd: "ls-al" } to a string format '{ "to": "server1, server2", "cmd": "ls-al" } ", and then broadcast using the broadcast code bc.postmessage (' {" to ":" server1, server2"," cmd ":" ls-al "}). The character string format is the first preset format. Wherein, the parameters "to" are server1 and server2 "represent sending control instructions to servers identified as server1 and server2, and" cmd "is ls-al" represents the control instructions as "ls-al".
After any sub page monitors the data in the character string format of '{ "to": "server1, server2", "cmd": "ls-al" }, the data in the character string format of' { "to": "server1, server2", "cmd": "ls-al" } "can be converted into a json object data format by using an analysis function json. The conversion code is var message=json.parameter (' { "to": "server1, server2", "cmd": "ls-al" }).
According to the control method of the cloud server, a main control page and a plurality of sub pages can be arranged in a browser, each sub page corresponds to a server identifier of a server, after the main control page acquires the plurality of server identifiers and a plurality of control instructions input by a user, the main control page broadcasts the plurality of server identifiers and the plurality of control instructions, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved.
On the basis of the control method of the cloud server shown in fig. 1, the embodiment of the present invention further provides a possible implementation manner, as shown in fig. 2, which is a flowchart of a second implementation manner of the control method of the cloud server in the embodiment of the present invention, where the method may include:
s210, after a main control page acquires a plurality of server identifications and a plurality of control instructions input by a user, determining a control mode of the main control page, wherein the control mode comprises a multi-control mode and a single-control mode;
s220, broadcasting a plurality of server identifiers and a plurality of control instructions when the control mode of the main control page is a multi-control mode;
s230, each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
S240, when the control mode of the main control page is a single control mode, selecting a target server identifier and at least one control instruction corresponding to the target server identifier from a plurality of server identifiers input by a user, and broadcasting the target server identifier and at least one control instruction corresponding to the target server identifier;
S250, when the sub page corresponding to the target server identifier monitors the target server identifier and at least one control instruction corresponding to the target server identifier, the target server identifier and the at least one control instruction corresponding to the target server identifier are obtained, and the at least one control instruction corresponding to the target server identifier is sent to the target server identified by the target server identifier.
In some examples, the control method of the cloud server according to the embodiment of the present invention may control a plurality of servers simultaneously or may control one server separately, where the above-mentioned main control page may be provided with a control mode selection button, so that a user selects a control mode through the button. The main control page can also be provided with a switching button to enable a user to switch the control mode, and can be provided with an opening button and a closing button, when the user clicks the opening button, the user is informed to open the multi-control mode, and when the user clicks the closing button, the user is informed to close the multi-control mode, and the single-control mode is opened.
When the user selects the control mode, the main control page can acquire the control mode selected by the user, so that the control mode of the main control page can be determined.
When the control mode of the main control page is determined to be a multi-control mode, a plurality of server identifications and a plurality of control instructions can be broadcast, so that when one sub-page monitors the server identification corresponding to the sub-page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification can be sent to the corresponding server. Therefore, the user inputs a plurality of control instructions on the main control page, and then the corresponding sub-pages automatically send the corresponding control instructions to the corresponding servers. And the user does not need to input control instructions into pages corresponding to each cloud server in the browser, so that the process of controlling a plurality of cloud servers can be simplified, and the control efficiency is improved.
When the control mode of the main control page is a single control mode, when a plurality of server identifications and a plurality of control instructions are input by a user, a prompt window can be displayed on the page, so that the user can select one server identification from the plurality of server identifications as a target server identification, and the main control page can further determine the target server identification and at least one control instruction corresponding to the target server identification from the plurality of server identifications input by the user according to the selection of the user;
In some examples, the above-mentioned master page may also randomly select one server identifier from the plurality of server identifiers as the target server identifier or select the first server identifier or the last server identifier from the plurality of server identifiers as the target server identifier, which is also possible.
After the above main control page obtains the target server identifier and at least one control instruction corresponding to the target server identifier, the target server identifier and at least one control instruction corresponding to the target server identifier may be broadcasted, so when the sub page corresponding to the target server identifier monitors the target server identifier and at least one control instruction corresponding to the target server identifier, the target server identifier and at least one control instruction corresponding to the target server identifier may be obtained, and the at least one control instruction corresponding to the target server identifier may be sent to the target server identified by the target server identifier.
By the embodiment of the invention, the switching of multiple control modes and the control of the server under different control modes can be realized, and the flexibility of the control method of the cloud server applying the embodiment of the invention is improved.
It is understood that step S230 in the embodiment of the present invention is the same as or similar to step S120 in the first embodiment, and will not be described herein.
In some examples, the embodiment of the invention can select some cloud servers from a plurality of cloud servers to control, and can also control all cloud servers. In order to further improve the efficiency of controlling the cloud servers, the embodiment of the present invention further provides a possible implementation manner, as shown in fig. 3, which is a flowchart of a third implementation manner of a control method of the cloud server according to the embodiment of the present invention, where the method may include:
s310, when the control mode of the main control page is a multi-control mode, the main control page broadcasts the preset parameters and control instructions corresponding to the preset parameters after acquiring the preset parameters and the control instructions corresponding to the preset parameters input by a user, wherein the preset parameters are used for indicating all sub-pages to send the control instructions corresponding to the preset parameters to the respective corresponding servers;
s320, after all the sub-pages monitor the preset parameters and the control instructions corresponding to the preset parameters, the control instructions corresponding to the preset parameters are respectively sent to the servers corresponding to the sub-pages.
In some examples, when the control mode of the main control page is a multi-control mode, the user may input a preset parameter for indicating that all sub-pages send control instructions to the servers corresponding to the sub-pages and a control instruction corresponding to the preset parameter in the main control page, so the main control page may acquire the preset parameter input by the user and the control instruction corresponding to the preset parameter; the preset parameter may be a parameter that is pre-agreed to the main control page and the sub-page, for example, the preset parameter may be "all" (all), which indicates that a control instruction corresponding to the preset parameter is sent to all cloud servers.
In some examples, a data format may be agreed for a main control page and a sub-page before executing a control method of a cloud server according to an embodiment of the present invention, where the data may include: { to: "xx, … …, xx", cmd: "Command" }, or { to: "ALL", cmd: "Command" }; the method comprises the steps that to is that 'xx, xx and xx' indicate that commands are sent to a plurality of cloud servers, for example, to is that 'server 1, server2 and server 3' indicate that commands are sent to cloud servers server1, server2 and server3, and at the moment, three sub pages corresponding to the cloud servers server1, server2 and server3 respectively can send commands to the cloud servers server1, server2 and server3 respectively, and other sub pages do not respond; to "ALL" means sending commands to ALL cloud servers.
After the main control page acquires the preset parameters input by the user and the control instructions corresponding to the preset parameters, the main control page can broadcast the preset parameters and the control instructions corresponding to the preset parameters; because the preset parameters can instruct all sub-pages to send the control instructions corresponding to the preset parameters to the corresponding servers, all the sub-pages can monitor the preset parameters and the control instructions corresponding to the preset parameters, and then all the sub-pages can send the control instructions corresponding to the preset parameters to the corresponding cloud servers respectively.
For example, assuming that the control instruction corresponding to the preset parameter is "ls-al", after all the sub-pages monitor the control instruction "ls-al", the control instruction "ls-al" may be sent to the cloud servers corresponding to the sub-pages respectively.
Through the embodiment of the invention, a user can control a plurality of cloud servers more conveniently, and the efficiency of controlling the cloud servers is further improved.
In still other examples, after sending the corresponding at least one control instruction to the corresponding server, each server may receive the corresponding control instruction and execute the control instruction, and after executing the control instruction, each server may obtain the response information corresponding to the control instruction and return the response information corresponding to the control instruction to the corresponding sub page. At this time, each corresponding sub-page may acquire response information returned by the corresponding server, and when each sub-page acquires response information corresponding to the control instruction returned by the corresponding server, the response information may be displayed on the corresponding sub-page. Thus, the user can conveniently view the response information of the cloud server corresponding to each sub page on each sub page.
The control instruction may be a monitoring instruction, or may be a parameter adjustment instruction, and the response information may be a monitoring result corresponding to the monitoring instruction, or may be an adjusted parameter corresponding to the parameter adjustment instruction, which may be all that is required.
On the basis of the control method of the cloud server shown in fig. 1, the embodiment of the present invention further provides a possible implementation manner, as shown in fig. 4, which is a flowchart of a fourth implementation manner of the control method of the cloud server in the embodiment of the present invention, where the method may include:
s410, after the main control page acquires a plurality of server identifiers and a plurality of control instructions input by a user, acquiring a communication mode selected by the user, wherein the communication mode is used for representing a data interaction mode between the main control page and the sub-page, and the communication mode at least comprises: a broadcasting mode;
and S420, when the communication mode selected by the user is a broadcasting mode, sending broadcasting instructions to all sub-pages to instruct all the sub-pages to monitor the main control page.
S430, broadcasting a plurality of server identifiers and a plurality of control instructions, wherein each server identifier corresponds to at least one control instruction;
S440, each sub-page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
In some examples, various communication modes can be adopted between the main control page and the sub-page, for example, the main control page can be communicated with the sub-page in a broadcast communication mode, and also can be directly communicated with the sub-page in a data packet communication mode to carry out data interaction. In order to improve the flexibility of communication between the main control page and the sub-page, the main control page can be provided with a selection button of a communication mode so that a user can select different communication modes.
When the communication mode is selected by the user in the main control page, the main control page can acquire the communication mode selected by the user, and when the communication mode acquired by the main control page is a broadcast mode, in order to enable the sub-pages to monitor the main control page, the main control page can firstly send a broadcast instruction to the sub-pages so as to inform each sub-page that the main control page adopts the broadcast mode to communicate, so that each sub-page is instructed to monitor the main control page.
When the user selects the data packet communication mode, the main control page can send the control instruction corresponding to each server identifier to the sub-page corresponding to the server identified by the server identifier, so that after all the sub-pages acquire the corresponding control instruction, the corresponding control instruction can be sent to the corresponding server.
By the embodiment of the invention, the user can select different communication modes to communicate between the main control page and the sub-page, and the flexibility of communicating between the main control page and the sub-page is improved.
Step S440 of the embodiment of the present invention is the same as or similar to step S120 of the first embodiment, and will not be described again.
Correspondingly, with the above method embodiment, the embodiment of the present invention further provides a control device of a cloud server, where the device is applied to a terminal, the terminal is connected with a plurality of servers in a communication manner through a browser, a main control page and a plurality of sub pages are provided in the browser, each sub page corresponds to a server identifier of one server, as shown in fig. 5, and the device may include:
the broadcasting module 510 is configured to, after acquiring a plurality of server identifiers and a plurality of control instructions input by a user, broadcast the plurality of server identifiers and the plurality of control instructions by the main control page, where each server identifier corresponds to at least one control instruction;
A monitor module 520, configured to monitor the main control page by each sub-page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
According to the control device of the cloud server, a main control page and a plurality of sub pages can be arranged in a browser, each sub page corresponds to a server identifier of a server, after the main control page acquires the plurality of server identifiers and a plurality of control instructions input by a user, the main control page broadcasts the plurality of server identifiers and the plurality of control instructions, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved.
In some examples, the apparatus further comprises:
the control mode determining module is used for determining a control mode of the main control page after the main control page acquires a plurality of server identifications and a plurality of control instructions input by a user, wherein the control mode comprises a multi-control mode and a single-control mode;
when the control mode of the main control page is a multi-control mode, the broadcasting module 510 is triggered to broadcast a plurality of server identifiers and a plurality of control instructions;
when the control mode of the main control page is a single control mode, triggering the broadcasting module 510 to select a target server identifier and at least one control instruction corresponding to the target server identifier from a plurality of server identifiers input by a user, and broadcasting the target server identifier and at least one control instruction corresponding to the target server identifier;
the monitoring module 520 is further configured to, when the sub page corresponding to the target server identifier monitors the target server identifier and at least one control instruction corresponding to the target server identifier, obtain the target server identifier and at least one control instruction corresponding to the target server identifier, and send the at least one control instruction corresponding to the target server identifier to the target server identified by the target server identifier.
In some examples, the broadcast module 510 is further to:
after the main control page acquires preset parameters and control instructions corresponding to the preset parameters input by a user, broadcasting the preset parameters and the control instructions corresponding to the preset parameters, wherein the preset parameters are used for indicating all sub-pages to send the control instructions corresponding to the preset parameters to the corresponding servers;
the monitoring module 520 is further configured to send control instructions corresponding to the preset parameters to the servers corresponding to the sub-pages respectively after all the sub-pages monitor the preset parameters and the control instructions corresponding to the preset parameters.
In some examples, the broadcast module 510 is specifically configured to:
after a plurality of server identifications and a plurality of control instructions input by a user are acquired by a main control page, broadcasting the plurality of server identifications and the plurality of control instructions through a first preset format;
the monitor module 520 is specifically configured to:
when any sub page monitors a server identifier corresponding to the sub page and at least one control instruction corresponding to the server identifier, converting the at least one control instruction corresponding to the server identifier into at least one control instruction in a second preset format; and sending at least one control instruction in a second preset format to the corresponding server.
In some examples, the apparatus further comprises:
the communication mode acquisition module is used for acquiring a communication mode selected by a user, wherein the communication mode is used for representing a data interaction mode between a main control page and a sub page and at least comprises the following steps: a broadcasting mode;
an indication module for: and when the communication mode selected by the user is a broadcasting mode, sending broadcasting instructions to all the sub-pages to instruct all the sub-pages to monitor the main control page.
The embodiment of the invention also provides an electronic device, as shown in fig. 6, which comprises a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 complete communication with each other through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the control method of the cloud server according to any of the embodiments described above when executing the program stored in the memory 603, for example, the following method may be executed:
after acquiring a plurality of server identifications and a plurality of control instructions input by a user, the main control page broadcasts the server identifications and the control instructions, wherein each server identification corresponds to at least one control instruction;
Each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
According to the electronic device provided by the embodiment of the invention, a main control page and a plurality of sub pages can be arranged in a browser, each sub page corresponds to a server identifier of a server, then after the main control page acquires the plurality of server identifiers and a plurality of control instructions input by a user, the main control page broadcasts the plurality of server identifiers and the plurality of control instructions, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In still another embodiment of the present invention, there is further provided a computer readable storage medium, in which a computer program is stored, the computer program when executed by a processor implementing a control method of a cloud server as shown in any one of the foregoing embodiments, for example, may implement the following method:
after acquiring a plurality of server identifications and a plurality of control instructions input by a user, the main control page broadcasts the server identifications and the control instructions, wherein each server identification corresponds to at least one control instruction;
each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
The embodiment of the invention provides a computer readable storage medium, which can be used for setting a main control page and a plurality of sub pages in a browser, wherein each sub page corresponds to a server identifier of a server, and then the main control page broadcasts the plurality of server identifiers and a plurality of control instructions after acquiring the plurality of server identifiers and the plurality of control instructions input by a user, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved.
In yet another embodiment of the present invention, there is further provided a computer program product containing instructions, which when executed on a computer, cause the computer to perform the method for controlling a cloud server according to any one of the foregoing embodiments, for example, the method may be performed as follows:
after acquiring a plurality of server identifications and a plurality of control instructions input by a user, the main control page broadcasts the server identifications and the control instructions, wherein each server identification corresponds to at least one control instruction;
each sub-page monitors a main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server.
The embodiment of the invention provides a computer program product containing instructions, which can be used for setting a main control page and a plurality of sub pages in a browser, wherein each sub page corresponds to a server identifier of a server, and then the main control page broadcasts the plurality of server identifiers and the plurality of control instructions after acquiring the plurality of server identifiers and the plurality of control instructions input by a user, and then each sub page monitors the main control page; when any sub page monitors the server identification corresponding to the sub page and at least one control instruction corresponding to the server identification, the at least one control instruction corresponding to the server identification is sent to the corresponding server. Therefore, the control of the cloud servers can be realized by inputting a plurality of control instructions into one main control page without inputting the control instructions into sub pages corresponding to each server, so that the process of controlling the cloud servers can be simplified, and the efficiency of controlling the cloud servers is improved.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present invention are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, server, or data center. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, electronic devices, storage media, and computer program product embodiments containing instructions, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the portions of the method embodiments that are described herein.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.