CN116743906A - Command execution method, device, system, equipment and storage medium - Google Patents
Command execution method, device, system, equipment and storage medium Download PDFInfo
- Publication number
- CN116743906A CN116743906A CN202310538688.8A CN202310538688A CN116743906A CN 116743906 A CN116743906 A CN 116743906A CN 202310538688 A CN202310538688 A CN 202310538688A CN 116743906 A CN116743906 A CN 116743906A
- Authority
- CN
- China
- Prior art keywords
- mobile terminal
- network communication
- command
- target command
- address information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004891 communication Methods 0.000 claims abstract description 137
- 230000006870 function Effects 0.000 claims description 36
- 238000012546 transfer Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72409—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
- H04M1/72412—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/163—In-band adaptation of TCP data exchange; In-band control procedures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention discloses a command execution method, a device, a system, equipment and a storage medium. The method is applied to the mobile terminal and comprises the following steps: starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function; receiving a target command sent by a control end through network communication service, wherein the target command is input in the control end based on network address information of a mobile end; executing the received target command. By the technical scheme of the embodiment of the invention, the command execution operation can be simplified without data wires, and the command execution efficiency is improved.
Description
Technical Field
Embodiments of the present invention relate to computer technology, and in particular, to a method, an apparatus, a system, a device, and a storage medium for executing a command.
Background
With the rapid development of computer technology, it is required to control the mobile terminal to execute a specified command, for example, a command to execute an update system, install software, etc.
Currently, a USB data line is generally used to connect a mobile terminal with an external device, and a command execution tool and a configuration environment are installed in the external device. And after the environment configuration is completed, inputting a command, and sending the command to the mobile terminal through a data line for execution.
However, in the process of implementing the present invention, the inventors found that at least the following problems exist in the prior art:
the existing command execution mode needs to be realized by means of a data line, and a command execution tool and a configuration environment are required to be installed, so that the operation is complex, and the command execution efficiency is reduced.
Disclosure of Invention
The embodiment of the invention provides a command execution method, a device, a system, equipment and a storage medium, which are used for simplifying command execution operation and improving command execution efficiency.
In a first aspect, an embodiment of the present invention provides a command execution method, which is applied to a mobile terminal, and includes:
starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function;
receiving a target command sent by a control end through the network communication service, wherein the target command is input in the control end based on the network address information of the mobile end;
and executing the received target command.
In a second aspect, an embodiment of the present invention provides a command execution method, which is applied to a control terminal having a network communication function, including:
acquiring network address information of a mobile terminal;
acquiring a target command input based on the network address information;
and sending the target command to the mobile terminal through a network communication service between the mobile terminal and a control terminal which are started in advance, so that the mobile terminal executes the received target command.
In a third aspect, an embodiment of the present invention further provides a command execution device, integrated on a mobile terminal, including:
the network communication service opening module is used for opening the network communication service between the mobile terminal and the control terminal;
the target command receiving module is used for receiving a target command sent by the control end through the network communication service, and the target command is input in the control end based on the network address information of the mobile end;
and the target command execution module is used for executing the received target command.
In a fourth aspect, an embodiment of the present invention further provides a command execution device, integrated at a control end having a network communication function, including:
the network address information acquisition module is used for acquiring the network address information of the mobile terminal;
the target command acquisition module is used for inputting a target command based on the network address information;
and the target command sending module is used for sending the target command to the mobile terminal through the network communication service between the mobile terminal and the control terminal which are started in advance, so that the mobile terminal executes the received target command.
In a fifth aspect, an embodiment of the present invention further provides a command execution system, including: the mobile terminal and the control terminal have a network communication function;
wherein the mobile terminal is configured to execute the command execution method provided in the first aspect;
the control terminal is used for executing the command execution method as provided in the second aspect.
In a sixth aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the command execution method as provided by any embodiment of the present invention.
In a seventh aspect, embodiments of the present invention further provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a command execution method as provided by any of the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits:
the network communication service between the mobile terminal and the control terminal with the network communication function is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, the target command is only needed to be input in the control terminal based on the network address information of the mobile terminal, other operations are not needed, the command execution operation is greatly simplified, and the command execution efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of command execution provided by one embodiment of the present invention;
FIG. 2 is a flow chart of a method of command execution provided by one embodiment of the present invention;
FIG. 3 is a schematic diagram of a command execution device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a command execution device according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of a command execution system according to one embodiment of the invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a flowchart of a command execution method according to an embodiment of the present invention, where the embodiment is applicable to a case where a control terminal with a network communication function sends a command to be executed to a mobile terminal for execution. The method may be performed by a command execution device, which may be implemented in software and/or hardware, and integrated in the mobile terminal. As shown in fig. 1, the method specifically includes the following steps:
s110, starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function.
The mobile terminal may refer to any mobile device that needs to execute an external control command. For example, the mobile terminal may be, but is not limited to, a cell phone, tablet computer, etc. The operating system of the mobile terminal may be, but is not limited to, an android system or ios system. The control end may refer to a web page end, a client APP with a network communication function, and other application programs developed using HTTP protocol, webSocket protocol, or TCP protocol, etc. The web page end may have a terminal with a web page browsing function. For example, the web page end may refer to a browser in a terminal device such as a mobile phone, a desktop computer, a tablet computer, and the like. The control terminal has a network communication function. The mobile terminal does not have a function of performing network communication with the control terminal. The network communication service may be a service for providing information transfer between the mobile terminal and the control terminal.
Specifically, an application program APP may be set in the mobile terminal, and the network communication service between the mobile terminal and the control terminal is started by executing the application program APP. For example, the mobile terminal may automatically trigger the execution of the application program after being started, so as to automatically start the network communication service between the mobile terminal and the control terminal in the mobile terminal. Or after the mobile terminal is started, when the command needs to be executed, the user can manually trigger the application program to be executed, so that the network communication service between the mobile terminal and the control terminal is manually started in the mobile terminal. By starting the network communication service in the mobile terminal, the mobile terminal has the function of communicating with the control terminal, so that the point-to-point direct access is realized, the connection is not needed by a data line, and the command execution of the mobile terminal is quickly realized.
Illustratively, S110 may include: opening a socket port; and starting network communication service between the mobile terminal and the control terminal based on a preset network communication protocol through the socket port.
The Socket port Socket may refer to an interface that an application program communicates through a network protocol, and is also an interface that the application program interacts with a network protocol stack. The preset network communication protocol may be a network communication protocol set in advance based on traffic demand. For example, the preset network communication protocol may include, but is not limited to: hypertext transfer protocol or WebSocket protocol. Among these, the hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) is a request response protocol. The WebSocket protocol is a protocol that performs full duplex communication over a single TCP (Transmission Control Protocol ) connection. WebSocket may allow the mobile terminal to actively push data to the control terminal. In WebSocket, the control end and the mobile end only need to complete one handshake, and can directly establish persistent connection between the control end and the mobile end and perform bidirectional data transmission.
Specifically, a socket port may be opened in the application program of the mobile terminal. Through the socket port, a network communication service based on the hypertext transfer protocol can be started, namely, a virtual Http Server service is started in the mobile terminal. Or, through the socket port, a network communication service based on the WebSocket protocol can be started, that is, a virtual WebSocket Server service is started in the mobile terminal. Wherein, http Server refers to Socket layer-based Http application Server. The WebSocket Server also refers to a WebSocket application Server based on a Socket layer.
S120, receiving a target command sent by the control end through the network communication service, wherein the target command is input in the control end based on the network address information of the mobile end.
The target command may refer to a command to be executed by the mobile terminal. For example, the target command may be an update system command, an install software command, a grab mobile side log command, or a get mobile side status command, etc. The number of target commands may be one or more, the specific number of which is determined by user input. The network address information of the mobile terminal may be used to characterize location information of network communication services opened in the mobile terminal. The network address information of the mobile terminal may include mobile terminal IP address information and port number information; alternatively, the network address information may include mobile side domain name information and port number information. Wherein, mobile terminal IP address information and mobile terminal domain name information can be used to characterize the specific network location of the mobile terminal. The port number information may refer to a port number of a network communication service opened in the mobile terminal in order to distinguish between different application services in the network.
Specifically, the network address information of the mobile terminal can be queried from the mobile terminal log, and all target commands to be executed are input in the control terminal based on the network address information of the mobile terminal. For example, the network address information of the mobile terminal is input in the page search box of the control terminal, so that the control terminal determines and displays the target page corresponding to the network address information. And the user can input all target commands to be executed on the target page, and after the input is completed, the sending operation of the target commands can be triggered by clicking a submit button. For another example, the network configuration can be completed by inputting the network address information of the mobile terminal in the network configuration interface of the control terminal, and all target commands to be executed are input in the command control page of the control terminal, so that the control terminal can send all the input target commands to the mobile terminal through the network communication service. The mobile terminal can receive all target commands which need to be executed currently through the network communication service.
When the control end is a web page end, the target page opened in the control end based on the network address information of the mobile end is derived from the mobile end, and a corresponding target page can be configured in the mobile end in advance. For example, after the network address information of the mobile terminal is input in the control terminal, the control terminal may directly obtain the target page for inputting the instruction from the mobile terminal, and display the target page in the control terminal. The control end can directly communicate with the mobile end without depending on a central server, so that the command execution of decentralization is realized, and the command execution efficiency is improved.
S130, executing the received target command.
Specifically, after receiving all the target commands, the mobile terminal may perform command analysis on each target command, and execute each target command, thereby completing the command execution operation. The user only needs to input the target command based on the network address information of the mobile terminal in the control terminal in the whole command execution process, other operations are not needed, and dependence on the USB data line and the centralized equipment is reduced, so that the command execution operation is greatly simplified, and the command execution efficiency is improved. And mobile end command execution of a single node is achieved.
According to the technical scheme, the network communication service between the mobile terminal and the control terminal is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, the target command is only needed to be input in the control terminal based on the network address information of the mobile terminal, other operations are not needed, the command execution operation is greatly simplified, and the command execution efficiency is improved.
Fig. 2 is a flowchart of a command execution method according to an embodiment of the present invention, where the embodiment is applicable to a case where a control terminal with a network communication function sends a command to be executed to a mobile terminal for execution. The method can be executed by a command execution device, and the device can be realized by software and/or hardware and is integrated at a control end with a network communication function. As shown in fig. 2, the method specifically includes the following steps:
s210, acquiring network address information of the mobile terminal.
The mobile terminal may refer to any mobile device that needs to execute an external control command. For example, the mobile terminal may be, but is not limited to, a cell phone, tablet computer, etc. The operating system of the mobile terminal may be, but is not limited to, an android system or ios system. The control terminal may refer to a web page terminal, a client terminal having a network communication function, and other application programs developed using HTTP protocol, webSocket protocol, or TCP protocol, etc. The web page end may refer to a terminal with a web page browsing function. For example, the web page end may refer to a browser in a terminal device such as a mobile phone, a desktop computer, a tablet computer, and the like. The control terminal has a network communication function. The mobile terminal does not have a function of performing network communication with the control terminal.
The network address information of the mobile terminal can be used to characterize the location information of the network communication service opened in the mobile terminal. The network address information of the mobile terminal may include mobile terminal IP address information and port number information; alternatively, the network address information may include mobile side domain name information and port number information. Wherein, mobile terminal IP address information and mobile terminal domain name information can be used to characterize the specific network location of the mobile terminal. The port number information may refer to a port number of a network communication service opened in the mobile terminal in order to distinguish between different application services in the network.
Specifically, the network address information of the mobile terminal can be queried from the mobile terminal log, and the network address information of the mobile terminal is input into the control terminal. For example, the network address information of the mobile terminal is input in a page search box of the control terminal. Or, the network address information of the mobile terminal is input in the network configuration interface of the control terminal, so that the control terminal can obtain the network address information of the mobile terminal input by the user.
S220, acquiring a target command input based on the network address information.
The target command may refer to a command to be executed by the mobile terminal. For example, the target command may be an update system command, an install software command, a grab mobile side log command, or a get mobile side status command, etc. The number of target commands may be one or more, the specific number of which is determined by user input.
Specifically, all target commands to be executed can be input in the control terminal based on the obtained network address information of the mobile terminal, so that the control terminal can obtain all target commands input by the user.
Illustratively, S220 may include: displaying a target page corresponding to the mobile terminal based on the network address information; and acquiring a target command input on the target page. The target page may be preset, and is used for configuring a page of the mobile terminal to be subjected to the command.
Specifically, the control end can determine and display the target page corresponding to the network address information based on the network address information of the mobile end input by the user in the page search box. And the user can input all target commands to be executed on the target page, and after the input is completed, the control end can acquire all target commands input by the user and trigger the sending operation of the target commands by clicking the submit button. Or after the network configuration is completed by inputting the network address information of the mobile terminal in the network configuration interface of the control terminal, all target commands to be executed can be input in the command control page of the control terminal.
When the control end is a web page end, the target page opened in the control end based on the network address information of the mobile end is derived from the mobile end, and a corresponding target page can be configured in the mobile end in advance. For example, after the network address information of the mobile terminal is input in the control terminal, the control terminal may directly obtain the target page for inputting the instruction from the mobile terminal, and display the target page in the control terminal. The control end can directly communicate with the mobile end without depending on a central server, so that the command execution of decentralization is realized, and the command execution efficiency is improved.
And S230, sending the target command to the mobile terminal through the network communication service between the mobile terminal and the control terminal which are started in advance, so that the mobile terminal executes the received target command.
The network communication service may be a service for providing information transfer between the mobile terminal and the control terminal. Specifically, the network communication service between the mobile terminal and the control terminal may be started in the mobile terminal in advance. The specific opening process of the network communication service is as follows: and opening a socket port in the mobile terminal, and opening network communication service between the mobile terminal and the control terminal based on a preset network communication protocol through the socket port. For example, a network communication service based on the hypertext transfer protocol may be started through the opened socket port, that is, a virtual Http Server service is started in the mobile terminal. Or, a WebSocket protocol-based network communication service can be started through the opened socket port, that is, a virtual WebSocket Server service is started in the mobile terminal. By starting the network communication service in the mobile terminal, the mobile terminal has the function of communicating with the control terminal, so that the point-to-point direct access is realized, the connection is not needed by a data line, and the command execution of the mobile terminal is quickly realized.
After the mobile terminal starts the network communication service, the control terminal can send all obtained target commands to the mobile terminal through the network communication service. The mobile terminal can receive all target commands which need to be executed currently through the network communication service, and conduct command analysis on each received target command, and execute each target command, so that command execution operation is completed.
It should be noted that, the user only needs to input the target command based on the network address information of the mobile terminal in the control terminal, and other operations are not needed, so that the dependence on the USB data line and the centralized equipment is reduced, the command execution operation is greatly simplified, and the command execution efficiency is improved. And mobile end command execution of a single node is achieved.
According to the technical scheme, the network communication service between the mobile terminal and the control terminal is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, the target command is only needed to be input in the control terminal based on the network address information of the mobile terminal, other operations are not needed, the command execution operation is greatly simplified, and the command execution efficiency is improved.
On the basis of the above technical solution, after S230, the method further includes: acquiring an execution result of the target command through network communication service; and displaying the execution result of the target command.
Specifically, the control end can acquire the execution result of each input target command in the mobile end through network communication service, and display the execution result of each command in a preset display area of the control end, so that a user can know the execution condition of each command more conveniently, and user experience is greatly improved.
If the preset network communication protocol in the network communication service is a hypertext transfer protocol, sending an execution result acquisition request to the mobile terminal, and receiving an execution result of a target command returned by the mobile terminal based on the result acquisition request; if the preset network communication protocol in the network communication service is WebSocket protocol, receiving an execution result of the target command sent by the mobile terminal after the execution of the target command is finished.
The hypertext transfer protocol is a request response protocol, among others. The WebSocket protocol is a protocol that performs full duplex communications over a single TCP connection. WebSocket may allow the mobile terminal to actively push data to the control terminal.
Specifically, when the opened network communication service is a virtual Http Server service, after sending the target command to the mobile terminal, a polling mode may be adopted to send an execution result acquisition request to the mobile terminal. The mobile terminal responds to the received execution result acquisition request and returns the acquired execution result of the target command, so that the control terminal can actively acquire the execution result of the target command. When the opened network communication service is virtual WebSocket Server service, the mobile terminal can directly send the execution result of the target command to the control terminal in a real-time push mode when the target command is executed, and a request is not required to be sent, so that the control terminal can acquire the execution result of the target command more quickly.
The following is an embodiment of a command execution device provided by the embodiment of the present invention, which belongs to the same inventive concept as the command execution method applied to the mobile terminal in the above embodiment, and details of the embodiment of the command execution device, which are not described in detail, may refer to the embodiment of the command execution method applied to the mobile terminal.
Fig. 3 is a schematic structural diagram of a command execution device according to an embodiment of the present invention, where the embodiment is applicable to a situation that a control end with a network communication function sends a command to be executed to a mobile end for execution. As shown in fig. 3, the device is integrated on a mobile terminal, and specifically includes: a network communication service initiation module 310, a target command reception module 320, and a target command execution module 330.
The network communication service opening module 310 is configured to open a network communication service between the mobile terminal and the control terminal, where the control terminal has a network communication function; a target command receiving module 320, configured to receive, through the network communication service, a target command sent by a control end, where the target command is input in the control end based on network address information of the mobile end; and a target command execution module 330, configured to execute the received target command.
According to the technical scheme, the network communication service between the mobile terminal and the control terminal is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, the target command is only needed to be input in the control terminal based on the network address information of the mobile terminal, other operations are not needed, the command execution operation is greatly simplified, and the command execution efficiency is improved.
Optionally, the network communication service opening module 310 is specifically configured to:
opening a socket port; and starting the network communication service between the mobile terminal and the control terminal based on a preset network communication protocol through the socket port.
Optionally, the preset network communication protocol includes: hypertext transfer protocol or WebSocket protocol.
Optionally, the network address information of the mobile terminal includes mobile terminal IP address information and port number information; or, the network address information includes mobile terminal domain name information and port number information.
The command execution device provided by the embodiment of the invention can execute the command execution method applied to the mobile terminal provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
The following is an embodiment of a command execution device provided by the embodiment of the present invention, which belongs to the same inventive concept as the command execution method applied to the control end in the above embodiment, and details of the embodiment of the command execution device, which are not described in detail, may refer to the embodiment of the command execution method applied to the control end.
Fig. 4 is a schematic structural diagram of a command execution device according to an embodiment of the present invention, where the embodiment is applicable to a situation that a control end sends a command to be executed to a mobile end for execution. As shown in fig. 4, the device is integrated at a control end with a network communication function, and specifically includes: a network address information acquisition module 410, a target command acquisition module 420, and a target command transmission module 430.
The network address information obtaining module 410 is configured to obtain network address information of the mobile terminal; a target command acquisition module 420, configured to input a target command based on the network address information; and a target command sending module 430, configured to send the target command to the mobile terminal through a network communication service between the mobile terminal and a control terminal that is started in advance, so that the mobile terminal executes the received target command.
According to the technical scheme, the network communication service between the mobile terminal and the control terminal is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, the target command is only needed to be input in the control terminal based on the network address information of the mobile terminal, other operations are not needed, the command execution operation is greatly simplified, and the command execution efficiency is improved.
Optionally, the target command obtaining module 420 is specifically configured to:
displaying a target page corresponding to the mobile terminal based on the network address information; and acquiring a target command input on the target page.
Optionally, the apparatus further comprises:
the execution result acquisition module is used for acquiring an execution result of the target command through the network communication service after the target command is sent to the mobile terminal;
and the execution result display module is used for displaying the execution result of the target command.
Optionally, the execution result obtaining module is specifically configured to:
if the preset network communication protocol in the network communication service is a hypertext transfer protocol, sending an execution result acquisition request to the mobile terminal, and receiving an execution result of the target command returned by the mobile terminal based on the result acquisition request;
and if the preset network communication protocol in the network communication service is a WebSocket protocol, receiving an execution result of the target command sent by the mobile terminal after the execution of the target command is finished.
The command execution device provided by the embodiment of the invention can execute the command execution method applied to the control end provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
It should be noted that, in the embodiment of the command execution device, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Fig. 5 is a schematic structural diagram of a command execution system according to an embodiment of the present disclosure, where the embodiment is applicable to a case where a control end sends a command to be executed to a mobile end for execution. As shown in fig. 5, the system specifically includes: a mobile terminal 510 and a control terminal 520 with network communication function.
The mobile terminal 510 is configured to execute the command execution method applied to the mobile terminal 510 provided in the foregoing embodiment. The control end 520 is configured to execute the command execution method applied to the control end 520 provided in the above embodiment.
According to the command execution system in the embodiment of the disclosure, the network communication service between the mobile terminal and the control terminal with the network communication function is started in the mobile terminal, and the control terminal can send the target command input based on the network address information of the mobile terminal to the mobile terminal through the network communication service, so that the point-to-point direct access can be realized by using the started network communication service, a data line is not needed, and only the target command is input based on the network address information of the mobile terminal in the control terminal without other operations, thereby greatly simplifying the command execution operation and improving the command execution efficiency.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Fig. 6 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 6 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing the command execution method steps applied to the mobile terminal provided by the embodiment of the present invention, and the method includes:
starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function; receiving a target command sent by a control end through the network communication service, wherein the target command is input in the control end based on the network address information of the mobile end; and executing the received target command.
Or, the method for executing the command applied to the control end with the network communication function provided by the embodiment of the invention is realized, and the method comprises the following steps:
acquiring network address information of a mobile terminal; acquiring a target command input based on the network address information; and sending the target command to the mobile terminal through a network communication service between the mobile terminal and a control terminal which are started in advance, so that the mobile terminal executes the received target command.
Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the command execution method provided in any embodiment of the present invention.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a command execution method for a mobile terminal as provided by the embodiment of the present invention, the method including:
starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function; receiving a target command sent by a control end through the network communication service, wherein the target command is input in the control end based on the network address information of the mobile end; and executing the received target command.
Or when the program is executed by a processor, the method for executing the command applied to the control end with the network communication function provided by the embodiment of the invention is implemented, and the method comprises the following steps:
acquiring network address information of a mobile terminal; acquiring a target command input based on the network address information; and sending the target command to the mobile terminal through a network communication service between the mobile terminal and a control terminal which are started in advance, so that the mobile terminal executes the received target command.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (13)
1. A command execution method, applied to a mobile terminal, comprising:
starting network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function;
receiving a target command sent by a control end through the network communication service, wherein the target command is input in the control end based on the network address information of the mobile end;
and executing the received target command.
2. The method of claim 1, wherein said enabling network communication services between the mobile terminal and a control terminal comprises:
opening a socket port;
and starting the network communication service between the mobile terminal and the control terminal based on a preset network communication protocol through the socket port.
3. The method of claim 2, wherein the predetermined network communication protocol comprises: hypertext transfer protocol or WebSocket protocol.
4. A method according to any of claims 1-3, wherein the network address information of the mobile terminal comprises mobile terminal IP address information and port number information; or, the network address information includes mobile terminal domain name information and port number information.
5. The command execution method is characterized by being applied to a control end with a network communication function and comprising the following steps:
acquiring network address information of a mobile terminal;
acquiring a target command input based on the network address information;
and sending the target command to the mobile terminal through a network communication service between the mobile terminal and a control terminal which are started in advance, so that the mobile terminal executes the received target command.
6. The method of claim 5, wherein the obtaining the target command input based on the network address information comprises:
displaying a target page corresponding to the mobile terminal based on the network address information;
and acquiring a target command input on the target page.
7. The method of claim 5, further comprising, after sending the target command to the mobile terminal:
acquiring an execution result of the target command through the network communication service;
and displaying the execution result of the target command.
8. The method of claim 7, wherein the obtaining, by the network communication service, the execution result of the target command comprises:
if the preset network communication protocol in the network communication service is a hypertext transfer protocol, sending an execution result acquisition request to the mobile terminal, and receiving an execution result of the target command returned by the mobile terminal based on the result acquisition request;
and if the preset network communication protocol in the network communication service is a WebSocket protocol, receiving an execution result of the target command sent by the mobile terminal after the execution of the target command is finished.
9. A command execution device integrated on a mobile terminal, comprising:
the network communication service opening module is used for opening the network communication service between the mobile terminal and the control terminal, wherein the control terminal has a network communication function;
the target command receiving module is used for receiving a target command sent by the control end through the network communication service, and the target command is input in the control end based on the network address information of the mobile end;
and the target command execution module is used for executing the received target command.
10. A command execution device integrated with a control terminal having a network communication function, comprising:
the network address information acquisition module is used for acquiring the network address information of the mobile terminal;
the target command acquisition module is used for inputting a target command based on the network address information;
and the target command sending module is used for sending the target command to the mobile terminal through the network communication service between the mobile terminal and the control terminal which are started in advance, so that the mobile terminal executes the received target command.
11. A command execution system, the system comprising: the mobile terminal and the control terminal have a network communication function;
wherein the mobile terminal is configured to execute the command execution method according to any one of claims 1 to 4;
the control terminal is configured to execute the command execution method according to any one of claims 5 to 8.
12. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the command execution method of any of claims 1-8.
13. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the command execution method according to any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310538688.8A CN116743906A (en) | 2023-05-12 | 2023-05-12 | Command execution method, device, system, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310538688.8A CN116743906A (en) | 2023-05-12 | 2023-05-12 | Command execution method, device, system, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116743906A true CN116743906A (en) | 2023-09-12 |
Family
ID=87905236
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310538688.8A Pending CN116743906A (en) | 2023-05-12 | 2023-05-12 | Command execution method, device, system, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116743906A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060112171A1 (en) * | 2004-11-19 | 2006-05-25 | Rader Shawn T | System and method to control devices using a remote control device via hypertext transfer protocol (HTTP) |
CN204904015U (en) * | 2015-07-03 | 2015-12-23 | 深圳大学 | Through wireless control system who removes equipment operation |
CN109871288A (en) * | 2018-12-25 | 2019-06-11 | 上海瑞家信息技术有限公司 | Execute method, apparatus, equipment and the medium of android system order |
CN114338632A (en) * | 2021-12-24 | 2022-04-12 | 广州通则康威智能科技有限公司 | Remote terminal control method and device, computer equipment and storage medium |
-
2023
- 2023-05-12 CN CN202310538688.8A patent/CN116743906A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060112171A1 (en) * | 2004-11-19 | 2006-05-25 | Rader Shawn T | System and method to control devices using a remote control device via hypertext transfer protocol (HTTP) |
CN204904015U (en) * | 2015-07-03 | 2015-12-23 | 深圳大学 | Through wireless control system who removes equipment operation |
CN109871288A (en) * | 2018-12-25 | 2019-06-11 | 上海瑞家信息技术有限公司 | Execute method, apparatus, equipment and the medium of android system order |
CN114338632A (en) * | 2021-12-24 | 2022-04-12 | 广州通则康威智能科技有限公司 | Remote terminal control method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102096156B1 (en) | Voice wakeup method, apparatus and readable medium | |
WO2018192487A1 (en) | Method and apparatus for controlling smart device linkage | |
CN108280020B (en) | Monitoring method and device of computer equipment, terminal and computer storage medium | |
CN103365840A (en) | Web-based screenshot taking method and device | |
CN110489440B (en) | Data query method and device | |
US20140040763A1 (en) | Managing active gui elements remotely | |
CN102904959A (en) | Network accelerating method and gateway | |
CN109857575A (en) | Interface call method, device, electronic equipment and storage medium | |
CN108769175A (en) | Remote real machine access control method, device, storage medium and electronic equipment | |
CN110825370A (en) | Mobile terminal application development method, device and system | |
CN114077367A (en) | Method and device for realizing shortcut of android application in Linux system | |
CN112131092A (en) | Page debugging method and device | |
US8793651B2 (en) | Remote card content management using synchronous server-side scripting | |
CN111770043B (en) | Game data communication method, device, storage medium and electronic equipment | |
CN113709243B (en) | Equipment remote control method and device, electronic equipment and storage medium | |
CN113961836A (en) | Page jump method and device, electronic equipment and storage medium | |
US10958726B2 (en) | Method of synchronizing device list in a smart network system, apparatus, and computer storage medium thereof | |
CN103379037A (en) | Route equipment and method and system thereof | |
US8280950B2 (en) | Automatic client-server code generator | |
CN115079885B (en) | System control method and device for double window display, electronic equipment and storage medium | |
CN116743906A (en) | Command execution method, device, system, equipment and storage medium | |
CN114124475B (en) | Network asset port scanning and service identification method and device | |
CN112671814B (en) | Cross-platform equipment development method, device and system | |
CN113641439A (en) | Text recognition and display method, device, electronic equipment and medium | |
CN113821430A (en) | Multi-service testing method and device |
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 |