TW201737065A - Remote command processing method and device - Google Patents

Remote command processing method and device Download PDF

Info

Publication number
TW201737065A
TW201737065A TW106105967A TW106105967A TW201737065A TW 201737065 A TW201737065 A TW 201737065A TW 106105967 A TW106105967 A TW 106105967A TW 106105967 A TW106105967 A TW 106105967A TW 201737065 A TW201737065 A TW 201737065A
Authority
TW
Taiwan
Prior art keywords
remote command
command
response data
remote
switch parameter
Prior art date
Application number
TW106105967A
Other languages
Chinese (zh)
Other versions
TWI738726B (en
Inventor
Xiong Xiao
Kun Wu
xiao-hui Xie
jian-qing Hao
cheng-hao Sun
Original Assignee
Alibaba Group Services Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Services Ltd filed Critical Alibaba Group Services Ltd
Publication of TW201737065A publication Critical patent/TW201737065A/en
Application granted granted Critical
Publication of TWI738726B publication Critical patent/TWI738726B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Selective Calling Equipment (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

Provided in embodiments of the present application are a remote command processing method and device, the method specifically comprising: receiving a trigger request of a remote command; acquiring, according to the trigger request, the remote command and an on-off parameter corresponding thereto; transmitting to a server the remote command; receiving response data returned by the server for the remote command; and if the on-off parameter corresponding to the remote command is off, then outputting the response data. The embodiments of the present application can reduce time consumed by intercepting and querying operation for returned data, thereby improving IO processing performance, and accelerating execution of a remote command.

Description

遠端命令的處理方法和裝置 Remote command processing method and device

本申請關於通信技術領域,特別是關於一種遠端命令的處理方法、以及一種遠端命令的處理裝置。 The present application relates to the field of communication technologies, and in particular, to a method for processing a remote command and a processing device for a remote command.

隨著資訊時代的持續發展,IT(資訊技術,Information Technology)運維已經成為IT服務內涵中重要的組成部分。面對越來越複雜的業務,面對越來越多樣化的用戶需求,不斷擴展的IT應用需要越來越合理的模式來保障IT服務能靈活便捷、安全穩定地持續保障,這種模式中的保障因素就是IT運維。 With the continuous development of the information age, IT (Information Technology) operation and maintenance has become an important part of the IT service. Faced with increasingly complex businesses, in the face of increasingly diverse user needs, ever-expanding IT applications require more and more reasonable models to ensure that IT services are flexible, convenient, secure and stable. The guarantee factor is IT operation and maintenance.

Fabric是目前開源社群中被廣泛使用的SSH(安全外殼協議,Secure Shell)命令等遠端命令的遠端下發執行框架,其提供的功能主要包括:執行本地或遠端命令、上傳/下載檔案,以及其他協助工具,如提示用戶輸入、中止執行等。基於Fabric,各企業可方便地開發出自身的運維系統。 Fabric is a remote execution framework for remote commands such as SSH (Secure Shell Protocol) commands widely used in the open source community. Its functions include: executing local or remote commands, uploading/downloading. Files, and other assistance tools, such as prompting user input, aborting execution, etc. Based on Fabric, companies can easily develop their own operation and maintenance systems.

目前的遠端命令具體可以包括:互動式命令和非互動式命令兩種。其中,互動式命令可以為在命令執行過程 中,需要用戶端進行交互才能繼續執行的命令;最常見的場景為:在刪除針對某個系統檔的互動式命令時,運維系統會輸出需要輸入管理員密碼的提示,並且,在用戶端輸入管理員密碼後,該互動式命令才被繼續執行。非互動式命令可以為在命令執行過程中,不需要用戶端進行交互即可完成整個命令執行過程的命令。 The current remote command may specifically include: an interactive command and a non-interactive command. Among them, the interactive command can be in the command execution process The command that requires the user to interact to continue execution; the most common scenario is: when deleting an interactive command for a system file, the operation and maintenance system will output a prompt to enter the administrator password, and at the user end After entering the administrator password, the interactive command is executed. The non-interactive command can be a command that can complete the entire command execution process without the need for the user to interact during the execution of the command.

為了判斷當前遠端命令是否需要用戶端進行交互,本領域中的傳統方案通常為:用戶端對遠端命令的返回資料進行攔截,並查找該返回資料中是否包含預置關鍵字,若包含,則確認當前遠端命令需要用戶端進行交互,若不包含,則確認當前遠端命令不需要用戶端進行交互。例如,上述查找該返回資料中是否包含預置關鍵字的過程具體可以包括:用戶端可以不停地讀取伺服器的返回資料,並判斷該返回資料中是否包含password、sudo、input等預置關鍵字。 In order to determine whether the current remote command requires the user to interact, the traditional solution in the field is usually: the user intercepts the returned data of the remote command, and searches whether the returned data contains the preset keyword, if included, The current remote command needs to be interacted with by the user. If not, the current remote command does not need to be interacted with by the user. For example, the process for searching whether the returned data includes the preset keyword may include: the user end can continuously read the return data of the server, and determine whether the returned data includes a preset such as password, sudo, input, etc. Keyword.

然而,在當前遠端命令為非互動式命令時,傳統方案也會進行相應的攔截和查找操作,上述攔截和查找操作將會佔用用戶端與伺服器之間的IO(輸入輸出,Input-Output)處理時間。尤其是在上述返回資料為大資料量的資料時,由於是按段進行返回資料的攔截和查找操作,因此需要針對單個遠程命令的返回資料重複執行多次攔截和查找操作,從而大大地降低了IO處理性能,並且,降低了遠端命令的執行速度。而對於大規模的運維系統而言,其遠端命令的耗時將嚴重拖慢整個運維系統的處理速度。 However, when the current remote command is a non-interactive command, the traditional solution will perform corresponding interception and lookup operations. The above interception and lookup operations will occupy the IO between the client and the server (input and output, Input-Output) ) Processing time. Especially when the above-mentioned returned data is a large amount of data, since the returning data is intercepted and searched by segment, it is necessary to repeatedly perform multiple interception and search operations for the return data of a single remote command, thereby greatly reducing the number of interception and search operations. IO handles performance and reduces the execution speed of remote commands. For large-scale operation and maintenance systems, the time consumption of remote commands will seriously slow down the processing speed of the entire operation and maintenance system.

本申請實施例所要解決的技術問題是提供一種遠端命令的處理方法,能夠節省返回資料的攔截和查找操作所花費的耗時,從而能夠提高IO處理性能,並且,能夠提高遠端命令的執行速度。 The technical problem to be solved by the embodiments of the present application is to provide a method for processing a remote command, which can save time spent on intercepting and searching operations of returning data, thereby improving IO processing performance and improving execution of remote commands. speed.

相應的,本申請實施例還提供了一種遠端命令的處理裝置,用以保證上述方法的實現及應用。 Correspondingly, the embodiment of the present application further provides a remote command processing device to ensure implementation and application of the foregoing method.

為了解決上述問題,本申請公開了一種遠端命令的處理方法,包括:接收遠端命令的觸發請求;依據所述觸發請求,獲取遠端命令及其對應的開關參數;向伺服器發送所述遠端命令;接收所述伺服器針對所述遠端命令返回的回應資料;在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 In order to solve the above problem, the present application discloses a method for processing a remote command, including: receiving a trigger request of a remote command; acquiring a remote command and its corresponding switch parameter according to the trigger request; and transmitting the a remote command; receiving response data returned by the server for the remote command; and outputting the response data when the switch parameter corresponding to the remote command is off.

可選地,所述觸發請求中攜帶有命令檔的位址資訊,則所述依據所述觸發請求,獲取遠端命令及其對應的開關參數的步驟,包括:依據所述位址資訊,從所述命令檔中讀取遠端命令及其對應的開關參數。 Optionally, the triggering request carries the address information of the command file, and the step of acquiring the remote command and the corresponding switch parameter according to the trigger request, including: according to the address information, The remote command and its corresponding switch parameters are read in the command file.

可選地,所述觸發請求中攜帶有命令檔的位址資訊和所述命令檔中遠端命令的開關參數,則所述依據所述觸發 請求,獲取遠端命令及其對應的開關參數的步驟,包括:依據所述位址資訊,從所述命令檔中讀取遠端命令,並將讀取的遠端命令與所述觸發請求中攜帶的開關參數進行關聯。 Optionally, the trigger request carries the address information of the command file and the switch parameter of the remote command in the command file, and the triggering is performed according to the triggering The requesting, obtaining the remote command and the corresponding switch parameter, comprising: reading the remote command from the command file according to the address information, and reading the remote command and the trigger request The carried switch parameters are associated.

可選地,所述方法還包括:在所述遠端命令對應的開關參數為開啟時,將所述回應資料進行攔截;從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;輸出所述互動式命令對應的交互提示資訊。 Optionally, the method further includes: intercepting the response data when the switch parameter corresponding to the remote command is enabled; and searching for an interactive command that requires the user to interact from the intercepted response data; Outputting interactive prompt information corresponding to the interactive command.

可選地,所述接收所述伺服器針對所述遠端命令返回的回應資料的步驟,包括:從用戶端的通訊端介面中讀取所述伺服器針對所述遠端命令返回的回應資料段。 Optionally, the step of receiving the response data returned by the server for the remote command comprises: reading, from a communication interface of the client, a response data segment returned by the server for the remote command .

可選地,所述在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出的步驟,包括:在所述回應資料段的內容不為空、且所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 Optionally, the step of outputting the response data when the switch parameter corresponding to the remote command is off includes: the content of the response data segment is not empty, and the remote command corresponds to The response data is output when the switch parameter is off.

另一方面,本申請公開了一種遠端命令的處理裝置,包括:第一接收模組,用於接收遠端命令的觸發請求;獲取模組,用於依據所述觸發請求,獲取遠端命令及其對應的開關參數;發送模組,用於向伺服器發送所述遠端命令; 第二接收模組,用於接收所述伺服器針對所述遠端命令返回的回應資料;以及第一輸出模組,用於在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 On the other hand, the present disclosure discloses a remote command processing device, including: a first receiving module, configured to receive a trigger request of a remote command; and an acquiring module, configured to obtain a remote command according to the trigger request And a corresponding switch parameter; a sending module, configured to send the remote command to the server; a second receiving module, configured to receive response data returned by the server for the remote command, and a first output module, configured to: when the switch parameter corresponding to the remote command is off Respond to data output.

可選地,所述觸發請求中攜帶有命令檔的位址資訊,則所述獲取模組,包括:第一獲取子模組,用於依據所述位址資訊,從所述命令檔中讀取遠端命令及其對應的開關參數。 Optionally, the triggering request carries the address information of the command file, and the acquiring module includes: a first acquiring submodule, configured to read from the command file according to the address information. Take the remote command and its corresponding switch parameters.

可選地,所述觸發請求中攜帶有命令檔的位址資訊和所述命令檔中遠端命令的開關參數,則所述獲取模組,包括:第二獲取子模組,用於依據所述位址資訊,從所述命令檔中讀取遠端命令,並將讀取的遠端命令與所述觸發請求中攜帶的開關參數進行關聯。 Optionally, the triggering request carries the address information of the command file and the switch parameter of the remote command in the command file, and the acquiring module includes: a second acquiring sub-module, configured to The address information is read, the remote command is read from the command file, and the read remote command is associated with the switch parameter carried in the trigger request.

可選地,所述裝置還包括:攔截模組,用於在所述遠端命令對應的開關參數為開啟時,將所述回應資料進行攔截;查找模組,用於從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;第二輸出模組,用於輸出所述互動式命令對應的交互提示資訊。 Optionally, the device further includes: an intercepting module, configured to intercept the response data when the switch parameter corresponding to the remote command is turned on; and the searching module is configured to use the intercepted response data Searching for an interactive command that requires the user to interact; and a second output module for outputting the interactive prompt information corresponding to the interactive command.

與現有技術相比,本申請實施例包括以下優點:本申請實施例可以依據遠端命令的觸發請求,獲取遠端命令及其對應的開關參數,並在所述遠端命令對應的開 關參數為關閉時,將所述回應資料輸出;由於本申請實施例在所述遠端命令對應的開關參數為關閉時,可以不進行返回資料的攔截和查找操作,因此,能夠節省返回資料的攔截和查找操作所花費的耗時,從而能夠提高IO處理性能,並且,能夠提高遠端命令的執行速度。 Compared with the prior art, the embodiment of the present application includes the following advantages: the embodiment of the present application can obtain the remote command and its corresponding switch parameter according to the trigger request of the remote command, and open corresponding to the remote command. When the off parameter is off, the response data is output; since the switch parameter corresponding to the remote command is off when the embodiment of the present application is closed, the intercepting and searching operations of the returned data may not be performed, thereby saving the returned data. The time taken to intercept and find operations can improve IO processing performance and increase the execution speed of remote commands.

100‧‧‧用戶端 100‧‧‧ Client

200‧‧‧伺服器 200‧‧‧Server

601‧‧‧第一接收模組 601‧‧‧First Receiver Module

602‧‧‧獲取模組 602‧‧‧Get Module

603‧‧‧發送模組 603‧‧‧Transmission module

604‧‧‧第二接收模組 604‧‧‧second receiving module

605‧‧‧第一輸出模組 605‧‧‧First output module

圖1是本申請的一種遠端命令的處理方法的應用環境的示意圖;圖2是本申請的一種遠端命令的處理方法實施例一的步驟流程圖;圖3是本申請的一種遠端命令的處理方法實施例二的步驟流程圖;圖4是本申請的一種回應資料的示意;圖5是本申請的一種遠端命令的處理方法實施例三的步驟流程圖;以及圖6是本申請的一種遠端命令的處理裝置實施例的結構框圖。 1 is a schematic diagram of an application environment of a method for processing a remote command according to the present application; FIG. 2 is a flow chart of a first embodiment of a method for processing a remote command according to the present application; FIG. 3 is a remote command of the present application; FIG. 4 is a schematic diagram of a response data of the present application; FIG. 5 is a flow chart of the third embodiment of the processing method of the remote command of the present application; and FIG. 6 is the flow chart of the third embodiment; A block diagram of a processing device embodiment of a remote command.

為使本申請的上述目的、特徵和優點能夠更加明顯易懂,下面結合附圖和具體實施方式對本申請作進一步詳細的說明。 The above described objects, features and advantages of the present application will become more apparent and understood.

針對傳統方案中存在的大資料量傳輸場景中非互動式 命令的判斷過程導致IO處理性能低、以及遠端命令的執行速度慢的技術問題,本申請實施例可以依據遠端命令的觸發請求,獲取遠端命令及其對應的開關參數,並在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出;由於本申請實施例在所述遠端命令對應的開關參數為關閉時,可以不進行返回資料的攔截和查找操作,因此,能夠節省返回資料的攔截和查找操作所花費的耗時,從而能夠提高IO處理性能,並且,能夠提高遠端命令的執行速度。 Non-interactive in the large data volume transmission scene existing in the traditional scheme The determining process of the command causes the IO processing performance to be low, and the execution speed of the remote command is slow. The embodiment of the present application may obtain the remote command and its corresponding switch parameter according to the trigger request of the remote command, and When the switch parameter corresponding to the remote command is off, the response data is output. Because the switch parameter corresponding to the remote command is closed, the interception and search operation of the return data may not be performed. It can save time-consuming interception and lookup operations of returning data, thereby improving IO processing performance and improving the execution speed of remote commands.

本申請實施例可以應用於Fabric、Ansible等運維系統的應用場景中,用於提高上述運維系統的提高IO處理性能及遠端命令的執行速度,可以理解,本申請實施例對於具體的應用場景不加以限制。 The embodiment of the present application can be applied to an application scenario of a service system such as a fabric or an anisible, and is used to improve the IO processing performance and the execution speed of the remote command in the operation and maintenance system. The scene is not limited.

本申請實施例提供的遠端命令的處理方法可應用於圖1所示的應用環境中,如圖1所示,用戶端100與伺服器200可以位於有線或無線網路中,透過該有線或無線網路,用戶端100與伺服器200進行資料交互。 The processing method of the remote command provided by the embodiment of the present application can be applied to the application environment shown in FIG. 1. As shown in FIG. 1, the client 100 and the server 200 can be located in a wired or wireless network, through the wired or In the wireless network, the client 100 interacts with the server 200 for data.

具體地,用戶端100可以運行在物理機或者虛擬機器上,其可以接收用戶輸入的遠端命令的觸發請求,依據所述觸發請求,獲取遠端命令及其對應的開關參數,並向伺服器發送所述遠端命令,以使伺服器200獲取所述遠端命令的回應資料。其中,在所述遠端命令為互動式命令時,所述回應資料中可以包括所述遠端命令的交互提示資訊,在所述遠端命令為非互動式命令時,所述回應資料中可以 包括所述遠端命令的處理結果,可以理解,本申請實施例對於具體的回應資料不加以限制。 Specifically, the client 100 can be run on a physical machine or a virtual machine, and can receive a trigger request of a remote command input by the user, and obtain a remote command and its corresponding switch parameter according to the trigger request, and send the server to the server. Sending the remote command to enable the server 200 to obtain the response data of the remote command. The response data may include the interactive prompt information of the remote command when the remote command is an interactive command. When the remote command is a non-interactive command, the response data may be Including the processing result of the remote command, it can be understood that the embodiment of the present application does not limit the specific response information.

並且,用戶端100還可以接收所述伺服器200針對所述遠端命令返回的回應資料,並在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。本申請實施例中,上述開關參數具體可以包括關閉或開啟,其中,關閉可用於指示不進行回應資料的攔截和查找操作,開啟可用於指示進行回應資料的攔截和查找操作。 Moreover, the client 100 can also receive the response data returned by the server 200 for the remote command, and output the response data when the switch parameter corresponding to the remote command is off. In the embodiment of the present application, the foregoing switch parameter may specifically include turning off or on, wherein the closing may be used to indicate that the intercepting and searching operations of the response data are not performed, and the opening and the searching operation for indicating the response data may be turned on.

可以理解,上述圖1所示應用環境只是作為應用示例,本申請實施例中輸入流程的目的之一在於,在所述遠端命令對應的開關參數為關閉時,可以不進行返回資料的攔截和查找操作,從而可以解決大資料量傳輸場景中非互動式命令的判斷過程導致IO處理性能低、以及遠端命令的執行速度慢的技術問題,而對遠端命令的處理流程的具體應用環境不加以限制。 It can be understood that the application environment shown in FIG. 1 is only used as an application example. One of the purposes of the input process in the embodiment of the present application is that when the switch parameter corresponding to the remote command is off, the interception of the returned data may not be performed. The search operation can solve the technical problem that the non-interactive command judgment process in the large data transmission scenario leads to low IO processing performance and slow execution speed of the remote command, and the specific application environment of the remote command processing flow is not Limit it.

方法實施例一 Method embodiment 1

參照圖2,示出了本申請的一種遠端命令的處理方法實施例一的步驟流程圖,具體可以包括如下步驟: Referring to FIG. 2, a flow chart of a first embodiment of a method for processing a remote command according to the present application is shown, which may specifically include the following steps:

步驟201、接收遠端命令的觸發請求; Step 201: Receive a trigger request of a remote command.

步驟202、依據所述觸發請求,獲取遠端命令及其對應的開關參數;本申請實施例中,上述觸發請求可由用戶輸入,其可用於觸發遠端命令,以使用戶端向伺服器發送對應遠端命 令。 Step 202: Acquire a remote command and a corresponding switch parameter according to the trigger request. In the embodiment of the present application, the trigger request may be input by a user, and may be used to trigger a remote command, so that the user sends a corresponding response to the server. Remote life make.

本技術領域中,用戶端會對遠端命令的返回資料進行攔截,並查找該返回資料中是否包含預置關鍵字,若包含,則確認當前遠端命令需要用戶端進行交互。其中,查找該返回資料中是否包含預置關鍵字的過程具體可以包括:用戶端可以不停地讀取伺服器的返回資料,並判斷該返回資料中是否包含password、sudo、input等預置關鍵字。 In the technical field, the UE intercepts the returned data of the remote command, and searches whether the returned data includes the preset keyword. If yes, it confirms that the current remote command requires the user to interact. The process of searching for the preset keyword in the returned data may include: the user end can continuously read the return data of the server, and determine whether the return data includes a preset key such as password, sudo, input, etc. word.

而本申請實施例中的用戶可以包括:具有專業知識的運維人員,上述運維人員通常對遠端命令比較熟悉,故對於即將觸發的遠端命令而言,運維人員熟悉遠端命令中是否包含上述預置關鍵字、以至於能夠明確其是否需要用戶端進行交互,因此,本申請實施例的用戶具備準確設置即將觸發的遠端命令的開關參數的能力,具體地,在即將觸發的遠端命令需要用戶端進行交互(亦即為互動式命令)時,使用者可以將對應的開關參數設置為開啟,或者,在即將觸發的遠端命令不需要用戶端進行交互(亦即為非互動式命令)時,使用者可以將對應的開關參數設置為關閉。 The user in the embodiment of the present application may include: an operation and maintenance personnel with professional knowledge. The operation and maintenance personnel are generally familiar with the remote command, so the operation and maintenance personnel are familiar with the remote command for the remote command to be triggered. Whether the preset keyword is included in the above-mentioned preset keyword, so that the user of the embodiment of the present application has the ability to accurately set the switch parameter of the remote command to be triggered, specifically, the triggering When the remote command requires the user to interact (that is, an interactive command), the user can set the corresponding switch parameter to be enabled, or the remote command to be triggered does not require the user to interact (ie, is not When the interactive command is used, the user can set the corresponding switch parameter to off.

本申請實施例可以提供依據所述觸發請求,獲取遠端命令及其對應的開關參數的如下技術方案: An embodiment of the present application may provide the following technical solutions for obtaining a remote command and its corresponding switch parameter according to the trigger request:

技術方案1 Technical solution 1

技術方案1中,所述觸發請求中可以攜帶有命令檔的 位址資訊,則所述依據所述觸發請求,獲取遠端命令及其對應的開關參數的步驟202,具體可以包括: In the technical solution 1, the trigger request may carry a command file. And the step 202 of obtaining the remote command and the corresponding switch parameter according to the triggering request, which may include:

步驟A1、依據所述位址資訊,從所述命令檔中讀取遠端命令及其對應的開關參數。 Step A1: Read the remote command and its corresponding switch parameter from the command file according to the address information.

本申請實施例中,命令檔中可以記錄有一個或多個遠端命令,該命令檔通常由用戶編寫得到,故用戶能夠準確地確定該命令檔中是否包含上述預置關鍵字、以至於能夠明確該命令檔中遠端命令是否需要用戶端進行交互。因此,在用戶明確該命令檔中遠端命令是否需要用戶端進行交互的基礎上,其可以在該命令檔中記錄對應的開關參數。其中,該命令檔中記錄的開關參數的數目可以為一個,以說明該命令檔中存在需要用戶端進行交互的遠端命令。或者,該命令檔中記錄的開關參數的數目可以與遠端命令的數目相同,以標識每個遠端命令是否需要用戶端進行交互。可以理解,本申請實施例對於開關參數在上述命令檔中的具體記錄方式不加以限制。 In the embodiment of the present application, one or more remote commands may be recorded in the command file, and the command file is usually prepared by the user, so that the user can accurately determine whether the preset keyword is included in the command file, so that It is clear whether the remote command in the command file requires the client to interact. Therefore, on the basis that the user clarifies whether the remote command requires the user to interact in the command file, the corresponding switch parameter can be recorded in the command file. The number of the switch parameters recorded in the command file may be one, to indicate that there is a remote command in the command file that requires the user to interact. Alternatively, the number of switch parameters recorded in the command file may be the same as the number of remote commands to identify whether each remote command requires the user to interact. It can be understood that the specific recording manner of the switch parameter in the above command file is not limited in the embodiment of the present application.

在本申請的一種可選實施例中,上述命令檔所記錄的遠端命令及開關參數均可以具有對應的預設位置,例如,開關參數的預設位置可以為第一行或者最後一行或者預設行號等,故步驟A1可以首先依據上述位址資訊載入上述命令檔,並按照上述預設位置從所述命令檔中讀取遠端命令及其對應的開關參數。可以理解,本申請實施例對於依據所述位址資訊從所述命令檔中讀取遠端命令及其對應的開關參數的具體讀取過程不加以限制。 In an optional embodiment of the present application, the remote command and the switch parameter recorded by the command file may have corresponding preset positions. For example, the preset position of the switch parameter may be the first line or the last line or The line number is set, so step A1 may first load the command file according to the address information, and read the remote command and its corresponding switch parameter from the command file according to the preset position. It can be understood that the specific reading process of reading the remote command and its corresponding switch parameter from the command file according to the address information is not limited.

技術方案2 Technical solution 2

技術方案2中,所述觸發請求中可以攜帶有命令檔的位址資訊和所述命令檔中遠端命令的開關參數,則所述依據所述觸發請求,獲取遠端命令及其對應的開關參數的步驟202,具體可以包括: In the technical solution 2, the trigger request may carry the address information of the command file and the switch parameter of the remote command in the command file, and the remote command and the corresponding switch are obtained according to the trigger request. Step 202 of the parameter may specifically include:

步驟B1、依據所述位址資訊,從所述命令檔中讀取遠端命令,並將讀取的遠端命令與所述觸發請求中攜帶的開關參數進行關聯。其中,上述關聯可以將遠端命令與對應的開關參數關聯,假設上述命令檔中記錄有M個遠端命令,觸發請求中攜帶有N個開關參數,則可以建立M個遠端命令與N個開關參數之間的映射關係。 Step B1: The remote command is read from the command file according to the address information, and the read remote command is associated with the switch parameter carried in the trigger request. The association may associate the remote command with the corresponding switch parameter. If the M command is recorded in the command file, and the switch request carries N switch parameters, the M remote command and the N command may be established. The mapping relationship between switch parameters.

相對於技術方案1在命令檔中同時記錄遠端命令和開關參數,技術方案2可以僅僅在命令檔中記錄遠端命令,並透過觸發請求攜帶所述命令檔中遠端命令的開關參數;這樣,步驟B1可以依據所述位址資訊從所述命令檔中讀取遠端命令,並將讀取的遠端命令與所述觸發請求中攜帶的開關參數進行關聯,以獲取遠端命令及其對應的開關參數。 Compared with the technical solution 1, the remote command and the switch parameter are simultaneously recorded in the command file, and the technical solution 2 can record the remote command only in the command file, and carry the switch parameter of the remote command in the command file through the trigger request; The step B1 can read the remote command from the command file according to the address information, and associate the read remote command with the switch parameter carried in the trigger request to obtain the remote command and Corresponding switch parameters.

需要說明的是,本申請實施例中的觸發請求可由使用者透過鍵盤、滑鼠等輸入方式輸入,本申請實施例對於上述觸發請求的具體獲取方式不加以限制。 It should be noted that the triggering request in the embodiment of the present application may be input by the user through a keyboard, a mouse, or the like. The specific manner of obtaining the trigger request is not limited in the embodiment of the present application.

可以理解,上述技術方案1和技術方案2只是作為依據所述觸發請求,獲取遠端命令及其對應的開關參數的可 選技術方案,實際上,本領域技術人員還可以根據實際應用需求,採用依據所述觸發請求,獲取遠端命令及其對應的開關參數的其他技術方案,例如,可以提供預置介面,以使使用者透過該預置介面提交觸發請求,並在該觸發請求中攜帶遠端命令及其對應的開關參數,其中,該觸發請求中可以攜帶多個遠端命令及其對應的開關參數、或者可以攜帶多個遠端命令及每個遠端命令對應的開關參數等,本申請實施例對於依據所述觸發請求,獲取遠端命令及其對應的開關參數的具體技術方案不加以限制。 It can be understood that the foregoing technical solution 1 and technical solution 2 are only used as the triggering request to obtain the remote command and its corresponding switch parameter. In the technical solution, in fact, those skilled in the art may also adopt other technical solutions for obtaining a remote command and its corresponding switch parameter according to the trigger request according to actual application requirements, for example, a preset interface may be provided. The user submits a trigger request through the preset interface, and the remote command and the corresponding switch parameter are carried in the trigger request, where the trigger request may carry multiple remote commands and their corresponding switch parameters, or may The specific technical solution for obtaining the remote command and the corresponding switch parameter according to the trigger request is not limited.

步驟203、向伺服器發送所述遠端命令;在本申請的一種應用示例中,用戶端可以向伺服器發送所述遠端命令對應的字串,以通知伺服器執行上述遠端命令,其中,可以一次發送一個遠端命令,也可以一次發送多個遠端命令。 Step 203: Send the remote command to the server. In an application example of the application, the user may send a string corresponding to the remote command to the server, to notify the server to execute the remote command, where You can send one remote command at a time, or you can send multiple remote commands at once.

而伺服器在接收到上述遠端命令後,可以判斷上述遠端命令是否需要用戶端進行交互(例如,是否需要輸入密碼等),若需要,則可以在向用戶端發送的回應資料中攜帶對應的交互提示資訊,若不需要,則可以在向用戶端發送的回應資料中攜帶對應的處理結果。 After receiving the remote command, the server may determine whether the remote command requires the user to interact (for example, whether a password is required, etc.), and if necessary, carry the corresponding response data sent to the user end. The interactive prompt information, if not required, can carry the corresponding processing result in the response data sent to the client.

步驟204、接收所述伺服器針對所述遠端命令返回的回應資料;在本申請的一種可選實施例中,所述接收所述伺服器針對所述遠端命令返回的回應資料的步驟204,具體可以包括: Step 204: Receive response data returned by the server for the remote command. In an optional embodiment of the present application, the step 204 of receiving the response data returned by the server for the remote command Specifically, the method may include:

步驟C1、從用戶端的SOCKET(通訊端)介面中讀取所述伺服器針對所述遠端命令返回的回應資料段。 Step C1: Read a response data segment returned by the server for the remote command from a SOCKET interface of the client.

上述可選實施例可以適用於大資料量傳輸場景,其中,上述通訊端介面可由用戶端的作業系統提供,上述回應資料段中可以包含大資料量的資料,例如,其長度可以為4096 bytes,可以理解,本申請實施例對於上述回應資料段的具體長度不加以限制。 The foregoing optional embodiment may be applicable to a large data volume transmission scenario, wherein the communication interface may be provided by a client operating system, and the response data segment may include a large amount of data. For example, the length may be 4096 bytes. It is understood that the specific length of the above response data segment is not limited in the embodiment of the present application.

步驟205、在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 Step 205: Output the response data when the switch parameter corresponding to the remote command is off.

在本申請的一種可選實施例中,上述步驟205將所述回應資料輸出的過程具體可以包括:在所述遠端命令對應的開關參數為關閉時,直接透過資料流程將上述回應資料展示在顯示裝置上,亦即,可以直接將上述回應資料提供給使用者;由於對於非互動式命令,可以不進行返回資料的攔截和查找操作,因此,能夠節省返回資料的攔截和查找操作所花費的耗時。 In an optional embodiment of the present application, the step 205 of the step of outputting the response data may include: displaying the response data directly through the data flow when the switch parameter corresponding to the remote command is off On the display device, that is, the response data can be directly provided to the user; since the non-interactive command can not intercept and search the returned data, the cost of intercepting and searching for the returned data can be saved. time consuming.

在本申請實施例的另一種可選實施例中,在從用戶端的SOCKET(通訊端)介面中讀取所述伺服器針對所述遠端命令返回的回應資料段的情況下,所述在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出的步驟205,具體可以包括:在所述回應資料段的內容不為空、且所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。在實際應用中,本可選實施例可以首先判斷回應資料段的內容是否為空,若不為空,則可以判斷所述遠端 命令對應的開關參數是否為關閉,在所述回應資料段的內容不為空、且所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 In another optional embodiment of the embodiment of the present application, in the case that the response data segment returned by the server for the remote command is read from the SOCKET interface of the user end, the When the switch parameter corresponding to the remote command is off, the step 205 of outputting the response data may include: the content of the response data segment is not empty, and the switch parameter corresponding to the remote command is closed. The response data is output. In an actual application, the optional embodiment may first determine whether the content of the response data segment is empty, and if not, the remote end may be determined. Whether the switch parameter corresponding to the command is off, and when the content of the response data segment is not empty, and the switch parameter corresponding to the remote command is off, the response data is output.

在本申請的再一種可選實施例中,在所述回應資料段的內容為空時,可以結束本申請實施例中遠端命令的處理流程。 In a further optional embodiment of the present application, when the content of the response data segment is empty, the processing flow of the remote command in the embodiment of the present application may be ended.

綜上,本申請實施例可以依據遠端命令的觸發請求,獲取遠端命令及其對應的開關參數,並在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出;由於本申請實施例在所述遠端命令對應的開關參數為關閉時,可以不進行返回資料的攔截和查找操作,因此,能夠節省返回資料的攔截和查找操作所花費的耗時,從而能夠提高IO處理性能,並且,能夠提高遠端命令的執行速度。 In summary, the embodiment of the present application may obtain the remote command and its corresponding switch parameter according to the trigger request of the remote command, and output the response data when the switch parameter corresponding to the remote command is off; In the embodiment of the present application, when the switch parameter corresponding to the remote command is off, the intercepting and searching operations of the returned data may not be performed. Therefore, the time taken for the intercepting and searching operations of the returned data can be saved, thereby improving the IO. Processing performance, and can improve the execution speed of remote commands.

方法實施例二 Method embodiment two

參照圖3,示出了本申請的一種遠端命令的處理方法實施例二的步驟流程圖,具體可以包括如下步驟:步驟301、接收遠端命令的觸發請求;步驟302、依據所述觸發請求,獲取遠端命令及其對應的開關參數;步驟303、向伺服器發送所述遠端命令;步驟304、接收所述伺服器針對所述遠端命令返回的回應資料;步驟305、在所述遠端命令對應的開關參數為關閉 時,將所述回應資料輸出;相對於圖2所示方法實施例一,本實施例的方法還可以包括:步驟306、在所述遠端命令對應的開關參數為開啟時,將所述回應資料進行攔截;步驟307、從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;步驟308、輸出所述互動式命令對應的交互提示資訊。 Referring to FIG. 3, a flow chart of the second embodiment of the method for processing a remote command of the present application is shown. The method may include the following steps: Step 301: Receive a trigger request of a remote command; Step 302: According to the trigger request Obtaining a remote command and its corresponding switch parameter; step 303, sending the remote command to the server; step 304, receiving response data returned by the server for the remote command; step 305, in the The switch parameter corresponding to the remote command is off. The response data is outputted. The method of the embodiment may further include: in step 306, when the switch parameter corresponding to the remote command is turned on, the response is The data is intercepted. Step 307: Search for an interactive command that requires the user to interact with the intercepted response data. Step 308: Output interactive prompt information corresponding to the interactive command.

本實施例的步驟306-步驟308對回應資料進行攔截和查找處理,以從該回應資料中識別出需要用戶端進行交互的互動式命令,進而可以得到對應的交互提示資訊資訊。 In step 306 to step 308 of the embodiment, the response data is intercepted and searched to identify an interactive command that requires the user to interact with the response data, and the corresponding interactive prompt information information can be obtained.

在本申請的一種可選實施例中,上述步驟307具體可以包括:對回應資料進行攔截,對所攔截的回應資料按行(\r、\n、\r\n)進行切割,並對每一個當前行判斷其是否包含預置關鍵字(sudo、password);若是,則可以輸出提示框,提示用戶端進行交互;若否,則可以將當前行對應的回應資料輸出,並透過步驟307繼續下一次判斷直至所有回應數據被處理完畢。 In an optional embodiment of the present application, the foregoing step 307 may specifically include: intercepting the response data, cutting the intercepted response data by lines (\r, \n, \r\n), and cutting each A current line determines whether it contains a preset keyword (sudo, password); if yes, it can output a prompt box to prompt the user to interact; if not, the response data corresponding to the current line can be output, and continue through step 307. The next judgment is made until all response data has been processed.

參照圖4,示出了本申請的一種回應資料的示意,其中,Fabric可以對10.125.0.171(伺服器)返回的回應資料進行攔截和查找處理,其中,在發現某行回應資料包含有“password”關鍵字時,可以輸出交互提示資訊“out:[sudo]password for xiong.xiaox:”,以提示使用者輸入密 碼,在使用者輸入密碼之後,Fabric可以將用戶輸入的密碼發送回10.125.0.171伺服器,以使伺服器對該密碼進行認證;其中,在該密碼的認證通過時,伺服器可以繼續執行對應的遠端命令,並向用戶端發送對應的回應資料,其中,該回應資料中可以包括遠端命令的執行結果;而在該密碼的認證不通過時,伺服器可以拒絕執行對應的遠端命令,並向用戶端發送對應的回應資料,其中,該回應資料中可以包括遠端命令的密碼錯誤結果。可以理解,上述只是作為回應資料的處理過程示例,實際上,本申請實施例對於回應資料的具體處理過程不加以限制。 Referring to FIG. 4, a schematic diagram of a response data of the present application is shown, in which the fabric can intercept and search the response data returned by 10.125.0.171 (server), wherein the response data of a certain row is found to contain "password". "Keyword, you can output the interactive prompt information "out: [sudo]password for xiong.xiaox:" to prompt the user to enter the secret Code, after the user enters the password, the fabric can send the password entered by the user back to the 10.125.0.171 server, so that the server can authenticate the password; wherein, when the password is authenticated, the server can continue to perform the corresponding The remote command sends a corresponding response data to the client, where the response data may include the execution result of the remote command; and when the authentication of the password fails, the server may refuse to execute the corresponding remote command. And sending a corresponding response data to the client, wherein the response data may include a password error result of the remote command. It can be understood that the above is only an example of the processing procedure of the response data. In fact, the specific processing procedure of the response data is not limited in the embodiment of the present application.

方法實施例三 Method embodiment three

參照圖5,示出了本申請的一種遠端命令的處理方法實施例三的步驟流程圖,具體可以包括如下步驟:步驟501、用戶端接收遠端命令的觸發請求;步驟502、用戶端依據所述觸發請求,獲取遠端命令及其對應的開關參數;步驟503、用戶端向伺服器發送所述遠端命令;步驟504、用戶端從通訊端介面中讀取所述伺服器針對所述遠端命令返回的回應資料段;步驟505、用戶端判斷上述回應資料段的資料是否為空,若是,則結束流程,否則,執行步驟506;步驟506、用戶端判斷所述遠端命令對應的開關參數是否為關閉,若是,則執行步驟507,否則,執行步驟 508;步驟507、用戶端將所述回應資料輸出;步驟508、用戶端將所述回應資料進行攔截;步驟509、用戶端從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;步驟510、用戶端輸出所述互動式命令對應的交互提示資訊。 Referring to FIG. 5, a flow chart of the third embodiment of the method for processing a remote command of the present application is shown. The method may include the following steps: Step 501: The UE receives a trigger request of a remote command; Step 502: The trigger request acquires a remote command and its corresponding switch parameter; step 503, the user sends the remote command to the server; and step 504, the user reads the server from the communication interface for the The response data segment returned by the remote command is sent; in step 505, the user determines whether the data of the response data segment is empty, and if yes, the process ends; otherwise, step 506 is performed; step 506, the user terminal determines that the remote command corresponds to Whether the switch parameter is off, if yes, go to step 507, otherwise, perform the step 508; Step 507, the user end outputs the response data; Step 508: The user end intercepts the response data; Step 509: The user end searches for the interactive command that needs the user end to interact from the intercepted response data; Step 510: The user end outputs the interactive prompt information corresponding to the interactive command.

需要說明的是,在本申請的一種可選實施例中,步驟507還可以將回應資料寫入快取,以備遠端命令的處理需要。 It should be noted that, in an optional embodiment of the present application, step 507 may also write the response data to the cache for the processing of the remote command.

需要說明的是,對於方法實施例,為了簡單描述,故將其都表述為一系列的動作組合,但是本領域技術人員應該知悉,本申請實施例並不受所描述的動作順序的限制,因為依據本申請實施例,某些步驟可以採用其他順序或者同時進行。其次,本領域技術人員也應該知悉,說明書中所描述的實施例均屬於較佳實施例,所涉及的動作並不一定是本申請實施例所必須的。 It should be noted that, for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the embodiments of the present application are not limited by the described action sequence, because In accordance with embodiments of the present application, certain steps may be performed in other sequences or concurrently. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

裝置實施例 Device embodiment

參照圖6,示出了本申請的一種遠端命令的處理裝置實施例的結構框圖,具體可以包括如下模組:第一接收模組601,用於接收遠端命令的觸發請求;獲取模組602,用於依據所述觸發請求,獲取遠端命令及其對應的開關參數; 發送模組603,用於向伺服器發送所述遠端命令;第二接收模組604,用於接收所述伺服器針對所述遠端命令返回的回應資料;以及第一輸出模組605,用於在所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 Referring to FIG. 6 , it is a structural block diagram of an embodiment of a remote command processing apparatus of the present application, which may specifically include the following modules: a first receiving module 601, configured to receive a trigger request of a remote command; The group 602 is configured to obtain a remote command and a corresponding switch parameter according to the trigger request. The sending module 603 is configured to send the remote command to the server, the second receiving module 604 is configured to receive the response data returned by the server for the remote command, and the first output module 605. And configured to output the response data when the switch parameter corresponding to the remote command is off.

在本申請的一種可選實施例中,所述觸發請求中可以攜帶有命令檔的位址資訊,則所述獲取模組602,具體可以包括:第一獲取子模組,用於依據所述位址資訊,從所述命令檔中讀取遠端命令及其對應的開關參數。 In an optional embodiment of the present application, the triggering request may carry the address information of the command file, and the obtaining module 602 may specifically include: a first acquiring sub-module, according to the The address information reads the remote command and its corresponding switch parameter from the command file.

在本申請的另一種可選實施例中,所述觸發請求中可以攜帶有命令檔的位址資訊和所述命令檔中遠端命令的開關參數,則所述獲取模組602,具體可以包括:第二獲取子模組,用於依據所述位址資訊,從所述命令檔中讀取遠端命令,並將讀取的遠端命令與所述觸發請求中攜帶的開關參數進行關聯。 In another optional embodiment of the present application, the triggering request may include the address information of the command file and the switch parameter of the remote command in the command file, where the obtaining module 602 may specifically include The second obtaining submodule is configured to read the remote command from the command file according to the address information, and associate the read remote command with the switch parameter carried in the trigger request.

在本申請的再一種可選實施例中,所述裝置還可以包括:攔截模組,用於在所述遠端命令對應的開關參數為開啟時,將所述回應資料進行攔截;查找模組,用於從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;第二輸出模組,用於輸出所述互動式命令對應的交互提示資訊。 In still another optional embodiment of the present application, the apparatus may further include: an intercepting module, configured to intercept the response data when the switch parameter corresponding to the remote command is turned on; The utility model is configured to search for an interactive command that requires the user to interact with the intercepted response data, and a second output module, configured to output the interactive prompt information corresponding to the interactive command.

在本申請的又一種可選實施例中,所述第二接收模組603,具體可以包括:讀取子模組,用於從用戶端的通訊端介面中讀取所述伺服器針對所述遠端命令返回的回應資料段。 In a further optional embodiment of the present application, the second receiving module 603 may specifically include: a reading submodule, configured to read the server from the communication end interface of the user end for the far The response data segment returned by the terminal command.

在本申請的一種可選實施例中,所述第一輸出模組605,具體可以包括:輸出子模組,用於在所述回應資料段的內容不為空、且所述遠端命令對應的開關參數為關閉時,將所述回應資料輸出。 In an optional embodiment of the present application, the first output module 605 may specifically include: an output submodule, where the content of the response data segment is not empty, and the remote command corresponds to The response data is output when the switch parameter is off.

對於裝置實施例而言,由於其與方法實施例基本相似,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。 For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

本說明書中的各個實施例均採用遞進的方式描述,每個實施例重點說明的都是與其他實施例的不同之處,各個實施例之間相同相似的部分互相參見即可。 The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments can be referred to each other.

本領域內的技術人員應明白,本申請實施例的實施例可提供為方法、裝置、或電腦程式產品。因此,本申請實施例可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體方面的實施例的形式。而且,本申請實施例可採用在一個或多個其中包含有電腦可用程式碼的電腦可用儲存媒體(包括但不限於磁碟記憶體、CD-ROM、光學記憶體等)上實施的電腦程式產品的形式。 Those skilled in the art will appreciate that embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Thus, embodiments of the present application may take the form of a complete hardware embodiment, a fully software embodiment, or an embodiment combining soft and hardware aspects. Moreover, embodiments of the present application may employ computer program products implemented on one or more computer usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) including computer usable code. form.

在一個典型的配置中,所述電腦設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和記憶體。記憶 體可能包括電腦可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非揮發性記憶體等形式,如唯讀記憶體(ROM)或快閃記憶體(flash RAM)。記憶體是電腦可讀媒體的示例。電腦可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是電腦可讀指令、資料結構、程式的模組或其他資料。電腦的儲存媒體的例子包括,但不限於相變記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可擦除可程式設計唯讀記憶體(EEPROM)、快閃記憶體或其他記憶體技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁片儲存或其他磁性存放裝置或任何其他非傳輸媒體,可用於儲存可以被計算設備訪問的資訊。按照本文中的界定,電腦可讀媒體不包括非持續性的電腦可讀媒體(transitory media),如調製的資料信號和載波。 In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, a network interface, and memory. memory The body may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer readable media, such as read only memory (ROM) or flash memory (flash RAM) ). Memory is an example of a computer readable medium. Computer readable media including both permanent and non-permanent, removable and non-removable media can be stored by any method or technology. Information can be computer readable instructions, data structures, modules of programs, or other materials. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory (RAM). Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM only, digitally versatile A compact disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include non-persistent computer readable media, such as modulated data signals and carrier waves.

