Server configuration method, computer device and storage medium

By automating the judgment and generation of configuration scripts, the problem of low server configuration efficiency is solved, achieving an efficient and reliable server configuration process and ensuring system consistency and stability.

CN119544497BActive Publication Date: 2025-12-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411591785.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-12-09
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

In existing technologies, server configurations need to be manually modified one by one, which leads to low efficiency. As the number of servers increases, the response speed decreases, affecting user experience and management efficiency.

Method used

By obtaining the configuration information of the source server and the target server, the system automatically determines whether the target server meets the migration conditions, and generates a configuration script based on the configuration information to be migrated to configure the target server. This includes node-by-node comparison, format conversion, and configuration script generation to ensure configuration consistency and compatibility.

Benefits of technology

It automates server configuration, improves configuration efficiency, reduces human error, ensures configuration consistency and system stability, and reduces time and communication costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544497B_ABST
    Figure CN119544497B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of server management, and discloses a server configuration method, computer equipment and a storage medium. The method comprises the following steps: obtaining first configuration information of a source server and second configuration information of a target server, wherein the first configuration information comprises to-be-migrated configuration information; comparing the first configuration information with the second configuration information to determine whether the target server meets a configuration migration condition; and if the target server meets the configuration migration condition, configuring the target server based on the to-be-migrated configuration information. Through implementation of the technical scheme of the application, the configuration information of the source server can be directly migrated to the target server in an efficient and accurate manner.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of server management, and particularly relates to a server configuration method, computer equipment and a storage medium. BACKGROUND

[0002] To ensure stable delivery of products, development, testing and operation environments must be consistent. However, the diversity of server architecture and version differences make environment construction complex, consume a lot of manpower and time, and increase the communication cost between teams.

[0003] In the related art, it is usually necessary to manually modify the server configuration one by one, which is inefficient when dealing with complex requirements. With the increase in the number of servers, the response speed decreases, thereby affecting user experience and management efficiency. SUMMARY

[0004] Therefore, the present application provides a server configuration method, computer equipment and a storage medium to solve the problem of low efficiency and slow response caused by manually configuring servers one by one.

[0005] In a first aspect, the present application provides a server configuration method, comprising: obtaining first configuration information of a source server and second configuration information of a target server, the first configuration information comprising to-be-migrated configuration information; comparing the first configuration information and the second configuration information to determine whether the target server meets a configuration migration condition; and if the target server meets the configuration migration condition, configuring the target server based on the to-be-migrated configuration information.

[0006] The server configuration method provided by the embodiments of the present application can automatically determine whether the target server meets the migration condition by comparing the configuration information of the source server and the target server, thereby simplifying the migration process, reducing manual intervention, and improving server configuration automation without manually configuring each server. Before migration, the system verifies the configuration compatibility of the target server, thereby reducing the risk of failure caused by improper configuration and improving the working stability of the server system. By realizing the rapid copying and pasting of server configuration, the time for setting up multiple servers is significantly reduced, the time cost is reduced, the configuration efficiency of the server is improved, the consistency of all server configurations can be ensured, the problem of inconsistent configuration caused by human error is reduced, the accuracy of the configuration is improved, and the reliability of the server system operation is ensured.

[0007] In an optional implementation, the configuring the target server based on the to-be-migrated configuration information comprises: generating a configuration script based on the to-be-migrated configuration information; and configuring the target server according to the configuration script.

[0008] The server configuration method provided by the embodiment of the application reduces manual operation, reduces the risk of errors, realizes automatic configuration, and improves efficiency. The target server is ensured to be set according to a unified configuration script, consistency of system configuration is maintained, and problems caused by human differences are reduced.

[0009] In an optional implementation, the first configuration information of the source server is obtained by obtaining a configuration file structure and original configuration information of the source server, the configuration file structure including naming specifications, nesting relationship information and attribute configuration information of each node in the configuration file, and the original configuration information is mapped to corresponding nodes in the configuration file structure according to the naming specifications, the nesting relationship information and the attribute configuration information of each node to generate the first configuration information.

[0010] The server configuration method provided by the embodiment of the application realizes structured processing of configuration by obtaining the structure of the configuration file and the original configuration information, improves the readability and manageability of the configuration, ensures that the original configuration information is accurately mapped to the corresponding node, reduces errors caused by manual configuration, and improves data consistency. By defining naming specifications and nesting relationships, the configuration is standardized, facilitating subsequent management and maintenance.

[0011] In an optional implementation, the first configuration information and the second configuration information are compared to determine whether the target server meets the configuration migration condition, including: comparing the first configuration information and the second configuration information node by node to determine the difference information between the first configuration information and the second configuration information; if the difference information is within a preset range that the target server can support, it is determined that the target server meets the configuration migration condition; and / or, data verification is performed on the first configuration information and the second configuration information to obtain a data verification result; if the data verification result is correct, it is determined that the target server meets the configuration migration condition.

[0012] The server configuration method provided by the embodiment of the application can accurately identify the differences between configurations by comparing the first and second configuration information node by node, ensuring accuracy before migration. Determining whether the difference information is within a preset range that the target server can support helps to reduce the risk caused by incompatible configurations and ensures system stability. Data verification can effectively detect the integrity and correctness of the configuration information, further ensuring the reliability of the migration process. The systematic comparison and verification process can be automatically executed, reducing manual intervention and improving the efficiency of configuration migration.

