A command calling method, system, device and readable medium

Through the command call method, the complex problem of operation and maintenance management in the software architecture transformation is solved, a unified command calling framework is provided, and the rapid integration of commands and remote calls are realized, which simplifies operation and maintenance management and supports the management of the entire life cycle.

CN114637612BActive Publication Date: 2025-08-12INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210289610.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2025-08-12
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

In the process of transforming software architecture from monolithic to microservice architecture, operation and maintenance management is complex, especially command development, deployment, update and remote call, and it is difficult to achieve unified operation and maintenance control and block operating system differences in existing technologies.

Method used

The methods of command invocation include command definition, publishing information and the connection establishment of the running node, deployment and update and configuration management, providing a unified command invocation framework, supporting identity authentication, permission control, log monitoring, etc., to realize the full life cycle management of commands.

Benefits of technology

It realizes rapid integration of commands and remote calls, solves the problem of difficult command reuse, provides identity authentication, permission control and monitoring statistics, and simplifies operation and maintenance management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637612B_ABST
    Figure CN114637612B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology and discloses a method, system, device, and readable medium for command invocation. The method comprises: defining a command for invoking a command in a command invocation framework; establishing a connection between the command's publishing information and a running node in the command invocation framework based on the command definition to obtain the running node to which the command belongs; deploying or updating the running node based on the command's publishing information and the node information of the running node; and establishing a configuration for the command invocation framework to enable a caller to invoke the command through the command invocation framework. The disclosed method provides management of the entire lifecycle of a command invocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a command calling method, system, device and readable medium. Background Art

[0002] Currently, software architectures are shifting from monolithic to microservices, and with the increasing number of servers, operations and maintenance are becoming increasingly complex. For example, stopping and starting services, automatically deploying and updating applications, and monitoring service status all require specific machines to perform corresponding functions. Some actions have dependencies, requiring a unified operations console for management. However, during actual command development and operation and maintenance invocation, some operations are tightly coupled with specific frameworks and are not designed and developed according to a command-based approach, making them difficult to reuse with other frameworks. Once a command is developed, how can it be distributed, deployed, and updated to the appropriate machines? How can this be achieved by masking differences in operating system programming, avoiding manual updates, achieving automatic updates, and remotely invoking commands be difficult? These are challenges facing existing technologies. Summary of the Invention

[0003] In view of this, the present invention proposes a command invocation method, system, device, and readable medium. The present invention proposes a command invocation method that manages the entire lifecycle of a command invocation through command development, command definition, command configuration, service-oriented command invocation, command deployment and update, command operation and maintenance monitoring, and command invocation code generation.

[0004] Based on the above purpose, one aspect of an embodiment of the present invention provides a command calling method, comprising the following steps: defining a command for calling a command in a command calling framework; establishing a connection between the publishing information of the command and the running node in the command calling framework according to the command definition to obtain the running node to which the command belongs; deploying or updating the running node according to the publishing information of the command and the node information of the running node; establishing a configuration for the command calling framework when calling the command, so as to enable the caller to call the command through the command calling framework.

[0005] In some embodiments, the command definition for calling a command in a command calling framework includes: setting two parameter receiving methods, namely, splicing command line strings and input streams, so that the command calling framework can receive input parameters of different lengths; establishing a command definition including a unique command identifier, execution program path, working directory, parameter receiving method, input parameter definition, output parameter definition, and whether it can be executed in parallel.

[0006] In some embodiments, establishing a connection between the release information of the command and the running node in the command calling framework according to the command definition to obtain the running node to which the command belongs includes: setting the download link of the command program to support the use of variables to apply to the download of the command program in different operating systems; establishing the release information of the command according to information including the operating system to which the command is applicable, the command program version, the command program download location, and the files that need to be deleted during the upgrade; and matching the command to the running node in the command calling framework through a command program deployment tool based on the release information of the command.

[0007] In some embodiments, the deployment or updating of the running node according to the release information of the command and the node information of the running node includes: managing the running node, obtaining the node information of the running node including the deployed commands, command versions, command installation locations and configurations; deploying or updating the running node according to the node information and the release information of the command, including downloading the command program, decompressing it to a specified directory, and deleting the file.

[0008] In some embodiments, the establishment of a configuration for the command calling framework to call the command so as to enable the caller to call the command through the command calling framework also includes: establishing a configuration including the authentication method, the caller's operating authority, whether to enable logging, and whether the command process is resident in memory when calling the command; providing statistics on the execution status of calling the command through log analysis of the command call, and feeding back the statistical results to the console.

[0009] In some embodiments, the configuration of establishing the command calling framework when calling the command to enable the caller to call the command through the command calling framework includes: the command calling framework encapsulates the call of the command as a remotely callable service, and provides a unified command calling entry. In response to the caller sending the command definition and corresponding parameters of the command through the command calling entry, the command calling framework matches the running node to which the command belongs to implement the call of the command.

