WO2012139329A1 - Upgrade method and device based on task template, batch upgrade system - Google Patents

Upgrade method and device based on task template, batch upgrade system Download PDF

Info

Publication number
WO2012139329A1
WO2012139329A1 PCT/CN2011/075967 CN2011075967W WO2012139329A1 WO 2012139329 A1 WO2012139329 A1 WO 2012139329A1 CN 2011075967 W CN2011075967 W CN 2011075967W WO 2012139329 A1 WO2012139329 A1 WO 2012139329A1
Authority
WO
WIPO (PCT)
Prior art keywords
remote server
command
template
upgrade
execution
Prior art date
Application number
PCT/CN2011/075967
Other languages
French (fr)
Chinese (zh)
Inventor
卢振兴
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012139329A1 publication Critical patent/WO2012139329A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the present invention relates to the field of communications, and in particular, to an upgrade method and device based on a task template, and a batch upgrade system. Background technique
  • the upgrade method currently used is generally performed after logging in to a remote server using the telnet protocol or SSH (Secure Shell) protocol, such as backing up files, stopping services, etc.; then the new version The file is uploaded to the remote server through ftp, and the version is replaced by executing a shell script or decompressing and copying commands.
  • the database script needs to open the database client to execute; finally, the command to start the service is executed.
  • the technical problem solved by the present invention is to provide a method and device for upgrading a task template based on a task template, and a batch upgrade system.
  • the upgrade process is combined to customize, automate, and quickly integrate the software upgrade process and improve the software.
  • the efficiency and accuracy of the upgrade; on the other hand, the upgrade process is batched, effectively liberating manpower from repetitive work.
  • the present invention provides a method for upgrading a task template, including: packaging a common operation, and combining the functional units after the package according to an upgrade requirement to form a task template;
  • the task template is parsed into an operation command, and the operation command is executed after the operation command is sent to a remote server.
  • the common operation is encapsulated into a corresponding functional unit, and the functional unit is composed of a plurality of logically sequential operations, and a function is completed through a series of operation commands;
  • the common operations include backup of files and directories, file transfer, shell script execution, database script execution, database backup, and human machine command execution.
  • the file is placed from the local server to the ftp server, and the remote server is notified by a socket connection command.
  • the remote server obtains the file from the ftp server and completes the transfer of the file from the local server to the remote server.
  • parsing the task template into an operation command is: parsing a task template by a program, parsing the task template into a corresponding functional unit, and then parsing each functional unit into a series of Logical sequential operation commands.
  • the operation command is executed on the remote server through the socket connection. If the operation command is successfully executed, it is determined whether all the operation commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the subsequent commands are continuously executed; If the operation command fails to execute, Then enter the error processing flow.
  • the invention also provides an upgrade device based on a task template, including
  • the template editing module is configured to encapsulate common operations, and combine the functional units after the packaging according to the upgrade requirements to form a task template.
  • a socket communication module configured to establish a communication channel with a remote server through a socket connection
  • a template parsing execution module configured to parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
  • the template editing module is configured to encapsulate a common operation into: the template editing module is configured to package a common operation into a corresponding functional unit, where the functional unit is composed of multiple logically sequential operations. A function is completed through a series of operation commands; the common operations include file and directory backup, file transfer, shell script execution, database script execution, database backup, and human machine command execution.
  • the socket communication module is configured to establish a communication channel with a remote server through a socket connection:
  • the socket communication module is configured to send a command to a remote server through a socket input stream, obtain a log and a result returned by the remote server execution command through the socket output stream, and put the file from the local server to the ftp server for the operation involving the file.
  • Sending a command to the remote server through the socket connection the remote server obtains the file from the ftp server, and completes the transfer of the file from the local server to the remote server.
  • the template parsing execution module is configured to parse the task template into an operation command:
  • the template parsing execution module is configured to parse the task template by the program, parse the task template into corresponding functional units, and then parse each functional unit into a series of logically ordered operation commands.
  • the present invention also provides a batch upgrade system, including the above-mentioned upgrade apparatus, and a data distribution thread module;
  • a data distribution thread module configured to receive scheduling data, perform scheduling allocation uniformly, sequentially determine a plurality of upgrading devices, assign task data to an upgrading device that processes an idle state, and set a state of the upgrading device to be in operation;
  • a plurality of upgrade devices are configured to process the task data, and after the upgrade is completed, change its own state to idle, and notify the data distribution thread module.
  • the technical solution of the present invention is used to control the entire upgrade process in one tool, and avoids too many tools to be used back and forth; at the same time, the entire upgrade process is automatically connected in series and executed in order, which also avoids The execution process may be missed by switching back and forth during manual operation, which greatly improves the accuracy and efficiency of execution.
  • the batch upgrade system as long as the server performance allows, the user can maximize the number of connections according to the actual situation of the device and improve the upgrade efficiency.
  • Figure 1 is a flow chart of a first embodiment of the present invention
  • Figure 2 is a diagram of a task template editing example
  • Figure 3 is a schematic diagram of socket communication; 4 is a flowchart of execution of a task template;
  • Figure 5 is a structural view showing a second embodiment of the present invention.
  • Figure 6 is a structural view of a third embodiment of the present invention. detailed description
  • a flowchart of a first embodiment of the present invention provides an upgrade method based on a task template, where the method includes the following steps:
  • step S101 the common operations are encapsulated, and the encapsulated functional units are combined to form a task template according to the upgrade requirement;
  • FIG. 2 it is a task template editing example diagram, which encapsulates the operations commonly used in the upgrade process, and is packaged as a backup of files and directories, file transfer, shell script execution, database script execution, database backup, and man-machine command execution.
  • Function each function consists of a number of logically sequential operations, through which a function is completed.
  • backup of files and directories includes creating a backup destination directory, creating a backup timestamp directory, and executing a copy command;
  • the file transfer includes the operation of transferring the file from the local (put) to the ftp server and the remote server fetching the file from the ftp server (get) the past operation;
  • Shell script execution includes transferring the shell to the remote server, changing shell execution permissions, and executing shell script operations;
  • Database script execution includes transferring database scripts to remote servers, connecting to databases, and executing database scripts;
  • Database backup includes connecting to the database and executing database backup commands
  • the man-machine command includes sending the command itself.
  • a task template is formed by combining these functions as needed in the upgrade process.
  • the first combination of templates is very convenient. Just drag the packaged operation to the upgrade process tree on the right side and fill in the key attributes to complete the template creation.
  • the template is also very flexible. The steps of the template can be adjusted arbitrarily, so that each project can customize its own template according to the project's own situation, thus implementing its own upgrade process; finally, the way to package the operation into functions is also very easy to expand, if there is a new The function needs to be added to the function list on the left side of the new function, and the new function can be added and the compatibility expansion of the original function can be realized.
  • Each operation defines attributes such as execution user, execution timeout, pause after execution, description of this step, etc. By filling in these attributes, the steps of the entire upgrade template can be displayed in an explanatory language, which is very convenient. The user understands.
  • Step S102 the local server establishes a communication channel with the remote server through a socket (socket) connection;
  • the communication channel is based on some protocol contents of telnet and SSH to complete the session simulation of telnet and SSH. As long as the device's IP information and the logged-in username and password are filled in, an automatic connection to the remote server can be achieved. And through the input and output of the socket, the transmission of the command and the processing of the return of the execution result are realized.
  • FIG. 3 it is a schematic diagram of socket communication.
  • the local server establishes a connection with a remote server through socket communication, and sends a command to a remote server through a socket input stream (Input Stream), and outputs a stream through the socket (Output Stream) ) to get the logs and results returned by the remote server execution command.
  • Involving the operation of the file, through the ftp protocol first transfer the file from the local server to the ftp server, and then send the command to the remote server through the socket, so that the remote server obtains the file through the ftp protocol to the ftp server (get) Down, thereby completing the transfer of files from the local server to the remote server.
  • This process is to first simulate the underlying environment of manual execution, and then This environment simulates other operations.
  • Step S103 Parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
  • FIG. 4 it is a flowchart for executing a task template, including,
  • step S401 the task template is read, and when the template task is executed, the template is parsed into a packaged functional unit, and then each functional unit is parsed into a series of logically ordered commands;
  • Step S402 executing a command on the remote server through the socket connection. If the command is successfully executed, determining whether all the commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the subsequent commands are continued; If the execution fails, the error processing flow is entered.
  • This process is actually a simulated remote login to the server, manually enter the command to execute.
  • Backup of files and directories first establish a connection with the remote server through socket communication, and then send a backup command to the remote server to complete the backup.
  • the man-machine command execution first establishes a connection with the remote server through socket communication, and then sends the man-machine command to be executed to the remote server for execution.
  • Database backup first establish a connection with the remote server through socket communication, put the backup script to the ftp server, then send the get script command to the remote server, the remote server then get the backup script to the ftp server, and finally send the command to execute the backup script. Give the remote server a backup of the database.
  • Shell script execution first establish a connection with the remote server through socket communication, put the shell script to the ftp server, then send the get command to the remote server, then the remote server to the get shell script on the ftp server, and finally send the command to execute the shell script to the remote server, Perform shell script execution.
  • File transfer first establish a connection with the remote server through socket communication, put the file to the ftp server, then send the get file command to the remote server, the remote server to the ftp server get file, complete the file transfer.
  • Database script execution first establish a connection with the remote server through socket communication, put the database script to the ftp server, then send the get command to the remote server, then the remote server to the ftp server get database script, and finally send the command to execute the database script to the remote The server, the execution of the database script.
  • the backup of files and directories is similar to the communication process of human-machine command execution, but the backup of actual files and directories, and finally the backup command is a series of commands, including the creation of backup target directory, disk space detection, File copying, etc., and man-machine command execution only needs to send the command to be executed.
  • the communication process is similar, the actual steps are very different, mainly in the fact that the last command sent is actually a series of logical sequences. Command combination, not just a single command.
  • database backup, shell script execution, and database script execution are similar in communication process, but the actual steps in the execution process are quite different.
  • database backup also needs to create backup target directory, detect disk space, and connect. Database and so on; while shell script execution needs to change the execution permission of the shell, etc.; database script execution needs to connect to the database without detecting disk space.
  • the file is first uploaded from the local to the ftp server, and the put operation is implemented by the program, and the ftp server to the remote server is passed by the program to the device.
  • the socket connection initiates a get operation and gets the file to the remote server.
  • the transfer of files from the local server to the remote server is done through a two-step ftp operation.
  • the script execution part of the template involved in the template after connecting to the remote server, call the built-in shell script on the remote server carry out.
  • This implements the telnet/SSH client, ftp client, database client and other functions, so that the entire upgrade process is controlled within a tool, avoiding too many tools to use back and forth.
  • the entire upgrade process is automatically executed in series by the program, which also avoids the omission of the execution process caused by the switch back and forth during the manual operation, which greatly improves the accuracy and efficiency of the execution.
  • FIG. 5 is a structural diagram of a second embodiment of the present invention.
  • the template editing module is configured to encapsulate common operations, and combine the functional units after the packaging according to the upgrade requirements to form a task template.
  • a socket communication module configured to establish a communication channel with a remote server through a socket connection
  • a template parsing execution module configured to parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
  • the template editing module is configured to encapsulate common operations, specifically
  • the template editing module is configured to package a common operation into a corresponding functional unit, where the functional unit is composed of a plurality of logically sequential operations, and completes a function through a series of operation commands; the common operations include backup of files and directories. , file transfer, shell script execution, database script execution, database backup, and human machine command execution.
  • the socket communication module is configured to establish, by using a socket connection, a communication channel with a remote server,
  • the socket communication module is configured to send a command to a remote server through a socket input stream, obtain a log and a result returned by the remote server execution command through the socket output stream, and put the file from the local server to the ftp server for the operation involving the file.
  • the remote server is notified by sending a command through the socket connection, and the remote server obtains the file from the ftp server, thereby completing the transmission of the file from the local server to the remote server.
  • the template parsing execution module is configured to parse the task template into an operation command, specifically,
  • the template parsing execution module is configured to parse the task template by the program, parse the task template into corresponding functional units, and then parse each functional unit into a series of logically ordered operation commands.
  • FIG. 6 is a structural diagram of a third embodiment of the present invention.
  • a batch upgrade system using the above upgrade apparatus is provided, including
  • a data distribution thread module configured to receive scheduling data, perform scheduling allocation uniformly, sequentially determine a plurality of upgrading devices, view that the upgrading device is in an idle state, and then assign task data to the upgrading device, and the state of the upgrading device Modified to work;
  • the maximum number of connections can be determined by the configuration method. As long as the server performance allows, the user can maximize the number of connections according to the actual situation of the device and improve the efficiency of the upgrade.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