[0013] In an optional implementation, the first configuration information and the second configuration information are format-converted to obtain format-converted first configuration information and second configuration information.

[0014] The server configuration method provided by the embodiment of the present application can ensure that the configuration information between different modules can be seamlessly connected, and improve the compatibility between the modules. The standardized format can help to reduce configuration errors caused by format mismatch, and improve the accuracy of data. Through the unified format, the management process can be simplified, the configuration is more consistent, and the subsequent maintenance and operation are facilitated.

[0015] In an optional implementation, the to-be-migrated configuration information includes version information, a refresh strategy and a specific configuration command corresponding to each server component included in the source server; and the configuration script is generated based on the to-be-migrated configuration information, including: obtaining a predefined configuration script template; and inserting the version information, the refresh strategy and the specific configuration command into the configuration script template to generate the configuration script.

[0016] The server configuration method provided by the embodiment of the present application can reduce the workload of manually writing scripts, improve the efficiency, and reduce the possibility of human error by automatically generating configuration scripts. The use of a predefined template ensures that all generated configuration scripts follow the same structure and format, improving the consistency of the configuration. The configuration script is quickly generated based on existing configuration information, which shortens the migration time and makes the deployment process more efficient.

[0017] In an optional implementation, an abnormal event occurring during configuration of the target server based on the configuration script is monitored to generate a monitoring exception log; a corresponding coping strategy of the abnormal event is obtained; and the abnormal event is processed according to the coping strategy.

[0018] The server configuration method provided by the embodiment of the present application can discover possible problems in the configuration process in time by monitoring abnormal events, improving the reliability of the system. The monitoring exception log is generated to provide detailed data support for subsequent troubleshooting and analysis, enhancing the problem tracking capability. The coping strategy corresponding to the abnormal event is obtained to realize targeted processing and improve the efficiency of problem solving. By analyzing the exception log and the processing effect, the coping strategy can be continuously optimized to improve the quality of future configuration management. By processing the abnormality in time, the risk of configuration failure is reduced, and the stability of the overall system is improved.

[0019] In an optional embodiment, during the configuration, first state information of each server component in the source server and second state information of each server component in the target server are acquired; the state information includes version information, refresh strategy and specific configuration commands; the first state information is mapped to corresponding nodes in the configuration file structure to generate first target information; and the second state information is mapped to corresponding nodes in the configuration file structure to generate second target information; when it is detected that the first state information of any server component in the source server changes, the first target information is updated to obtain updated first target information; when it is detected that the second state information of any server component in the target server changes, the second target information is updated to obtain updated second target information; the updated first target information and the second target information are format-converted to obtain format-converted first target information and second target information; the format-converted first target information and the second target information are compared node by node to determine real-time difference information between the format-converted first target information and the second target information; and if the real-time difference information is within a preset range supportable by the target server, it is determined that the target server meets the configuration migration condition.

[0020] The server configuration method provided by the embodiment of the application can track the changes of components in the configuration process in real time by acquiring the state information of the source server and the target server, thereby improving the visualization and manageability of the system. Mapping the state information to corresponding nodes in the configuration file structure ensures the consistency and accuracy of the information, which helps to avoid configuration errors. When the state information changes, the target information is updated in time, thereby ensuring that the configuration file always reflects the latest system state and improving the flexibility. The compatibility between different systems is enhanced through the format conversion processing, thereby ensuring that the configuration can be smoothly migrated. The format-converted target information is compared node by node, thereby accurately identifying the real-time difference and ensuring the scientificity of the migration decision. The support condition of the target server is determined through the preset range, thereby reducing the risk in the migration process and improving the success rate.

[0021] In a second aspect, the application provides a server configuration device, comprising: an acquisition module configured to acquire first configuration information of a source server and second configuration information of a target server, the first configuration information comprising to-be-migrated configuration information; a comparison module configured to compare the first configuration information and the second configuration information to determine whether the target server meets a configuration migration condition; and a configuration module configured to configure the target server based on the to-be-migrated configuration information if the target server meets the configuration migration condition.

[0022] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, which are connected with each other in communication, and the memory stores computer instructions; the processor executes the computer instructions to perform the server configuration method of the first aspect or any of the corresponding embodiments.

[0023] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the server configuration method of the first aspect or any of the corresponding embodiments.

[0024] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions for making a computer execute the server configuration method of the first aspect or any of the corresponding embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0026] Figure 1 Fig. 1 is a flow diagram of a server configuration method according to an embodiment of the present application;

[0027] Figure 2 Fig. 2 is a flow diagram of another server configuration method according to an embodiment of the present application;

[0028] Figure 3 Fig. 3 is a flow diagram of still another server configuration method according to an embodiment of the present application;

[0029] Figure 4 Fig. 4 is a flow diagram of yet another server configuration method according to an embodiment of the present application;

[0030] Figure 5 Fig. 5 is a structural block diagram of a server configuration device according to an embodiment of the present application;

[0031] Figure 6 Fig. 6 is a hardware structure diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0033] In order to ensure the high-quality delivery of products, the consistency of R&D, testing and operation environments is crucial to reduce errors and improve team collaboration. When building and maintaining these server environments, version management and configuration management are particularly important.

[0034] Due to the complexity of server settings, building an environment that meets specific needs often requires a lot of manpower and time. In addition, during the upgrading of servers, even if the same function is implemented, the commands required to be executed may be different due to version differences. This not only increases the complexity of configuration, but also brings great challenges to the information exchange between development, testing and operation teams, often requiring repeated confirmation and communication to reach a consensus on environment configuration.