本申請實施例是參照根據本申請實施例的方法、終端設備(系統)、和電腦程式產品的流程圖和/或方框圖來描述的。應理解可由電腦程式指令實現流程圖和/或方框圖中的每一流程和/或方框、以及流程圖和/或方框圖中的流程和/或方框的結合。可提供這些電腦程式指令到通用電腦、專用電腦、嵌入式處理機或其他可程式設計資料處理終端設備的處理器以產生一個機器,使得透過電腦或其 他可程式設計資料處理終端設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的裝置。 The embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. Providing such computer program instructions to a processor of a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine through the computer or The instructions executed by the processor of the programmable data processing terminal device generate means for implementing the functions specified in one or more blocks of the flow or in a block or blocks of the flow chart.

這些電腦程式指令也可儲存在能引導電腦或其他可程式設計資料處理終端設備以特定方式工作的電腦可讀記憶體中,使得儲存在該電腦可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能。 The computer program instructions can also be stored in a computer readable memory that can boot a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory include the manufacture of the instruction device. The instruction means implements the functions specified in a block or blocks of a flow or a flow and/or a block diagram of the flowchart.

這些電腦程式指令也可裝載到電腦或其他可程式設計資料處理終端設備上,使得在電腦或其他可程式設計終端設備上執行一系列操作步驟以產生電腦實現的處理,從而在電腦或其他可程式設計終端設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的步驟。 These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device to perform a series of operational steps on a computer or other programmable terminal device to produce computer-implemented processing for use on a computer or other programmable computer. The instructions executed on the design terminal device provide steps for implementing the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