[0010] In some embodiments, establishing the configuration of the command calling framework when calling the command to enable the caller to call the command through the command calling framework also includes: generating an agent that calls the command according to the command definition and corresponding parameters, and enabling the caller to call the command through the agent.

[0011] Another aspect of an embodiment of the present invention also provides a command calling system, comprising the following modules: a first module, configured to define a command for calling a command in a command calling framework; a second module, configured to establish a connection between the publishing information of the command and the running node in the command calling framework according to the command definition, so as to obtain the running node to which the command belongs; a third module, configured to deploy or update the running node according to the publishing information of the command and the node information of the running node; and a fourth module, configured to establish a configuration when the command calling framework calls the command, so as to enable the caller to call the command through the command calling framework.

[0012] Another aspect of an embodiment of the present invention provides a computer device comprising at least one processor; and a memory, wherein the memory stores computer instructions that can be executed on the processor, and when the instructions are executed by the processor, the steps of any of the above methods are implemented.

[0013] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium storing a computer program that implements any of the above method steps when executed by a processor.

[0014] The present invention has at least the following beneficial effects: the present invention proposes a method, system, device and readable medium for command calling, wherein the command calling method provided by the present invention automatically publishes a service that can be remotely called according to the command definition, and provides identity authentication, authority, command publishing, command deployment, command update, command monitoring statistics, command calling agent generation, and provides full life cycle management of commands. The command calling method provided by the present invention solves the problem of difficulty in command reuse by providing a command calling framework based on a unified command definition; after the command development is completed, the command can be integrated into the calling framework through simple configuration to achieve rapid command launch; the command is made into a service for callers to call, solving the problem of difficulty in remote command calling; in addition, it also provides configurations including identity authentication, operation authority control, logs, monitoring statistics analysis, etc. during the command call operation, providing management of the entire life cycle of the command call. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.

[0016] Figure 1 A schematic diagram of an embodiment of a command calling method provided by the present invention;

[0017] Figure 2 A schematic diagram of another embodiment of a command calling method provided by the present invention;

[0018] Figure 3 A schematic diagram of an embodiment of a command calling system provided by the present invention;

[0019] Figure 4 A schematic diagram of an embodiment of a computer device provided by the present invention;

[0020] Figure 5 A schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0021] The following describes embodiments of the present invention. However, it is to be understood that the disclosed embodiments are merely examples and other embodiments can take various alternative forms.

[0022] In addition, it should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one. The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusions, so that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but may also include elements not explicitly listed or inherent to such processes, methods, articles, or apparatuses.

[0023] One or more embodiments of the present application will be described below with reference to the accompanying drawings.

[0024] Based on the above objectives, a first aspect of an embodiment of the present invention provides an embodiment of a command calling method. Figure 1 FIG. 1 is a schematic diagram of an embodiment of a method for calling a command provided by the present invention. Figure 1 As shown, a command calling method according to an embodiment of the present invention includes the following steps:

[0025] S1. Define the command call in the command call framework;

[0026] S2. Establishing a connection between the command publishing information and the running node in the command calling framework according to the command definition to obtain the running node to which the command belongs;

[0027] S3. Deploy or update the running node according to the release information of the command and the node information of the running node;

[0028] S4. Establishing a configuration for the command calling framework to call the command, so that the caller can call the command through the command calling framework.

[0029] Figure 2 Shown is another schematic diagram of an embodiment of a command calling method provided by the present invention.

[0030] A method for command calling is provided, which establishes a command calling framework to manage command calling and defines a command, and uses metadata to describe the command, which has good scalability and mainly includes: a unique command identifier, an entry program path, a working directory, a parameter receiving method, an input parameter definition, an output parameter definition, whether parallel execution is possible, and other information. As shown in Table 1, the content of the command definition provided in the embodiment of the present invention is understood to include, but not limited to, only the command definition in Table 1 in actual applications. The metadata of the command definition can be further expanded as needed. The command definition is an abstract definition that does not strongly identify the operating system or programming language. Regarding the parameter receiving method, considering that the command calling has a limit on the length of the command line, when the input parameter is too large, it is not suitable for calling by splicing the command line. Two parameter input methods are provided in the embodiment of the present invention. When the input parameter is small, a direct string splicing method is used; when the input parameter is large, an input stream method is used. For the input stream method, a signal needs to be set. When the command program requires a parameter, a parameter input signal is issued. After the input signal is detected, the parameter is written to the input stream. As for whether it can be executed in parallel, because some commands can only be executed serially, if the called command is executed serially, when there are multiple command execution requests, they can only wait in queue.