An upgrade method based on a task template is provided. The method comprises: common operations are encapsulated and the encapsulated function units are combined to form the task template according to the upgrade requirement (S101); a communication channel is established with a remote server through a socket connection (S102); the task template is parsed to operation instructions and the operation instructions are executed after being sent to the remote server (S103). The technical solution of the present invention also provides an upgrade device based on the task template and a batch upgrade system. The execution veracity and efficiency are improved extremely by using the technical solution of the present invention. Additionally, users can furthest increase the connection numbers according to the actual situation of the device so as to improve the upgrade efficiency only if the capability of the server is allowable by using the batch upgrade system.

Description

一种基于任务模板的升级方法及装置、 批量升级系统 技术领域  Method and device for upgrading based on task template, batch upgrading system
本发明涉及通信领域, 特别地涉及一种基于任务模板的升级方法及装 置、 批量升级系统。 背景技术  The present invention relates to the field of communications, and in particular, to an upgrade method and device based on a task template, and a batch upgrade system. Background technique
在通信领域大量设备的使用已成为常态, 随之而来的是这些设备上软 件的升级需要耗费大量的人力。 目前所釆用的升级方法一般为釆用 telnet 协议或者 SSH ( Secure Shell, 安全外壳)协议登录到远程服务器上以后, 进行一系列命令的执行, 如备份文件、 停止业务等; 然后将新的版本文件 通过 ftp上传到远程服务器上, 通过执行外壳(shell )脚本或者解压、 拷贝 命令来完成版本的替换; 涉及到数据库脚本则还需要打开数据库客户端执 行; 最后还要执行启动业务的命令等。 通过上述步骤完成的升级过程, 费 时费力, 需要用到多种工具, 如 telnet工具、 ftp工具、 数据库客户端工具 等, 而且一台一台设备的进行升级, 对于存在上百上千台设备要升级的情 况, 所需要耗费的人力和时间是不可想象的。 因此, 寻找一种方法, 能够 将这些类似的需要大量重复的工作以自动执行的方式来完成, 成为一个迫 切需要解决的问题。 发明内容  The use of a large number of devices in the field of communications has become the norm, with the consequent upgrade of software on these devices requiring a lot of manpower. The upgrade method currently used is generally performed after logging in to a remote server using the telnet protocol or SSH (Secure Shell) protocol, such as backing up files, stopping services, etc.; then the new version The file is uploaded to the remote server through ftp, and the version is replaced by executing a shell script or decompressing and copying commands. In addition, the database script needs to open the database client to execute; finally, the command to start the service is executed. The upgrade process completed through the above steps is time-consuming and laborious, and requires various tools, such as telnet tools, ftp tools, database client tools, etc., and upgrades one device, for hundreds or thousands of devices. In the case of an upgrade, the labor and time required are unimaginable. Therefore, finding a way to accomplish these similarly large-scale repetitive tasks in an automated manner becomes an issue that is urgently needed to be solved. Summary of the invention
本发明解决的技术问题在于提供了一种基于任务模板的升级方法及装 置、 批量升级系统, 通过该技术方法一方面使升级过程组合定制化、 自动 化, 快速的整合出软件的升级流程, 提高软件升级的效率和准确性; 另外 一方面使升级过程批量化, 有效的将人力从重复的工作中解放出来。 为解决上述问题, 本发明提供了一种基于任务模板的升级方法, 包括, 对常用操作进行封装, 按照升级需要对封装后的功能单元进行组合形 成任务模板; The technical problem solved by the present invention is to provide a method and device for upgrading a task template based on a task template, and a batch upgrade system. On the one hand, the upgrade process is combined to customize, automate, and quickly integrate the software upgrade process and improve the software. The efficiency and accuracy of the upgrade; on the other hand, the upgrade process is batched, effectively liberating manpower from repetitive work. To solve the above problem, the present invention provides a method for upgrading a task template, including: packaging a common operation, and combining the functional units after the package according to an upgrade requirement to form a task template;
通过 socket (套接字)连接建立与远程服务器间的通信通道;  Establish a communication channel with the remote server through a socket (socket) connection;
将所述任务模板解析为操作命令, 将所述操作命令发送到远程服务器 后执行所述操作命令。  The task template is parsed into an operation command, and the operation command is executed after the operation command is sent to a remote server.
上述的方法, 其中, 所述对常用操作进行封装为:  The above method, wherein the commonly used operations are encapsulated as:
将常用操作封装为相应的功能单元, 所述功能单元由多条有逻辑顺序 的操作组成, 通过一系列操作命令完成一个功能;  The common operation is encapsulated into a corresponding functional unit, and the functional unit is composed of a plurality of logically sequential operations, and a function is completed through a series of operation commands;
所述常用操作包括文件及目录的备份、 文件传输、 shell脚本执行、 数 据库脚本执行、 数据库备份及人机命令执行。  The common operations include backup of files and directories, file transfer, shell script execution, database script execution, database backup, and human machine command execution.
上述的方法, 其中, 所述通过 socket连接建立与远程服务器间的通信 通道为:  The above method, wherein the communication channel established between the remote server and the remote server is:
通过 socket输入流对远程服务器发送命令, 通过 socket输出流来获取 远程服务器执行命令返回的日志及结果;  Sending commands to the remote server through the socket input stream, and obtaining the logs and results returned by the remote server execution command through the socket output stream;
对于涉及文件的操作, 将文件从本地服务器放到 ftp服务器上, 通过 socket连接发送命令通知远程服务器, 远程服务器从 ftp服务器上获取所述 文件, 完成文件从本地服务器到远程服务器的传输。  For operations involving files, the file is placed from the local server to the ftp server, and the remote server is notified by a socket connection command. The remote server obtains the file from the ftp server and completes the transfer of the file from the local server to the remote server.
上述的方法, 其中, 所述将所述任务模板解析为操作命令为: 通过程序对任务模板进行解析, 将所述任务模板解析为相应的功能单 元, 然后将每个功能单元解析为一系列有逻辑顺序的操作命令。  The above method, wherein the parsing the task template into an operation command is: parsing a task template by a program, parsing the task template into a corresponding functional unit, and then parsing each functional unit into a series of Logical sequential operation commands.
上述的方法, 其中, 所述执行所述操作命令为:  The above method, wherein the performing the operation command is:
通过 socket连接在远程服务器上执行所述操作命令, 若操作命令执行 成功, 判断所有操作命令是否已执行结束, 若所有命令已成功执行完成, 则认为该功能已成功实现, 否则继续执行后续命令; 若操作命令执行失败, 则进入出错处理流程。 The operation command is executed on the remote server through the socket connection. If the operation command is successfully executed, it is determined whether all the operation commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the subsequent commands are continuously executed; If the operation command fails to execute, Then enter the error processing flow.
本发明还提供了一种基于任务模板的升级装置, 包括,  The invention also provides an upgrade device based on a task template, including
模板编辑模块, 用于对常用操作进行封装, 按照升级需要对封装后的 功能单元进行组合形成任务模板;  The template editing module is configured to encapsulate common operations, and combine the functional units after the packaging according to the upgrade requirements to form a task template.
socket通信模块, 用于通过 socket连接建立与远程服务器间的通信通 道;  a socket communication module, configured to establish a communication channel with a remote server through a socket connection;
模板解析执行模块, 用于将所述任务模板解析为操作命令, 将所述操 作命令发送到远程服务器后执行所述操作命令。  And a template parsing execution module, configured to parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
上述的装置, 其中, 所述模板编辑模块用于对常用操作进行封装为: 所述模板编辑模块用于将常用操作封装为相应的功能单元, 所述功能 单元由多条有逻辑顺序的操作组成, 通过一系列操作命令完成一个功能; 所述常用操作包括文件及目录的备份、 文件传输、 shell脚本执行、 数 据库脚本执行、 数据库备份及人机命令执行。  In the above device, the template editing module is configured to encapsulate a common operation into: the template editing module is configured to package a common operation into a corresponding functional unit, where the functional unit is composed of multiple logically sequential operations. A function is completed through a series of operation commands; the common operations include file and directory backup, file transfer, shell script execution, database script execution, database backup, and human machine command execution.
上述的装置, 其中, 所述 socket通信模块用于通过 socket连接建立与 远程服务器间的通信通道为:  The above device, wherein the socket communication module is configured to establish a communication channel with a remote server through a socket connection:
所述 socket通信模块用于通过 socket输入流对远程服务器发送命令, 通过 socket输出流来获取远程服务器执行命令返回的日志及结果; 以及 对于涉及文件的操作, 将文件从本地服务器放到 ftp服务器上, 通过 socket连接发送命令通知远程服务器, 远程服务器从 ftp服务器上获取所述 文件, 完成文件从本地服务器到远程服务器的传输。  The socket communication module is configured to send a command to a remote server through a socket input stream, obtain a log and a result returned by the remote server execution command through the socket output stream, and put the file from the local server to the ftp server for the operation involving the file. Sending a command to the remote server through the socket connection, the remote server obtains the file from the ftp server, and completes the transfer of the file from the local server to the remote server.
上述的装置, 其中, 所述模板解析执行模块用于将所述任务模板解析 为操作命令为:  The above device, wherein the template parsing execution module is configured to parse the task template into an operation command:
所述模板解析执行模块用于通过程序对任务模板进行解析, 将所述任 务模板解析为相应的功能单元, 然后将每个功能单元解析为一系列有逻辑 顺序的操作命令。 上述的装置, 其中, 所述模板解析执行模块用于执行所述操作命令为: 所述模板解析执行模块用于通过 socket连接在远程服务器上执行命令, 若操作命令执行成功, 判断所有命令是否已执行结束, 若所有命令已成功 执行完成, 则认为该功能已成功实现, 否则继续执行后续命令; 若操作命 令执行失败, 则进入出错处理流程。 The template parsing execution module is configured to parse the task template by the program, parse the task template into corresponding functional units, and then parse each functional unit into a series of logically ordered operation commands. The above device, wherein the template parsing execution module is configured to execute the operation command: the template parsing execution module is configured to execute a command on a remote server through a socket connection, and if the operation command is successfully executed, determine whether all the commands have been The execution ends. If all the commands have been successfully executed, the function is considered to have been successfully implemented. Otherwise, the subsequent commands are executed. If the operation command fails, the error processing flow is entered.
本发明还提供了一种批量升级系统, 包括上述的升级装置、 以及数据 分配线程模块; 其中,  The present invention also provides a batch upgrade system, including the above-mentioned upgrade apparatus, and a data distribution thread module;
数据分配线程模块, 用于接收任务数据后, 统一进行调度分配, 依次 判断多个升级装置, 将任务数据分配给处理空闲状态的升级装置, 并将该 升级装置的状态置为工作中;  a data distribution thread module, configured to receive scheduling data, perform scheduling allocation uniformly, sequentially determine a plurality of upgrading devices, assign task data to an upgrading device that processes an idle state, and set a state of the upgrading device to be in operation;
多个升级装置, 用于对任务数据进行处理, 在升级完成后, 更改自己 的状态为空闲, 同时通知所述数据分配线程模块。  A plurality of upgrade devices are configured to process the task data, and after the upgrade is completed, change its own state to idle, and notify the data distribution thread module.
与现有技术相比, 釆用本发明的技术方案, 使整个升级过程控制在一 个工具内, 避免了过多工具来回使用; 同时整个升级过程是自动串联起来 按顺序执行的, 这也避免了手工操作过程中来回切换而可能造成的执行过 程遗漏, 极大的提高了执行的准确性和效率。 另外, 釆用批量升级系统, 只要服务器性能允许, 使用者可以根据设备的实际情况来最大限度的增加 连接数, 提高升级效率。 附图说明  Compared with the prior art, the technical solution of the present invention is used to control the entire upgrade process in one tool, and avoids too many tools to be used back and forth; at the same time, the entire upgrade process is automatically connected in series and executed in order, which also avoids The execution process may be missed by switching back and forth during manual operation, which greatly improves the accuracy and efficiency of execution. In addition, with the batch upgrade system, as long as the server performance allows, the user can maximize the number of connections according to the actual situation of the device and improve the upgrade efficiency. DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解, 构成本发明的一 部分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发 明的不当限定。 在附图中:  The drawings are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图 1是本发明第一实施例流程图;  Figure 1 is a flow chart of a first embodiment of the present invention;
图 2是任务模板编辑示例图;  Figure 2 is a diagram of a task template editing example;
图 3是 socket通信示意图; 图 4是任务模板执行流程图; Figure 3 is a schematic diagram of socket communication; 4 is a flowchart of execution of a task template;
图 5是为本发明第二实施例结构图;  Figure 5 is a structural view showing a second embodiment of the present invention;
图 6是本发明第三实施例结构图。 具体实施方式  Figure 6 is a structural view of a third embodiment of the present invention. detailed description
为了使本发明所要解决的技术问题、 技术方案及有益效果更加清楚、 明白, 以下结合附图和实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments in order to make the present invention. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
如图 1 所示, 为本发明第一实施例流程图, 提供了一种基于任务模板 的升级方法, 该方法包括以下步骤:  As shown in FIG. 1 , a flowchart of a first embodiment of the present invention provides an upgrade method based on a task template, where the method includes the following steps:
步骤 S101 , 将常用操作进行封装, 按照升级需要对封装后的功能单元 进行组合形成任务模板;  In step S101, the common operations are encapsulated, and the encapsulated functional units are combined to form a task template according to the upgrade requirement;
如图 2所示, 是任务模板编辑示例图, 将升级过程中常用的操作进行 封装, 封装为文件及目录的备份、 文件传输、 shell脚本执行、 数据库脚本 执行、 数据库备份及人机命令执行等功能, 每个功能均由多条有逻辑顺序 的操作组成, 通过这一系列操作命令完成一个功能。  As shown in Figure 2, it is a task template editing example diagram, which encapsulates the operations commonly used in the upgrade process, and is packaged as a backup of files and directories, file transfer, shell script execution, database script execution, database backup, and man-machine command execution. Function, each function consists of a number of logically sequential operations, through which a function is completed.
如文件及目录的备份包括创建备份目标目录、 创建备份时间戳目录、 执行拷贝命令;  For example, backup of files and directories includes creating a backup destination directory, creating a backup timestamp directory, and executing a copy command;
而文件传输包括文件从本地传输 ( put )到 ftp服务器的操作和远程服务 器将文件从 ftp服务器获取 ( get )过去的操作;  The file transfer includes the operation of transferring the file from the local (put) to the ftp server and the remote server fetching the file from the ftp server (get) the past operation;
shell脚本执行包括传输 shell到远程服务器、 更改 shell执行权限、 执 行 shell脚本操作;  Shell script execution includes transferring the shell to the remote server, changing shell execution permissions, and executing shell script operations;
数据库脚本执行包括传输数据库脚本到远程服务器、 连接数据库、 执 行数据库脚本;  Database script execution includes transferring database scripts to remote servers, connecting to databases, and executing database scripts;
数据库备份包括连接数据库、 执行数据库备份命令;  Database backup includes connecting to the database and executing database backup commands;
人机命令包括发送命令本身。 通过对这些功能按照升级过程的需要进行组合则形成任务模板。从图 1 中可以看出, 首先模板的组合非常方便, 只要将封装好的操作拖动到右侧 的升级过程树中, 填写关键属性就可以完成模板的制作; 同时模板的编写 也非常灵活, 模板的步骤可以任意调整, 这样每个项目都可以根据项目自 身的情况来定制自己的模板, 从而实现自己的升级过程; 最后这种将操作 封装成功能的方式也非常易于扩展, 如果有新的功能需要, 仅需要将新的 功能封装好添加到左侧的功能列表中, 就可以实现新功能的增加以及对原 有功能的兼容扩展。 The man-machine command includes sending the command itself. A task template is formed by combining these functions as needed in the upgrade process. As can be seen from Figure 1, the first combination of templates is very convenient. Just drag the packaged operation to the upgrade process tree on the right side and fill in the key attributes to complete the template creation. At the same time, the template is also very flexible. The steps of the template can be adjusted arbitrarily, so that each project can customize its own template according to the project's own situation, thus implementing its own upgrade process; finally, the way to package the operation into functions is also very easy to expand, if there is a new The function needs to be added to the function list on the left side of the new function, and the new function can be added and the compatibility expansion of the original function can be realized.
其中, 每个操作都定义了执行用户、 执行超时时间、 执行后是否暂停、 本步骤描述等属性, 通过对这些属性的填写, 可以使整个升级模板的步骤 以解释性的语言展示出来, 非常便于使用人员理解。  Each operation defines attributes such as execution user, execution timeout, pause after execution, description of this step, etc. By filling in these attributes, the steps of the entire upgrade template can be displayed in an explanatory language, which is very convenient. The user understands.
步骤 S102, 本地服务器通过 socket (套接字)连接建立与远程服务器 间的通信通道;  Step S102, the local server establishes a communication channel with the remote server through a socket (socket) connection;
该通信通道是基于 telnet及 SSH的一些协议内容来完成对 telnet和 SSH 的会话模拟。 只要填写了设备的 IP信息及登录的用户名和密码, 就可以实 现与远程服务器间的自动连接。 以及通过 socket的输入和输出, 来实现命 令的发送以及执行结果返回的处理,  The communication channel is based on some protocol contents of telnet and SSH to complete the session simulation of telnet and SSH. As long as the device's IP information and the logged-in username and password are filled in, an automatic connection to the remote server can be achieved. And through the input and output of the socket, the transmission of the command and the processing of the return of the execution result are realized.
具体地, 如图 3所示, 是 socket通信示意图, 本地服务器通过 socket 通信建立与远程服务器之间的连接, 通过 socket输入流(Input Stream ) 来 对远程服务器发送命令, 通过 socket输出流(Output Stream ) 来获取远程 服务器执行命令返回的日志及结果。 涉及到文件的操作, 则通过 ftp协议, 首先将文件从本地服务器传输 put至 ftp服务器上, 然后再通过 socket发送 命令给远程服务器, 让远程服务器通过 ftp协议到 ftp服务器上将文件获取 ( get ) 下来, 从而完成文件从本地服务器到远程服务器的传输。  Specifically, as shown in FIG. 3, it is a schematic diagram of socket communication. The local server establishes a connection with a remote server through socket communication, and sends a command to a remote server through a socket input stream (Input Stream), and outputs a stream through the socket (Output Stream) ) to get the logs and results returned by the remote server execution command. Involving the operation of the file, through the ftp protocol, first transfer the file from the local server to the ftp server, and then send the command to the remote server through the socket, so that the remote server obtains the file through the ftp protocol to the ftp server (get) Down, thereby completing the transfer of files from the local server to the remote server.
这一过程的目的就是首先将手工执行的底层环境模拟出来, 然后再在 这一环境上模拟其他的操作。 The purpose of this process is to first simulate the underlying environment of manual execution, and then This environment simulates other operations.
步骤 S103 , 将所述任务模板解析为操作命令, 将所述操作命令发送到 远程服务器后执行所述操作命令。  Step S103: Parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
具体地, 如图 4所示, 是任务模板执行流程图, 包括,  Specifically, as shown in FIG. 4, it is a flowchart for executing a task template, including,
步骤 S401 , 读取任务模板, 在执行模板任务时, 将模板解析为一个个 封装好的功能单元, 然后再将每个功能单元解析成为一系列有逻辑顺序的 命令;  In step S401, the task template is read, and when the template task is executed, the template is parsed into a packaged functional unit, and then each functional unit is parsed into a series of logically ordered commands;
步骤 S402, 通过 socket连接在远程服务器上执行命令, 如果命令执行 成功, 判断所有命令是否已执行结束, 若所有命令已成功执行完成, 则认 为该功能已成功实现, 否则继续执行后续命令; 如果命令执行失败, 则进 入出错处理流程。  Step S402, executing a command on the remote server through the socket connection. If the command is successfully executed, determining whether all the commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the subsequent commands are continued; If the execution fails, the error processing flow is entered.
这一过程实际就是模拟的远程登录到服务器以后, 手工输入执行的命 令。  This process is actually a simulated remote login to the server, manually enter the command to execute.
相应地, 对于封装的各个功能, 具体执行过程如下:  Correspondingly, for each function of the package, the specific execution process is as follows:
文件及目录的备份, 首先通过 socket通信与远程服务器建立连接, 然 后发送备份命令给远程服务器完成备份。  Backup of files and directories, first establish a connection with the remote server through socket communication, and then send a backup command to the remote server to complete the backup.
人机命令执行, 首先通过 socket通信与远程服务器建立连接, 然后将 要执行的人机命令发送给远程服务器进行执行。  The man-machine command execution first establishes a connection with the remote server through socket communication, and then sends the man-machine command to be executed to the remote server for execution.
数据库备份, 首先通过 socket通信与远程服务器建立连接后, 将备份 脚本 put到 ftp服务器, 然后发送 get脚本的命令给远程服务器, 远程服务 器然后到 ftp服务器上 get备份脚本, 最后发送执行备份脚本的命令给远程 服务器来实现数据库的备份。  Database backup, first establish a connection with the remote server through socket communication, put the backup script to the ftp server, then send the get script command to the remote server, the remote server then get the backup script to the ftp server, and finally send the command to execute the backup script. Give the remote server a backup of the database.
Shell脚本执行, 首先通过 socket通信与远程服务器建立连接, 将 shell 脚本 put到 ftp服务器, 然后发送 get命令给远程服务器, 然后远程服务器 到 ftp服务器上 get shell脚本,最后发送执行 shell脚本的命令给远程服务器, 进行 shell脚本的执行。 Shell script execution, first establish a connection with the remote server through socket communication, put the shell script to the ftp server, then send the get command to the remote server, then the remote server to the get shell script on the ftp server, and finally send the command to execute the shell script to the remote server, Perform shell script execution.
文件传输, 首先通过 socket通信与远程服务器建立连接后, 将文件 put 到 ftp服务器, 然后发送 get文件的命令给远程服务器, 远程服务器到 ftp 服务器上 get文件, 完成文件的传输。  File transfer, first establish a connection with the remote server through socket communication, put the file to the ftp server, then send the get file command to the remote server, the remote server to the ftp server get file, complete the file transfer.
数据库脚本执行, 首先通过 socket通信与远程服务器建立连接, 将数 据库脚本 put到 ftp服务器, 然后发送 get命令给远程服务器, 然后远程服 务器到 ftp服务器上 get数据库脚本, 最后发送执行数据库脚本的命令给远 程服务器, 进行数据库脚本的执行。  Database script execution, first establish a connection with the remote server through socket communication, put the database script to the ftp server, then send the get command to the remote server, then the remote server to the ftp server get database script, and finally send the command to execute the database script to the remote The server, the execution of the database script.
从上述过程来看, 文件及目录的备份与人机命令执行的通信过程类似, 但实际文件及目录的备份, 最后发送备份命令是一系列的命令, 包括备份 目标目录的创建, 磁盘空间检测, 文件拷贝等, 而人机命令执行仅需要将 待执行的命令发送出去就可以了, 虽然通信过程类似, 但实际步骤存在很 大差异, 主要表现在最后发送的命令其实是一系列有逻辑顺序的命令组合, 而非单纯的一条命令。 同样, 数据库备份、 shell脚本执行、 数据库脚本执 行在通信过程上是类似的, 但实际在执行过程中的具体步骤存在很大的差 别, 如数据库备份同样需要创建备份目标目录、 检测磁盘空间、 连接数据 库等; 而 shell脚本执行则需要更改 shell的执行权限等; 数据库脚本执行则 需要连接数据库, 而无需检测磁盘空间这些操作。  From the above process, the backup of files and directories is similar to the communication process of human-machine command execution, but the backup of actual files and directories, and finally the backup command is a series of commands, including the creation of backup target directory, disk space detection, File copying, etc., and man-machine command execution only needs to send the command to be executed. Although the communication process is similar, the actual steps are very different, mainly in the fact that the last command sent is actually a series of logical sequences. Command combination, not just a single command. Similarly, database backup, shell script execution, and database script execution are similar in communication process, but the actual steps in the execution process are quite different. For example, database backup also needs to create backup target directory, detect disk space, and connect. Database and so on; while shell script execution needs to change the execution permission of the shell, etc.; database script execution needs to connect to the database without detecting disk space.
通过程序实现一些需要客户端工具才能实现的功能, 以减少升级过程 中因为使用工具过多而造成的复杂性。如将升级过程中涉及的 ftp操作拆分 为两步进行, 首先将文件从本地上传到 ftp服务器, 由程序实现的 put操作 来完成,而从 ftp服务器到远程服务器则由程序 telnet到设备以后通过 socket 连接发起 get操作, 将文件获取到远程服务器。 通过两步 ftp操作, 完成文 件从本地服务器到远程服务器的传输。 模板中涉及的数据库脚本执行部分, 通过连接到远程服务器以后, 在远程服务器上调用程序内置的 shell脚本来 完成。 这样就实现了 telnet/SSH客户端、 ftp客户端、 数据库客户端等功能, 从而使整个升级过程控制在一个工具内, 避免了过多工具来回使用。 同时 整个升级过程是由程序自动串联起来按顺序执行的, 这也避免了手工操作 过程中因为来回切换而可能造成的执行过程遗漏, 极大的提高了执行的准 确性和效率。 Implement some functions that require client tools to achieve the complexity of the upgrade process due to the use of too many tools. If the ftp operation involved in the upgrade process is split into two steps, the file is first uploaded from the local to the ftp server, and the put operation is implemented by the program, and the ftp server to the remote server is passed by the program to the device. The socket connection initiates a get operation and gets the file to the remote server. The transfer of files from the local server to the remote server is done through a two-step ftp operation. The script execution part of the template involved in the template, after connecting to the remote server, call the built-in shell script on the remote server carry out. This implements the telnet/SSH client, ftp client, database client and other functions, so that the entire upgrade process is controlled within a tool, avoiding too many tools to use back and forth. At the same time, the entire upgrade process is automatically executed in series by the program, which also avoids the omission of the execution process caused by the switch back and forth during the manual operation, which greatly improves the accuracy and efficiency of the execution.
如图 5 所示, 为本发明第二实施例结构图, 提供了一种基于任务模板 的升级装置, 包括,  As shown in FIG. 5, which is a structural diagram of a second embodiment of the present invention, an upgrade apparatus based on a task template is provided, including
模板编辑模块, 用于对常用操作进行封装, 按照升级需要对封装后的 功能单元进行组合形成任务模板;  The template editing module is configured to encapsulate common operations, and combine the functional units after the packaging according to the upgrade requirements to form a task template.
socket通信模块, 用于通过 socket连接建立与远程服务器间的通信通 道;  a socket communication module, configured to establish a communication channel with a remote server through a socket connection;
模板解析执行模块, 用于将所述任务模板解析为操作命令, 将所述操 作命令发送到远程服务器后执行所述操作命令。  And a template parsing execution module, configured to parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
其中 , 所述模板编辑模块用于对常用操作进行封装具体为 ,  The template editing module is configured to encapsulate common operations, specifically
所述模板编辑模块用于将常用操作封装为相应的功能单元, 所述功能 单元由多条有逻辑顺序的操作组成, 通过一系列操作命令完成一个功能; 所述常用操作包括文件及目录的备份、 文件传输、 shell脚本执行、 数 据库脚本执行、 数据库备份及人机命令执行。  The template editing module is configured to package a common operation into a corresponding functional unit, where the functional unit is composed of a plurality of logically sequential operations, and completes a function through a series of operation commands; the common operations include backup of files and directories. , file transfer, shell script execution, database script execution, database backup, and human machine command execution.
其中, 所述 socket通信模块用于通过 socket连接建立与远程服务器间 的通信通道包括,  The socket communication module is configured to establish, by using a socket connection, a communication channel with a remote server,
所述 socket通信模块用于通过 socket输入流对远程服务器发送命令, 通过 socket输出流来获取远程服务器执行命令返回的日志及结果; 以及 对于涉及文件的操作, 将文件从本地服务器放到 ftp服务器上, 通过 socket连接发送命令通知远程服务器, 远程服务器从 ftp服务器上获取所述 文件, 从而完成文件从本地服务器到远程服务器的传输。 其中 , 所述模板解析执行模块用于将所述任务模板解析为操作命令具 体为, The socket communication module is configured to send a command to a remote server through a socket input stream, obtain a log and a result returned by the remote server execution command through the socket output stream, and put the file from the local server to the ftp server for the operation involving the file. The remote server is notified by sending a command through the socket connection, and the remote server obtains the file from the ftp server, thereby completing the transmission of the file from the local server to the remote server. The template parsing execution module is configured to parse the task template into an operation command, specifically,
所述模板解析执行模块用于通过程序对任务模板进行解析, 将所述任 务模板解析为相应的功能单元, 然后将每个功能单元解析为一系列有逻辑 顺序的操作命令。  The template parsing execution module is configured to parse the task template by the program, parse the task template into corresponding functional units, and then parse each functional unit into a series of logically ordered operation commands.
如图 6所示, 为本发明第三实施例结构图, 提供了一种釆用上述升级 装置的批量升级系统, 包括,  As shown in FIG. 6, which is a structural diagram of a third embodiment of the present invention, a batch upgrade system using the above upgrade apparatus is provided, including
数据分配线程模块, 用于接收任务数据后, 统一进行调度分配, 依次 判断多个升级装置, 查看那一个升级装置处于空闲状态, 然后将任务数据 分配给该升级装置, 并且将该升级装置的状态修改为工作中;  a data distribution thread module, configured to receive scheduling data, perform scheduling allocation uniformly, sequentially determine a plurality of upgrading devices, view that the upgrading device is in an idle state, and then assign task data to the upgrading device, and the state of the upgrading device Modified to work;
多个升级装置, 用于对任务数据进行处理, 在升级完成后, 会更改自 己的状态为空闲, 同时通知数据分配线程。  Multiple upgrade devices are used to process the task data. After the upgrade is completed, the status of the user is changed to idle and the data distribution thread is notified.
釆用上述系统, 通过配置的方法来决定最大连接数, 只要服务器性能 允许, 使用者可以根据设备的实际情况来最大限度的增加连接数, 提高升 级效率。  Using the above system, the maximum number of connections can be determined by the configuration method. As long as the server performance allows, the user can maximize the number of connections according to the actual situation of the device and improve the efficiency of the upgrade.
上述说明示出并描述了本发明的优选实施例, 但如前所述, 应当理 解本发明并非局限于本文所披露的形式, 不应看作是对其他实施例的排除, 而可用于各种其他组合、 修改和环境, 并能够在本文所述发明构想范围内, 通过上述教导或相关领域的技术或知识进行改动。 而本领域人员所进行的 改动和变化不脱离本发明的精神和范围, 则都应在本发明所附权利要求的 保护范围内。  The above description shows and describes a preferred embodiment of the present invention, but as described above, it should be understood that the present invention is not limited to the form disclosed herein, and should not be construed as being Other combinations, modifications, and environments are possible and can be modified by the teachings of the above teachings or related art within the scope of the inventive concept described herein. All changes and modifications made by those skilled in the art are intended to be within the scope of the appended claims.

