A visual computer instruction management system and method
By designing a visual computer command management system, the problems of high operational difficulty and security risks of Xshell terminal software in Linux server management were solved. It realizes visual management, flexible combination and automatic rollback of commands, and improves the security and convenience of system management.
Patent Information
- Application Number
- CN202211202230.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The existing Xshell terminal software has problems such as high difficulty of operation, lack of graphical interface, inability to combine and execute commands, inability to schedule execution, and inability to roll back and restore when managing Linux servers, which leads to security risks.
A visual computer instruction management system was designed, including a server management module, an instruction management module, a file repository management module, and a task management module. It supports instruction combination, reverse instruction, scheduled execution, and automatic rollback and restoration, and uses node-ssh for server operations.
It enables visualized management of commands, reduces the difficulty of operation and maintenance, improves flexibility and security, supports instant and scheduled execution, automatically rolls back and restores erroneous operations, and eliminates security risks.
Smart Images

Figure CN115639992B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of Linux instruction management, and in particular to a visual computer instruction management system and method. Background Technology
[0002] Currently, operating a Linux server generally requires logging in via SSH and then entering various Linux commands. A commonly used tool is the Xshell terminal software. However, using Xshell has the following shortcomings: 1. Xshell only allows manual command-line input for server management. The commands are numerous and complex, requiring a high level of expertise from the operator. It only has a command-line interface, lacking a graphical interface, resulting in an unfriendly user experience; 2. Xshell only allows pure command input. It cannot manage commands or combine commands for execution; 3. Xshell can only execute commands immediately, not on a scheduled basis; 4. If errors occur after entering commands in Xshell, there is no way to roll back and restore them, posing a significant security risk to the server system. Summary of the Invention
[0003] To address the aforementioned technical problems, this application proposes a visual computer instruction management system and method.
[0004] Firstly, this application proposes a visual computer instruction management system, comprising:
[0005] The server management module is used to store and manage the server's IP address, port, username, and password.
[0006] The instruction management module is used for combining instructions, setting reverse instructions, setting file upload instructions, and setting instruction templates.
[0007] The file repository management module is used for file uploading and temporary storage of files to be uploaded;
[0008] The task management module is used to execute instructions, manage instructions to be executed, and roll back and restore executed instructions.
[0009] The instruction executor is used to log in to the server based on the server information in the server management module, obtain the permission to operate the server, and also to execute the instructions in the task sequentially using node-ssh. When an error is encountered, it automatically rolls back and restores the instruction operation according to the reverse instruction, displays the server feedback information to the user, and records the execution log.
[0010] By adopting the above technical solution, this application provides a visual computer instruction management system that enables visual management of instructions, greatly reducing the difficulty of computer management for maintenance personnel; it realizes the combined management and execution of instructions, improves the flexibility and scalability of instruction settings, and enables the management of execution tasks, supporting both immediate and scheduled execution. It can adapt to system management work under various circumstances, eliminating the need for system maintenance late at night; it automatically rolls back and restores executed instruction tasks when errors occur, improves the security of instruction execution, and allows manual rollback of executed instruction tasks when necessary, eliminating security risks to the server system caused by misoperation.
[0011] Preferably, the instruction management module includes a data structure for implementing instruction combination and reverse instruction, wherein the data structure for implementing instruction combination and reverse instruction includes:
[0012] id, the unique identifier of the instruction;
[0013] name, the name of the instruction;
[0014] command, the command code or command template of an instruction;
[0015] reversecommandid, the ID of the reverse command, used for rollback and restoration operations;
[0016] children: A collection of child instruction IDs, an array type. If specified, the instruction is a compound instruction, the command field is invalid, and the specific instruction information is provided by children.
[0017] `reversechildren` is a collection of reverse child instruction IDs, an array type, used for rollback and restoration operations. If this field is specified, it indicates that the reverse instruction is a composite instruction, and the `reversecommandid` field is invalid. The reverse instruction information is provided by `reversechildren`.
[0018] Preferably, the instruction template is formatted using ES6 string templates, and the instruction template takes the form: instruction text ${instruction variable}.
[0019] Preferably, the file repository management module includes a data structure for storing file information, wherein the data structure for storing file information includes fileID as the unique ID of the file, and the address Path of the stored local file.
[0020] Preferably, the instruction executor uses node-ssh to execute single or combined instructions in the task sequentially.
[0021] Preferably, the task management module performs task management according to the following steps:
[0022] S101: Create a new task, set the task name, execution time and target server information;
[0023] S102: Set the instruction to be executed;
[0024] S103: Store files to be uploaded in the file repository management module;
[0025] S104: Traverse the sub-instructions of the instruction to be executed and generate the final list of instructions to be executed;
[0026] S105: Traverse the final list of instructions to be executed, obtain the instruction variable, and set the value of the instruction variable by the user. If the instruction variable is of type sourceId, obtain the file path in the file repository management module.
[0027] S106: Save to task list;
[0028] S107: Determine whether an execution time is set. If no execution time is set, the task is immediately handed over to the instruction executor for execution. If an execution time is set, the task list is traversed periodically. When a task expires, it is handed over to the instruction executor for execution.
[0029] S109: Select whether to click the rollback and restore operation in the task list. If needed, the executed tasks will be handed over to the instruction executor for rollback and restore.
[0030] Preferably, the instruction executor performs the task according to the following steps:
[0031] S201: After the executor receives the task, it logs into the server using node-ssh's ssh.connect based on the server information in the task and obtains operation permissions.
[0032] S202: Traverse the final list of instructions to be executed in the task, and replace the instruction variables in the instruction list with the instruction variable values set in the task;
[0033] S203: Use node-ssh's ssh.execCommand to execute commands one by one;
[0034] S204: If an upload command is encountered, the file path is found in the file repository management module through the sourceId value of the command, and the file is uploaded using node-ssh's ssh.putFile, where the source address of the uploaded file is path and the target address is the target of the command;
[0035] S205: If an error is encountered, stop running, iterate through the executed instructions, execute the reverse instruction of the instruction, realize the automatic rollback of the task, and record the error information in the task management module; if a manual rollback instruction is received from the task list, iterate through and execute the reverse instruction of the instruction to realize the task rollback; if successful, record the success status in the task management module.
[0036] Secondly, this application also proposes a visual computer instruction management method, which utilizes the visual computer instruction management system described in the first aspect for instruction management, and the method includes the following steps:
[0037] S301: Use the instruction manager to add new instructions and set reverse instructions;
[0038] S302: Use the instruction manager to combine the newly created instructions in S301 and set the reverse instructions to construct complex instructions;
[0039] S303: Use Task Manager to create a new task, specify the command to be executed, the time to execute the task, or execute it immediately;
[0040] S304: If an error is encountered during task execution, execution will be terminated, and a rollback operation will be performed according to the reverse instruction.
[0041] S305: Process the task list, including immediately executing unexecuted tasks in the task list, canceling the execution of unexecuted tasks, or performing rollback operations on already executed tasks.
[0042] Thirdly, this application also proposes an electronic device, comprising:
[0043] One or more processors;
[0044] Storage device for storing one or more programs;
[0045] When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in the second aspect.
[0046] In summary, this application includes at least the following beneficial technical effects:
[0047] 1. This application discloses a visual computer instruction management system, which realizes the visual management of instructions, greatly reducing the difficulty of computer management for operation and maintenance personnel; it realizes the combined management and execution of instructions, improving the flexibility and scalability of instruction settings; it realizes the management of execution tasks, supports real-time execution and scheduled execution, and can adapt to system management work under various conditions, eliminating the need for system maintenance late at night;
[0048] 2. This application provides a visual computer instruction management system that automatically rolls back and restores executed instruction tasks when errors occur, thereby improving the security of instruction execution; it also enables manual rollback of executed instruction tasks when necessary, eliminating security risks to the server system caused by misoperation. Attached Figure Description
[0049] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of this application. Other embodiments and many anticipated advantages of these embodiments will be readily recognized as they become better understood through reference to the following detailed description. Components in the drawings are not necessarily to scale. The same reference numerals refer to corresponding similar parts.
[0050] Figure 1 This is a schematic diagram of a module of a visual computer instruction management system in one embodiment of this application.
[0051] Figure 2 This is a schematic diagram illustrating the specific process of the task management steps of the task management module in one embodiment of this application.
[0052] Figure 3 This is a schematic diagram of a specific embodiment of the task management steps that can be applied to the task management module of this application.
[0053] Figure 4 This is a schematic diagram illustrating the specific instruction execution steps of the instruction executor in one embodiment of this application.
[0054] Figure 5 This is a schematic diagram of a specific embodiment of the instruction execution steps that can be applied to the instruction executor of this application.
[0055] Figure 6 This is a flowchart illustrating a visual computer instruction management method in one embodiment of this application.
[0056] Figure 7 This is a schematic diagram of a specific embodiment of the visual computer instruction management method applicable to this application.
[0057] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing the electronic devices of the present application embodiments. Detailed Implementation
[0058] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0059] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0060] Firstly, reference Figure 1 This application discloses a visual computer instruction management system, which includes a server management module 101, an instruction management module 102, a file repository management module 103, a task management module 104, and an instruction executor 105. This visual computer instruction management system uses Node.js as its development language, but is not limited to this language.
[0061] In a specific embodiment, the server management module is used to store and manage the server's IP address, port, username, and password. The server management module is used to perform CRUD operations on the server.
[0062] In a specific embodiment, the instruction management module is used for combining instructions, setting reverse instructions, setting file upload instructions, and setting instruction templates.
[0063] The instruction management module manages the creation, deletion, modification, and querying of instructions. Specifically, an instruction can be composed of multiple sub-instructions. Also specifically, when adding or modifying an instruction, a reverse instruction can be specified for later rollback and restoration. Furthermore, the system includes a built-in file upload instruction to upload files stored in the file repository management module to the target location on the server. Additionally, instructions in this module can be set as instruction templates; the variable parts of the template can be specified when creating a task, improving the flexibility and reusability of instructions.
[0064] The instruction management module employs a unique data structure for storing instructions, enabling the combination of instructions and the setting of reverse instructions:
[0065]
[0066]
[0067] In this data structure,
[0068] The id is the unique identifier of this instruction.
[0069] name is the name of the instruction.
[0070] The command is the instruction code or instruction template for that instruction.
[0071] reverseCommandId is the ID of the reverse instruction of this command, used for rollback and restoration operations.
[0072] `children` is a collection of IDs for child instructions, and is an array type. If specified, the instruction is a compound instruction, the `command` field is invalid, and the specific instruction information is provided by `children`.
[0073] `reverseChildren` is a collection of reverse sub-instruction IDs, an array type, used for rollback and restoration operations. If this field is specified, it indicates that the reverse instruction is a compound instruction, the `reverseCommandId` field is invalid, and information about the reverse instruction is provided by `reverseChildren`.
[0074] The instructions in the instruction management module can be set as instruction templates. The variable parts in the templates can be specified when creating a task, which improves the flexibility and reusability of the instructions.
[0075] The format of the instruction template is implemented using ES6 string templates, as follows:
[0076] `Instruction text ${instruction variable}……`
[0077] The command text is immutable; the command variables are mutable and are assigned values by the Task Manager.
[0078] For example, the command template for copying a file is:
[0079] '`cp-r${formPath}${toPath}`'
[0080] Here, `${formPath}` is the source address of the file to be copied, and `${toPath}` is the destination address. These are both command variables and are mutable. `cp -r`, on the other hand, is the command text and is immutable.
[0081] The instruction management module has built-in special file upload instructions to upload files stored in the file repository management module to the target location on the server:
[0082]
[0083] Here, sourceId points to the file ID of the file repository management module, and target points to the target location on the server to be uploaded.
[0084] The file repository management module is used for file uploading and temporary storage of files to be uploaded. All files to be uploaded in this system are temporarily stored in the file repository management module for file management.
[0085] The file repository management module includes a data structure for storing file information. The data structure for storing file information includes fileID as the unique ID of the file, and the path of the local file after storage.
[0086] The task management module is used to execute instructions, manage instructions to be executed, and roll back and restore executed instructions.
[0087] The smallest unit of execution in the task management module is an instruction, which includes single instructions and compound instructions.
[0088] Reference Figure 2 and Figure 3 When creating a new task in the task management module, the instructions to be executed are specified. The module then iterates through all sub-instructions within the instruction information to generate a final instruction to be executed.
[0089] List. Then set the values of the instruction variables one by one, following these steps:
[0090] S101: Create a new task, set the task name, execution time and target server information;
[0091] S102: Set the instruction to be executed;
[0092] S103: Store files to be uploaded in the file repository management module;
[0093] S104: Traverse the sub-instructions of the instruction to be executed and generate the final list of instructions to be executed;
[0094] S105: Traverse the final list of instructions to be executed, obtain the instruction variable, and set the value of the instruction variable by the user. If the instruction variable is of type sourceId, obtain the file path in the file repository management module.
[0095] S106: Save to task list;
[0096] S107: Determine whether an execution time is set. If no execution time is set, the task is immediately handed over to the instruction executor for execution. If an execution time is set, the task list is traversed periodically. When a task expires, it is handed over to the instruction executor for execution.
[0097] S109: Select whether to click the rollback and restore operation in the task list. If needed, the executed tasks will be handed over to the instruction executor for rollback and restore.
[0098] The instruction executor is used to log in to the server based on the server information from the server management module, obtain permissions to operate the server, and also to execute single or combined instructions in a task sequentially using node-ssh. When an error is encountered, it automatically rolls back and restores the instruction operation based on the reverse instruction, displays the server feedback information to the user, and records the execution log.
[0099] Reference Figure 4 and Figure 5 The instruction executor performs the task according to the following steps:
[0100] S201: After the executor receives the task, it logs into the server using node-ssh's ssh.connect based on the server information in the task and obtains operation permissions.
[0101] S202: Traverse the final list of instructions to be executed in the task, and replace the instruction variables in the instruction list with the instruction variable values set in the task;
[0102] S203: Use node-ssh's ssh.execCommand to execute commands one by one;
[0103] S204: If an upload command is encountered, the file path is found in the file repository management module through the sourceId value of the command, and the file is uploaded using node-ssh's ssh.putFile, where the source address of the uploaded file is path and the target address is the target of the command;
[0104] S205: If an error is encountered, stop running, iterate through the executed instructions, execute the reverse instruction of the instruction, realize the automatic rollback of the task, and record the error information in the task management module; if a manual rollback instruction is received from the task list, iterate through and execute the reverse instruction of the instruction to realize the task rollback; if successful, record the success status in the task management module.
[0105] Secondly, refer to Figure 6 and Figure 7 This application also discloses an embodiment of a visual computer instruction management method, which utilizes the visual computer instruction management system described in the first aspect for instruction management, and the method includes the following steps:
[0106] S301: Use the instruction manager to add new instructions and set reverse instructions;
[0107] S302: Use the instruction manager to combine the newly created instructions in S301 and set the reverse instructions to construct complex instructions;
[0108] S303: Use Task Manager to create a new task, specify the command to be executed, and specify the time to execute the task or execute it immediately; if no time is set for the task, it will be executed immediately; if a time is set, it will be executed at that time.
[0109] S304: If an error is encountered during task execution, execution will be terminated, and a rollback operation will be performed according to the reverse instruction.
[0110] S305: Process the task list, including immediately executing unexecuted tasks in the task list, canceling the execution of unexecuted tasks, or performing rollback operations on already executed tasks.
[0111] This application of a visual computer instruction management system is for server operation and maintenance management. Through this system, operation and maintenance personnel can achieve visual server instruction management. Compared to traditional server operation and maintenance methods, this system is more secure, easier to use, more convenient, and more flexible.
[0112] The visual computer instruction management system disclosed in this application has the following beneficial technical effects:
[0113] 1. It enables visual management of commands, greatly reducing the difficulty of computer management for maintenance personnel.
[0114] 2. Enables combined management and execution of instructions. Improves the flexibility and scalability of instruction settings.
[0115] 3. Enables management of execution tasks, supporting both immediate and scheduled execution. It can adapt to various system management situations, eliminating the need for system maintenance late at night.
[0116] 4. Implement automatic rollback and restoration of executed instructions in the event of an error. Improve the security of instruction execution.
[0117] 5. Enables manual rollback of executed commands when necessary, eliminating security risks to the server system caused by misoperation.
[0118] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 400 suitable for implementing electronic devices according to embodiments of the present application. Figure 8 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0119] like Figure 8As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 402 or programs loaded from storage section 408 into random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the system 400. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0120] The following components are connected to I / O interface 405: an input section 406 including a keyboard, mouse, etc.; an output section 407 including a liquid crystal display (LCD) and speakers, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card and a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. Drive 140 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 140 as needed so that computer programs read from them can be installed into storage section 408 as needed.
[0121] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 109, and / or installed from removable medium 111. When the computer program is executed by central processing unit (CPU) 101, it performs the functions defined in the methods of this application.
[0122] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the following... Figure 1 The method shown.
[0123] It should be noted that the computer-readable storage medium described in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0124] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0126] The specific embodiments of this application have been described above, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0127] In the description of this application, it should be understood that the terms "upper," "lower," "inner," "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and for simplification, and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The simple fact that certain measures are recited in mutually different dependent claims does not indicate that combinations of these measures cannot be used for improvement. Any reference signs in the claims should not be construed as limiting the scope.
Claims
1. A visual computer instruction management system, characterized in that: The system includes: The server management module is used to store and manage the server's IP address, port, username, and password. The instruction management module is used for combining instructions, setting reverse instructions, setting file upload instructions, and setting instruction templates. The file repository management module is used for file uploading and temporary storage of files to be uploaded; The task management module is used to execute instructions, manage instructions to be executed, and roll back and restore executed instructions. The instruction executor is used to log in to the server based on the server information in the server management module, obtain the permission to operate the server, and also to execute the instructions in the task sequentially using node-ssh. When an error is encountered, it automatically rolls back and restores the instruction operation according to the reverse instruction, displays the server feedback information to the user, and records the execution log. The instruction management module includes a data structure for implementing instruction combination and reverse instruction generation. The data structure for implementing instruction combination and reverse instruction generation includes: id, the unique identifier of the instruction; name, the name of the instruction; command, the command code or command template of an instruction; reversecommandid, the ID of the reverse command, used for rollback and restoration operations; children: A collection of child instruction IDs, an array type. If specified, the instruction is a compound instruction, the command field is invalid, and the specific instruction information is provided by children. `reversechildren` is a collection of reverse child instruction IDs, an array type, used for rollback and restoration operations. If this field is specified, it indicates that the reverse instruction is a composite instruction, and the `reversecommandid` field is invalid. The reverse instruction information is provided by `reversechildren`. The instruction template is formatted using ES6 string templates, and its form is: instruction text ${instruction variable}; The command text is immutable; the command variables are mutable and are assigned values by the Task Manager.
2. The visual computer instruction management system according to claim 1, characterized in that: The file repository management module includes a data structure for storing file information. The data structure for storing file information includes fileID as the unique ID of the file, and the path of the local file after storage.
3. The visual computer instruction management system according to claim 2, characterized in that: The instruction executor uses node-ssh to execute single or combined instructions in the task sequentially.
4. A visual computer instruction management system according to any one of claims 1-3, characterized in that: The task management module manages tasks according to the following steps: S101: Create a new task, set the task name, execution time and target server information; S102: Set the instruction to be executed; S103: Store files to be uploaded in the file repository management module; S104: Traverse the sub-instructions of the instruction to be executed and generate the final list of instructions to be executed; S105: Traverse the final list of instructions to be executed, obtain the instruction variable, and set the value of the instruction variable by the user. If the instruction variable is of type sourceId, obtain the file path in the file repository management module. S106: Save to task list; S107: Determine whether an execution time is set. If no execution time is set, the task is immediately handed over to the instruction executor for execution. If an execution time is set, the task list is traversed periodically. When a task expires, it is handed over to the instruction executor for execution. S108: Select whether to click the rollback and restore operation in the task list. If needed, the executed tasks will be handed over to the instruction executor for rollback and restore.
5. A visual computer instruction management system according to any one of claims 1-3, characterized in that: The instruction executor performs the task according to the following steps: S201: After the executor receives the task, it logs into the server using node-ssh's ssh.connect based on the server information in the task and obtains operation permissions. S202: Traverse the final list of instructions to be executed in the task, and replace the instruction variables in the instruction list with the instruction variable values set in the task; S203: Use node-ssh's ssh.execCommand to execute commands one by one; S204: If an upload command is encountered, the file path is found in the file repository management module through the sourceId value of the command, and the file is uploaded using node-ssh's ssh.putFile, where the source address of the uploaded file is path and the target address is the target of the command; S205: If an error is encountered, stop running, iterate through the executed instructions, execute the reverse instruction of the instruction, realize the automatic rollback of the task, and record the error information in the task management module; if a manual rollback instruction is received from the task list, iterate through and execute the reverse instruction of the instruction to realize the task rollback; if successful, record the success status in the task management module.
6. A visual computer instruction management method, characterized in that: The method utilizes the visual computer instruction management system described in any one of claims 1-5 for instruction management, and the method includes the following steps: S301: Use the instruction manager to add new instructions and set reverse instructions; S302: Use the instruction manager to combine the newly created instructions in S301 and set the reverse instructions to construct complex instructions; S303: Use Task Manager to create a new task, specify the command to be executed, the time to execute the task, or execute it immediately; S304: If an error is encountered during task execution, execution will be terminated, and a rollback operation will be performed according to the reverse instruction. S305: Process the task list, including immediately executing unexecuted tasks in the task list, canceling the execution of unexecuted tasks, or performing rollback operations on already executed tasks.
7. An electronic device, comprising: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in claim 6.
Citation Information
Patent Citations
Task scheduling method and device and electronic equipment
CN112948068A