儘管已描述了本申請實施例的較佳實施例,但本領域內的技術人員一旦得知了基本創造性概念,則可對這些實施例做出另外的變更和修改。所以,所附申請專利範圍意欲解釋為包括較佳實施例以及落入本申請實施例範圍的所有變更和修改。 While a preferred embodiment of the embodiments of the present invention has been described, those skilled in the art can make further changes and modifications to the embodiments. Therefore, the scope of the appended claims is intended to be construed as a

最後,還需要說明的是,在本文中,諸如第一和第二等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在任何這種實際的關係或者順序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的 包含,從而使得包括一系列要素的過程、方法、物品或者終端設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、物品或者終端設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的過程、方法、物品或者終端設備中還存在另外的相同要素。 Finally, it should also be noted that in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between operations. Moreover, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive Included so that a process, method, article, or terminal device that includes a series of elements includes not only those elements but also other elements not explicitly listed, or is inherently included in the process, method, article, or device Elements. An element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that comprises the element, without further limitation.

以上對本申請所提供的一種遠端命令的處理方法和一種遠端命令的處理裝置,進行了詳細介紹,本文中應用了具體個例對本申請的原理及實施方式進行了闡述,以上實施例的說明只是用於幫助理解本申請的方法及其核心思想;同時,對於本領域的一般技術人員,依據本申請的思想,在具體實施方式及應用範圍上均會有改變之處,綜上所述,本說明書內容不應理解為對本申請的限制。 The method for processing a remote command and the processing device for a remote command provided by the present application are described in detail above. The principle and implementation manner of the present application are described in the following, and the description of the above embodiment is described. It is only used to help understand the method of the present application and its core ideas; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in specific implementation manners and application scopes. The contents of this specification are not to be construed as limiting the application.