Claims

权利要求书 Claim
1、 一种基于任务模板的升级方法, 其特征在于, 该方法包括, 对常用操作进行封装, 按照升级需要对封装后的功能单元进行组合形 成任务模板;  A method for upgrading a task template, the method comprising: encapsulating a common operation, and combining the functional units after the package according to an upgrade requirement to form a task template;
通过 socket连接建立与远程服务器间的通信通道;  Establish a communication channel with the remote server through a socket connection;
将所述任务模板解析为操作命令, 将所述操作命令发送到远程服务器 后执行所述操作命令。  The task template is parsed into an operation command, and the operation command is executed after the operation command is sent to a remote server.
2、 根据权利要求 1所述的方法, 其特征在于, 所述对常用操作进行封 装为:  2. The method according to claim 1, wherein the packaging is performed as follows:
将常用操作封装为相应的功能单元, 所述功能单元由多条有逻辑顺序 的操作组成, 通过一系列操作命令完成一个功能;  The common operation is encapsulated into a corresponding functional unit, and the functional unit is composed of a plurality of logically sequential operations, and a function is completed through a series of operation commands;
所述常用操作包括文件及目录的备份、 文件传输、 shell脚本执行、 数 据库脚本执行、 数据库备份及人机命令执行。  The common operations include backup of files and directories, file transfer, shell script execution, database script execution, database backup, and human machine command execution.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述通过 socket连 接建立与远程服务器间的通信通道为:  The method according to claim 1 or 2, wherein the establishing a communication channel with the remote server through the socket connection is:
通过 socket输入流对远程服务器发送命令, 通过 socket输出流来获取 远程服务器执行命令返回的日志及结果;  Sending commands to the remote server through the socket input stream, and obtaining the logs and results returned by the remote server execution command through the socket output stream;
对于涉及文件的操作, 将文件从本地服务器放到 ftp服务器上, 通过 socket连接发送命令通知远程服务器, 远程服务器从 ftp服务器上获取所述 文件, 完成文件从本地服务器到远程服务器的传输。  For operations involving files, the file is placed from the local server to the ftp server, and the remote server is notified by a socket connection command. The remote server obtains the file from the ftp server and completes the transfer of the file from the local server to the remote server.
4、 根据权利要求 3所述的方法, 其特征在于, 所述将所述任务模板解 析为操作命令为:  The method according to claim 3, wherein the parsing the task template into an operation command is:
通过程序对任务模板进行解析, 将所述任务模板解析为相应的功能单 元, 然后将每个功能单元解析为一系列有逻辑顺序的操作命令。  The task template is parsed by the program, the task template is parsed into corresponding function units, and each functional unit is parsed into a series of logically ordered operation commands.
5、 根据权利要求 4所述的方法, 其特征在于, 所述执行所述操作命令 为: The method according to claim 4, wherein the performing the operation command For:
通过 socket连接在远程服务器上执行所述操作命令, 若操作命令执行 成功, 判断所有操作命令是否已执行结束, 若所有命令已成功执行完成, 则认为该功能已成功实现, 否则继续执行后续命令; 若操作命令执行失败, 则进入出错处理流程。  The operation command is executed on the remote server through the socket connection. If the operation command is successfully executed, it is determined whether all the operation commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the subsequent commands are continuously executed; If the operation command fails to execute, the error processing flow is entered.
6、 一种基于任务模板的升级装置, 其特征在于, 该装置包括, 模板编辑模块, 用于对常用操作进行封装, 按照升级需要对封装后的 功能单元进行组合形成任务模板;  An upgrade device based on a task template, the device includes: a template editing module, configured to encapsulate a common operation, and combine the functional units after the package according to an upgrade requirement to form a task template;
socket通信模块, 用于通过 socket连接建立与远程服务器间的通信通 道;  a socket communication module, configured to establish a communication channel with a remote server through a socket connection;
模板解析执行模块, 用于将所述任务模板解析为操作命令, 将所述操 作命令发送到远程服务器后执行所述操作命令。  And a template parsing execution module, configured to parse the task template into an operation command, and execute the operation command after sending the operation command to a remote server.
7、 根据权利要求 6所述的装置, 其特征在于, 所述模板编辑模块用于 对常用操作进行封装为:  7. The device according to claim 6, wherein the template editing module is configured to encapsulate common operations as:
所述模板编辑模块用于将常用操作封装为相应的功能单元, 所述功能 单元由多条有逻辑顺序的操作组成, 通过一系列操作命令完成一个功能; 所述常用操作包括文件及目录的备份、 文件传输、 shell脚本执行、 数 据库脚本执行、 数据库备份及人机命令执行。  The template editing module is configured to package a common operation into a corresponding functional unit, where the functional unit is composed of a plurality of logically sequential operations, and completes a function through a series of operation commands; the common operations include backup of files and directories. , file transfer, shell script execution, database script execution, database backup, and human machine command execution.
8、 根据权利要求 6或 7所述的装置, 其特征在于, 所述 socket通信模 块用于通过 socket连接建立与远程服务器间的通信通道为:  The device according to claim 6 or 7, wherein the socket communication module is configured to establish a communication channel with the remote server through the socket connection:
所述 socket通信模块用于通过 socket输入流对远程服务器发送命令, 通过 socket输出流来获取远程服务器执行命令返回的日志及结果; 以及 对于涉及文件的操作, 将文件从本地服务器放到 ftp服务器上, 通过 socket连接发送命令通知远程服务器, 远程服务器从 ftp服务器上获取所述 文件, 完成文件从本地服务器到远程服务器的传输。 The socket communication module is configured to send a command to a remote server through a socket input stream, obtain a log and a result returned by the remote server execution command through the socket output stream, and put the file from the local server to the ftp server for the operation involving the file. Sending a command to the remote server through the socket connection, the remote server obtains the file from the ftp server, and completes the transfer of the file from the local server to the remote server.
9、 根据权利要求 8所述的装置, 其特征在于, 所述模板解析执行模块 用于将所述任务模板解析为操作命令为: The apparatus according to claim 8, wherein the template parsing execution module is configured to parse the task template into an operation command:
所述模板解析执行模块用于通过程序对任务模板进行解析, 将所述任 务模板解析为相应的功能单元, 然后将每个功能单元解析为一系列有逻辑 顺序的操作命令。  The template parsing execution module is configured to parse the task template by the program, parse the task template into corresponding functional units, and then parse each functional unit into a series of logically ordered operation commands.
10、 根据权利要求 9所述的装置, 其特征在于, 所述模板解析执行模 块用于执行所述操作命令为:  10. The apparatus according to claim 9, wherein the template parsing execution module is configured to execute the operation command as:
所述模板解析执行模块用于通过 socket连接在远程服务器上执行命令, 若操作命令执行成功, 判断所有命令是否已执行结束, 若所有命令已成功 执行完成, 则认为该功能已成功实现, 否则继续执行后续命令; 若操作命 令执行失败, 则进入出错处理流程。  The template parsing execution module is configured to execute a command on a remote server through a socket connection. If the operation command is successfully executed, it is determined whether all the commands have been executed. If all the commands have been successfully executed, the function is considered to be successfully implemented, otherwise the function continues. Execute the subsequent command; if the operation command fails to execute, enter the error processing flow.
11、 一种批量升级系统, 其特征在于, 该系统包括多个权利要求 6至 10任一项所述的升级装置、 以及数据分配线程模块; 其中,  A batch upgrade system, characterized in that the system includes the upgrade device of any one of claims 6 to 10, and a data distribution thread module;
数据分配线程模块, 用于接收任务数据后, 统一进行调度分配, 依次 判断多个升级装置, 将任务数据分配给处理空闲状态的升级装置, 并将该 升级装置的状态置为工作中;  a data distribution thread module, configured to receive scheduling data, perform scheduling allocation uniformly, sequentially determine a plurality of upgrading devices, assign task data to an upgrading device that processes an idle state, and set a state of the upgrading device to be in operation;
多个升级装置, 用于对任务数据进行处理, 在升级完成后, 更改自己 的状态为空闲, 同时通知所述数据分配线程模块。  A plurality of upgrade devices are configured to process the task data, and after the upgrade is completed, change its own state to idle, and notify the data distribution thread module.
PCT/CN2011/075967 2011-04-14 2011-06-20 Upgrade method and device based on task template, batch upgrade system WO2012139329A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110093710.XA CN102736926B (en) 2011-04-14 2011-04-14 The upgrade method of a kind of task based access control template and device, batch upgrading system
CN201110093710.X 2011-04-14