[0031] Attribute Number Property Name Attribute Type Id Unique identifier String Code serial number String Name name String ProgramEntry Entry program path String WorkDir Working Directory String EnableLog Enable Logging Boolean Args Fixed parameter list String[] EnableStreamInput Enable input stream input Boolean InputSignal Parameter stream input signal String Charset Character Set String EnableArgsVarReplace Enable parameter variable substitution Boolean

[0032] Table 1

[0033] In an embodiment of the present invention, based on the command definition, a connection is established between the command's release information and the execution node in the command invocation framework, and the execution node to which the command belongs is found within the command invocation framework. The release information includes a command compressed package and a release information file. The command compressed package includes the application file and the command definition file, supporting compressed file types such as zip and tar. The release information file contains information such as the applicable operating system (Windows, Linux, Mac, etc.), the command program version, the program download location, and files to be deleted during upgrades. As shown in Table 2, the contents of the release information file provided in an embodiment of the present invention include, but are not limited to, the release information in Table 2 in actual applications. The release information content can be further expanded as needed. Command release primarily involves publishing new commands and new command versions. After a command developer completes development, they place the command program and release information into the command invocation framework, which automatically matches the command to the execution node within the framework. When releasing a new command version, in addition to updating the command program, some files may also be deleted. Command programs developed in different programming languages have different contents in different operating systems. For example, command programs developed in the Go language are completely different in Windows and Linux operating systems. Therefore, the command programs corresponding to each command need to be divided by operating system, but the release information file is the same. Therefore, the download link of the command program supports the use of variables. For example, the download link of the patch update command is: 127.0.0.1 / tool / @@OS@@ / patchcommand.zip, where @@OS@@ is a variable and the download tool will replace it according to the operating system of the running node.

[0034]

[0035] Table 2

[0036] Based on the command release information, the command's execution node can be found within the command invocation framework. Using the node information of the execution node, the command can be deployed or updated. Node information primarily includes: IP address, port number, deployed commands, command version, command installation location and configuration, public key, etc. This information allows the command, command version, and command installation directory installed on the execution node to be retrieved, enabling operations such as downloading the command program, extracting it to a designated directory, and deleting files. When updating a command, before overwriting a file, program usage issues arise. Therefore, the current command must first be stopped, the corresponding process ID of the executable program for the current command must be queried, and the process exited. The entire command update is automatically deployed and updated by the backend after receiving the command. Command deployment and updates are also standard commands, and corresponding operation logs will be generated.

[0037] Establish a command call framework to configure the command call during operation, including authentication methods, operation permissions, whether to enable logging, and whether the command process is resident in memory. Regarding authentication methods, private key signatures, public key verification, username and password, tokens, and other authentication methods are supported, and authentication methods can be expanded. Regarding operation permissions, the caller's permissions are controlled to prevent unauthorized users from executing commands. Support is provided for setting the logging range, and request and response parameters can be specified separately. Since some commands are frequently called, if a process is started for each call, performance and resource consumption issues will arise. Therefore, configuration is provided for whether to be resident in memory.

[0038] To analyze command calls and facilitate subsequent improvements and upgrades, we analyze backend logs to collect command execution status, including the number of failures and successes. For each command execution, if logging is enabled, you can view the command execution log using a generated unique representation, including input parameters, output parameters, success rate, exception stack trace, etc., and then feed the statistical results to the console.

[0039] The command itself can be executed through the command line. To facilitate the caller's call, the command call framework provides a unified command call entry, that is, the command call is encapsulated and then published as a remotely callable service. It supports publishing services in styles such as Socket, Rest, and Web Service.

[0040] Through the command definition and the corresponding parameters, a proxy for the command calling end can be generated. By default, proxy codes in multiple programming languages are supported. The caller can call the command through the proxy, making it convenient for the caller to call the command.

[0041] Based on the above purpose, the second aspect of an embodiment of the present invention proposes a command calling system, comprising the following modules: a first module 011, configured for defining a command for calling a command in a command calling framework; a second module 012, configured for establishing a connection between the publishing information of the command and the running node in the command calling framework according to the command definition, so as to obtain the running node to which the command belongs; a third module 013, configured for deploying or updating the running node according to the publishing information of the command and the node information of the running node; and a fourth module 014, configured for establishing a configuration when the command calling framework calls the command, so as to enable the caller to call the command through the command calling framework.

[0042] Based on the above objectives, a third aspect of the embodiments of the present invention provides a computer device, Figure 4 FIG. 1 is a schematic diagram of an embodiment of a computer device provided by the present invention. Figure 4As shown, an embodiment of a computer device provided by the present invention includes the following modules: at least one processor 021; and a memory 022, wherein the memory 022 stores computer instructions 023 that can be run on the processor 021, and the computer instructions 023 implement the steps of any of the above methods when executed by the processor 021.