Claims (10)

一種遠端命令的處理方法,其特徵在於,包括:接收遠端命令的觸發請求;依據該觸發請求,獲取遠端命令及其對應的開關參數;向伺服器發送該遠端命令;接收該伺服器針對該遠端命令返回的回應資料;在該遠端命令對應的開關參數為關閉時,將該回應資料輸出。 A method for processing a remote command, comprising: receiving a trigger request of a remote command; acquiring a remote command and a corresponding switch parameter according to the trigger request; sending the remote command to a server; and receiving the servo The response data returned by the remote command is output; when the switch parameter corresponding to the remote command is off, the response data is output. 根據申請專利範圍第1項所述的方法,其中,該觸發請求中攜帶有命令檔的位址資訊,則該依據所述觸發請求,獲取遠端命令及其對應的開關參數的步驟,包括:依據該位址資訊,從該命令檔中讀取遠端命令及其對應的開關參數。 According to the method of claim 1, wherein the triggering request carries the address information of the command file, the step of acquiring the remote command and the corresponding switch parameter according to the trigger request, including: According to the address information, the remote command and its corresponding switch parameters are read from the command file. 根據申請專利範圍第1項所述的方法,其中,該觸發請求中攜帶有命令檔的位址資訊和該命令檔中遠端命令的開關參數,則所述依據該觸發請求,獲取遠端命令及其對應的開關參數的步驟,包括:依據該位址資訊,從該命令檔中讀取遠端命令,並將讀取的遠端命令與該觸發請求中攜帶的開關參數進行關聯。 The method of claim 1, wherein the trigger request carries the address information of the command file and the switch parameter of the remote command in the command file, and the obtaining the remote command according to the trigger request And the step of the corresponding switch parameter, comprising: reading the remote command from the command file according to the address information, and associating the read remote command with the switch parameter carried in the trigger request. 根據申請專利範圍第1至3項中任一項所述的方法,其中,所述方法還包括:在該遠端命令對應的開關參數為開啟時,將該回應資 料進行攔截;從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;輸出該互動式命令對應的交互提示資訊。 The method of any one of claims 1 to 3, wherein the method further comprises: when the corresponding switch parameter of the remote command is on, the response is The interception is performed; the interactive command that requires the user to interact is searched from the intercepted response data; and the interactive prompt information corresponding to the interactive command is output. 根據申請專利範圍第1至3項中任一項所述的方法,其中,所述接收該伺服器針對該遠端命令返回的回應資料的步驟,包括:從用戶端的通訊端介面中讀取該伺服器針對該遠端命令返回的回應資料段。 The method of any one of claims 1 to 3, wherein the step of receiving the response data returned by the server for the remote command comprises: reading the content from the communication interface of the client The response data segment returned by the server for this remote command. 根據申請專利範圍第5項所述的方法,其中,所述在該遠端命令對應的開關參數為關閉時,將該回應資料輸出的步驟,包括:在該回應資料段的內容不為空、且該遠端命令對應的開關參數為關閉時,將該回應資料輸出。 The method of claim 5, wherein the step of outputting the response data when the switch parameter corresponding to the remote command is off includes: the content of the response data segment is not empty, When the switch parameter corresponding to the remote command is off, the response data is output. 一種遠端命令的處理裝置,其特徵在於,包括:第一接收模組,用於接收遠端命令的觸發請求;獲取模組,用於依據該觸發請求,獲取遠端命令及其對應的開關參數;發送模組,用於向伺服器發送該遠端命令;第二接收模組,用於接收該伺服器針對該遠端命令返回的回應資料;以及第一輸出模組,用於在該遠端命令對應的開關參數為關閉時,將該回應資料輸出。 A remote command processing device, comprising: a first receiving module, configured to receive a trigger request of a remote command; and an acquiring module, configured to acquire a remote command and a corresponding switch according to the trigger request a sending module, configured to send the remote command to the server; a second receiving module, configured to receive the response data returned by the server for the remote command; and a first output module, configured to When the switch parameter corresponding to the remote command is off, the response data is output. 根據申請專利範圍第7項所述的裝置,其中,所述 觸發請求中攜帶有命令檔的位址資訊,則該獲取模組,包括:第一獲取子模組,用於依據該位址資訊,從該命令檔中讀取遠端命令及其對應的開關參數。 The device of claim 7, wherein the The acquiring module carries the address information of the command file, and the acquiring module includes: a first acquiring submodule, configured to read the remote command and the corresponding switch from the command file according to the address information. parameter. 根據申請專利範圍第7項所述的裝置,其中,該觸發請求中攜帶有命令檔的位址資訊和該命令檔中遠端命令的開關參數,則該獲取模組,包括:第二獲取子模組,用於依據該位址資訊,從該命令檔中讀取遠端命令,並將讀取的遠端命令與該觸發請求中攜帶的開關參數進行關聯。 According to the device of claim 7, wherein the trigger request carries the address information of the command file and the switch parameter of the remote command in the command file, the acquiring module includes: a second acquisition The module is configured to read the remote command from the command file according to the address information, and associate the read remote command with the switch parameter carried in the trigger request. 根據申請專利範圍第7至9項中任一項所述的裝置,其中,該裝置還包括:攔截模組,用於在該遠端命令對應的開關參數為開啟時,將該回應資料進行攔截;查找模組,用於從所攔截的回應資料中查找需要用戶端進行交互的互動式命令;第二輸出模組,用於輸出該互動式命令對應的交互提示資訊。 The device of any one of clauses 7 to 9, wherein the device further comprises: an intercepting module, configured to intercept the response data when the corresponding switch parameter of the remote command is turned on The search module is configured to search for an interactive command that requires the user to interact from the intercepted response data; and the second output module is configured to output the interactive prompt information corresponding to the interactive command.
TW106105967A 2016-03-31 2017-02-22 Method and device for processing remote commands TWI738726B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610202831.6 2016-03-31
CN201610202831.6A CN107291524B (en) 2016-03-31 2016-03-31 Remote command processing method and device