[0035] In related technologies, a multi-server unified configuration management system allows users to easily create and manage tasks through a graphical interface, and sends requests to multiple servers, thereby avoiding the tediousness of managing one by one. Or the remote management module of the server software can accept remote instructions and perform corresponding management operations without the need for switch and router permissions by deploying an application layer service inside the server. However, whether it is a multi-server unified configuration management system or a remote management module based on server software, manual modification of server configuration is still required one by one in actual operation, which cannot meet the demand of quickly configuring complex function points. With the explosive growth of managed servers, the response speed of the multi-server unified configuration system will be significantly slowed down, affecting user experience. While the remote management module based on server software is convenient for remote control of a single server, as the number of servers increases, the time required for management personnel will also increase, resulting in a serious impact on management efficiency.

[0036] Therefore, the technical solution of the present application stores the configuration information of a specific environment through a remote server, and uses automated means to directly migrate these configurations to another server. This method enables the same environment to be quickly built, thereby saving time and improving efficiency. At the same time, it also reduces the communication cost between testing, operation and R&D teams, avoiding the problem of inconsistent environments caused by cognitive differences.

[0037] According to the embodiments of the present application, a server configuration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] In the present embodiment, a server configuration method is provided, which can be used in computer devices such as desktop computers, notebook computers, etc. Figure 1 The flowchart of the server configuration method according to the embodiments of the present application is shown in FIG. 1, which includes the following steps: Figure 1

[0039] In step S101, the first configuration information of the source server and the second configuration information of the target server are obtained, and the first configuration information includes the configuration information to be migrated.

[0040] The first configuration information refers to the complete configuration information of the source server, which can include, for example, the version information of the key firmware and components (such as the baseboard management controller (BMC), the basic input / output system (BIOS), the network card, etc.), the refresh policy and the key configuration commands, etc.

[0041] The configuration information to be migrated refers to the specific configuration content selected from the source server and prepared to be migrated to the target server. Specifically, the configuration information can be automatically collected by a configuration management tool such as Ansible, Chef or Puppet, or the configuration information of the source server can be obtained by connecting to the source server through SSH and using commands such as cat, grep, ipconfig, etc., which is not limited here.

[0042] The second configuration information refers to the current configuration information of the target server, which can include, for example, the installed firmware version and component status, the current configuration command and policy, etc. Specifically, the configuration information of the target server can be collected using the same configuration management tool, or the real-time configuration information of the target server can be monitored through an integrated monitoring tool (such as Prometheus or Zabbix), which is not limited here.

[0043] In step S102, the first configuration information and the second configuration information are compared to determine whether the target server meets the configuration migration condition.

[0044] ​The configuration migration condition refers to a condition for ensuring that the target server can successfully bear the configuration of the source server, for example, can include compatibility, performance requirements, dependencies, and the like. In one specific example, by comparing the key fields in the first configuration information and the second configuration information, it is checked whether the source server and the target server are consistent and compatible. If it is determined that the source server and the target server are consistent and compatible, it can be determined that the target server meets the configuration migration condition.

[0045] In step S103, if the target server meets the configuration migration condition, the target server is configured based on the to-be-migrated configuration information.

[0046] Specifically, if the target server meets the configuration migration condition, the configuration is applied to the target server item by item according to the to-be-migrated configuration information, for example, the target server can be configured by a modification file generated based on the to-be-migrated configuration information, or the target server can be configured by calling an application programming interface (API). Of course, the target server can also be configured by other means, which is not limited here.

[0047] The server configuration method provided by the embodiment of the application can automatically determine whether the target server meets the migration condition by comparing the configuration information of the source server and the target server, thereby simplifying the migration process, reducing manual intervention, and eliminating the need for manual configuration one by one, and improving the automation of server configuration. Before migration, the system will first verify the configuration compatibility of the target server, thereby reducing the risk of failure caused by improper configuration and improving the working stability of the server system. By realizing the rapid copying and pasting of server configuration, the time for setting multiple servers is significantly reduced, the time cost is reduced, the configuration efficiency of the server is improved, at the same time, the consistency of all server configurations can be ensured, the problem of inconsistent configuration caused by human error is reduced, the accuracy of configuration is improved, and the reliability of the server system is ensured.

[0048] In the embodiment, a server configuration method is provided, which can be used for computer devices such as desktop computers, notebook computers, and the like, Figure 2 is a flowchart of the server configuration method according to the embodiment of the application, as Figure 2 shown, the flowchart includes the following steps:

[0049] In step S201, first configuration information of a source server and second configuration information of a target server are obtained, and the first configuration information includes to-be-migrated configuration information.

[0050] Specifically, the above step S201 includes:

[0051] In step S2011, a configuration file structure and original configuration information of the source server are obtained. The configuration file structure includes naming specification, nesting relationship information and attribute configuration information of each node in the configuration file.

[0052] The configuration file structure refers to a structure of how each node in the configuration file is organized and related to each other. Specifically, the configuration file structure includes naming specification, nesting relationship and attribute configuration information of each node. The naming specification is used to specify how each node is named to maintain consistency and readability. The nesting relationship is used to define a hierarchical relationship between nodes, and to indicate which nodes are parent nodes and which are child nodes.