[0043] The present invention also provides a computer-readable storage medium. Figure 5 FIG. 1 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Figure 5 As shown, the computer-readable storage medium 031 stores a computer program 032 that performs the above method when executed by a processor.

[0044] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program for setting the system parameters can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). The above-mentioned computer program embodiments can achieve the same or similar effects as any of the corresponding aforementioned method embodiments.

[0045] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a processor, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present invention are performed.

[0046] In addition, the above method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.

[0047] It will also be appreciated by those skilled in the art that the various exemplary logic blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.

[0048] In one or more exemplary designs, the function can be implemented in hardware, software, firmware or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transmit a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. As an example and not limitation, the computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of an instruction or data structure and can be accessed by a general or special-purpose computer or a general or special-purpose processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DOL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DOL or wireless technologies such as infrared, radio and microwaves are all included in the definition of medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0049] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.

[0050] It should be understood that, as used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" is intended to include any and all possible combinations of one or more of the associated listed items.

[0051] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0052] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program instructing the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.

[0053] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples. Within the spirit of the embodiments of the present invention, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the scope of protection of the embodiments of the present invention.

Claims

1. A command calling method, characterized in that: include: Perform command definition for calling commands in the command calling framework, which includes: establishing a command definition including a unique identifier of the command, an execution program path, a working directory, a parameter receiving method, an input parameter definition, an output parameter definition, and whether parallel execution is possible; Establishing a connection between the command release information and the running node in the command calling framework according to the command definition to obtain the running node to which the command belongs, which includes: establishing the command release information according to information including the operating system applicable to the command, the command program version, the command program download location, and files that need to be deleted during upgrade; and matching the command to the running node in the command calling framework through a command program deployment tool based on the command release information; Deploy or update the running node according to the release information of the command and the node information of the running node; A configuration for the command calling framework to call the command is established to enable the caller to call the command through the command calling framework.

2. The command calling method according to claim 1, characterized in that: The command definition for calling a command in the command calling framework includes: Two parameter receiving modes, namely, splicing command line strings and input streams, are set so that the command calling framework can receive input parameters of different lengths.

3. The command calling method according to claim 1, characterized in that: The establishing of a connection between the release information of the command and the running node in the command calling framework according to the command definition to obtain the running node to which the command belongs includes: The download link of the command program can support the use of variables to adapt to the download of the command program in different operating systems.

4. The command calling method according to claim 1, characterized in that: The deploying or updating the running node according to the release information of the command and the node information of the running node includes: Managing the running nodes and obtaining node information of the running nodes including deployed commands, command versions, command installation locations, and configurations; The running node is deployed or updated according to the node information and the release information of the command, including downloading the command program, decompressing it to a designated directory, and deleting the file.

5. The command calling method according to claim 1, characterized in that: The step of establishing a configuration for the command calling framework to call the command so as to enable the caller to call the command through the command calling framework further includes: Establishing configurations for calling the command, including authentication method, caller's operation permissions, whether logging is enabled, and whether the command process is resident in memory; The execution status of the command is analyzed by analyzing the log of the command call, and the statistical results are fed back to the console.

6. The command calling method according to claim 1, characterized in that: The establishing of the configuration of the command calling framework when calling the command so as to enable the caller to call the command through the command calling framework includes: The command calling framework encapsulates the calling of the command as a remotely callable service and provides a unified command calling entry; In response to the caller sending the command definition and corresponding parameters of the command through the command calling entry, the command calling framework matches the running node to which the command belongs, and implements the calling of the command.

7. The command calling method according to claim 1, characterized in that: The step of establishing a configuration for the command calling framework to call the command so as to enable the caller to call the command through the command calling framework further includes: An agent for calling the command is generated according to the command definition and corresponding parameters, and the caller's calling of the command is realized through the agent.

8. A command calling system, characterized in that: include: The first module is configured to define a command for calling a command in a command calling framework; A second module is configured to establish a connection between the release information of the command and the running node in the command calling framework according to the command definition, so as to obtain the running node to which the command belongs; A third module is configured to deploy or update the running node according to the release information of the command and the node information of the running node; as well as The fourth module is configured to establish a configuration for the command calling framework to call the command, so as to enable the caller to call the command through the command calling framework; The first module is further used to: establish a command definition including a unique command identifier, an execution program path, a working directory, a parameter receiving method, an input parameter definition, an output parameter definition, and whether parallel execution is possible; The second module is also used to: establish the release information of the command based on information including the operating system applicable to the command, the command program version, the command program download location, and the files that need to be deleted during the upgrade; and match the command to the running node in the command calling framework through the command program deployment tool based on the release information of the command.

9. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and device for visually publishing software, electronic equipment and storage medium

    CN110096284A

  • Big data operation and maintenance management platform

    CN111158743A