Publications (1)

Publication Number Publication Date
WO2012139329A1 true WO2012139329A1 (en) 2012-10-18

Family

ID=46992483

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/075967 WO2012139329A1 (en) 2011-04-14 2011-06-20 Upgrade method and device based on task template, batch upgrade system

Country Status (2)

Country Link
CN (1) CN102736926B (en)
WO (1) WO2012139329A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516788A (en) * 2015-12-09 2016-04-20 珠海迈科智能科技股份有限公司 Programming method and system for storage device of set top box

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279001B (en) * 2015-11-20 2018-09-07 杭州云柚科技有限公司 A kind of remote software upgrade method for network-termination device
CN107305497A (en) * 2016-04-21 2017-10-31 中兴通讯股份有限公司 Version upgrading method and device
WO2018218399A1 (en) * 2017-05-27 2018-12-06 中国科学院深圳先进技术研究院 Upgrade control method and upgrade control equipment applied to application system migration
CN108182075A (en) * 2017-12-29 2018-06-19 成都三零凯天通信实业有限公司 A kind of program by the automatic escalation target software of socket communication modes

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770375A (en) * 2008-12-26 2010-07-07 新奥特(北京)视频技术有限公司 Method for realizing automatic update of software as well as system and device therefor
CN101820447A (en) * 2010-03-31 2010-09-01 青岛海信宽带多媒体技术有限公司 Software upgrading method and upgrading device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0017336D0 (en) * 2000-07-15 2000-08-30 Ibm Preferable modes of software package deployment
CN100461699C (en) * 2006-06-28 2009-02-11 华为技术有限公司 Method for automatic updating of equipment
CN101094229B (en) * 2007-07-24 2012-12-19 深圳市融创天下科技股份有限公司 Increment upgrading method for networked application programs
CN100535860C (en) * 2007-10-25 2009-09-02 中兴通讯股份有限公司 Equipment software upgrade automatic realizing system and method
CN101170568B (en) * 2007-11-29 2012-01-11 中兴通讯股份有限公司 A method for automatically generating and executing Telnet command via batch mode

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770375A (en) * 2008-12-26 2010-07-07 新奥特(北京)视频技术有限公司 Method for realizing automatic update of software as well as system and device therefor
CN101820447A (en) * 2010-03-31 2010-09-01 青岛海信宽带多媒体技术有限公司 Software upgrading method and upgrading device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516788A (en) * 2015-12-09 2016-04-20 珠海迈科智能科技股份有限公司 Programming method and system for storage device of set top box