[0053] The attribute configuration information is additional information (such as data type, default value, etc.) defined for each node, which enhances the description of data. Specifically, the configuration file structure can be obtained through a definition file of a design document or a configuration management tool, or the structure information can be parsed from an existing configuration file, without limitation.

[0054] The original configuration information is actual configuration information extracted from the source server, including component versions and configuration parameters installed on the source server, which can be recorded in an eXtensible Markup Language (XML) format, for example. Specifically, a related script or API call can be executed to collect the original configuration information from the source server.

[0055] In step S2012, the original configuration information is mapped to corresponding nodes in the configuration file structure according to the naming specification, nesting relationship information and attribute configuration information of each node, to generate first configuration information.

[0056] The first configuration information refers to structured data generated from the original configuration information of the source server after processing, which contains information of each component and configuration item in the source server, and conforms to the predefined configuration file structure. Specifically, the original configuration information on the source server is extracted, and each component and its corresponding attribute is determined. According to the predefined naming specification, it is determined where each original configuration item should be placed in the configuration file.

[0057] In one specific example, if there is a "BIOS version" in the original information, it is mapped to a "BIOS" node in the configuration file structure. <bios>"under the node. According to the nesting relationship information, ensure that each node is correctly organized according to the hierarchy. For example, place " <networkinterface>"as" <server>The first configuration information is generated by integrating the above steps.

[0058] In step S2013, the second configuration information of the target server is obtained.

[0059] It can be understood that the second configuration information refers to the structured data generated after processing the original configuration information of the target server, which contains the information of each component and configuration item in the target server and conforms to the predefined configuration file structure. Specifically, the original configuration information of the target server is obtained, and the original configuration information of the target server is mapped to the corresponding node in the configuration file structure according to the naming specification, nesting relationship information and attribute configuration information of each node, to generate the second configuration information.

[0060] In step S2014, the first configuration information and the second configuration information are format-converted to obtain the format-converted first configuration information and the second configuration information.

[0061] Specifically, according to the subsequent processing requirements, the target format to which the first configuration information and the second configuration information are converted is determined. For example, if it needs to be compatible with a certain API interface, the JavaScript Object Notation (JSON) format can be selected. The nodes and their attribute values in the first configuration information and the second configuration information are extracted, and the extracted data is reorganized according to the specification of the target format. For example, for the JSON format, each node needs to be converted into a key-value pair form to maintain the nesting relationship. For the Comma-Separated Values (CSV) format, the data needs to be flattened into a row and column form, and the fields are appropriately selected as column headers. The converted data is written into a file in the target format, ensuring that it complies with the syntax specification of the format. For example, when generating JSON, it needs to ensure that each object, array and string complies with the JSON syntax. After completing the format conversion, the format-converted first configuration information and the second configuration information are obtained.

[0062] In some optional embodiments, before obtaining the first configuration information of the source server and the second configuration information of the target server, it is necessary to ensure that the network connection between the computer device, the source server and the target server is stable and unobstructed. The management personnel should ensure that the target server operating system (OS) has been normally started, and the operating system IP address (OS IP) is accurately filled in to ensure smooth access and operation during the migration process.

[0063] The server configuration method provided by the embodiment of the application realizes the structured processing of the configuration by obtaining the structure of the configuration file and the original configuration information, improves the readability and manageability of the configuration, ensures that the original configuration information is accurately mapped to the corresponding node, reduces errors caused by manual configuration, and improves data consistency. By defining the naming specification and the nesting relationship, the standardization of the configuration is promoted, and subsequent management and maintenance are facilitated. Format conversion can ensure that the configuration information between different modules can be seamlessly connected, improving the compatibility between modules. The standardized format helps to reduce configuration errors caused by format mismatches and improve data accuracy. Through the unified format, it is helpful to simplify the management process, make the configuration more consistent, and facilitate subsequent maintenance and operation.

[0064] In step S202, the first configuration information and the second configuration information are compared to determine whether the target server meets the configuration migration condition.

[0065] Specifically, the above step S202 includes:

[0066] In step S2021, the first configuration information and the second configuration information are compared node by node to determine the difference information between the first configuration information and the second configuration information.

[0067] The difference information refers to all inconsistencies between the first configuration information and the second configuration information, including missing nodes, different values or attributes, and structural changes. Specifically, starting from the root node in the configuration file structure, each node is traversed layer by layer, and the first configuration information and the second configuration information are compared. For missing nodes, different attribute values or inconsistent structures, specific difference information is recorded to form a difference list.

[0068] In step S2022, if the difference information is within the preset range that the target server can support, it is determined that the target server meets the configuration migration condition.

[0069] The preset range refers to the specific standards of the configuration difference that the target server can accept and support. For example, it can include compatibility requirements, function support and performance standards, etc. The compatibility requirement refers to the version difference allowed by the source server and the target server, the range of specific configuration items (such as IP address, port number, etc.). The function support refers to the fact that the target server must support all key functions and features of the source server. The performance standard refers to any performance parameter, such as the maximum limit of response time and resource usage.

[0070] Specifically, by comparing the generated difference information, it is checked whether each difference meets the preset range. If all difference information is within the acceptable range, it means that the target server can support these configurations. If there is any difference that does not meet the preset range, it means that the target server cannot meet the configuration migration condition.

[0071] In step S2023, data verification is performed on the first configuration information and the second configuration information to obtain a data verification result.