Publications (2)

Publication Number Publication Date
TW201737065A true TW201737065A (en) 2017-10-16
TWI738726B TWI738726B (en) 2021-09-11

Family

ID=59962563

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106105967A TWI738726B (en) 2016-03-31 2017-02-22 Method and device for processing remote commands

Country Status (3)

Country Link
CN (1) CN107291524B (en)
TW (1) TWI738726B (en)
WO (1) WO2017167103A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336770A (en) * 2019-04-04 2019-10-15 平安科技(深圳)有限公司 Method, apparatus, equipment and the storage medium of long-range monitoring loophole
CN113190296A (en) * 2021-05-19 2021-07-30 瀚高基础软件股份有限公司 Paramiko-based interactive command execution method and device
CN115314536B (en) * 2022-08-03 2024-02-02 平安付科技服务有限公司 Remote command execution method and device, storage medium and computer equipment

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100824792B1 (en) * 2006-07-11 2008-04-24 삼성전자주식회사 Command processing devices and method thereof, and systems having the same
US8635214B2 (en) * 2006-07-26 2014-01-21 International Business Machines Corporation Improving results from search providers using a browsing-time relevancy factor
CN102035748B (en) * 2010-12-31 2014-07-30 深圳市深信服电子科技有限公司 Application-based traffic control method and controller
CN102739440A (en) * 2012-05-24 2012-10-17 大唐移动通信设备有限公司 Method and device for accessing hardware device
WO2015045108A1 (en) * 2013-09-27 2015-04-02 三菱電機株式会社 Client/server program generation device and client/server program generation program
CN103746843A (en) * 2013-12-31 2014-04-23 百度在线网络技术(北京)有限公司 Method and equipment for processing RPC (Remote Procedure Call Protocol) command
CN104796279B (en) * 2014-01-21 2018-05-22 腾讯科技(深圳)有限公司 The treating method and apparatus of request bag
CN104486133B (en) * 2014-12-26 2017-11-17 大唐移动通信设备有限公司 The method and system of network element proxy management

