Installation file generation method, device, electronic device and storage medium
By automatically generating KickStart files, using step multi-fork trees and task forests to build an orderly and ring-free graph, it solves the problems of inefficient and error-prone problems in manual writing KickStart files, and realizes efficient and accurate installation file generation and configuration to meet the needs of large-scale server operating system installation.
Patent Information
- Application Number
- CN202411773109.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-08
AI Technical Summary
Manually writing KickStart files is inefficient and prone to configuration errors, which affects the configuration efficiency of KickStart files and cannot meet the server operating system installation requirements.
By obtaining the step molecules and task atoms divided in the historical installation file, building a step multi-fork tree and task forest, assembling it into an ordered ring-free graph, determining the execution order of task atoms, generating an installation file template and rendering it into a target installation file.
It reduces the workload of manually maintaining KickStart files, reduces the possibility of human writing errors, improves the efficiency and accuracy of installation files, enhances the configuration efficiency of KickStart files, and meets the needs of large-scale server operating system installation.
Smart Images

Figure CN119781784A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to an installation file generation method, an installation file generation device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the advent of the cloud computing era, cloud vendors need to purchase a large number of server devices and install operating systems on them. PXE installation is an efficient solution for batch server operating system installation. KickStart files are necessary files for installation using PXE. Kickstart files contain answers to all questions that the installation program or operating system usually asks, such as the time zone used by the system, how the drive should be partitioned, and which software packages should be installed.
[0003] At present, the traditional method is to manually write KickStart files. This method that relies on manually writing installation files has many problems: First, due to the continuous expansion of cloud server device types, device functions and the increase in the number of devices, manually writing KickStart files is difficult and time-consuming. In addition, due to human factors, configuration errors or configuration omissions may occur. Therefore, manually writing KickStart files required for installation is inefficient and prone to configuration errors, which seriously affects the configuration efficiency of the KickStart files and cannot meet the server operating system installation requirements. Summary of the invention
[0004] In view of this, the present invention aims to propose an installation file generation method, device, electronic device and storage medium to solve the problem that manually writing the KickStart file required for installation is inefficient and prone to configuration errors, which affects the configuration efficiency of the KickStart file and cannot meet the server operating system installation requirements.
[0005] According to a first aspect of the present invention, a method for generating an installation file is provided, the method comprising:
[0006] Get the step molecules and task atoms divided in the historical installation file;
[0007] A step multitree is constructed using the dependency relationship of the step molecules, and a task forest is constructed using the dependency relationship of the task atoms;
[0008] Assembling the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph;
[0009] Obtaining operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template;
[0010] The installation file template is rendered using the operation to be executed to obtain a target installation file for the server to be installed.
[0011] Optionally, the step of obtaining the step molecules and task atoms divided in the historical installation file includes:
[0012] Obtain historical installation files of various types of servers, and determine the installation steps and installation tasks in the historical installation files;
[0013] Determining a predefined dependency relationship between the installation step and the installation task; wherein the installation step includes the installation task;
[0014] The installation steps and the installation tasks are divided according to dependency relationships to obtain step molecules and task atoms.
[0015] Optionally, constructing a step multitree by using the dependency relationship of the step molecules, and constructing a task forest by using the dependency relationship of the task atoms, comprises:
[0016] Obtaining predefined dependencies of step molecules and dependencies of the task atoms;
[0017] Deducing the steps using the dependency relationship of the step molecules to construct a multi-branch tree of steps;
[0018] The dependency relationship of the task atoms is used to perform task deduction, to construct at least two task multi-branch trees, and the task multi-branch trees are combined to obtain a task forest.
[0019] Optionally, assembling the step multitree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph includes:
[0020] Generate an ordered acyclic graph of task atoms according to the topological relationship between the step multitree and the task atoms in the task forest;
[0021] A task atom execution linked list is obtained according to the ordered acyclic graph, and the task atom execution linked list is used to store the execution order of the task atoms.
[0022] Optionally, the obtaining of operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template includes:
[0023] Obtaining operations to be performed on the server to be installed; wherein the operations to be performed include at least one of an installation step and an installation task;
[0024] Traversing the task atoms in the ordered acyclic graph according to the operation to be executed, and determining an ordered acyclic graph matching the operation to be executed;
[0025] The ordered acyclic graph is used to generate an installation file template.
[0026] Optionally, the step of using the ordered acyclic graph to generate an installation file template includes:
[0027] Calling a preset installation file template framework, and converting the task atomic execution linked list corresponding to the ordered acyclic graph into a preset format text;
[0028] The preset format text is integrated with the preset installation file template framework to generate an installation file template.
[0029] Optionally, the using the operation to be performed to render the installation file template to obtain a target installation file of the server to be installed includes:
[0030] Obtaining configuration information of the operation to be performed;
[0031] The configuration information of the operation to be executed is rendered to the installation file template to obtain the target installation file of the server to be installed.
[0032] According to a second aspect of the present invention, there is provided an installation file generating device, the device comprising:
[0033] An acquisition module is used to obtain step molecules and task atoms divided in the historical installation file;
[0034] A construction module, used to construct a step multitree using the dependency relationship of the step molecules, and to construct a task forest using the dependency relationship of the task atoms;
[0035] A processing module, used for assembling the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph;
[0036] A template generation module is used to obtain operations to be executed of the server to be installed, determine an ordered acyclic graph matching the operations to be executed, and use the ordered acyclic graph to generate an installation file template;
[0037] The template rendering module is used to render the installation file template using the operation to be executed to obtain the target installation file of the server to be installed.
[0038] According to another aspect of the present invention, there is also provided an electronic device, comprising:
[0039] processor;
[0040] a memory for storing instructions executable by the processor;
[0041] The processor is configured to execute the instructions to implement the installation file generation method as described above.
[0042] According to another aspect of the present invention, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the installation file generating method described above are implemented.
[0043] The installation file generation method provided by the embodiment of the present invention obtains the step molecules and task atoms divided in the historical installation file, constructs a step multitree using the dependency relationship of the step molecules, and constructs a task forest using the dependency relationship of the task atoms, assembles the step multitree and the task forest to obtain an ordered acyclic graph, determines the execution order of the task atoms in the ordered acyclic graph, obtains the to-be-executed operations of the server to be installed, determines the ordered acyclic graph matching the to-be-executed operations, generates an installation file template using the ordered acyclic graph, renders the installation file template using the to-be-executed operations, and obtains the target installation file of the server to be installed. The embodiment of the present invention abstracts the installation operation into atoms, automatically arranges the topological relationship of the task atoms, obtains the ordered acyclic graph of the task atoms, and automatically generates the KS file based on the installation operation to be executed and the ordered acyclic graph of the task atoms, thereby reducing the workload of manually maintaining the entire set of KS files, and reducing the possibility of errors in manually writing KiskStart files, thereby improving the generation efficiency and accuracy of the installation file, further improving the configuration efficiency of the KickStart file, and meeting the large-scale server operating system installation requirements.
[0044] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0046] Figure 1is a flowchart of a method for generating an installation file provided by an embodiment of the present invention;
[0047] Figure 2 yes Figure 1 Flow chart of step 101 in the installation file generation method provided by the embodiment of the present invention;
[0048] Figure 3 yes Figure 1 Flow chart of step 102 in the installation file generation method provided by the embodiment of the present invention;
[0049] Figure 4 yes Figure 1 Flow chart of step 103 in the installation file generation method provided by the embodiment of the present invention;
[0050] Figure 5 yes Figure 1 Flow chart of step 104 in the installation file generation method provided by the embodiment of the present invention;
[0051] Figure 6 yes Figure 1 Flow chart of step 105 in the installation file generation method provided by the embodiment of the present invention;
[0052] Figure 7 This is a scenario diagram of the installation file generation method provided by an embodiment of the present invention. Figure 1 ;
[0053] Figure 8 It is a schematic diagram of the architecture of the installation file generation method provided by an embodiment of the present invention;
[0054] Fig. 9 This is a scenario diagram of the installation file generation method provided by an embodiment of the present invention. Figure 2 ;
[0055] Fig.10 It is a structural schematic diagram of an installation file generating device provided by an embodiment of the present invention;
[0056] Fig.11 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0058] Reference Figure 7 , which shows a scenario diagram of the installation file generation method provided by an embodiment of the present invention Figure 1 Traditional KickStart files rely on manual configuration, which is stored in the system after configuration and called when the operating system is installed on the server. However, manual KickStart files required for installation are inefficient and prone to configuration errors. Therefore, in cloud server OS deployment, automatic generation of KickStart files is very necessary. This embodiment uses a unified platform to achieve centralized management and configuration updates of KickStart files for different cloud computing products and devices from different manufacturers, and customizes and generates KS files according to different hardware environments and installation requirements. Through automated orchestration, the possibility of errors in manually writing KiskStart files is reduced. The DAG algorithm automatically calculates the rules required by different products and different roles, making KS files easier to maintain and expand.
[0059] Reference Figure 1 , shows a flowchart of the steps of the installation file generation method provided by an embodiment of the present invention, the method may include:
[0060] Step 101, obtaining the step molecules and task atoms divided in the historical installation file.
[0061] In an embodiment of the present invention, in order to solve the problem that manually writing the KickStart file required for installation is inefficient and prone to configuration errors, which affects the configuration efficiency of the KickStart file and cannot meet the installation requirements of the server operating system, this embodiment abstracts the installation steps and installation tasks into atomic code blocks and standardized description languages, automatically customizes and generates KS files according to different installation requirements, and realizes automatic and rapid generation of KickStart files without manual writing, thereby simplifying the workload of deployment personnel and reducing the probability of manual deployment failure. The configuration efficiency of the KickStart file is greatly improved by automatically arranging and generating files.
[0062] It should be noted that, refer to Figure 8, a schematic diagram of the architecture of the installation file generation method provided in an embodiment of the present invention, the installation file in this embodiment is a KickStart file, and the KickStart file is usually used to automate the installation and configuration process of the operating system, especially in the Linux system. The installation file is a text file that contains a series of installation and configuration instructions for installing and initializing the operating system in unattended mode.
[0063] Specifically, in this embodiment, the step molecules and task atoms divided in the historical installation file are obtained. The historical installation file is a sample installation file for various types of servers, which can be a sample file pre-configured by an operator. The historical installation file includes installation and configuration operations for various types of servers. This embodiment divides the installation and configuration operations of the historical installation file through an atomic model, and divides the complex steps or tasks of the installation into independent step molecules or task atoms, and defines the dependency and sequence relationships between the atoms. The sequence relationship and dependency relationship are defined in combination with the steps required for the installation, such as partitioning the disk first and then installing the driver, etc., wherein the atomic model is a method of decomposing a complex system or process into the most basic, indivisible units or components. These basic units are called "atoms", and atoms are the smallest, indivisible operations or tasks in the system.
[0064] In this embodiment, the step molecules divided in the historical installation file include but are not limited to operating system setting molecules, user setting molecules, disk setting molecules, server network setting molecules, etc., and the task atoms divided in the historical installation file include but are not limited to time zone setting atoms, language setting atoms, user name and password configuration atoms, firewall setting atoms, storage intranet configuration atoms, computing intranet configuration atoms, etc. Each atomic operation can be represented as a node, and the dependency relationship between nodes is represented as directed edges, which will not be repeated here.
[0065] Step 102, using the dependency relationship of step molecules to construct a step multi-branch tree, and using the dependency relationship of task atoms to construct a task forest.
[0066] In an embodiment of the present invention, the dependency relationship of step molecules is used to construct a step multi-branch tree, and the dependency relationship of task atoms is used to construct a task forest. In this way, the dependency relationship and sequence relationship between each step and task can be clearly represented, so as to better manage and execute the automatic generation of KickStart files.
[0067] In this embodiment, the step molecule is a higher-level abstraction, representing a complete set of subtasks. Each step molecule contains multiple task atoms, which together complete a specific function. Through the dependency relationship of the step molecules, a multi-branch tree structure can be constructed to represent the dependency and sequence relationship between each step. The task atom is a lower-level abstraction, representing a specific operation or configuration. Each task atom is an independent atomic operation and can be represented as a node. Through the dependency relationship of the task atoms, multiple multi-branch tree structures can be constructed. Multiple multi-branch tree structures are combined into a task forest, which represents the dependency and sequence relationship between each task.
[0068] It should be noted that, refer to Fig. 9 , is a scenario diagram of the installation file generation method provided by an embodiment of the present invention Figure 2 Each node in the step molecule multitree structure represents a step molecule. The edges between nodes represent the dependency relationship of step molecules. If a step molecule depends on another step molecule, there is an edge from the dependent step molecule to the dependent step molecule. The hierarchical structure of the multitree can clearly represent the execution order of each step. For example, suppose there are the following step molecules and their dependencies: operating system setting molecule to user setting molecule, operating system setting molecule to disk setting molecule, then a multitree is constructed based on this dependency. The task forest of task atoms consists of multiple task atom multitrees. Each task atom multitree represents a group of task atoms and their dependencies. If a task atom depends on another task atom, there is an edge from the dependent task atom to the dependent task atom. The hierarchical structure of each task atom multitree in the task forest can clearly represent the execution order of each task.
[0069] Step 103, assemble the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determine the execution order of the task atoms in the ordered acyclic graph.
[0070] In an embodiment of the present invention, the step multi-branch tree and the task forest are assembled into an ordered acyclic graph (Directed Acyclic Graph, DAG), and the execution order of the task atoms in the ordered acyclic graph is determined. The ordered acyclic graph can clearly represent the dependency and sequence relationship between the various steps and tasks. It should be noted that the ordered acyclic graph is a special directed graph, in which there is no loop starting from a node and passing through several edges back to the node. All edges in the DAG are directed, and there is no closed loop in the graph.
[0071] Specifically, the step multi-branch tree and the task forest are assembled into an ordered acyclic graph, each step molecule and task atom is represented as a node, and the dependency relationship between nodes is represented as a directed edge. In the ordered acyclic graph, the execution order of task atoms can be determined by topological sorting. Topological sorting is an algorithm for sorting the nodes of a directed acyclic graph, so that for each directed edge u to v, node u appears before node v in the sorting. We will not go into details here.
[0072] Step 104, obtaining the operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template.
[0073] In an embodiment of the present invention, the operations to be executed of the server to be installed are obtained, an ordered acyclic graph (DAG) matching the operations to be executed is determined, and an installation file template is generated using the ordered acyclic graph to automatically generate a KickStart file that meets specific requirements, thereby improving the efficiency and accuracy of configuration file generation.
[0074] Specifically, obtain the operations to be executed of the server to be installed. The operations to be executed may include operating system settings, user settings, disk settings, network settings, security settings, software package installation and service configuration, etc., determine the ordered acyclic graph that matches the operations to be executed, or construct an ordered acyclic graph by analyzing the dependencies of the operations to be executed. The ordered acyclic graph represents the dependencies and sequence relationships between the operations. A KickStart file template that meets specific requirements is generated through the ordered acyclic graph. Each operation can be represented as a configuration item. The execution order of the operations is determined through topological sorting, and the corresponding installation file template is generated.
[0075] It should be noted that the operations to be executed on the server to be installed can be the atomic operations required by the user according to different business needs, which are used to confirm the installation process and the final target effect, so as to ensure that the selected atomic operations can meet the user's specific server startup configuration requirements. Through the user's selection, the corresponding KickStart file template can be generated according to the user's needs, which improves the efficiency and accuracy of configuration file generation, better manages and executes the automatic generation of installation files, and meets the needs of large-scale server delivery.
[0076] Step 105: Render the installation file template using the operation to be executed to obtain the target installation file of the server to be installed.
[0077] In the embodiment of the present invention, the installation file template is rendered by the operation to be executed to obtain the target installation file of the server to be installed, and the KickStart file that meets the specific requirements can be automatically generated, thereby improving the efficiency and accuracy of generating the configuration file. Specifically, the installation file template is rendered by the operation to be executed to generate the KickStart file that meets the specific requirements, and each placeholder in the installation file template is replaced with the specific value in the operation to be executed, and the installation file template is rendered by these specific values to generate the target installation file KickStart file of the server to be installed.
[0078] The installation file generation method provided by the embodiment of the present invention obtains the step molecules and task atoms divided in the historical installation file, constructs a step multitree using the dependency relationship of the step molecules, and constructs a task forest using the dependency relationship of the task atoms, assembles the step multitree and the task forest to obtain an ordered acyclic graph, determines the execution order of the task atoms in the ordered acyclic graph, obtains the to-be-executed operations of the server to be installed, determines the ordered acyclic graph matching the to-be-executed operations, generates an installation file template using the ordered acyclic graph, renders the installation file template using the to-be-executed operations, and obtains the target installation file of the server to be installed. The embodiment of the present invention abstracts the installation operation into atoms, automatically arranges the topological relationship of the task atoms, obtains the ordered acyclic graph of the task atoms, and automatically generates the KS file based on the installation operation to be executed and the ordered acyclic graph of the task atoms, thereby reducing the workload of manually maintaining the entire set of KS files, and reducing the possibility of errors in manually writing KiskStart files, thereby improving the generation efficiency and accuracy of the installation file, further improving the configuration efficiency of the KickStart file, and meeting the large-scale server operating system installation requirements.
[0079] Further, see Figure 2 , showing Figure 1 A flowchart of step 101 in a method for generating an installation file is provided. The method is substantially the same as the method for generating an installation file provided in the first embodiment of the present invention. Step 101 may include:
[0080] Step 1011, obtaining historical installation files of various types of servers, and determining installation steps and installation tasks in the historical installation files;
[0081] Step 1012, determining a predefined dependency relationship between the installation step and the installation task; wherein the installation step includes the installation task;
[0082] Step 1013, dividing the installation steps and the installation tasks according to the dependency relationship to obtain step molecules and task atoms.
[0083] It should be noted that, in an embodiment of the present invention, historical installation files of various types of servers are obtained, the installation steps and installation tasks in the historical installation files are determined, and the dependencies of the pre-defined installation steps and installation tasks are determined. By dividing the installation steps and installation tasks according to the dependencies, step molecules and task atoms are obtained. By abstracting the installation operations into atomic code blocks, KS files can be customized and generated according to different hardware environments and installation requirements, thereby improving the flexibility of installation and reducing manual writing through automated orchestration.
[0084] Specifically, historical installation files of various types of servers are obtained, and installation steps and tasks are extracted from them. Historical installation files may include manually written KickStart files, automatically generated configuration files, etc. The dependencies between installation steps and installation tasks are pre-defined based on the actual installation requirements of the server and are not specifically limited here. The installation steps and installation tasks are divided according to the dependencies to obtain step molecules and task atoms. Each step molecule represents a complete set of subtasks, and each task atom represents a specific operation or configuration.
[0085] For example, there are installation files for the following categories of servers: the installation files for Class A servers include operating system settings, user settings, disk settings, network settings, security settings, software package installation, and service configuration steps; the installation files for Class B servers include operating system settings, network settings, security settings, software package installation, and other steps; the installation files for Class N servers include operating system settings, user settings, disk settings, network settings, and other steps. By analyzing these installation files, the following installation steps and tasks can be extracted: operating system settings, user settings, disk settings, IP configuration tasks, VLAN configuration tasks, and so on.
[0086] The embodiment of the present invention obtains historical installation files of various types of servers, determines installation steps and installation tasks, divides the installation steps and installation tasks according to dependencies, obtains step molecules and task atoms, and facilitates automatic generation of installation files through the division of step molecules and task atoms.
[0087] Further, see Figure 3 , showing Figure 1 A flowchart of step 102 in a method for generating an installation file is provided. The method is substantially the same as the method for generating an installation file provided in the first embodiment of the present invention. Step 102 may include:
[0088] Step 1021, obtaining the predefined dependency relationships of step molecules and the dependency relationships of task atoms.
[0089] Step 1022, use the dependency relationship of the step molecules to perform step deduction and construct a step multi-branch tree.
[0090] Step 1023, using the dependency relationship of task atoms to perform task deduction, construct at least two task multi-branch trees, and combine the task multi-branch trees to obtain a task forest.
[0091] It should be noted that, in this embodiment, it is necessary to obtain the dependencies between pre-defined step molecules and task atoms. The dependencies can be pre-defined in the system, or determined by analyzing historical installation files and user needs. Through the dependencies of the step molecules, step deduction can be performed to construct a step multi-branch tree, each step molecule represents a complete set of subtasks, and the edges between nodes represent dependencies; through the dependencies of task atoms, task deduction can be performed to construct at least two task multi-branch trees, and these task multi-branch trees are combined to obtain a task forest, each task atom represents a specific operation or configuration, and the edges between nodes represent dependencies.
[0092] In the embodiment of the present invention, through the division of step molecules and task atoms, they are abstracted into atomic code blocks, and KS files can be customized and generated according to different hardware environments and installation requirements. Through automated arrangement and low-code means, the possibility of errors in manually writing KiskStart files is reduced, and the reliability of installation is improved. By maintaining atomic code blocks, the workload of manually maintaining the entire set of KS files is reduced, and work efficiency is improved.
[0093] Further, see Figure 4 , showing Figure 1 A flowchart of step 103 in a method for generating an installation file is provided. The method is substantially the same as the method for generating an installation file provided in the first embodiment of the present invention. Step 103 may include:
[0094] Step 1031, generating an ordered acyclic graph of task atoms according to the topological relationship between the step multitree and the task atoms in the task forest;
[0095] Step 1032, obtaining a task atom execution linked list according to the ordered acyclic graph, where the task atom execution linked list is used to store the execution order of the task atoms.
[0096] It should be noted that in an embodiment of the present invention, an ordered acyclic graph (DAG) of task atoms is generated based on the topological relationship between the step multi-branch tree and the task atoms in the task forest, and a task atom execution linked list is obtained based on the ordered acyclic graph. The task atom execution linked list is used to store the execution order of task atoms, thereby ensuring that tasks are executed in the correct order.
[0097] Specifically, according to the topological relationship between the step multitree and the task atoms in the task forest, an ordered acyclic graph of the task atoms is generated. By analyzing the dependency relationship between the task atoms, an ordered acyclic graph can be constructed to represent the dependency and sequence relationship between the tasks. The execution order of the task atoms can be obtained through the ordered acyclic graph. The task atom execution linked list is used to store the execution order of the task atoms to ensure that the tasks are executed in the correct order.
[0098] For example, according to the topological relationship between each step molecule in the step multitree and the topological relationship between each task atom in the task forest, an ordered acyclic graph with task atoms as units is generated. For example, A to B is a partial order relationship in the Step multitree, a1 to a2 and a1 to a3 are two partial order relationships in the A molecule, assuming that a1 is the parent node of a2 and a3, and a2 and a3 are leaf nodes; b1 to b2 and b1 to b3 are two partial order relationships in the B molecule, assuming that b1 is the parent node of b2 and b3, and b2 and b3 are leaf nodes; according to the relationship from A to B, it can be inferred that all leaf nodes of A are the parent nodes of the parent node of B, that is, a partial order relationship from a2 to b1 and a3 to b1 is formed, and then an ordered acyclic graph AB composed of the two multitrees A and B is formed. According to the ordered acyclic graph AB, a task atom execution linked list is obtained, and the task atom execution linked list is used to store the execution order of task atoms.
[0099] It should be noted that the topological sorting of the directed acyclic graph of the installation task is the sorting in which the starting points of all edges appear before their end points, that is, the execution of an atom must depend on the execution of the preceding atom. Because the installation operations have a certain order and no cyclic relationship, they can form a topological sorting. Figure 1 There must be no loops, and an edge in the loop must point from a later-ordered vertex to a higher-ordered vertex, such as a package load atom to b kernel upgrade atom to c switch to default kernel atom, and a network card configuration atom to b network card aggregation atom to c network service restart atom. Based on this, topological sorting can be used to define a directed acyclic graph: a directed acyclic graph is a directed acyclic graph if and only if it has a topological sorting. In general, topological sorting is not unique. A directed acyclic graph has a unique topological sorting only when there is a path that can contain all its vertices, and in this case, the topological sorting is the same as the order in which they appear in this path.
[0100] The embodiment of the present invention generates an ordered acyclic graph of task atoms according to the topological relationship of task atoms in the step multi-branch tree and the task forest, and obtains the task atom execution linked list according to the ordered acyclic graph, thereby ensuring that tasks are executed in the correct order, improving the accuracy of the installation file template, and facilitating the automatic configuration of installation files that meet installation requirements.
[0101] Further, see Figure 5 , showing Figure 1 A flowchart of step 104 in a method for generating an installation file is provided. The method is substantially the same as the method for generating an installation file provided in the first embodiment of the present invention. Step 104 may include:
[0102] Step 1041, obtaining operations to be performed on the server to be installed; wherein the operations to be performed include at least one of an installation step and an installation task;
[0103] Step 1042, traversing the task atoms in the ordered acyclic graph according to the operation to be executed, and determining the ordered acyclic graph matching the operation to be executed;
[0104] Step 1043, using an ordered acyclic graph to generate an installation file template.
[0105] It should be noted that, in an embodiment of the present invention, to obtain the operations to be executed of the server to be installed, the operations to be executed include at least one of the installation steps and the installation tasks. It is necessary to traverse the task atoms in the ordered acyclic graph according to the operations to be executed, and determine the ordered acyclic graph that matches the operations to be executed. Through the ordered acyclic graph, a KickStart file template that meets specific requirements can be generated. Each task atom can be represented as a configuration item. The execution order of the tasks is determined through topological sorting, and the corresponding installation file template is generated. The rules required by different products and different roles are automatically calculated through the DAG algorithm, so that the KS file is easier to maintain and expand.
[0106] Specifically, step 1043 uses an ordered acyclic graph to generate an installation file template, which may include the following steps:
[0107] First, a preset installation file template framework is called, and the task atomic execution linked list corresponding to the ordered acyclic graph is converted into a preset format text;
[0108] Secondly, the preset format text is integrated with the preset installation file template framework to generate an installation file template.
[0109] It should be noted that in the above steps, the preset KickStart file template framework is called, which contains common configuration items and placeholders, and the task atom execution list corresponding to the ordered acyclic graph is converted into a preset format text, each task atom is represented as a configuration item, and the converted preset format text is integrated with the preset installation file template framework to generate the final installation file template. Generating the KickStart file template according to the execution sequence obtained by automatic arrangement involves combining and converting the configuration into I / O text content in a specific format, and ensuring that the structure and content of the text can be correctly recognized and applied by the server startup process.
[0110] Further, see Figure 6 , showing Figure 1 A flowchart of step 105 in a method for generating an installation file is provided. The method is substantially the same as the method for generating an installation file provided in the first embodiment of the present invention. Step 105 may include:
[0111] Step 1051, obtaining configuration information of the operation to be performed;
[0112] Step 1052: Render the configuration information of the operation to be executed to the installation file template to obtain the target installation file of the server to be installed.
[0113] In an embodiment of the present invention, it is necessary to obtain configuration information of the operation to be performed. The configuration information may include operating system version, disk partition scheme, network configuration, security settings, software package installation and service configuration, etc. The configuration information of the operation to be performed is rendered to the installation file template to generate the target installation file of the server to be installed. Each configuration item in the installation file template will be replaced by specific configuration information to generate the final KickStart file. By obtaining the configuration information of the operation to be performed and rendering the configuration information to the installation file template, a KickStart file that meets specific requirements can be automatically generated, which not only improves the efficiency and accuracy of configuration file generation, but also can better manage and execute the automatic generation of installation cases to meet the needs of large-scale delivery.
[0114] Reference Fig.10 , shows a schematic diagram of the structure of an installation file generating device provided by an embodiment of the present invention, the device comprising:
[0115] An acquisition module 201 is used to acquire step molecules and task atoms divided in a historical installation file;
[0116] A construction module 202 is used to construct a step multitree using the dependency relationship of the step molecules, and to construct a task forest using the dependency relationship of the task atoms;
[0117] A processing module 203 is used to assemble the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determine the execution order of task atoms in the ordered acyclic graph;
[0118] A template generation module 204 is used to obtain operations to be executed of the server to be installed, determine an ordered acyclic graph matching the operations to be executed, and use the ordered acyclic graph to generate an installation file template;
[0119] The template rendering module 205 is used to render the installation file template using the operation to be executed to obtain the target installation file of the server to be installed.
[0120] Furthermore, the acquisition module 201 includes:
[0121] The first acquisition submodule is used to acquire historical installation files of various types of servers and determine the installation steps and installation tasks in the historical installation files;
[0122] A determination submodule, used to determine a predefined dependency relationship between the installation step and the installation task; wherein the installation step includes the installation task;
[0123] The division submodule is used to divide the installation steps and the installation tasks according to dependency relationships to obtain step molecules and task atoms.
[0124] Furthermore, the construction module 202 includes:
[0125] A second acquisition submodule is used to acquire the dependency relationship of the predefined step molecules and the dependency relationship of the task atoms;
[0126] The first construction submodule is used to perform step deduction using the dependency relationship of the step molecules to construct a multi-branch tree of steps;
[0127] The second construction submodule is used to perform task deduction using the dependency relationship of the task atoms, construct at least two task multi-branch trees, and combine the task multi-branch trees to obtain a task forest.
[0128] Furthermore, the processing module 203 includes:
[0129] A first generating submodule, used for generating an ordered acyclic graph of task atoms according to the topological relationship between the step multi-branch tree and the task atoms in the task forest;
[0130] The processing submodule is used to obtain a task atom execution linked list according to the ordered acyclic graph, and the task atom execution linked list is used to store the execution order of the task atoms.
[0131] Furthermore, the template generation module 204 includes:
[0132] A third acquisition submodule is used to acquire operations to be performed on the server to be installed; wherein the operations to be performed include at least one of an installation step and an installation task;
[0133] A traversal submodule, used for traversing the task atoms in the ordered acyclic graph according to the operation to be executed, and determining the ordered acyclic graph matching the operation to be executed;
[0134] The second generating submodule is used to generate an installation file template using the ordered acyclic graph.
[0135] Furthermore, the second generation submodule includes:
[0136] A calling unit, used for calling a preset installation file template framework, and converting the task atom execution linked list corresponding to the ordered acyclic graph into a preset format text;
[0137] The generating unit is used to integrate the preset format text with the preset installation file template framework to generate an installation file template.
[0138] Furthermore, the template rendering module 205 includes:
[0139] A fourth acquisition submodule, used to acquire configuration information of the operation to be performed;
[0140] The rendering submodule is used to render the configuration information of the operation to be executed to the installation file template to obtain the target installation file of the server to be installed.
[0141] The installation file generation device provided by the embodiment of the present invention obtains the step molecules and task atoms divided in the historical installation file, constructs a step multi-branch tree using the dependency relationship of the step molecules, and constructs a task forest using the dependency relationship of the task atoms, assembles the step multi-branch tree and the task forest to obtain an ordered acyclic graph, determines the execution order of the task atoms in the ordered acyclic graph, obtains the to-be-executed operations of the server to be installed, determines the ordered acyclic graph matching the to-be-executed operations, generates an installation file template using the ordered acyclic graph, renders the installation file template using the to-be-executed operations, and obtains the target installation file of the server to be installed. The embodiment of the present invention abstracts the installation operation into atoms, automatically arranges the topological relationship of the task atoms, obtains the ordered acyclic graph of the task atoms, and automatically generates the KS file based on the installation operation to be executed and the ordered acyclic graph of the task atoms, thereby reducing the workload of manually maintaining the entire set of KS files, and reducing the possibility of errors in manually writing KiskStart files, thereby improving the generation efficiency and accuracy of the installation file, further improving the configuration efficiency of the KickStart file, and meeting the large-scale server operating system installation requirements.
[0142] Reference Fig.11 , an embodiment of the present invention further provides an electronic device, such as Fig.11 As shown, it includes a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 504.
[0143] A processor 301, a memory 303 for storing processor executable instructions;
[0144] The processor 301 is configured to execute the instructions to implement the following installation file generation method:
[0145] Get the step molecules and task atoms divided in the historical installation file;
[0146] A step multitree is constructed using the dependency relationship of the step molecules, and a task forest is constructed using the dependency relationship of the task atoms;
[0147] Assembling the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph;
[0148] Obtaining operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template;
[0149] The installation file template is rendered using the operation to be executed to obtain a target installation file for the server to be installed.
[0150] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0151] The communication interface is used for communication between the above terminal and other devices.
[0152] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0153] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0154] In another embodiment provided by the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the installation file generation method described in any of the above embodiments is implemented.
[0155] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0156] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0157] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0158] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for generating an installation file, characterized in that: The method comprises: Get the step molecules and task atoms divided in the historical installation file; A step multitree is constructed using the dependency relationship of the step molecules, and a task forest is constructed using the dependency relationship of the task atoms; Assembling the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph; Obtaining operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template; The installation file template is rendered using the operation to be executed to obtain a target installation file for the server to be installed.
2. The method according to claim 1, characterized in that: The step molecules and task atoms divided in the historical installation file are obtained, including: Obtain historical installation files of various types of servers, and determine the installation steps and installation tasks in the historical installation files; Determining a predefined dependency relationship between the installation step and the installation task; wherein the installation step includes the installation task; The installation steps and the installation tasks are divided according to dependency relationships to obtain step molecules and task atoms.
3. The method according to claim 1, characterized in that: The step of constructing a multi-branch tree of steps by using the dependency relationship of the step molecules, and the task of constructing a task forest by using the dependency relationship of the task atoms, include: Obtaining predefined dependencies of step molecules and dependencies of the task atoms; Deducing the steps using the dependency relationship of the step molecules to construct a multi-branch tree of steps; The dependency relationship of the task atoms is used to perform task deduction, to construct at least two task multi-branch trees, and the task multi-branch trees are combined to obtain a task forest.
4. The method according to claim 1, characterized in that: The step of assembling the step multitree and the task forest to obtain an ordered acyclic graph and determining the execution order of task atoms in the ordered acyclic graph comprises: Generate an ordered acyclic graph of task atoms according to the topological relationship between the step multitree and the task atoms in the task forest; A task atom execution linked list is obtained according to the ordered acyclic graph, and the task atom execution linked list is used to store the execution order of the task atoms.
5. The method according to claim 1, characterized in that: The step of obtaining operations to be executed of the server to be installed, determining an ordered acyclic graph matching the operations to be executed, and using the ordered acyclic graph to generate an installation file template includes: Obtaining operations to be performed on the server to be installed; wherein the operations to be performed include at least one of an installation step and an installation task; Traversing the task atoms in the ordered acyclic graph according to the operation to be executed, and determining an ordered acyclic graph matching the operation to be executed; The ordered acyclic graph is used to generate an installation file template.
6. The method according to claim 5, characterized in that: The step of using the ordered acyclic graph to generate an installation file template comprises: Calling a preset installation file template framework, and converting the task atomic execution linked list corresponding to the ordered acyclic graph into a preset format text; The preset format text is integrated with the preset installation file template framework to generate an installation file template.
7. The method according to claim 1, characterized in that: The step of rendering the installation file template by using the operation to be executed to obtain the target installation file of the server to be installed includes: Obtaining configuration information of the operation to be performed; The configuration information of the operation to be executed is rendered to the installation file template to obtain the target installation file of the server to be installed.
8. An installation file generating device, characterized in that: The device comprises: An acquisition module is used to obtain step molecules and task atoms divided in the historical installation file; A construction module, used to construct a step multitree using the dependency relationship of the step molecules, and to construct a task forest using the dependency relationship of the task atoms; A processing module, used for assembling the step multi-branch tree and the task forest to obtain an ordered acyclic graph, and determining the execution order of task atoms in the ordered acyclic graph; A template generation module is used to obtain operations to be executed of the server to be installed, determine an ordered acyclic graph matching the operations to be executed, and use the ordered acyclic graph to generate an installation file template; The template rendering module is used to render the installation file template using the operation to be executed to obtain the target installation file of the server to be installed.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the installation file generation method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, causes the processors to execute the installation file generating method according to any one of claims 1 to 7.