[0072] The data verification result refers to a verification result obtained by comparing the first configuration information and the second configuration information, and is used to confirm the consistency of the two in terms of content and structure, and the integrity of the information. Specifically, when performing data verification, a suitable verification method is selected. For example, the hash values of the two pieces of configuration information can be calculated and compared, or the specific contents of the two pieces of configuration information can be compared item by item to ensure that all key fields are consistent or that the structures of the two are the same. In particular, under the configuration file structure, it is checked whether the nodes and attributes are consistent, which is not limited herein. The selected verification method is executed, and the result of each step is recorded, so as to verify the integrity and consistency of the configuration and find potential errors or mismatches.

[0073] In step S2024, if the data verification result is correct, it is determined that the target server meets the configuration migration condition.

[0074] The data verification result is summarized to determine whether the first configuration information and the second configuration information are consistent. If the first configuration information and the second configuration information are consistent, it can be determined that the target server meets the configuration migration condition, and at this time, the migration of the configuration information can be prepared. If there is a difference or inconsistency between the first configuration information and the second configuration information, further analysis and adjustment are required according to the difference.

[0075] In step S203, if the target server meets the configuration migration condition, the target server is configured based on the to-be-migrated configuration information. For details, refer to step S103 of the embodiment shown in Figure 1 The embodiment shown in

[0076] The server configuration method provided by the embodiment can accurately identify the difference between the configurations by comparing the first and second configuration information node by node, ensuring the accuracy before migration. Determining whether the difference information is within the preset range that can be supported by the target server helps to reduce the risk caused by incompatible configurations and ensures the system stability. Data verification can effectively detect the integrity and correctness of the configuration information, further ensuring the reliability of the migration process. The systematic comparison and verification process can be automatically executed, reducing manual intervention and improving the efficiency of configuration migration.

[0077] In this embodiment, a server configuration method is provided, which can be used in computer devices such as desktop computers, notebook computers, etc. Figure 3 is a flowchart of the server configuration method according to the embodiment of the application, as shown in Figure 3 The flowchart includes the following steps:

[0078] Step S301, obtaining first configuration information of the source server and second configuration information of the target server, the first configuration information including to-be-migrated configuration information. For details, please refer to Figure 2 Step S201 of the embodiment shown will not be repeated here.

[0079] Step S302, comparing the first configuration information and the second configuration information to determine whether the target server meets the configuration migration condition. For details, please refer to Figure 2 Step S202 of the embodiment shown will not be repeated here.

[0080] Step S303, if the target server meets the configuration migration condition, configuring the target server based on the to-be-migrated configuration information.

[0081] Specifically, the above step S303 includes:

[0082] Step S3031, if the target server meets the configuration migration condition, generating a configuration script based on the to-be-migrated configuration information.

[0083] The configuration script is a structured file containing a series of instructions and commands for configuring the target server to make its firmware and component settings consistent with the source server. Specifically, the to-be-migrated configuration information is parsed, and a configuration script is built according to the parsing results, with each command organized according to a predetermined logical structure to ensure that the execution order and dependency relationships are met.

[0084] In some optional embodiments, the to-be-migrated configuration information includes version information, refresh policies and specific configuration commands of each server component included in the source server; the above step S3031 includes:

[0085] Step a1, obtaining a predefined configuration script template.

[0086] The configuration script template is a predefined structured file containing a series of basic instructions and formats for configuring the server. Specifically, the configuration script template can contain placeholders for filling in specific configuration information such as version information, refresh policies and specific configuration commands when generating the configuration script.

[0087] Specifically, the configuration script template can be accessed from the configuration management system, version control system or internal document library as needed, or a suitable template version can be selected according to the specific needs of the server components to be migrated, without limitation.

[0088] Step a2, inserting the version information, refresh policies and specific configuration commands into the configuration script template to generate the configuration script.

[0089] Specifically, after loading the configuration script template, the placeholders in it are parsed to identify the parts that need to be replaced. The version information of each component of the source server is extracted from the configuration information to be migrated and used to replace the version placeholders in the template. Similarly, the refresh policy is extracted and inserted into the template, and specific configuration commands are extracted and inserted as needed to replace the corresponding placeholders. After all the insertions are completed, a complete configuration script containing all the specific configuration information is obtained.

[0090] In the above embodiments, by automatically generating the configuration script, the workload of manually writing the script is reduced, the efficiency is improved, and the possibility of human error is reduced. Using predefined templates ensures that all generated configuration scripts follow the same structure and format, improving the consistency of the configuration. Based on the existing configuration information, the configuration script is quickly generated, the migration time is shortened, and the deployment process is more efficient.

[0091] Step S3032, configure the target server according to the configuration script.

[0092] Specifically, the configuration commands are executed step by step according to the instructions in the configuration script, such as downloading and installing firmware, modifying configuration parameters, restarting services, etc. After completing the configuration, verification and testing can be performed to ensure that the configuration of the target server is consistent with that of the source server and is running normally.

[0093] In some optional embodiments, if the target server does not meet the configuration migration conditions, the tool or script is used to compare the first configuration information and the second configuration information to identify incompatible and / or inconsistent parts, and to check the differences in software versions, dependent libraries and configuration parameters. All differences are recorded, including specific configuration items and software versions.