Also Published As

Publication number Publication date
CN102736926A (en) 2012-10-17
CN102736926B (en) 2016-06-15

Similar Documents

Publication Publication Date Title
US11099976B2 (en) Generating code for deploying cloud infrastructure
US20200250074A1 (en) Test Orchestration Platform
CN109547509B (en) Cross-platform deployment method and system
WO2012139329A1 (en) Upgrade method and device based on task template, batch upgrade system
WO2017105966A1 (en) Dynamic/on-demand packaging as part of deployment
CN107426335B (en) System capable of automatically generating cloud environment configuration file and use method
WO2015188617A1 (en) Method and device for installing mysql databases
WO2018036342A1 (en) Csar-based template design visualization method and device
EP3391216A1 (en) Packaging tool for first and third party component deployment
WO2015143794A1 (en) Creating and upgrading methods, server, terminal, upgrading system, and storage media
CN104765641A (en) Job scheduling method and system
CN105204991A (en) Internet of things test method and device
WO2016201995A1 (en) Method and apparatus for implementation of test object construction, and service configuration test apparatus
US10972351B2 (en) Dynamic management of network environments
CN111159019B (en) Application program testing method, testing control terminal and testing terminal
CN110659198A (en) Application program test case execution method and device and software test system
WO2021244644A1 (en) Method for dynamically integrating application, and software system and machine therefor
EP3230865B1 (en) Recovery execution system using programatic generation of actionable workflows
CN111769979A (en) Cloud resource arranging method, system, terminal and storage medium
WO2011103729A1 (en) Method for registering, canceling self-defined shell program and corresponding system
CN109992295B (en) Version management method and server
CN112272190B (en) Data access method and device
CN104570967B (en) Long-range control method and system based on android system
JP5993835B2 (en) Smart terminal fuzzing apparatus and method using multi-node
US10592227B2 (en) Versioned intelligent offline execution of software configuration automation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11863652

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11863652

Country of ref document: EP

Kind code of ref document: A1