Software automatic deployment method and system, electronic equipment and storage medium
By automatically detecting the operating system environment and software installation package types, the automated deployment and real-time online management of the software are solved, and the software installation paths of Linux or Unix kernel operating systems and domestic operating systems are not unified, version control is difficult, installation is complicated and operation is difficult, saving manpower and reducing costs.
Patent Information
- Application Number
- CN202411983856.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The software installation paths of Linux or Unix kernel operating systems and domestic operating systems are not unified, version control is difficult, installation is cumbersome and operation is difficult.
By automatically detecting the operating system environment of the target host, obtaining the operating system type, hardware architecture and operating system version, obtaining the software installation package type, and installing the software to the target storage path according to the operating system type and installation package type, collecting software installation information and formatting it into metadata, adding uniqueness identifiers and timestamps, writing metadata to the database, realizing the automated deployment of the software and real-time online management.
It realizes the automated deployment and real-time online management of the software, solves the problems of inconsistent software installation paths, difficult version control, cumbersome installation and difficult operation and maintenance, greatly saves manpower and reduces the cost of investment with high-performance computing clusters.
Smart Images

Figure CN119917121A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer software, and in particular relates to a software automation deployment method, system, electronic equipment and storage medium. Background Art
[0002] With the extensive and in-depth application of digital design in the field of nuclear power, the efficiency of design work has been greatly improved, providing support for the high-quality development of nuclear power. However, with the increase in the types and number of design software applications in nuclear power design, and the complexity of the operating environment and installation conditions (the design software operating environment mainly has three platforms: Windows, Linux and UNIX), the same software may have multiple versions, which brings huge challenges to software management and operation and maintenance.
[0003] At present, the design software running on the Windows platform can specify the installation path of the software or use the default installation path of the software through manual customized installation and deployment. After the installation is completed, the software needs to be run through the software's exe executable program or the shortcut of the executable program. The nuclear power design software running on the Windows platform is basically commercial software. The software packaging is mostly in the form of closures. The software package contains the software main program, software operating environment, software license management program, etc. In the customized automatic installation of software, the software using msi and exei packages can be customized and automatically installed, but automatic operation and maintenance and automatic version management cannot be achieved. If the design software is installed on the client, it can only repeat the work. The user proposes the installation requirements, and the IT engineer installs or handles the faults, and the work is repeated continuously, resulting in a waste of manpower. If the software is installed on the High Performance Computing (HPC) platform and used remotely in the form of authorization, the HPC hardware cost and maintenance and operation cost are high, and the operation speed is greatly affected by the network bandwidth.
[0004] Design software running on Linux or Unix platforms can also be installed and deployed manually through customized installation. You can specify the software installation path or use the software's default installation path. Then manually add the directory where the software's executable program is located to the environment variable, and then run the software through the graphical interface or Linux shell terminal. Currently, users engaged in design have insufficient knowledge of Linux or Unix operating systems. When using the software, human factors may cause the software to be unavailable or fail, resulting in a poor user experience. IT operation and maintenance personnel need to manually customize the installation of each software, and then set the software's running environment. The software can only be delivered for use after debugging. At the same time, users need to be trained on how to use it, which is time-consuming and laborious. Summary of the invention
[0005] The purpose of the present invention is to provide a method, system, device and medium for automatic software deployment, which automatically detects the target host operating system environment, automatically installs and deploys software, automatically collects software installation information and stores the installation information in a database, and displays all installed software through a web service engine to achieve real-time online management of installed software, thereby solving the technical problems of inconsistent software installation paths, difficult version control, cumbersome installation and difficult operation and maintenance for operating systems with Linux or Unix kernels and domestic operating systems.
[0006] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0007] The present invention provides a software automation deployment method, which comprises:
[0008] Detect the target host's operating system environment to obtain the operating system type, hardware architecture, and operating system version;
[0009] Obtain the software installation package type, and install the software to the target storage path according to the operating system type and the software installation package type;
[0010] Collecting software installation information and formatting the installation information into metadata;
[0011] A unique identifier and a timestamp are added to the metadata to obtain unique time-stamped metadata, and the unique time-stamped metadata is written into a permanent storage area.
[0012] In one embodiment of the present invention, the software automated deployment method further includes: reading the unique time-stamp metadata, and displaying the installed software through a data processing program.
[0013] In one embodiment of the present invention, the operating system types include Linux or Unix kernel operating systems and domestic operating systems.
[0014] In one embodiment of the present invention, detecting the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version includes:
[0015] Obtain the operating system type and the hardware architecture of the target host through the uname command;
[0016] The target host's operating system version is obtained by examining a series of distribution-specific files and commands.
[0017] In one embodiment of the present invention, obtaining the operating system type and the hardware architecture of the target host by using the uname command includes:
[0018] Obtain the operating system type of the target host through the uname -s command;
[0019] Use the uname -m command to obtain the hardware architecture of the target host.
[0020] In one embodiment of the present invention, the step of checking a series of files and commands specific to a distribution version to obtain the operating system version of the target host includes:
[0021] Read and display the distribution-specific file contents using the cat command;
[0022] Use the grep command to find the line containing the target string in the content of the distribution-specific file;
[0023] The second field is extracted by using the cut command with the first preset symbol as a delimiter, and the double quotes are deleted by using the tr command to obtain the operating system version of the target host described in plain text.
[0024] In one embodiment of the present invention, obtaining the operating system version of the target host by checking a series of distribution-specific files and commands includes: obtaining the operating system version of the target host by using the lsb command.
[0025] In one embodiment of the present invention, obtaining the software installation package type and installing the software to the target storage path according to the operating system type and the software installation package type includes:
[0026] Use the basename command to obtain the file name of the software installation package;
[0027] Using the awk command to split the file name with the second preset symbol and obtain the last field as the software installation package type;
[0028] Read the installation directory and version number of the software input by the user, and create the target storage path according to the installation directory and the version number;
[0029] Different installation commands are executed according to the operating system type and the software installation package type, so that the software is installed to the target storage path.
[0030] In one embodiment of the present invention, the collecting of software installation information and formatting the installation information into metadata includes:
[0031] Collect software installation information, including software name, software version, operating system type, operating system version, software installation time, installation host name, installation host IP address, and installer;
[0032] The installation information is formatted as metadata in CSV format.
[0033] In one embodiment of the present invention, the adding a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and writing the unique time-stamped metadata into a permanent storage area includes:
[0034] generating a unique identifier and a timestamp, and combining the unique identifier, the timestamp and the metadata to obtain the unique time-stamping metadata;
[0035] The unique time stamp data is written into the MySQL database for storage.
[0036] Based on the same inventive concept, another embodiment of the present invention further provides a software automatic deployment system, the system comprising:
[0037] A system environment checking device is used to detect the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version;
[0038] The software automatic installation device is used to obtain the type of software installation package and install the software to the target storage path according to the operating system type and the type of software installation package;
[0039] An installation information collection device is used to collect software installation information and format the installation information into metadata;
[0040] A data storage device, used for adding a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and writing the unique time-stamped metadata into a permanent storage area;
[0041] A software information display device, used to read the unique time-stamp metadata and display the installed software through a data processing program;
[0042] The software automatic operation and maintenance device is used to realize the automatic operation and maintenance of the installed software through autonomous programs.
[0043] Based on the same inventive concept, another embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0044] one or more processors;
[0045] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the software automation deployment method described in any of the above embodiments.
[0046] Based on the same inventive concept, another embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the software automation deployment method described in any of the above embodiments.
[0047] As described above, a software automation deployment method provided by the present invention has the following beneficial effects: by detecting the operating system environment of the target host, the operating system type, hardware architecture and operating system version are obtained, the software installation package type is obtained, and the software is installed to the target storage path according to the operating system type and the software installation package type, the software installation information is collected, and the installation information is formatted as metadata, a unique identifier and a timestamp are added to the metadata to obtain a unique time-stamped metadata, and the unique time-stamped metadata is written into a permanent storage area. The method can realize automatic detection of the target host operating system environment, automatic software installation and deployment, automatic collection of software versions, storage of software-related information in a database, and display of all installed software through a web service engine. The administrator can realize software version control, software upgrades, software authorization and other operations through a real-time online software management system, which solves the problems of Linux or Unix kernel operating systems and domestic operating systems, software installation and installation paths are not unified, version control is difficult, installation is cumbersome, and operation and maintenance are difficult, which greatly saves manpower, and compared with the cluster investment of HPC, saves a large amount of expenses, and has good economic benefits. Of course, any product implementing the present invention does not necessarily need to achieve all the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0049] Figure 1 A flowchart of a software automation deployment method provided for an exemplary embodiment of the present application.
[0050] Figure 2 A schematic diagram of a process for detecting an operating system environment of a target host provided by an exemplary embodiment of the present application.
[0051] Figure 3 A flowchart of obtaining the operating system type and hardware architecture provided by an exemplary embodiment of the present application.
[0052] Figure 4A flowchart of obtaining an operating system version is provided for an exemplary embodiment of the present application.
[0053] Figure 5 A schematic diagram of a process for obtaining a software installation package type and automatically installing software provided by an exemplary embodiment of the present application.
[0054] Figure 6 A flowchart of collecting software installation information and formatting it into metadata is provided for an exemplary embodiment of the present application.
[0055] Figure 7 A schematic diagram of a process for storing software installation information provided by an exemplary embodiment of the present application.
[0056] Figure 8 A structural diagram of a software automation deployment system provided for another exemplary embodiment of the present application.
[0057] Fig. 9 A schematic structural diagram of an electronic device provided for another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0058] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0059] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0060] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0061] In order to solve the technical problems of inconsistent software installation paths, difficult version control, cumbersome installation, and difficult operation and maintenance in Linux or Unix kernel operating systems and domestic operating systems, the present invention provides a software automation deployment method, which automatically detects the target host operating system environment, automatically installs and deploys software, automatically collects software installation information, and stores the installation information in a database, and displays all software installed on the target host through a web service engine, so as to realize real-time online management of installed software by users. Please refer to Figure 1 As shown, the software automatic deployment method includes the following steps:
[0062] S100: Detect the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version;
[0063] S200: Obtain the type of the software installation package, and install the software to a target storage path according to the operating system type and the type of the software installation package;
[0064] S300: Collecting software installation information and formatting the installation information into metadata;
[0065] S400: adding a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and writing the unique time-stamped metadata into a permanent storage area.
[0066] It should be noted that the software automatic deployment method further includes: reading the unique time-stamp metadata, and displaying the installed software through a data processing program. In this embodiment, the software management system developed by the python language is used to read the installation information data stored in step S400, and display all the software installed on the target host through the web service engine, so as to realize the overall display, statistics, and custom classification functions of the software.
[0067] The steps of the above software automation deployment method will be discussed in detail below.
[0068] First, step S100 is executed to detect the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version.
[0069] In an exemplary embodiment of the present application, the operating system type includes an operating system with a Linux or Unix kernel and a domestic operating system. It should be noted that Linux is an open source operating system, and Unix is a multi-user, multi-tasking operating system that supports multiple processor architectures.
[0070] In an exemplary embodiment of the present application, see Figure 2As shown, in step S100, the operating system environment of the target host is detected to obtain the operating system type, hardware architecture and operating system version, further comprising the following steps:
[0071] S110: Obtain the operating system type and the hardware architecture of the target host through the uname command;
[0072] S120: Obtain the operating system version of the target host by checking a series of files and commands specific to the distribution version.
[0073] In an exemplary embodiment of the present application, see Figure 3 As shown, in step S110, the operating system type and the hardware architecture of the target host are obtained by using the uname command, further comprising the following steps:
[0074] S111: Obtain the operating system type of the target host through the uname -s command;
[0075] S112: Obtain the hardware architecture of the target host through the uname -m command.
[0076] In an exemplary embodiment of the present application, see Figure 4 As shown, in step S120, by checking a series of files and commands specific to the distribution version, the operating system version of the target host is obtained, further comprising the following steps:
[0077] S121: reading and displaying the distribution-specific file content through the cat command;
[0078] S122: searching for a line containing a target string in the distribution-specific file content by using a grep command;
[0079] S123: extracting the second field by using the cut command with the first preset symbol as a delimiter, and deleting the double quotation marks by using the tr command to obtain the operating system version of the target host described in plain text.
[0080] It should be noted that, in an exemplary embodiment of the present application, in step S120, the operating system version of the target host is obtained by checking a series of distribution-specific files and commands, which also includes obtaining the operating system version of the target host through the lsb command.
[0081] Specifically, the uname -s command is used to obtain the operating system type of the target host, and is stored in the variable os_type, and the operating system type is printed and displayed in the system terminal. The uname -m command is used to obtain the hardware architecture of the target host, and is stored in the variable arch_type, and the hardware architecture is printed and displayed in the system terminal. An attempt is made to obtain and print the operating system version through a series of conditional judgments. It should be noted that the series of conditional judgments are sorted by priority, and the version information is attempted to be read from the most common to the less common system files or commands. For example, check whether the / etc / os-release file exists. If it exists, read the PRETTY_NAME field in the content of the file. It is worth noting that the / etc / os-release file is the standard location for storing version information for most modern Linux distributions. Check whether the lsb_release command is available. If it is available, use the lsb_release command to display the descriptive name of the system and obtain the operating system version from it. It is worth noting that the lsb_release command is common in operating systems based on Debian and Red Hat. Next, check system files such as / etc / lsb-release, / etc / debian_version, / etc / redhat-release, and / etc / SuSE-release one by one. These files are used to store version information in different Linux distributions. For specific distributions (such as Debian, Red Hat, SUSE, etc.), specific commands or file contents are used to extract version information.
[0082] It should be noted that if the above process still fails to successfully obtain the version information of the operating system, some more special files will continue to be checked, including system files such as / etc / release, / etc / irix-release, / etc / kylin-release, and / etc / uos-release. If all attempts to obtain the operating system version fail, the os_version variable is set to "unknown type system" and the operating system version is printed and displayed on the system terminal. It is worth noting that in this embodiment, in step S123, the first preset symbol is "=", that is, the second field is extracted by the cut command with "=" as the delimiter, and the double quotes are deleted by the tr command to obtain the operating system version of the target host described in plain text.
[0083] Next, step S200 is executed to obtain the type of software installation package, and install the software to the target storage path according to the operating system type and the type of software installation package.
[0084] In an exemplary embodiment of the present application, in step S200, the software installation package type is obtained, and the software is installed to the target storage path according to the operating system type and the software installation package type, further comprising the following steps:
[0085] S210: Obtain the file name of the software installation package through the basename command;
[0086] S220: split the file name with the second preset symbol through the awk command and obtain the last field as the software installation package type;
[0087] S230: reading the installation directory and version number of the software input by the user, and creating the target storage path according to the installation directory and the version number;
[0088] S240: Execute different installation commands according to the operating system type and the software installation package type, so that the software is installed to the target storage path.
[0089] Specifically, first remind the user to upload the software installation package corresponding to the operating system type, and set a path to wait for the user to upload. Once the uploaded file is detected, it will be automatically decompressed or installed according to the installation directory and software version entered by the user, as well as the detected operating system type and software installation package type. Finally, check and configure the bin directory of the software to the user's PATH environment variable. More specifically, first remind the user to upload a software installation package that matches the operating system type of the target host, then create a path on the target host to store the uploaded software installation package, and create a while loop to continuously check whether there is a software installation package file that conforms to a specific format (such as tar, tar.gz, deb, rpm, bin, dpkg, etc.) under the path. Once a file upload is detected, the loop will be immediately jumped out and the while loop will terminate. The file name of the software installation package is obtained through the basename command, the file name is split with the second preset symbol "." through the awk command and the last field is obtained as the type of the software installation package, the installation directory and version number of the software entered by the user are read, and the target storage path is created according to the installation directory and the version number, and different installation commands are executed according to the operating system type and the software installation package type, so that the software is installed to the target storage path. For example, for the Linux system, it will use different installation commands according to the software installation package type (such as tar, deb, rpm, etc.) to achieve automatic installation of the software. If the software installation package contains a bin directory, the directory is added to the user's PATH environment variable so that the user can run the executable file of the software directly in the command line. Finally, a message is printed on the system terminal indicating that the software has been successfully installed.
[0090] Next, step S300 is executed, that is, collecting the installation information of the software and formatting the installation information into metadata.
[0091] In an exemplary embodiment of the present application, in step S300, the installation information of the software is collected and the installation information is formatted into metadata, further comprising the following steps:
[0092] S310: Collecting software installation information, the installation information including software name, software version, operating system type, operating system version, software installation time, installation host name, installation host IP address and installer;
[0093] S320: Format the installation information into metadata in CSV format.
[0094] Specifically, define a variable INSTALL_INFO_FILE to store the path of the installation information file. Use the pgrep command to check whether there is a process matching the INSTALL_SCRIPT path running. If so, print a message in the system terminal to indicate that the automatic installation of the software is already running. Create a while loop to wait for the existence of the INSTALL_INFO_FILE file. If the file does not exist, continue the loop, and sleep for 1 second each time. It is worth noting that the purpose of creating a while loop here is to wait for the automatic installation of the software to complete. Collect the installation information of the software, which includes the software name, software version, operating system type, operating system version, software installation time, installation host name, installation host IP and installer. Format the collected installation information as metadata in CSV format, and append the formatted installation information to the INSTALL_INFO_FILE file.
[0095] Finally, step S400 is performed, that is, a unique identifier and a timestamp are added to the metadata to obtain unique time-stamped metadata, and the unique time-stamped metadata is written into a permanent storage area.
[0096] In an exemplary embodiment of the present application, in step S400, a unique identifier and a timestamp are added to the metadata to obtain unique time-stamped metadata, and the unique time-stamped metadata is written into a permanent storage area, further comprising the following steps:
[0097] S410: Generate a unique identifier and a timestamp, and combine the unique identifier, the timestamp and the metadata to obtain the unique time-stamping metadata;
[0098] S420: Write the unique time stamp data into the MySQL database for storage.
[0099] Specifically, define the MySQL database connection information, including the host name, user name, password and data name. Check whether the CSV file exists. If not, print a message on the system terminal to indicate that the CSV file does not exist. If yes, construct an SQL import command to generate a unique identifier and a timestamp, and combine the unique identifier, the timestamp and the metadata to obtain the unique time-stamp metadata. Finally, write the obtained unique time-stamp data into the MySQL database for storage. It should be noted that in this embodiment, the MySQL database is used to store the software installation information. Of course, in other embodiments, other types of databases can also be used to store the software installation information.
[0100] In summary, the present invention provides a method for automatic software deployment, which detects the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version, obtains the software installation package type, and installs the software to the target storage path according to the operating system type and software installation package type, collects the software installation information, and formats the installation information into metadata, adds a unique identifier and a timestamp to the metadata to obtain a unique time-stamped metadata, and writes the unique time-stamped metadata into a permanent storage area. The method can realize automatic detection of the target host operating system environment, automatic software installation and deployment, automatic collection of software versions, storage of software-related information in a database, and display of all installed software through a web service engine. The administrator can realize software version control, software upgrades, software authorization and other operations through a real-time online software management system, which solves the problems of Linux or Unix kernel operating systems and domestic operating systems, inconsistent software installation paths, difficult version control, cumbersome installation, and difficult operation and maintenance, greatly saving manpower, and compared with the cluster investment of HPC, saving a large amount of expenses, and having good economic benefits.
[0101] Based on the same inventive concept, please refer to Figure 8 As shown, another embodiment of the present invention further provides a software automation deployment system 11, the system comprising:
[0102] The system environment checking device 111 is used to detect the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version;
[0103] The software automatic installation device is used to obtain the type of software installation package and install the software to the target storage path according to the operating system type and the type of software installation package;
[0104] The installation information collecting device 113 is used to collect the installation information of the software and format the installation information into metadata;
[0105] The data storage device 114 is used to add a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and write the unique time-stamped metadata into a permanent storage area;
[0106] The software information display device 115 is used to read the unique time-stamp metadata and display the installed software through a data processing program;
[0107] The software automatic operation and maintenance device 116 is used to realize automatic operation and maintenance of installed software through an autonomous program.
[0108] It should be noted that the software automatic operation and maintenance device 116 is the background management module of the software information display device 115, which is used to realize the data and function management of the installed software and the software operation and maintenance functions, including software upgrades, software service start and stop, software offline and service suspension functions and software fault notification functions.
[0109] The software automation deployment system 11 includes the software automation deployment method described in any of the above embodiments. Since the software automation deployment system 11 provided in this embodiment belongs to the same inventive concept as the software automation deployment method provided in any of the above embodiments, it has at least the same beneficial effects as the software automation deployment method, and will not be described in detail here.
[0110] Based on the same inventive concept, please refer to Fig. 9 As shown, another embodiment of the present invention further provides an electronic device 1, which may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a software automation deployment program.
[0111] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as software automation deployment code, etc., but also can be used to temporarily store data that has been output or is to be output.
[0112] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device 1, and executes or executes programs or modules (such as software automation deployment programs, etc.) stored in the memory 12, and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
[0113] The processor 13 executes the operating system and various installed application programs of the electronic device 1. The processor 13 executes the application programs to implement the steps in the above-mentioned software automatic deployment method.
[0114] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a system environment checking device 111, a software automatic installation device 112, an installation information collecting device 113, a data storage device 114, a software information display device 115, and a software automatic operation and maintenance device 116.
[0115] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the software automation deployment method described in each embodiment of the present application.
[0116] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A software automation deployment method, characterized in that: include: Detect the target host's operating system environment to obtain the operating system type, hardware architecture, and operating system version; Obtain the software installation package type, and install the software to the target storage path according to the operating system type and the software installation package type; Collecting software installation information and formatting the installation information into metadata; A unique identifier and a timestamp are added to the metadata to obtain unique time-stamped metadata, and the unique time-stamped metadata is written into a permanent storage area.
2. The software automation deployment method according to claim 1, characterized in that: Also includes: The unique time stamp metadata is read and displayed by the data processing program to the installed software.
3. The software automation deployment method according to claim 1, characterized in that: The operating system types include Linux or Unix kernel operating systems and domestic operating systems.
4. The software automation deployment method according to claim 1, characterized in that: The detecting the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version includes: Obtain the operating system type and the hardware architecture of the target host through the uname command; The target host's operating system version is obtained by examining a series of distribution-specific files and commands.
5. The software automation deployment method according to claim 4, characterized in that: The obtaining the operating system type and the hardware architecture of the target host by using the uname command includes: Obtain the operating system type of the target host through the uname -s command; Use the uname -m command to obtain the hardware architecture of the target host.
6. The software automation deployment method according to claim 4, characterized in that: The operating system version of the target host is obtained by checking a series of distribution-specific files and commands, including: Read and display the distribution-specific file contents using the cat command; Use the grep command to find the line containing the target string in the content of the distribution-specific file; The second field is extracted by using the cut command with the first preset symbol as a delimiter, and the double quotes are deleted by using the tr command to obtain the operating system version of the target host described in plain text.
7. The software automation deployment method according to claim 4, characterized in that: The method of obtaining the operating system version of the target host by checking a series of files and commands specific to the distribution version includes: obtaining the operating system version of the target host by using the lsb command.
8. The software automation deployment method according to claim 1, characterized in that: The obtaining of the software installation package type and installing the software to a target storage path according to the operating system type and the software installation package type includes: Use the basename command to obtain the file name of the software installation package; Using the awk command to split the file name with the second preset symbol and obtain the last field as the software installation package type; Read the installation directory and version number of the software input by the user, and create the target storage path according to the installation directory and the version number; Different installation commands are executed according to the operating system type and the software installation package type, so that the software is installed to the target storage path.
9. The software automation deployment method according to claim 1, characterized in that: The collecting software installation information and formatting the installation information into metadata includes: Collect software installation information, including software name, software version, operating system type, operating system version, software installation time, installation host name, installation host IP address, and installer; The installation information is formatted as metadata in CSV format.
10. The software automation deployment method according to claim 1, characterized in that: The adding a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and writing the unique time-stamped metadata into a permanent storage area includes: generating a unique identifier and a timestamp, and combining the unique identifier, the timestamp and the metadata to obtain the unique time-stamping metadata; The unique time stamp data is written into the MySQL database for storage.
11. A software automation deployment system, characterized in that: The system comprises: A system environment checking device is used to detect the operating system environment of the target host to obtain the operating system type, hardware architecture and operating system version; The software automatic installation device is used to obtain the type of software installation package and install the software to the target storage path according to the operating system type and the type of software installation package; An installation information collection device is used to collect software installation information and format the installation information into metadata; A data storage device, used for adding a unique identifier and a timestamp to the metadata to obtain unique time-stamped metadata, and writing the unique time-stamped metadata into a permanent storage area; A software information display device, used to read the unique time-stamp metadata and display the installed software through a data processing program; The software automatic operation and maintenance device is used to realize the automatic operation and maintenance of the installed software through autonomous programs.
12. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the software automation deployment method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the software automation deployment method as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Method and system for managing Linux cluster software
CN102880935A
Operation system software installation method, device and equipment and storage medium
CN112527336A
Cross-multi-platform unified software distribution method and system based on Qt
CN115145594A
Automation system deployment method and related device
CN116107596A