[0094] For incompatible and / or inconsistent configuration items, adjustments are made one by one. For example, it can be tried to adjust the configuration of the target server to match the source server, or vice versa, depending on the actual situation; or a test environment can be built to verify the modified configuration, so that the modified configuration can be fully tested in the test environment to ensure that the new configuration does not introduce other problems. After confirming that the test is successful, the adjusted configuration is deployed to the target server.

[0095] In the above embodiments, by verifying the modified configuration in the test environment first, potential problems can be avoided in the production environment, reducing the risk of system crashes or failures. Comparing the configurations using tools or scripts can systematically identify incompatible and inconsistent parts, ensuring that all differences are recorded and handled, improving the accuracy of migration. For incompatible configuration items, the configuration of the target server or the source server can be flexibly adjusted, increasing adaptability and better addressing the needs of different environments. Recording all discovered differences and adjustment processes provides detailed change logs, which are helpful for future audits and troubleshooting. After verification in the test environment, if problems are found, the system can quickly roll back to the last stable configuration, ensuring business continuity.

[0096] In step S3033, an abnormal event occurring during the configuration of the target server based on the configuration script is monitored, and a monitoring abnormal log is generated.

[0097] The monitoring abnormal log is detailed information recording all abnormal events occurring during the configuration migration process, including time, abnormal type, error code and related context information. Specifically, any abnormal event, such as configuration error or system unresponsive, is detected in real time. Once an abnormality is found, detailed log information is recorded, including timestamp, abnormal type and related context, for subsequent analysis.

[0098] In step S3034, a coping strategy corresponding to the abnormal event is obtained.

[0099] The abnormal event is represented by the monitoring abnormal log, and the coping strategy is a solution or processing step formulated for a specific abnormal event. Specifically, the coping strategy comes from a pre-built log library and is automatically matched with the current abnormality through intelligent comparison function, aiming to quickly restore the system to normal state or reduce the impact of failure.

[0100] Specifically, after generating the monitoring abnormal log, the log content is automatically analyzed, and the coping strategy matching the current abnormality is retrieved from the pre-built log library. The coping strategy can include solutions, repair steps or recovery operations. The intelligent comparison function ensures that the most suitable coping solution for the current abnormality can be quickly found, shortening the response time.

[0101] In step S3035, the abnormal event is processed according to the coping strategy.

[0102] When an abnormal event occurs, the corresponding coping strategy is used to handle the abnormal event. Specifically, a specific repair command can be executed automatically to handle the abnormal event; the abnormal event can also be handled by adjusting the configuration; the abnormal event can also be handled by restarting the service, without limitation.

[0103] The server configuration method provided in the embodiment can find problems that may occur in the configuration process in time by monitoring abnormal events, improve the reliability of the system, generate monitoring abnormal logs, provide detailed data support for subsequent troubleshooting and analysis, enhance the problem tracking capability, acquire coping strategies corresponding to the abnormal logs, realize targeted processing, improve the efficiency of problem solving, continuously optimize the coping strategies by analyzing the abnormal logs and processing effects, improve the configuration management quality in the future, reduce the risk of configuration failure by processing the abnormal in time, and improve the stability of the overall system.

[0104] In the embodiment, a server configuration method is provided, which can be used for computer devices such as desktop computers, notebook computers and the like. Figure 4 The server configuration method according to the embodiment of the present application is shown in a flowchart as shown in Figure 4 The flowchart includes the following steps:

[0105] In step S401, first configuration information of a source server and second configuration information of a target server are acquired, and the first configuration information includes to-be-migrated configuration information. For details, refer to step S301 of the embodiment shown in Figure 3 The details are not repeated here.

[0106] In step S402, the first configuration information and the second configuration information are compared to determine whether the target server meets the configuration migration condition. For details, refer to step S302 of the embodiment shown in Figure 3 The details are not repeated here.

[0107] In step S403, if the target server meets the configuration migration condition, the target server is configured based on the to-be-migrated configuration information. For details, refer to step S303 of the embodiment shown in Figure 3 The details are not repeated here.

[0108] In step S404, during the configuration, first state information of each server component in the source server and second state information of each server component in the target server are acquired; the state information includes version information, refresh strategy and specific configuration command.

[0109] The first state information refers to the current state of each component in the source server, including version information, refresh strategy and specific configuration command. The second state information refers to the corresponding state of each component in the target server. Specifically, the state information of the components can be collected from the source server through API, management tools or scripts, and then the corresponding state information is acquired from the target server using a similar method.

[0110] Step S405, map the first state information to the corresponding node in the configuration file structure to generate the first target information; and map the second state information to the corresponding node in the configuration file structure to generate the second target information.

[0111] Specifically, the definition of each node in the configuration file is identified, and the corresponding node of the configuration file structure is filled according to the first state information to generate the first target information. The second state information is processed using the same method and mapped to the configuration file structure to generate the second target information.

[0112] Step S406, when detecting that the first state information of any server component in the source server changes, updating the first target information to obtain updated first target information; when detecting that the second state information of any server component in the target server changes, updating the second target information to obtain updated second target information.

[0113] When detecting that the state information of any component changes, the related first target information and / or second target information are immediately updated. Specifically, the latest state information of the changed component is re-extracted, and these updates are reflected in the corresponding target information. This process ensures that the first target information and the second target information are always up-to-date, facilitating subsequent analysis and comparison.

[0114] Step S407, format conversion is performed on the updated first target information and the second target information to obtain the format-converted first target information and the second target information.

