Automatic configuration method and device for container environment of business system and computer equipment
Automatically modifying the yaml file of the container cloud platform through the machine learning model, solving the problem of time-consuming and error-prone construction of the business system container environment, and achieving efficient and intelligent configuration and deployment.
Patent Information
- Application Number
- CN202510230691.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the construction of the business system container environment is time-consuming, prone to errors and omissions, and the configuration files cannot be reused, resulting in inaccurate construction efficiency.
The machine learning model is used to automatically modify the benchmark environment yaml file on the container cloud platform, and combine the related information of the local database and the difference information of the environment to be built to achieve automated configuration and deployment.
It reduces labor costs and improves construction efficiency, shortens from heaven and hour levels to minute levels, realizing the intelligent and sustainable configuration of the business system container environment.
Smart Images

Figure CN120256014A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a method, device, and computer equipment for automatically configuring a business system container environment. Background Art
[0002] The pace of migrating bank system applications to the cloud has accelerated, and the demand for building a business system container environment has been growing and rapidly accumulating. Currently, the industry generally uses a semi-automatic method that combines manual work with various third-party tools to build a business system container environment. However, due to the different system architectures and implemented functions, the number, complexity, and diversity of their configuration files vary greatly. Therefore, the preparation of configuration files usually needs to be done manually. As a result, problems such as errors, omissions, and long time consumption are likely to occur during the preparation process. In addition, the preparation process of configuration files cannot be reused for building other container environments of the same system, nor can it be used as a reference for building other business system container environments. These problems have become bottlenecks hindering the construction of business system container environments.
[0003] In view of this, the embodiments of this specification aim to provide a method, device, and computer equipment for automatically configuring a business system container environment. Summary of the Invention
[0004] Aiming at the above problems of the prior art, the purpose of the embodiments of this specification is to provide a method, device, and computer equipment for automatically configuring a business system container environment to solve the problems of long time consumption, easy errors, and easy omissions caused by manual configuration of business system containers in the prior art.
[0005] To solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows:
[0006] In the first aspect, the embodiments of this specification provide a method for automatically configuring a business system container environment, including:
[0007] Create a task for building a business system container environment;
[0008] Back up and pull the benchmark environment yaml file stored on the container cloud platform to the local server through gitlab;
[0009] Pull the project of the environment to be built to the local server, and copy the pulled benchmark environment yaml file to the corresponding directory of the project of the environment to be built on the local server;
[0010] Determine whether there is an environment to be built on the container cloud platform;
[0011] If so, back up and pull the environment YAML file to be built stored on the container cloud platform to the local server, and use a machine learning model on the local server to modify the benchmark environment YAML file according to the environment YAML file to be built;
[0012] If not, use a machine learning model to modify the benchmark environment YAML file according to the association information between the benchmark environment and the environment to be built stored in the local database;
[0013] Upload the modified benchmark environment YAML file to the project of the environment to be built in GitLab;
[0014] Configure the operation and maintenance tool for the environment to be built, and use the modified benchmark environment YAML file to deploy the environment to be built;
[0015] Automatically update the information stored in the local database regularly.
[0016] Specifically, using a machine learning model to modify the benchmark environment YAML file according to the environment YAML file to be built includes:
[0017] Compare the benchmark environment YAML file with the environment YAML file to be built to obtain difference information;
[0018] Input the difference information into a pre-trained first machine learning model to obtain the effective difference information output by the first machine learning model;
[0019] Input the effective difference information into a pre-trained second machine learning model to obtain the modification steps output by the second machine learning model;
[0020] Modify the benchmark environment YAML file according to the modification steps.
[0021] Specifically, using a machine learning model to modify the benchmark environment YAML file according to the association information between the benchmark environment and the environment to be built stored in the local database includes:
[0022] Judge whether there is the first association information of the environment to be built in the local database;
[0023] If so, obtain the modification steps in the first association information, and modify the benchmark environment YAML file according to the modification steps;
[0024] If not, judge whether there is the second association information of other environments of the business system in the local database;
[0025] If the second associated information exists, generate a modification template for the environment to be built according to the modification steps of other environments in the second associated information, generate modification steps according to the information of the reference environment, the information of the environment to be built, and the modification template, and use the modification steps to modify the reference environment yaml file.
[0026] Further, if the second associated information does not exist, the method further includes:
[0027] Input the modification steps in the associated information of other business system container environments in the local database into a pre-trained third machine learning model to obtain general modification items output by the third machine learning model;
[0028] Search for and match general modification items in the existing reference environment and the information of the environment to be built, and obtain the values to be modified and the corresponding modified values corresponding to the general modification items;
[0029] Generate modification steps according to the general modification items, the values to be modified, and the modified values through a fourth machine learning model, and use the modification steps to modify the reference environment yaml file.
[0030] Preferably, after modifying the reference environment yaml file, the method further includes:
[0031] Judge whether the modification of the reference environment yaml file using the modification steps is successful;
[0032] If successful, save the system information, container cloud platform information, reference environment information, environment to be built information, reference environment yaml file, the modified reference environment yaml file, the first comparison result, and the yaml modification steps as the first associated information of the environment to be built in the local database;
[0033] If not successful, input the failure reason and the corresponding modification steps into a pre-trained fifth machine learning model, output the adjusted modification steps, and modify the reference environment yaml file according to the adjusted modification steps;
[0034] Judge whether the modification of the reference environment yaml file using the adjusted modification steps is successful;
[0035] If so, save the system information, container cloud platform information, reference environment information, environment to be built information, reference environment yaml file, the modified reference environment yaml file, the first comparison result, and the adjusted yaml modification steps as the first associated information of the environment to be built in the local database.
[0036] Further, when the modification of the reference environment yaml file fails according to the adjusted modification steps, the method further includes:
[0037] Determine whether there is an environment to be built in the container cloud platform;
[0038] If not, obtain general modification items through a third machine learning model, and output modification steps through the general modification items and the modification values corresponding to the environment to be built. Modify the reference environment yaml file according to the modification steps;
[0039] If so, update the second machine learning model using the failed modification result of the reference environment yaml file until the modification of the reference environment yaml file according to the modification steps output by the second machine learning model is successful.
[0040] Specifically, the first machine learning model is trained through the following training steps:
[0041] Collect data, where the data includes the difference information between multiple sets of reference environment yaml files and the environment yaml files to be built;
[0042] Mark the difference information;
[0043] Randomly divide the data into training data and test data;
[0044] Input the training data into the initial first machine learning model to obtain a trained model;
[0045] Then input the test data into the trained first machine learning model to obtain predicted data and accuracy;
[0046] Iteratively update the first machine learning model until the accuracy reaches the preset condition.
[0047] Further, the second machine learning model is trained through the following training steps:
[0048] Collect training data, where the training data includes the effective difference information between the reference environment yaml file and the environment yaml file to be built;
[0049] Input the training data into the initial second machine learning model to obtain modification steps;
[0050] After modifying the reference environment yaml file using the modification steps, obtain the modified reference environment yaml file;
[0051] Calculate the loss function based on the modified reference environment yaml file and the environment yaml file to be built;
[0052] Iteratively update the second machine learning model until the loss function reaches a preset convergence condition.
[0053] Furthermore, the modification step includes five dimensions: modification type, search path, location path, old value, and new value;
[0054] Among them, the modification type includes addition, deletion, replacement, file renaming, file copying, and floating value copying.
[0055] Specifically, before pulling the project of the environment to be built from gitlab to the local server, the method further includes:
[0056] Judge whether the project of the environment to be built exists on gitlab;
[0057] If it does not exist, use UI automation to create the directory of the environment to be built.
[0058] Further, before backing up the benchmark environment yaml file stored on the container cloud platform through gitlab and pulling it to the local server, the method further includes:
[0059] Use UI automation to log in to the container cloud platform according to the username and password, create an interaction credential, and interact with the container cloud platform based on the credential;
[0060] In a second aspect, an embodiment of this specification provides a device for automatically configuring a business system container environment, including:
[0061] A creation module, configured to create a task for building a business system container environment;
[0062] A backup module, configured to back up the benchmark environment yaml file stored on the container cloud platform through gitlab and pull it to the local server;
[0063] A copying module, configured to pull the project of the environment to be built from gitlab to the local server, and copy the pulled benchmark environment yaml file to the corresponding directory of the project of the environment to be built on the local server;
[0064] A judgment module, configured to judge whether there is an environment to be built on the container cloud platform;
[0065] A first modification module, configured to, if so, back up the yaml file of the environment to be built stored on the container cloud platform through gitlab and pull it to the local server, and use a machine learning model on the local server to modify the benchmark environment yaml file according to the yaml file of the environment to be built;
[0066] A second modification module, configured to, if the answer is no, modify the base environment yaml file by using a machine learning model according to the association information between the base environment and the environment to be built stored in the local database;
[0067] An upload module, configured to upload the modified base environment yaml file to the project of the environment to be built in gitlab;
[0068] A deployment module, configured to configure an operation and maintenance tool for the environment to be built and deploy the environment to be built by using the modified base environment yaml file;
[0069] An update module, configured to automatically update the information stored in the local database regularly.
[0070] In a third aspect, an embodiment of this specification provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method provided by the above technical solution is implemented.
[0071] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method provided by the above technical solution is implemented.
[0072] In a fifth aspect, an embodiment of this specification provides a computer program product, including at least one instruction or at least one segment of program, and the at least one instruction or the at least one segment of program is loaded and executed by a processor to implement the method provided by the above technical solution.
[0073] By adopting the above technical solution, a method, a device, and a computer device for automatically configuring a business system container environment provided by an embodiment of this specification can reuse the configuration of an existing container environment, and use a machine learning model to modify the base environment yaml file, reducing the threshold for building a business system container environment and reducing labor costs; there is no need to manually prepare various preliminary materials and invest a large amount of modification time, greatly reducing the building time and improving the building efficiency.
[0074] To make the above and other purposes, features, and advantages of the embodiments of this specification more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings
[0075] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0076] Figure 1 It shows a schematic diagram of the steps of an automated configuration method for a business system container environment provided by an embodiment of this specification;
[0077] Figure 2 It shows a schematic diagram of the steps of using a machine learning model to modify a baseline environment YAML file according to a YAML file of an environment to be built when there is an environment to be built on a container cloud platform;
[0078] Figure 3 It shows a schematic diagram of the steps of using a machine learning model to modify a baseline environment YAML file according to the association information between the baseline environment and the environment to be built stored in a local database when there is no environment to be built on a container cloud platform;
[0079] Figure 4 It shows another schematic diagram of the steps of modifying a baseline environment YAML file;
[0080] Figure 5 It shows a schematic diagram of the structure of an automated configuration device for a business system container environment provided by an embodiment of this specification;
[0081] Figure 6 It shows a schematic diagram of the structure of a computer device provided by an embodiment of this specification.
[0082] Explanation of the reference symbols in the drawings:
[0083] 51. Creation module;
[0084] 52. Backup module;
[0085] 53. Copy module;
[0086] 54. Judgment module;
[0087] 55. First modification module;
[0088] 56. Second modification module;
[0089] 57. Upload module;
[0090] 58. Deployment module;
[0091] 59. Update module;
[0092] 602, Computer device;
[0093] 604, Processor;
[0094] 606, Memory;
[0095] 608, Driving mechanism;
[0096] 610, Input / output module;
[0097] 612, Input device;
[0098] 614, Output device;
[0099] 616, Presentation device;
[0100] 618, Graphical user interface;
[0101] 620, Network interface;
[0102] 622, Communication link;
[0103] 624, Communication bus. Detailed implementation
[0104] Next, the technical solutions in the embodiments of this specification will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this specification.
[0105] It should be noted that the terms "first", "second", etc. in this specification, the claims and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of this specification described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.
[0106] To solve the above problems, the embodiments of this specification provide a method, device and computer device for automatic configuration of a business system container environment, which can solve the problems of long time consumption, easy error and easy omission caused by manual configuration of business system containers in the prior art. Figure 1It is a schematic diagram of the steps of a method for automatically configuring a business system container environment provided by an embodiment of this specification. This specification provides the method operation steps as described in the embodiment or flowchart, but based on routine or non-creative labor, it may include more or fewer operation steps. The step order listed in the embodiment is only one way among the execution orders of numerous steps and does not represent the only execution order. When the actual system or device product executes, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or executed in parallel. Specifically, as Figure 1 shown, the method may include:
[0107] S101: Create a task for building a business system container environment.
[0108] Among them, the input parameters of the building task include the container cloud platform user login name and password, the business system name, the benchmark environment namespace and cluster, and the namespace and cluster information of the environment to be built.
[0109] S102: Back up and pull the benchmark environment yaml file stored on the container cloud platform to the local server through gitlab.
[0110] Among them, the benchmark environment refers to a set of container environments that have been built and are running stably for a business system, which can be used as a reference for building or iteratively updating other container environments of the same system; the environment to be built is the container environment of the business system to be built.
[0111] The container cloud platform is a platform for maintaining the business system container environment. A system can have multiple sets of container environments, each environment has a namespace, and can be built on one or more clusters.
[0112] Yaml is a file format. Yaml files are used to store various configuration information of the container environment. The building of the business system container environment depends on various yaml files, covering aspects such as storage, configuration, application, and network.
[0113] Gitlab is the repository for storing the business system container environment yaml files. A system shares one gitlab account. In the embodiments of this specification, the method of sharing one gitlab account is adopted, and different systems are managed in different projects.
[0114] Due to the characteristics of the container cloud platform, the yaml files stored on the container cloud platform cannot be directly obtained and need to go through GitLab. It is necessary to configure the operation and maintenance tool with the information of the benchmark environment container cloud platform (the operation and maintenance tool is a tool provided by the container cloud platform, which can interact with the container cloud platform and GitLab through interfaces to realize the backup and storage of yaml files from the container cloud platform to GitLab, or read the yaml files from GitLab and deploy them to the container cloud platform, so as to realize operations such as deployment, restart, update, stop, and deletion of container services); the operation and maintenance tool sends a backup command to back up the yaml files stored on the container cloud platform of the benchmark environment to the backup project on GitLab; then use Git (that is, the tool used to interact with GitLab) to pull the backed-up benchmark environment yaml files from GitLab to the local server.
[0115] S103: Pull the project of the environment to be built from GitLab to the local server, and copy the benchmark environment yaml file pulled to the local server to the corresponding directory of the project of the environment to be built on the local server.
[0116] If there is content in the directory of the project of the environment to be built pulled down, empty the directory before copying.
[0117] S104: Determine whether the environment to be built exists on the container cloud platform.
[0118] S105: If so, back up and pull the yaml file of the environment to be built stored on the container cloud platform to the local server, and use a machine learning model on the local server to modify the benchmark environment yaml file according to the yaml file of the environment to be built.
[0119] If the environment to be built exists on the container cloud platform, it indicates that the environment to be built for this business system is not the first time to be built, and the current building task is to update and iterate this container environment. Then use the yaml file of the environment to be built (that is, the yaml file currently running in this container environment of the business system) to modify the benchmark environment yaml file in the corresponding directory of the project of the environment to be built.
[0120] Similar to the benchmark environment yaml file, the yaml file of the environment to be built cannot be directly obtained from the container cloud platform. It is necessary to configure the operation and maintenance tool with the information of the container cloud platform of the environment to be built, and use the operation and maintenance tool to send a backup command; back up the yaml file of the environment to be built on the container cloud platform to GitLab; then use Git to pull the backed-up yaml file of the environment to be built from GitLab to the local server.
[0121] S106: If not, modify the baseline environment yaml file using a machine learning model based on the association information between the baseline environment and the environment to be built stored in the local database.
[0122] S107: Upload the modified baseline environment yaml file to the project of the environment to be built in gitlab.
[0123] S108: Configure the operation and maintenance tool for the environment to be built, and deploy the environment to be built using the modified baseline environment yaml file.
[0124] When the deployment fails, return the deployment failure and the detailed reason for the failure.
[0125] The method further includes:
[0126] S109: Automatically update the information stored in the local database regularly.
[0127] A method for automatically configuring the container environment of a business system provided by an embodiment of this specification can reuse the configurations of existing container environments, and use a machine learning model to modify the baseline environment yaml file, reducing the threshold for building the container environment of the business system and reducing labor costs; there is no need to manually prepare various preliminary materials (including container cloud platform information, yaml files, building manuals, etc.) and no need to spend a lot of time modifying yaml, thus greatly reducing the building time and improving the building efficiency, shortening the building time from days and hours to minutes, achieving the goal of cost reduction and efficiency improvement. On the other hand, the machine learning model can continuously learn, optimize, and iterate and update. As the number of connected systems increases, the number and diversity of samples available for learning also increase, thereby improving the accuracy of the model and realizing the intelligence and sustainability of building the container environment of the business system.
[0128] Further, as Figure 2 shown, in the embodiment of this specification, in step S105, using the machine learning model to modify the baseline environment yaml file according to the yaml file of the environment to be built includes:
[0129] S201: Compare the baseline environment yaml file and the yaml file of the environment to be built to obtain difference information.
[0130] S202: Input the difference information into a pre-trained first machine learning model to obtain the effective difference information output by the first machine learning model.
[0131] Specifically, the difference information includes valid differences and invalid differences. Among them, the valid differences at least include one or more of the namespace name, cluster name, container image address, values of requests and limits for CPU & memory, replicas value, database connection information, cache connection information, NAS storage information, object storage information, ELB network information, and application configuration information in the yaml; the invalid differences at least include one or several combinations of the creator of the yaml file, updater, restart timestamp, and update timestamp. Specifically, in the method provided by the embodiments of this specification, the difference information is input into a pre-trained first machine learning model to classify the difference information and filter out the valid difference information.
[0132] The quantity and types of yaml files in each system vary greatly. If there are many yaml files and a large number of differences, the volume of the difference information obtained by comparing the yaml files in the baseline environment and the environment to be built may be large, while the valid differences worthy of attention are only a part of them. Therefore, the yaml files in the baseline environment and the environment to be built are input into the first machine learning model to output the valid differences between the yaml files in the baseline environment and the environment to be built through the machine learning model, and filter out the invalid differences, thereby further improving the comparison and analysis efficiency and reducing the error rate of manual comparison; greatly improving the accuracy and integrity of the comparison, and further facilitating the success rate and accuracy of modifying the yaml files in the baseline environment based on the obtained difference information.
[0133] S203: Input the valid difference information into a pre-trained second machine learning model to obtain the modification steps output by the second machine learning model.
[0134] Specifically, in the method provided by the embodiments of this specification, the valid difference information is input into a pre-trained second machine learning model to obtain the modification steps corresponding to each valid difference; that is, for each valid difference between the yaml file in the baseline environment and the yaml file in the environment to be built, the corresponding modification steps are output respectively.
[0135] Preferably, in the embodiments of this specification, after the first machine learning model outputs the valid difference information, it may further include a step of manual review (such as including manually tagging the omissions or errors in the valid differences), and judge whether the valid difference information output by the first machine learning model is correct and complete through manual intervention. If there are omissions or deficiencies, the first machine learning model is iteratively updated again and the yaml file in the baseline environment is modified again to optimize the output of the valid difference information by the first machine learning model. Go through the configuration process again from step S103.
[0136] By manually checking for omissions and making up for deficiencies, the accuracy and integrity of the modification of the benchmark environment yaml file are ensured.
[0137] S204: Modify the benchmark environment yaml file according to the modification steps.
[0138] For the business system container environment automatic configuration method provided in the embodiments of this specification, when the environment to be built is not built for the first time, the existing yaml file of the environment to be built can be reused to modify the benchmark environment yaml file. Thus, the update and iteration efficiency of the yaml file of the environment to be built is improved, the manual configuration workload is reduced, and the efficiency is enhanced. And a method of a machine learning model is creatively proposed. According to the specific forms of the difference information, a suitable adapter is selected, and then according to the defined positioning rules and modification modes, it is converted into modification steps that can be understood by the program, solving problems such as slow start and easy omission and error in manual modification.
[0139] The first machine learning model is trained through the following steps:
[0140] Collect data, where the data includes the difference information between multiple sets of benchmark environment yaml files and the yaml files of the environment to be built;
[0141] Mark the difference information. Specifically, mark information such as the namespace name, cluster name, container image address, values of requests and limits of CPU & memory, replicas value, database connection information, cache connection information, NAS storage information, object storage information, and ELB network information in the yaml as valid; mark information such as the creator, updater, restart timestamp, and update timestamp of the yaml file as invalid;
[0142] Randomly divide the data into training data and test data;
[0143] Use the training data to train the first machine learning model;
[0144] Then input the test data into the trained first machine learning model to obtain the predicted data and the accuracy rate. The accuracy rate is calculated based on the predicted data output by the first machine learning model and the data marked as valid;
[0145] Iteratively update the first machine learning model until the accuracy rate reaches the preset condition.
[0146] The second machine learning model is trained through the following steps:
[0147] Collect training data, where the training data includes the effective difference information between the benchmark environment yaml file and the environment yaml file to be built; specifically, the effective difference information can be the namespace name, cluster name, container image address, values of requests and limits for CPU & memory, replicas value, database connection information, cache connection information, NAS storage information, object storage information, ELB network information, etc. in the yaml.
[0148] Input the training data into the initial second machine learning model to obtain modification steps.
[0149] After modifying the benchmark environment yaml file using the modification steps, obtain the modified benchmark environment yaml file.
[0150] Calculate the loss function based on the modified benchmark environment yaml file and the environment yaml file to be built.
[0151] Iteratively update the second machine learning model until the loss function reaches the preset convergence condition.
[0152] Among them, the modification steps include five dimensions: modification type, search path, positioning path, old value, and new value.
[0153] Specifically, the modification types include six types: addition, deletion, replacement, file renaming, file copying, and floating value copying.
[0154] For example, if a certain effective difference information is unique to the environment yaml file to be built and needs to be retained, the modification type involved in the corresponding modification steps is addition. Further, if there are requirements for the insertion position at the same level, the specific insertion position can be further specified through the positioning path.
[0155] For example, if a certain effective difference information is about the database, and the database information in the environment yaml file to be built is different from that in the benchmark environment yaml file, the modification type involved in the corresponding modification steps is replacement, the old value involved is the original database in the benchmark environment yaml file, and the new value is the database in the environment yaml file to be built.
[0156] For example, if a certain effective difference information is that the name of a certain file in the environment yaml file to be built is different from the name of the corresponding file in the benchmark environment yaml file (while the actual content of the file is the same), the modification type involved in the modification steps is file renaming.
[0157] For another example, as the business system iteratively updates, there may be a situation where the content of a certain file changes regularly or irregularly. When solidifying such valid difference information into modification steps, the modification type involved can be file copying.
[0158] For another example, if the valid difference information is a certain parameter with a floating and unfixed attribute value (for example, the application image address), but since the specific value of the image address is not fixed, the modification type involved at this time is floating value copying. That is, the action of updating the application image address is solidified into a modification step, rather than solidifying the specific value of the image address therein. Thus, when the application image address needs to be modified next time, this modification step can be reused, while ensuring the requirement that the specific value of the image address therein is not a fixed value. That is to say, floating value copying is a modification type that solidifies the modification action of a parameter with a floating and unfixed attribute value into a modification step.
[0159] The search path is to search the yaml directory / file path. When the modification types involve file renaming / file copying / floating value copying, it needs to be specific to the file path. For the remaining modification types, it can be a directory or file path.
[0160] The positioning path is the position where the attribute is located in the yaml file:
[0161] (1) When the new type has no positioning path, it is a new file; when the deletion type has no positioning path, it is a deleted file; when the replacement type has no positioning path, it is a batch replacement under the search path;
[0162] (2) When the modification type is file renaming and file copying types, no positioning path is required;
[0163] (3) When the modification type is floating value copying, a positioning path must exist;
[0164] (4) When precisely positioning the attribute, the positioning path must be filled in, indicating the position of the attribute in the file, used for precise positioning of the modification, and separated by @@ at each level. If there are multiple groups of yaml content in the same file, if you need to precisely position to a certain group, start with ## group number (starting from 0) to distinguish. If you need to check all groups, no distinction is required, such as ##1@@ subsequent positions. For different embedded content formats in the yaml file, there are different positioning rules.
[0165] The old value is the string value to be searched, which can be empty when the modification type is new / deletion; it needs to match the original value when the modification type is replacement; when the modification type is file renaming / file copying / floating value copying, no old value is required.
[0166] The new value is the string to be newly added / replaced. When the modification type is "new addition", the new value is the specific data value to be newly added; when the modification type is "deletion", it can be empty; when the modification type is "file renaming", the new value is the specific new file name; when the modification type is "file copying", the new value is the relative path of the file to be copied (if not filled, it is defaulted to copying the file in the same path in the backup environment to be built); when the modification type is "floating value copying" (such as when applying an image for an image), the new value is the positioning path corresponding to the image (it will copy from the positioning path corresponding in the file with the same path in the backup environment to be built; if not filled, it is defaulted to copying from the same positioning path in the file with the same path in the backup environment to be built).
[0167] Further, as Figure 3 shown, in the embodiment of this specification, step S106: According to the association information between the reference environment and the environment to be built stored in the local database, use a machine learning model to modify the reference environment yaml file, which further includes:
[0168] S301: Determine whether there is first association information of the environment to be built in the local database.
[0169] S302: If so, obtain the modification steps in the first association information, and modify the reference environment yaml file according to the modification steps.
[0170] That is, if there is no environment to be built on the container cloud platform, but there is first association information of the environment to be built stored in the local database, it indicates that the environment to be built has been built on the container cloud platform before but has been deleted, but there is still first association information related to the environment to be built stored in the local database. Therefore, the modification steps in the first association information can be used to modify the reference environment yaml file in the corresponding directory of the environment to be built project.
[0171] S303: If not, determine whether there is second association information of other environments of the business system in the local database.
[0172] If there is no environment to be built on the container cloud platform and there is also no association information between the reference environment and the environment to be built in the local database, it indicates that this build task is the first build of the environment to be built for this business system. At this time, further determine whether there is information about other environments of this business system stored in the local database.
[0173] Exemplarily, the reference environment can be denoted as A and the environment to be built as B. If there is no such environment to be built B on the container cloud platform and there is also no association information related to the environment to be built B in the local database, then further check whether there is association information about other environments (which can be denoted as C) of this business system in the local database.
[0174] S304: If there is the second associated information, generate a modification template for the environment to be built according to the modification steps of other environments in the second associated information, generate modification steps according to the information of the reference environment, the information of the environment to be built, and the modification template, and use the modification steps to modify the reference environment yaml file.
[0175] Since other environment C and the environment to be built B belong to the same business system, there are great commonalities between the other environment yaml file and the environment to be built yaml file. Therefore, the associated information based on the other environment is used as a modification template, and on this basis, modification steps are obtained to modify the reference environment yaml file in the corresponding directory of the environment to be built project.
[0176] S305: If there is no such second associated information, input the modification steps in the associated information of the container environment of other business systems in the local database into a pre-trained third machine learning model to obtain general modification items output by the third machine learning model; search for and match the general modification items in the existing reference environment and the information of the environment to be built, and obtain the values to be modified and the modification values corresponding to the general modification items; generate modification steps through a fourth machine learning model according to the general modification items, the values to be modified, and the modification values, and use the modification steps to modify the reference environment yaml file.
[0177] That is to say, the third machine learning model can obtain general modification items according to the modification steps in the associated information of the container environment of other business systems in the local database; while the fourth machine learning model can output modification steps corresponding to the general modification items.
[0178] Specifically, in the embodiments of this specification, the third machine learning model is trained through the following steps:
[0179] Collect data, where the data includes the modification steps in multiple sets of environment associated information;
[0180] Mark the modification steps. Specifically, if the modification steps involve the modification of information such as the namespace name, cluster name, container image address, requests and limits values of CPU & memory, replicas value, database connection information, cache connection information, NAS storage information, object storage information, ELB network information, etc. in yaml, they are general modification items, and the rest are marked as non-general modification items;
[0181] Randomly divide the data into training data and test data;
[0182] Use the training data to train the third machine learning model;
[0183] Then, input the test data into the trained third machine learning model to obtain the predicted data (i.e., the modification steps in the test data predicted by the third machine learning model as general modification items) and the accuracy rate; wherein, the accuracy rate is calculated from the predicted data output by the third machine learning model and the modification steps marked as general modification items;
[0184] Iteratively update the third machine learning model until the accuracy rate reaches the preset condition.
[0185] The fourth machine learning model is trained through the following steps:
[0186] Collect training data, where the training data includes general modification items; specifically, the general modification items can be information such as namespace names, cluster names, container image addresses, values of requests and limits for CPU & memory, replicas values, database connection information, cache connection information, NAS storage information, object storage information, ELB network information, etc. in yaml;
[0187] Input the training data, the values to be modified corresponding to the benchmark environment, and the values to be modified corresponding to the environment to be built into the initial fourth machine learning model to obtain the modification steps;
[0188] After modifying the benchmark environment yaml file using the modification steps, obtain the modified benchmark environment yaml file;
[0189] Calculate the loss function based on the modified benchmark environment yaml file and the environment to be built yaml file;
[0190] Iteratively update the fourth machine learning model until the loss function reaches the preset convergence condition.
[0191] Through the associated information of other business system container environments existing in the local database, and outputting general modification items through the third machine learning model, it is possible to identify and modify in advance the configuration items that need to be modified and are encountered by most systems, and then hand them over to manual verification for checking and filling in the gaps, which can effectively reduce labor costs and improve efficiency.
[0192] Through the method steps as Figure 3 shown, when there is no environment to be built on the container cloud platform, it is possible to at least partially reuse the associated information of the environment to be built stored in the local database or the associated information of other environments of the same business system or the associated information of container environments of different business systems, so that it is possible to achieve fast and accurate construction of the business system container environment without relying on the construction manual and without the need for technical personnel to have knowledge of system container environment construction, reducing the input of human and material resources and improving the construction quality and efficiency.
[0193] Further, in the embodiments of this specification, as Figure 4 shown, after modifying the benchmark environment yaml file, the method further includes:
[0194] S401: Determine whether the modification of the benchmark environment yaml file using the modification steps is successful.
[0195] S402: If successful, save the system information, container cloud platform information, benchmark environment information, environment to be built information, benchmark environment yaml file, the modified benchmark environment yaml file, the first comparison result, and the yaml modification steps as the first associated information of the environment to be built to the local database.
[0196] Among them, when there is no environment to be built on the container cloud platform, the first comparison result is obtained by comparing the modified benchmark environment yaml file with the unmodified benchmark environment yaml file. When there is an environment to be built on the container cloud platform, the first comparison result is obtained by comparing the modified benchmark environment yaml file with the backed-up environment to be built yaml file.
[0197] S403: If not successful, input the failure reason and the corresponding modification steps into a pre-trained fifth machine learning model, output the adjusted modification steps, and modify the benchmark environment yaml file according to the adjusted modification steps.
[0198] Among them, the fifth machine learning model is trained through the following steps:
[0199] Collect data, where the data includes failure reasons and corresponding solutions;
[0200] Mark the data. Specifically, mark the failure reasons with the same solution as one category;
[0201] Randomly divide the data into training data and test data;
[0202] Input the training data into the initial fifth machine learning model to obtain a trained model;
[0203] Then input the test data into the trained fifth machine learning model to obtain predicted data and an accuracy rate;
[0204] Iteratively update the fifth machine learning model until the accuracy rate reaches a preset condition.
[0205] S404: Determine whether the modification of the benchmark environment yaml file using the adjusted modification steps is successful.
[0206] S405: If so, save the system information, container cloud platform information, benchmark environment information, environment to be built information, benchmark environment yaml file, modified benchmark environment yaml file, the first comparison result, and adjusted yaml modification steps as the first associated information of the environment to be built to the local database.
[0207] S406: If not, determine whether there is an environment to be built in the container cloud platform.
[0208] S407: If not, obtain general modification items through the third machine learning model, and use the general modification items, values to be modified corresponding to the benchmark environment, and values to be modified corresponding to the environment to be built to output modification steps through the fourth machine learning model, and modify the benchmark environment yaml file according to the modification steps.
[0209] That is to say, when there is no environment to be built in the container cloud platform, the benchmark environment yaml file is modified according to the general modification steps in step S305.
[0210] S408: If so, update the second machine learning model with the modification result of the failed benchmark environment yaml file until the modification of the benchmark environment yaml file according to the modification steps output by the second machine learning model is successful.
[0211] That is to say, when there is an environment to be built in the container cloud platform, the second machine learning model is retrained and the process goes back to S103.
[0212] Preferably, before saving the first associated information to the local database, it may further include a step of manual review (for example, including manually tagging omissions or errors in the modification), and judge whether the modification steps are correct and complete through manual intervention.
[0213] Furthermore, the business system container environment automatic configuration method provided in the embodiments of this specification further includes:
[0214] S501: After successfully modifying according to the modification steps, obtain the first comparison result;
[0215] Among them, when there is no environment to be built on the container cloud platform, the first comparison result is obtained by comparing the modified benchmark environment yaml file with the unmodified benchmark environment yaml file. When there is an environment to be built on the container cloud platform, the first comparison result is obtained by comparing the modified benchmark environment yaml file with the backed-up environment to be built yaml file.
[0216] S502: Manually check whether there are omissions or errors in the first comparison result;
[0217] S503: If not, save the system information, container cloud platform information, baseline environment information, environment to be built information, baseline environment yaml file, the modified baseline environment yaml file, the first comparison result, and the yaml modification steps as the first associated information of the environment to be built in the local database;
[0218] S504: If so, mark the corresponding missing or incorrect places;
[0219] S505: Determine whether the environment to be built exists in the container cloud platform;
[0220] S505: If the environment to be built does not exist in the container cloud platform, input the difference information of the missing or incorrect parts into the second machine learning model to output the adjusted modification steps; and save the system information, container cloud platform information, baseline environment information, environment to be built information, baseline environment yaml file, the modified baseline environment yaml file, the first comparison result, and the adjusted yaml modification steps as the first associated information of the environment to be built in the local database; restart the process according to S103;
[0221] S506: If the environment to be built exists in the container cloud platform, re-iterate and update the first machine learning model, and restart modifying the baseline environment yaml file according to S103.
[0222] By establishing and continuously updating a knowledge base for business system container environment configuration (including system information, container cloud platform information, baseline environment information, environment to be built information, baseline environment yaml file, environment to be built yaml file, yaml file comparison result, yaml modification steps, etc.), it helps the subsequent reusability of business system container environment construction, provides convenience for business system container environment configuration; and can further boost the intelligence of the machine learning model, effectively ensuring the accuracy and stability of business system container environment construction.
[0223] Preferably, in the embodiments of this specification, before modifying the baseline environment yaml file using the modification steps, the method further includes:
[0224] Conduct manual review of the modification steps; update the first machine learning model according to the manual review results; and update the associated information stored in the local database (including the first associated information of the same environment to be built of this business system) according to the manual review results.
[0225] By manually checking for omissions and making up for deficiencies, it ensures the accuracy and integrity of modifying the baseline environment yaml file.
[0226] Specifically, in the embodiments of this specification, before pulling the project of the environment to be built from GitLab to the local server in step S103, the method further includes:
[0227] Use UI automation to log in to the GitLab platform and determine whether the project directory of the environment to be built exists on GitLab;
[0228] If it does not exist, use UI automation to create the project directory of the environment to be built.
[0229] In the embodiments of this specification, create the project directory of the environment to be built on GitLab and pull it to the local server. After modifying the YAML file at the local server, upload the YAML file to the corresponding project directory on GitLab, and then use it for the deployment of the environment to be built.
[0230] Further, before backing up and pulling the benchmark environment YAML file stored on the container cloud platform to the local server in step S102, the method further includes:
[0231] Verify the legality of the task input parameters;
[0232] After successfully logging in to the container cloud platform using UI automation with the username and password, create an interaction credential, and then use the credential to interact with the container cloud platform. In some possible application scenarios, there are multiple container cloud platforms, and each container cloud platform corresponds to a login address. Then, when entering the username and password, the login address of the container cloud platform to be interacted with needs to be entered at the same time. In other possible application scenarios, there is only one container cloud platform, and the user only needs to enter the username and password.
[0233] It should be noted that in the embodiments of this specification, the username and password (and the login address) used by the user to log in to the container cloud platform are all information that has been authorized and agreed by the user in the past. And in the technical solutions described in the embodiments of this specification, the acquisition, storage, use, processing, etc. of the above username, password, and login address all comply with the relevant regulations of national laws and regulations.
[0234] Except for a small number of steps that need to rely on manual work in the business system container environment automatic configuration method provided by the embodiments of this specification (such as inputting login step information and manual review), other steps can be automated. Therefore, the labor cost is greatly saved.
[0235] Further, for the method provided by the embodiments of this specification, step S109: Automatically update the information stored in the local database regularly, specifically including the following regular iterative update process:
[0236] Analysis: Regularly obtain all the saved data of the benchmark environment and the environment to be built for each business system from the local database and analyze them one by one.
[0237] Backup: Configure the operation and maintenance tool with the benchmark environment information, use the operation and maintenance tool to send a backup command, back up the yaml file of the benchmark environment on the container cloud platform to the backup project on gitlab, and then use git to pull the backed-up benchmark environment yaml from gitlab to the local server. Then configure the operation and maintenance tool with the information of the environment to be built, use the operation and maintenance tool to send a backup command, back up the yaml file of the environment to be built on the container cloud platform to the backup project on gitlab, and then use git to pull the backed-up yaml of the environment to be built from gitlab to the local server.
[0238] Comparison: Compare the backed-up benchmark environment yaml file with the backed-up yaml file of the environment to be built, and compare the comparison result with the comparison result saved in the database.
[0239] Update: Use the first machine learning model to analyze and identify whether there are effective differences in the comparison results. If there are, convert the effective differences into incremental modification steps through the second machine learning model and update them to the database together with the yaml files of the benchmark environment and the environment to be built. If not, update the yaml files of the benchmark environment and the environment to be built to the database. Then analyze the next piece of data until all the data in the database has been analyzed.
[0240] That is, update the yaml file of the benchmark environment, the yaml file of the environment to be built, the comparison result of the yaml files of the benchmark environment and the environment to be built, and the modification steps stored in the local database.
[0241] Through the above operations, the machine learning model is enabled to have self-learning ability. By establishing a classification intelligent algorithm in supervised learning, it can autonomously identify the incremental differences in the yaml file after the daily iteration of the container environment of the business system, autonomously distinguish the effective differences among them, and autonomously convert and supplement the modified content of the yaml file, forming an intelligent "self-learning, self-optimizing, self-iterating" positive construction closed-loop to ensure the availability of the container environment configuration of the business system in real time.
[0242] Based on the above-mentioned method for automatically configuring a business system container environment, the embodiments of this specification also correspondingly provide an apparatus for automatically configuring a business system container environment. The apparatus may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiments of this specification and combines necessary implementation hardware. Based on the same innovative concept, the apparatus in one or more embodiments provided by the embodiments of this specification is as described in the following embodiments. Since the implementation solutions for the apparatus to solve problems are similar to those of the method, the implementation of the specific apparatus in the embodiments of this specification can refer to the implementation of the foregoing method, and repeated parts will not be elaborated. As used hereinafter, the term "unit" or "module" may be a combination of software and / or hardware that can implement a predetermined function. Although the apparatuses described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0243] As Figure 5 shown, an apparatus for automatically configuring a business system container environment provided by the embodiments of this specification includes:
[0244] A creation module 51, configured to create a task for building a business system container environment;
[0245] A backup module 52, configured to back up and pull the benchmark environment yaml file stored on the container cloud platform to the local server through gitlab;
[0246] A replication module 53, configured to pull the project of the environment to be built from gitlab to the local server, so as to copy the benchmark environment yaml file pulled to the local server to the corresponding directory of the project of the environment to be built on the local server;
[0247] A judgment module 54, configured to judge whether there is an environment to be built on the container cloud platform;
[0248] A first modification module 55, configured to, if so, back up and pull the yaml file of the environment to be built stored on the container cloud platform to the local server, and modify the benchmark environment yaml file according to the yaml file of the environment to be built on the local server by using a machine learning model;
[0249] A second modification module 56, configured to, if not, modify the benchmark environment yaml file by using a machine learning model according to the association information between the benchmark environment and the environment to be built stored in the local database;
[0250] An upload module 57, configured to upload the modified benchmark environment yaml file to the project of the environment to be built on gitlab;
[0251] A deployment module 58, configured to configure an operation and maintenance tool for an environment to be built, and use the modified baseline environment yaml file to deploy the environment to be built;
[0252] An update module 59, configured to periodically and automatically update the baseline environment yaml file, the environment yaml file to be built, the comparison result between the baseline environment yaml file and the environment yaml file to be built, and the modification steps stored in the local database.
[0253] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with those obtained by the above method, and will not be elaborated here.
[0254] As Figure 6 shown, a computer device provided in the embodiments of this specification, and a business system container environment automatic configuration device provided in the embodiments of this specification may be the computer device in this embodiment, and execute the above method of this specification. The computer device 602 may include one or more processors 604, such as one or more central processing units (CPUs), and each processing unit may implement one or more hardware threads. The computer device 602 may also include any memory 606, which is used to store any kind of information such as code, settings, data, etc. Non-limiting, for example, the memory 606 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory devices, hard disks, optical discs, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 602. In one case, when the processor 604 executes the associated instructions stored in any memory or combination of memories, the computer device 602 may perform any operation of the associated instructions. The computer device 602 also includes one or more drive mechanisms 608 for interacting with any memory, such as a hard disk drive mechanism, an optical disc drive mechanism, etc.
[0255] The computer device 602 may also include an input / output module 610 (I / O) for receiving various inputs (via the input device 612) and for providing various outputs (via the output device 614). A specific output mechanism may include a presentation device 616 and an associated graphical user interface (GUI) 618. In other embodiments, the input / output module 610 (I / O), the input device 612, and the output device 614 may not be included, and it may only be a computer device in the network. The computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the components described above together.
[0256] The communication link 622 may be implemented in any manner, for example, via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0257] Corresponding to the method as Figures 1 to 4 shown, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is run by a processor, it executes the steps of the above method.
[0258] An embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the method as Figures 1 to 4 shown.
[0259] An embodiment of the present specification also provides a computer program product including at least one instruction or at least one segment of a program, and the at least one instruction or the at least one segment of the program is loaded and executed by a processor to implement the method as Figures 1 to 4 shown.
[0260] It should be understood that in various embodiments of the present specification, the magnitudes of the serial numbers of the above processes do not mean the order of execution is prior or subsequent. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present specification.
[0261] It should also be understood that in the embodiments of the present specification, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present specification generally represents an "or" relationship between the preceding and following associated objects.
[0262] Those of ordinary skill in the art will realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this specification can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this specification.
[0263] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0264] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can also be in electrical, mechanical, or other forms of connection.
[0265] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of this specification.
[0266] In addition, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0267] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, in essence, or the part that contributes to the prior art, or all or part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this specification. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0268] Specific embodiments are used in this specification to elaborate on the principles and implementation manners of this specification. The descriptions of the above embodiments are only used to help understand the method and its core idea of this specification; at the same time, for those of ordinary skill in the art, according to the idea of this specification, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this specification.
Claims
1. An automated configuration method for a business system container environment, characterized in that, Including: Create a task for building the business system container environment; Back up and pull the baseline environment yaml file stored on the container cloud platform to the local server via GitLab; Pull the project of the environment to be built from GitLab to the local server, and copy the baseline environment yaml file pulled to the local server to the corresponding directory of the project of the environment to be built on the local server; Judge whether there is an environment to be built on the container cloud platform; If so, back up and pull the yaml file of the environment to be built stored on the container cloud platform to the local server, and use a machine learning model on the local server to modify the baseline environment yaml file according to the yaml file of the environment to be built; If not, use a machine learning model to modify the baseline environment yaml file according to the association information between the baseline environment and the environment to be built stored in the local database; Upload the modified baseline environment yaml file to the project of the environment to be built on GitLab; Configure the operation and maintenance tool for the environment to be built, and use the modified baseline environment yaml file to deploy the environment to be built; Automatically update the information stored in the local database regularly.
2. The method according to claim 1, wherein Using a machine learning model to modify the baseline environment yaml file according to the yaml file of the environment to be built further includes: Compare the baseline environment yaml file and the yaml file of the environment to be built to obtain difference information; Input the difference information into a pre-trained first machine learning model to obtain the effective difference information output by the first machine learning model; Input the effective difference information into a pre-trained second machine learning model to obtain the modification steps output by the second machine learning model; Modify the baseline environment yaml file according to the modification steps.
3. The method according to claim 2, wherein Using a machine learning model to modify the baseline environment yaml file according to the association information between the baseline environment and the environment to be built stored in the local database further includes: Judge whether there is the first association information of the environment to be built in the local database; If so, obtain the modification steps in the first association information, and modify the baseline environment yaml file according to the modification steps; If not, judge whether there is the second association information of other environments of the business system in the local database; If the second association information exists, generate a modification template for the environment to be built according to the modification steps of the other environment in the second association information, generate modification steps according to the information of the baseline environment, the information of the environment to be built and the modification template, and use the modification steps to modify the baseline environment yaml file.
4. The method according to claim 3, wherein If the second association information does not exist, the method further includes: Input the modification steps in the association information of other business system container environments in the local database into a pre-trained third machine learning model to obtain the general modification items output by the third machine learning model; Search for and match common modification items in the existing benchmark environment and the information of the environment to be built, and obtain the values to be modified and the modified values corresponding to the common modification items; Generate modification steps according to the common modification items, the values to be modified and the modified values by the fourth machine learning model, and use the modification steps to modify the benchmark environment yaml file.
5. The method according to any one of claims 2 to 4, characterized in that After modifying the benchmark environment yaml file, the method further includes: Judge whether the modification of the benchmark environment yaml file using the modification steps is successful; If successful, save the system information, container cloud platform information, benchmark environment information, information of the environment to be built, benchmark environment yaml file, the modified benchmark environment yaml file, the first comparison result, and the yaml modification steps as the first associated information of the environment to be built to the local database; If not successful, input the failure reason and the corresponding modification steps into the pre-trained fifth machine learning model, output the adjusted modification steps, and modify the benchmark environment yaml file according to the adjusted modification steps; Judge whether the modification of the benchmark environment yaml file using the adjusted modification steps is successful; If so, save the system information, container cloud platform information, benchmark environment information, information of the environment to be built, benchmark environment yaml file, the modified benchmark environment yaml file, the first comparison result, and the adjusted yaml modification steps as the first associated information of the environment to be built to the local database.
6. The method according to claim 5, characterized in that When the modification of the benchmark environment yaml file fails according to the adjusted modification steps, the method further includes: Judge whether there is an environment to be built in the container cloud platform; If not, obtain the common modification items through the third machine learning model, and use the common modification items and the modified values corresponding to the environment to be built to output the modification steps by the fourth machine learning model, and modify the benchmark environment yaml file according to the modification steps; If so, update the second machine learning model using the failure modification result of the benchmark environment yaml file until the modification of the benchmark environment yaml file according to the modification steps output by the second machine learning model is successful.
7. The method according to claim 2, characterized in that, The first machine learning model is trained through the following training steps: Collect data, where the data includes the difference information between multiple sets of benchmark environment yaml files and the environment to be built yaml files; Mark the difference information; Randomly divide the data into training data and test data; Input the training data into the initial first machine learning model to obtain a trained model; Then input the test data into the trained first machine learning model to obtain the predicted data and accuracy rate; Iteratively update the first machine learning model until the accuracy rate reaches the preset condition.
8. The method according to claim 2, characterized in that The second machine learning model is trained through the following training steps: Collect training data, where the training data includes the effective difference information between the benchmark environment yaml file and the environment to be built yaml file; Input the training data into the initial second machine learning model to obtain the modification steps; After modifying the baseline environment yaml file using the modification steps, the modified baseline environment yaml file is obtained; Calculate the loss function based on the modified baseline environment yaml file and the environment yaml file to be built; Iteratively update the second machine learning model until the loss function reaches a preset convergence condition.
9. The method according to claim 6 or 8, characterized in that, The modification steps include five dimensions: modification type, search path, location path, old value, and new value; Among them, the modification type includes addition, deletion, replacement, file renaming, file copying, and floating value copying.
10. The method according to claim 1, wherein Before pulling the environment project to be built from gitlab to the local server, the method further includes: Judging whether the environment project to be built exists on gitlab; If not, use UI automation to create the directory of the environment to be built.
11. The method according to claim 1, wherein Before backing up and pulling the baseline environment yaml file stored on the container cloud platform to the local server through gitlab, the method further includes: Use UI automation to log in to the container cloud platform according to the username and password, create an interactive credential, and interact with the container cloud platform based on the credential.
12. An automated configuration device for a business system container environment, characterized in that, The device includes: A creation module for creating a task for building a business system container environment; A backup module for backing up and pulling the baseline environment yaml file stored on the container cloud platform to the local server through gitlab; A copying module for pulling the environment project to be built from gitlab to the local server, and copying the pulled baseline environment yaml file to the corresponding directory of the environment project to be built on the local server; A judgment module for judging whether there is an environment to be built on the container cloud platform; A first modification module for, if so, backing up and pulling the environment yaml file to be built stored on the container cloud platform to the local server, and using a machine learning model on the local server to modify the baseline environment yaml file according to the environment yaml file to be built; A second modification module for, if not, modifying the baseline environment yaml file using a machine learning model according to the association information between the baseline environment and the environment to be built stored in the local database; An upload module for uploading the modified baseline environment yaml file to the environment project to be built on gitlab; A deployment module for configuring the operation and maintenance tool for the environment to be built, and deploying the environment to be built using the modified baseline environment yaml file; An update module for automatically updating the information stored in the local database regularly.
13. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that, Includes at least one instruction or at least one segment of program, and the at least one instruction or the at least one segment of program is loaded and executed by the processor to implement the method according to any one of claims 1 to 11.
Citation Information
Cited By
General configuration method and system for electronic design automation tool and related equipment
CN120850945A