Disclosure of Invention
The invention provides a hospital software automatic deployment method based on data elements in order to solve the problems.
The technical scheme of the invention is as follows: the hospital software automation deployment method based on the data elements comprises the following steps:
s1: uploading a software installation package, a configuration file and a third party dependent software system package to a company software deployment service management end;
s2: downloading installation software from a company software deployment service management through client software;
s3: uploading the software installation package and the software deployment script to the in-hospital software deployment service management end through client software;
s4: logging in the in-hospital software deployment service management end, establishing communication between the in-hospital software deployment service management end and a target server needing to install software, and performing software deployment and installation on the target server by utilizing shell commands corresponding to the target server.
Further, in step S1, the corporate software deployment service management end is configured to write a software deployment script, install the software deployment script, download software, and manage software data meta information;
the software deployment script comprises a shortcut command and a logic fragment for executing software deployment and installation operation;
the software data meta information includes configuration information of the software.
Further, the software data meta-information includes a target server data meta-model and a software data meta-model;
the target server data meta-model comprises a data meta-identifier, a data meta-value type and a data meta-name;
the software data meta-model comprises basic data meta-information of the software and the dependency relationship of the software;
the specific method for constructing the dependency relationship comprises the following steps: taking the target server information, the third-party dependent software configuration information and the basic data meta information of the software as a first set, taking the software configuration information as a second set, and enabling one element of the first set to correspond to a plurality of elements of the second set.
Further, in step S1, the specific method for managing the software data meta information by the company software deployment service management end is as follows: acquiring a software data meta-model; traversing JSON Object nodes corresponding to each data group in the software data element model, if a dependency relationship exists, determining software configuration information according to the dependency relationship, updating the data item values of the JSON Object nodes according to the software configuration information, otherwise, setting the data item values of the JSON Object nodes as default values; the data item value of the JSON Object node is used as configuration information.
Further, the company software deployment service management end adopts Chinese shortcut command to write software deployment script;
the Chinese shortcut command comprises a port conflict processing command, an installation file uploading and decompressing command and an executing interaction command;
the port conflict processing command is used for carrying out port conflict detection before software installation, and specifically comprises the following steps: if the planned use port of the software is already occupied, automatically taking the next unoccupied port as the planned use port;
the installation file uploading and decompressing command is used for decompressing after the software installation package and the configuration file are uniformly packaged and uploaded to the software deployment service management end;
the execution interaction command is used for taking the shell command as an execution parameter.
Further, in step S4, the specific method for determining the shell command corresponding to the target server is as follows: based on configuration information of software, establishing a mapping relation between the Chinese shortcut command and the shell command; the method comprises the steps of obtaining the type and the system version of a target server, and identifying a Chinese shortcut command of the target server; and determining the shell command corresponding to the target server according to the Chinese shortcut command and the mapping relation of the target server.
Further, in step S4, the specific method for establishing communication between the in-hospital software deployment service management end and the target server needing to install the software is as follows: compiling the Chinese shortcut command, converting the compiled Chinese shortcut command into a corresponding shell command according to the type of the target server, establishing communication between the in-hospital software deployment service management end and the target server needing to install software in an SSH mode, sending the corresponding shell command to the target server, returning an execution result of the target server to the in-hospital software deployment service management end, and determining whether to send the next shell command to the target server through the in-hospital software deployment service management end.
The beneficial effects of the invention are as follows:
(1) In a hospital network environment, compared with the prior art, the method can improve the efficiency of on-site personnel deployment and operation and maintenance, and effectively solve the problem of off-line installation and deployment of Linux software;
(2) According to the invention, the efficiency of developing the deployment script is improved by adopting the Chinese deployment script development language, and based on the data elements and the software dependent computing algorithm, the implementation personnel do not need to pay attention to information collection, arrangement and configuration of dependent software when the software is deployed, and the effort is mainly focused on software deployment model definition and dependency mapping relation definition, so that the project deployment requirement taking a hospital as a unit can be better met, and the multiplexing degree is improved.
Detailed Description
Embodiments of the present invention are further described below with reference to the accompanying drawings.
As shown in fig. 1, the invention provides a hospital software automation deployment method based on data elements, which comprises the following steps:
s1: uploading a software installation package, a configuration file and a third party dependent software system package to a company software deployment service management end;
s2: downloading installation software from a company software deployment service management through client software;
since the hospital environment is isolated from the internet environment, the corporate network has access to the internet environment. Therefore, an operator firstly accesses a company network in an internet environment, downloads required installation software from a company software deployment service management end through client side downloading software, and the downloaded information comprises a software installation package, a deployment script and the like.
S3: uploading the software installation package and the software deployment script to the in-hospital software deployment service management end through client software;
s4: logging in the in-hospital software deployment service management end, establishing communication between the in-hospital software deployment service management end and a target server needing to install software, and performing software deployment and installation on the target server by utilizing shell commands corresponding to the target server. The implementation personnel logs in the software deployment service management end software in the hospital, and maintains SSH login information of a target server needing to install the software.
The in-house software deployment service management side software provides detailed software installation operation management functions. After the installation of the target server, the software generates a corresponding deployment record, which records key information during the installation, such as the storage position of the software installation package, the installation position of the software program, the access IP, the port, the user name, the password and the like of the software.
In the embodiment of the present invention, in step S1, a corporate software deployment service management end is used for writing a software deployment script, installing the software deployment script, downloading software and managing software data meta-information;
the software deployment script comprises a shortcut command and a logic fragment for executing software deployment and installation operation;
the software data meta information includes configuration information of the software.
In the embodiment of the invention, the software data meta-information comprises a target server data meta-model and a software data meta-model;
the target server data meta-model comprises a data meta-identifier, a data meta-value type and a data meta-name;
the software data meta-model comprises basic data meta-information of the software and the dependency relationship of the software; in the invention, the server data meta-model and the software data meta-model are expressed by adopting a JSON structure. The data set is an object node of the software.
The specific method for constructing the dependency relationship comprises the following steps: taking the target server information, the third-party dependent software configuration information and the basic data meta information of the software as a first set, taking the software configuration information as a second set, and enabling one element of the first set to correspond to a plurality of elements of the second set.
By analyzing a large number of software installation processes, information elements describing the software installation are basically obtained, wherein the information elements comprise server data elements and software basic data elements. These service data are each composed of individual data items, each of which is a data element. The data elements contain some basic attributes as shown in table 1.
TABLE 1
Sequence number
|
Data element attribute name
|
Constraint
|
1
|
Data element identifier
|
Must choose
|
2
|
Data element name
|
Must choose
|
3
|
Definition of the definition
|
Must choose
|
4
|
Data type of data element value
|
Must choose
|
5
|
Representation format
|
Must choose
|
6
|
Data element allowable value
|
Must choose
|
7
|
Data element mapping definition
|
Must choose |
The server data meta-model is shown in table 2.
TABLE 2
As shown in fig. 2, in the software data meta-model, due to the variety of software, each software installation depends on both server environment information and other third party software installation information, and also depends on some basic information of itself. A specific meta-model needs to be formulated according to the information requirements of each software before the software is installed. The software data element model consists of two parts, wherein the first part is a software basic data element; the second part is to define each dependent software as independent software data group according to the dependency relation. The software dependent data set may also contain its sub-data set information, such as software data elements and value fields.
The software base data elements are shown in table 3.
TABLE 3 Table 3
In the software dataset, definition 1: the software dependency refers to software on which software currently being installed directly depends. If other software is relied on in the dependent software, the indirectly dependent software does not belong to the dependency relationship of the current software.
Since the software dependency is dynamic, it can be defined only according to specific dependency conditions, for example, the access information of the database should be defined if the database MySQL is relied on. In particular, FIG. 3 illustrates that WebA relies on three software, FTP, mySQL and Redis when deployed for use. The WebA data meta-model comprises basic data meta-information, mySQL data group, redis data group and FTP data group; the MySQL data set comprises an access IP, an access port, an access user name, an access password and an access database, the Redis data set comprises an access IP, an access port, an access user name, an access password and an access database, and the FTP data set comprises an access IP, an access port, an access user name, an access password and an access path.
Definition 2: the mapping definition is relied on, the set A= { server information, the software configuration information and the software basic information are relied on, and the set B= { software configuration information }, wherein software related to the software configuration information and the software basic information is software which is currently to be installed. The dependent software configuration information means that the software which is already installed is configured according to the configuration information, and the dependent software must be installed in advance. The correspondence between element x in set A and element y in set B is: 1. one x element may correspond to a plurality of y elements, and one y element value may be a defined default value. If the system uses the port to be deployed, the system can dynamically calculate according to the occupation condition, and 3, when a y element value is derived from an x element, the y element can only have a mapping relation with an x element, and the y element value is a value of the x element value processed based on a character string or is directly equal to the x element value.
In the embodiment of the present invention, in step S1, a specific method for managing software data meta information by a company software deployment service management end is as follows: acquiring a software data meta-model; traversing JSON Object nodes corresponding to each data group in the software data element model, if a dependency relationship exists, determining software configuration information according to the dependency relationship, updating the data item values of the JSON Object nodes according to the software configuration information, otherwise, setting the data item values of the JSON Object nodes as default values; the data item value of the JSON Object node is used as configuration information.
Based on the software deployment data meta-model and the software dependency relationship, the installation information of the newly deployed software can be calculated according to the software deployment information. In this way, the efficiency of software information collection and configuration by the practitioner during the implementation process can be improved, while reducing possible configuration errors.
In the embodiment of the invention, a company software deployment service management end adopts Chinese shortcut commands to write software deployment scripts; after the operation and maintenance personnel finishes uploading the software installation package, the corresponding software deployment script needs to be written. Considering the commands commonly used by software installation and deployment scripts, the invention is realized by adopting a Chinese shortcut command mode in order to improve the script writing efficiency.
The Chinese shortcut command comprises a port conflict processing command, an installation file uploading and decompressing command and an executing interaction command;
the port conflict processing command is used for carrying out port conflict detection before software installation, and specifically comprises the following steps: if the planned use port of the software is already occupied, automatically taking the next unoccupied port as the planned use port;
the installation file uploading and decompressing command is used for decompressing after the software installation package and the configuration file are uniformly packaged and uploaded to the software deployment service management end;
the execution interaction command is used for taking the shell command as an execution parameter.
The method comprises the steps that port conflict detection is carried out before software is installed, a port conflict processing command is designed, whether a planned use port is occupied or not is judged according to the current port occupation condition when the command is used, and if the planned use port is occupied, a non-occupied port is automatically calculated to be used as the planned use port; after the software compression package is uploaded in the software installation process, decompression operation is performed, and an installation file uploading and decompressing command is designed based on the situation. Meanwhile, the flexibility of meeting the scene coverage increasing command is considered, the execution interaction command is designed, a developer is allowed to directly use the shell command as an execution parameter, and the return of an execution result is realized in a callback mode.
In the embodiment of the present invention, in step S4, the specific method for determining the shell command corresponding to the target server is as follows: based on configuration information of software, establishing a mapping relation between the Chinese shortcut command and the shell command; the method comprises the steps of obtaining the type and the system version of a target server, and identifying a Chinese shortcut command of the target server; and determining the shell command corresponding to the target server according to the Chinese shortcut command and the mapping relation of the target server.
Because the shortcut command is actually executed or the shell command, taking the difference of the operating systems into consideration, a mapping relation between the shortcut command and each type of operating system shell command needs to be established manually, and the mapping relation is the basis for realizing the shortcut command, and the corresponding shell command is executed according to the system type during the actual execution. The Chinese shortcut command shields the process of learning commands of different operating systems by real-time personnel, and reduces the learning cost.
In the embodiment of the present invention, in step S4, the specific method for establishing communication between the in-hospital software deployment service management end and the target server needing to install software is as follows: compiling the Chinese shortcut command, converting the compiled Chinese shortcut command into a corresponding shell command according to the type of the target server, establishing communication between the in-hospital software deployment service management end and the target server needing to install software in an SSH mode, sending the corresponding shell command to the target server, returning an execution result of the target server to the in-hospital software deployment service management end, and determining whether to send the next shell command to the target server through the in-hospital software deployment service management end.
The execution process of the deployment script is as follows: step 1: the script compiling stage judges whether the script belongs to the category of the shortcut command according to the keyword, if the script is not in the category of the shortcut command, the command is considered to be illegal, and if the parameter definition is not in accordance with the requirement under the condition that the command is legal, the command is considered to be illegal. Step 2: the script escape stage can escape the compiled shortcut command into a shell command which can be executed by the operating system according to the type of the target operating system. Step 3: in the script execution stage, a remote communication connection is established with a target server in an SSH mode, the well-defined shell commands are sent to an operating system one by one to be executed, and the target server executes the step 4. And 4, executing the target server after receiving the shell command, returning the executed result to the sender in real time by the target server, and executing the step 5 by the sender. And step 5, the command sender judges whether to send the next shell command to the target server for execution or quit the execution of the current deployment script according to the execution logic of the deployment script after receiving the return result.
Based on the software deployment data element definition, the installation of one software can meet the following conditions
Condition 1: the installation software is independent of any other software and is only related to the information of the affiliated server.
Condition 2: the installation software depends on third party software installation information, the information of the affiliated server and self-contained basic information. Depending software of a third party software on which the software depends is installed according to the software dependency definition, such indirect dependency needs to be converted into a direct dependency data set.
The working principle and the working process of the invention are as follows: in a hospital environment, the existing software needs to support offline downloading, management of the software needs to be unified, and installation and deployment scripts are formulated for each software installation. The implementation is unified to a designated server to download the resources, upload the resources through the hospital intranet, and then install the resources. The invention adopts the data element ideas to uniformly describe the server and the software installation information, solves the problem of software dependence configuration when the installed software depends on a plurality of other software based on a multi-model fusion algorithm of the data elements, realizes the software deployment script development language of Chinese language, shields the management command difference of an operating system at the language level, provides an in-hospital Linux software library management system, and realizes the remote visual closed-loop management of Linux software.