[0115] Specifically, the required output format is defined, which can be a standard format such as JSON, CSV, etc. The relevant data is extracted from the updated first target information and the second target information to organize them in the new format. According to the pre-defined target format, the extracted information is re-organized into a new data structure to obtain the format-converted first target information and the second target information.

[0116] Step S408, the format-converted first target information and the second target information are compared node by node to determine the real-time difference information between the format-converted first target information and the second target information.

[0117] Specifically, all nodes are extracted from the format-converted first target information and the second target information to ensure that they can be compared one by one. The nodes are compared one by one to check whether the values of each node are consistent. The different nodes and their corresponding values are recorded. The discovered difference information is recorded to form a difference report, for example, including the node path, the value of the first target information, the value of the second target information, and the difference type (such as addition, deletion, modification, etc.), to ensure that the difference information can reflect the changes in the state of the server components in real time.

[0118] In step S409, if the real-time difference information is within the preset range that the target server can support, it is determined that the target server meets the configuration migration condition.

[0119] The recorded real-time difference information is evaluated to check whether the differences are within the preset range. Specifically, the difference information evaluation can include: checking whether the number of difference nodes exceeds a preset threshold; evaluating whether the difference type is an allowed type, for example, whether some configuration changes are allowed; judging whether the potential impact of the difference on system performance is within an acceptable range, etc. If the real-time difference information is within the preset range, the target server is marked as "meeting the configuration migration condition" and is ready for the next step of configuration migration. If the difference exceeds the preset range, the information is recorded and an alarm or rollback operation can be triggered to ensure that no non-compliant migration is performed.

[0120] The server configuration method provided by the embodiments of the present application can track the changes of components in the configuration process in real time by obtaining the state information of the source server and the target server, thereby improving the visualization and manageability of the system. Mapping the state information to the corresponding nodes in the configuration file structure ensures the consistency and accuracy of the information, which helps to avoid configuration errors. When the state information changes, the target information is updated in a timely manner to ensure that the configuration file always reflects the latest system state, thereby improving flexibility. Through format conversion processing, the compatibility between different systems is enhanced to ensure that the configuration can be smoothly migrated. Comparing the target information after format conversion node by node can accurately identify real-time differences to ensure the scientific nature of the migration decision. By judging the support of the target server through a preset range, the risk in the migration process is reduced and the success rate is improved.

[0121] In the embodiments, a server configuration device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.

[0122] The embodiments provide a server configuration device, as shown in Figure 5 The device includes:

[0123] The first obtaining module 501 is configured to obtain first configuration information of a source server and second configuration information of a target server, the first configuration information including to-be-migrated configuration information.

[0124] The first comparison module 502 is configured to compare the first configuration information and the second configuration information to determine whether the target server meets a configuration migration condition.

[0125] The configuration module 503 is configured to configure the target server based on the configuration information to be migrated if the target server meets the configuration migration condition.

[0126] In some optional embodiments, the configuration module 503 includes:

[0127] The generation sub-module is configured to generate a configuration script based on the configuration information to be migrated.

[0128] The configuration sub-module is configured to configure the target server according to the configuration script.

[0129] In some optional embodiments, the first acquisition module 501 includes:

[0130] The first acquisition sub-module is configured to acquire a configuration file structure and original configuration information of the source server, the configuration file structure including naming specifications, nesting relationship information and attribute configuration information of each node in a configuration file.

[0131] The mapping sub-module is configured to map the original configuration information to corresponding nodes in the configuration file structure according to the naming specifications, the nesting relationship information and the attribute configuration information of each node, to generate the first configuration information.

[0132] In some optional embodiments, the first comparison module 502 includes:

[0133] The comparison sub-module is configured to compare the first configuration information and the second configuration information node by node to determine difference information between the first configuration information and the second configuration information.

[0134] The first determination sub-module is configured to determine that the target server meets the configuration migration condition if the difference information is within a preset range that can be supported by the target server.

[0135] The verification sub-module is configured to perform data verification on the first configuration information and the second configuration information to obtain a data verification result.

[0136] The second determination sub-module is configured to determine that the target server meets the configuration migration condition if the data verification result is correct.

[0137] In some optional embodiments, the first acquisition module 501 further includes:

[0138] The format conversion sub-module is configured to perform format conversion on the first configuration information and the second configuration information to obtain the first configuration information and the second configuration information after format conversion.

[0139] In some optional embodiments, the generation sub-module includes:

[0140] The acquisition unit is configured to acquire a pre-defined configuration script template.

[0141] The generating unit is configured to insert the version information, the refresh strategy and the specific configuration command into the configuration script template to generate the configuration script.

[0142] In some optional embodiments, the configuration module 503 further comprises:

[0143] The monitoring submodule is configured to monitor an abnormal event occurring during the configuration of the target server based on the configuration script, and generate a monitoring abnormal log;

[0144] The second obtaining submodule is configured to obtain a coping strategy corresponding to the abnormal event;

[0145] The processing submodule is configured to process the abnormal event according to the coping strategy.

[0146] In some optional embodiments, the apparatus further comprises:

[0147] The second obtaining module is configured to obtain first state information of each server component in the source server and second state information of each server component in the target server during the configuration; the state information comprises version information, a refresh strategy and a specific configuration command;

[0148] The generating module is configured to map the first state information to a corresponding node in a configuration file structure to generate first target information, and map the second state information to a corresponding node in the configuration file structure to generate second target information;