Also Published As

Publication number Publication date
CN107291524A (en) 2017-10-24
WO2017167103A1 (en) 2017-10-05
CN107291524B (en) 2020-04-07
TWI738726B (en) 2021-09-11

Similar Documents

Publication Publication Date Title
EP3158480B1 (en) Data query method and apparatus
CN107577427B (en) data migration method, device and storage medium for blockchain system
TWI549060B (en) Access methods and devices for virtual machine data
TW201902176A (en) Method and apparatus for writing transaction data into a blockchain system
TWI671642B (en) Method for sharing data across applications and web browser
TW201730789A (en) Information processing method, device and system
WO2021082157A1 (en) Methods, systems and devices for data sharing, and data and metadata storage
WO2018201887A1 (en) Data response method, apparatus, terminal device, and medium
WO2016026433A1 (en) Data processing method and data processing apparatus
US9600567B2 (en) Local context search results improvements
TW201740294A (en) Model training method and device
CN107423037B (en) Application program interface positioning method and device
US9110917B2 (en) Creating a file descriptor independent of an open operation
WO2017084348A1 (en) Management method and apparatus for ip hard disk
US20160110123A1 (en) Data object observation among domain-restricted containers
CN104020961A (en) Distributed data storage method, device and system
WO2017167103A1 (en) Remote command processing method and device
WO2021204082A1 (en) Deduplication of encrypted data using multiple keys
WO2015180650A1 (en) Method and device for generating key value in storage area network
US11157456B2 (en) Replication of data in a distributed file system using an arbiter
CN109657167B (en) Data acquisition method, device, server and storage medium
US9648103B2 (en) Non-uniform file access in a distributed file system
CN110168513A (en) The part of big file is stored in different storage systems
TW201926017A (en) Electronic device and web page management method thereof
CN117194298B (en) Control method, device, equipment and storage medium