[0149] The updating module is configured to update the first target information to obtain updated first target information when detecting that the first state information of any server component in the source server changes, and update the second target information to obtain updated second target information when detecting that the second state information of any server component in the target server changes;

[0150] The format conversion module is configured to perform format conversion on the updated first target information and the updated second target information to obtain format-converted first target information and format-converted second target information;

[0151] The second comparison module is configured to compare the format-converted first target information and the format-converted second target information node by node to determine real-time difference information between the format-converted first target information and the format-converted second target information;

[0152] The determining module is configured to determine that the target server satisfies the configuration migration condition if the real-time difference information is within a preset range that can be supported by the target server.

[0153] Further function descriptions of the above-mentioned various modules and units are the same as those of the above-mentioned corresponding embodiments, which will not be described herein again.

[0154] In this embodiment, the server configuration device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0155] The server configuration device provided in this invention can automatically determine whether the target server meets the migration conditions by comparing the configuration information of the source server and the target server. This simplifies the migration process, reduces manual intervention, eliminates the need for manual configuration, and improves the automation of server configuration. Before migration, the system verifies the configuration compatibility of the target server, thereby reducing the risk of failure due to improper configuration and improving the stability of the server system. By enabling rapid copying and pasting of server configurations, the time required to set up multiple servers is significantly reduced, lowering time costs and improving server configuration efficiency. Simultaneously, it ensures the consistency of configurations across all servers, reducing inconsistencies caused by human error, improving configuration accuracy, and ultimately guaranteeing the reliability of the server system.

[0156] This invention also provides a computer device having the above-described features. Figure 5 The server configuration shown.

[0157] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.

[0158] The processor 10 can be a central processing unit, a network processing unit, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic device, a general array logic, or any combination thereof.

[0159] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods illustrated in the above embodiments.

[0160] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function. The data storage area can store data created according to the use of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0161] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk. The memory 20 can further include a combination of the above-mentioned types of memories.

[0162] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 can be connected by a bus or other means, Figure 6 For example, by a bus connection.

[0163] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, and the like. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), and the like. The display device includes, but is not limited to, a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.

[0164] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0165] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, the operation of the computer can invoke or provide the method and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc. Correspondingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0166] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.< / server> < / networkinterface> < / bios>

Claims

1. A server configuration method characterized by, The method comprises: obtaining first configuration information of a source server and second configuration information of a target server, wherein the first configuration information comprises to-be-migrated configuration information; comparing the first configuration information and the second configuration information to determine whether the target server meets a configuration migration condition; if the target server meets the configuration migration condition, configuring the target server based on the to-be-migrated configuration information; during the configuration, obtaining first state information of each server component in the source server and second state information of each server component in the target server, wherein the state information comprises version information, refresh strategy and specific configuration command; mapping the first state information to a corresponding node in a configuration file structure to generate first target information, and mapping the second state information to a corresponding node in the configuration file structure to generate second target information; when detecting that the first state information of any server component in the source server changes, updating the first target information to obtain updated first target information; when detecting that the second state information of any server component in the target server changes, updating the second target information to obtain updated second target information; format-converting the updated first target information and the second target information to obtain format-converted first target information and second target information; comparing the format-converted first target information and the second target information node by node to determine real-time difference information between the format-converted first target information and the second target information; if the real-time difference information is within a preset range that can be supported by the target server, it is determined that the target server meets the configuration migration condition.

2. The method of claim 1, wherein, The configuration of the target server based on the to-be-migrated configuration information comprises: generating a configuration script based on the to-be-migrated configuration information; and configuring the target server according to the configuration script.

3. The method of claim 1, wherein, The obtaining of the first configuration information of the source server comprises: obtaining a configuration file structure and original configuration information of the source server, wherein the configuration file structure comprises naming specification, nesting relationship information and attribute configuration information of each node in a configuration file; mapping the original configuration information to a corresponding node in the configuration file structure according to the naming specification, the nesting relationship information and the attribute configuration information of each node to generate the first configuration information.

4. The method of claim 3, wherein, The comparison of the first configuration information and the second configuration information to determine whether the target server meets the configuration migration condition comprises: comparing the first configuration information and the second configuration information node by node to determine difference information between the first configuration information and the second configuration information; if the difference information is within a preset range that can be supported by the target server, it is determined that the target server meets the configuration migration condition; and / or, performing data verification on the first configuration information and the second configuration information to obtain a data verification result; if the data verification result is correct, it is determined that the target server meets the configuration migration condition.

5. The method according to claim 1 or 3, characterized in that, Further comprising: The first configuration information and the second configuration information are format-converted to obtain format-converted first configuration information and second configuration information.

6. The method of claim 2, wherein, The to-be-migrated configuration information includes version information, a refresh strategy, and a specific configuration command corresponding to each server component included in the source server; The configuration script is generated based on the to-be-migrated configuration information, including: obtaining a predefined configuration script template; inserting the version information, the refresh strategy, and the specific configuration command into the configuration script template to generate the configuration script.

7. The method of claim 2, wherein, Further comprising: monitoring an abnormal event occurring during configuration of the target server based on the configuration script to generate a monitoring exception log; obtaining a coping strategy corresponding to the abnormal event; processing the abnormal event according to the coping strategy.

8. A computer device, comprising: comprising: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the server configuration method of any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, which are used to make a computer execute the server configuration method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Operation environment migration support device, record medium with program stored therefor, and method therefor

    US20140297871A1