A method, device, equipment and medium for predicting container construction results

By constructing a container build result prediction data set and a neural network model, and analyzing Dockerfile features, the problem of automated container build result prediction is solved and operation and maintenance efficiency is improved.

CN114327753BActive Publication Date: 2024-10-15NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111517874.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-10-15
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

Existing technology cannot achieve automated prediction of container build results, causing developers to manually review build logs and wait for the build to end, affecting operation and maintenance efficiency.

Method used

By constructing a container construction result prediction data set, using abstract syntax trees to parse Dockerfile in stages, extracting syntax and structural feature vectors, using neural network algorithms to train prediction models, and performing parameter tuning, a container construction result prediction tool is constructed.

Benefits of technology

It realizes automated prediction of container construction results, improves operation and maintenance efficiency, and reduces manual intervention and waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327753B_ABST
    Figure CN114327753B_ABST
Patent Text Reader

Abstract

The invention relates to the field of software development, and discloses a method, device, equipment and medium for predicting container construction results. The invention constructs a container construction result prediction data set according to Google Bigquery open source community data and an image hosting community API; uses an abstract syntax tree to parse a container configuration file Dockerfile in stages in the container construction result prediction data set to obtain an AST feature syntax tree; performs depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encodes the configuration code chain to obtain a configuration syntax feature vector; extracts structured information of the Dockerfile to obtain a configuration structure feature vector, concatenates the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and uses a neural network algorithm to train the configuration feature vector to obtain a container construction result prediction model; performs performance evaluation on the container construction result prediction model according to an evaluation index, and uses a random search algorithm to perform parameter tuning on the container construction result prediction model; selects an optimal parameter combination according to the performance evaluation result, and constructs a final container construction result prediction tool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development, and in particular to a method, device, equipment and medium for predicting container construction results. Background Art

[0002] In recent years, Docker containers have become the industry standard as the most popular containerization tool. Docker is an open source project based on technologies such as LXC (Linux containers) and operating system virtualization. It allows applications with dependencies and execution environments to be packaged into a standardized image, providing a resource-independent operating environment for application software and its dependent components. The content of the Docker container is defined by the declaration in the configuration file Dockerfile, which specifies the Docker commands and their execution order. After the configuration is completed, developers can use the "docker build" command to build a custom container image. Docker builds the process of compiling, linking, testing, packaging, and converting source code into executable units, which is the key to turning source code into real software products.

[0003] In current practice, Dockerfile configuration errors, dependency package version errors, and long network communication delays can cause build failures. On the other hand, the container build process involves packaging, testing, pushing, and deployment, which may take a long time. Currently, developers can only manually check the relevant build logs and wait for the build to end before obtaining specific build results (success or failure). The build analysis and repair process is time-consuming and labor-intensive, which seriously affects the operation and maintenance efficiency of Docker containers. Therefore, how to achieve automatic prediction of container build results has become a technical problem that needs to be solved urgently.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a method, device, equipment and medium for predicting container construction results, aiming to solve the technical problem that the existing technology cannot realize automatic prediction of container construction results.

[0006] To achieve the above object, the present invention provides a method for predicting container construction results, the method comprising:

[0007] Construct containers based on Google Bigquery's open source community data and image hosting community API to build result prediction datasets;

[0008] In the container build result prediction dataset, the container configuration file Dockerfile is parsed in stages using an abstract syntax tree to obtain an AST feature syntax tree;

[0009] Performing a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector;

[0010] Extracting structured information of the Dockerfile to obtain a configuration structure feature vector, concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and using a neural network algorithm to train the configuration feature vector to obtain a container construction result prediction model;

[0011] Performing a performance evaluation on the container construction result prediction model according to the evaluation index, and performing parameter tuning on the container construction result prediction model using a random search algorithm;

[0012] The optimal parameter combination is selected according to the performance evaluation results to construct a final container construction result prediction tool.

[0013] Optionally, the step of constructing a container to build a result prediction data set according to the open source community data and the image hosting community API of Google Bigquery includes:

[0014] Filter out projects that use Docker based on Github data from Google BigQuery;

[0015] Based on the project names in the candidate project set, the API of the image hosting community Docker Hub is used to filter out open source projects that have hosted images in Docker Hub to form a container project set.

[0016] For each project in the container project set, the API of Docker Hub is used to extract and collect relevant container build data to obtain a container build result prediction data set.

[0017] Optionally, the step of parsing the container configuration file Dockerfile in stages using the abstract syntax tree in the container build result prediction dataset to obtain an AST feature syntax tree includes:

[0018] In the container build result prediction dataset, the Dockerfile is parsed using the abstract syntax tree AST, all instruction nodes are extracted, and the instruction node information is packaged as a parameter leaf node;

[0019] In the parameter leaf node, the embedded bash script is parsed using the abstract syntax tree AST to extract all parameter nodes;

[0020] An AST feature syntax tree is formed according to the instruction nodes and the parameter nodes.

[0021] Optionally, the step of performing depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector comprises:

[0022] For the AST feature syntax tree, traverse each node in the tree in a depth-first manner, record the configuration code token of each node one by one, and connect all tokens into a linear configuration code chain;

[0023] Numerically encoding the tokens in the configuration code chain to form a configuration syntax feature vector;

[0024] According to the configuration syntax feature vector, a vector dimension threshold is set, and "0" is added after the configuration syntax feature vector with a shorter length, so that the lengths of all configuration syntax feature vectors are kept consistent.

[0025] Optionally, the step of extracting the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and training the configuration feature vector using a neural network algorithm to obtain a container construction result prediction model includes:

[0026] Parse Dockerfile, obtain feature indicators such as the number of configuration code lines, instruction diversity value, whether there is a comment tag, the number of comment lines, whether there is a maintainer information tag, and construct a configuration structure feature vector;

[0027] Concatenating the configuration structure feature vector and the configuration syntax feature vector to form a configuration feature vector as a model input;

[0028] Searching for container build results according to the build ID in the container build result prediction data set, and outputting the corresponding container build results as a model;

[0029] Based on the container construction result prediction data set, a neural network algorithm is used to train the input and the output to obtain a container construction result prediction model.

[0030] Optionally, the step of performing performance evaluation on the container construction result prediction model according to the evaluation index and performing parameter tuning on the container construction result prediction model using a random search algorithm includes:

[0031] A result prediction model is constructed based on the container, and different evaluation indicators are used to evaluate the model performance, including: accuracy, recall, and F1;

[0032] In the container construction result prediction model, a random search algorithm is used to perform parameter tuning.

[0033] Optionally, the step of selecting the optimal parameter combination according to the performance evaluation result and constructing the final container construction result prediction tool includes:

[0034] Calculate the average value S of precision, recall and F1 under each set of parameters, and select the parameter combination with the largest S as the optimal parameter combination;

[0035] Based on the optimal parameter combination, a final container construction result prediction tool is constructed.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also proposes a device for predicting container construction results, the device comprising:

[0037] A data construction module is used to construct a container based on Google Bigquery's open source community data and image hosting community API to build a result prediction dataset;

[0038] A vector acquisition module, used to parse the container configuration file Dockerfile in stages using an abstract syntax tree in the container build result prediction dataset to obtain an AST feature syntax tree;

[0039] A vector mapping module, used for performing a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector;

[0040] A model building module, used to extract the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenate the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and use a neural network algorithm to train the configuration feature vector to obtain a container construction result prediction model;

[0041] A parameter tuning module, used to evaluate the performance of the container construction result prediction model according to the evaluation index, and to perform parameter tuning on the container construction result prediction model using a random search algorithm;

[0042] The tool generation module is used to select the optimal parameter combination according to the performance evaluation result and construct the final container construction result prediction tool.

[0043] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer device, which includes: a memory, a processor, and a prediction program for container construction results stored in the memory and executable on the processor, wherein the prediction program for container construction results is configured to implement the prediction method for container construction results as described above.

[0044] In addition, to achieve the above-mentioned purpose, the present invention further proposes a medium, on which a prediction program for container construction results is stored, and when the prediction program for container construction results is executed by a processor, the steps of the method for predicting container construction results as described above are implemented.

[0045] The present invention constructs a container build result prediction data set according to the open source community data and image hosting community API of Google Bigquery; uses an abstract syntax tree to parse the container configuration file Dockerfile in stages in the container build result prediction data set to obtain an AST feature syntax tree; performs depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encodes the configuration code chain to obtain a configuration syntax feature vector; extracts the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenates the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and uses a neural network algorithm to train the configuration feature vector to obtain a container build result prediction model; performs performance evaluation on the container build result prediction model according to an evaluation index, and uses a random search algorithm to perform parameter tuning on the container build result prediction model; selects the optimal parameter combination according to the performance evaluation result, constructs a final container build result prediction tool, and achieves the technical effect of automatic prediction of container build results. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a structural schematic diagram of a device for predicting container construction results of a hardware operating environment involved in an embodiment of the present invention;

[0047] Figure 2 A schematic flow chart of a first embodiment of a method for predicting container construction results according to the present invention. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0049] Reference Figure 1 , Figure 1 A schematic diagram of a device structure for predicting container construction results of a hardware operating environment involved in an embodiment of the present invention.

[0050] like Figure 1As shown, the prediction device for the container construction result may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0051] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the predicted device of the container construction result, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0052] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a prediction program for container construction results.

[0053] exist Figure 1 In the container construction result prediction device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the container construction result prediction device of the present invention can be set in the container construction result prediction device, and the container construction result prediction device calls the container construction result prediction program stored in the memory 1005 through the processor 1001, and executes the container construction result prediction method provided by the embodiment of the present invention.

[0054] The embodiment of the present invention provides a method for predicting container construction results. Figure 2 , Figure 2 A schematic flow chart of a first embodiment of a method for predicting container construction results according to the present invention.

[0055] In this embodiment, the method for predicting the container construction result includes the following steps:

[0056] Step S10: construct a container to build a result prediction dataset based on the open source community data of Google Bigquery and the image hosting community API.

[0057] Furthermore, the step of constructing a container build result prediction data set based on the open source community data and image hosting community API of Google Bigquery includes: filtering out projects using Docker based on the Github data of Google BigQuery; based on the project names in the candidate project set, using the API of the image hosting community Docker Hub to filter out open source projects that have images hosted in Docker Hub to form a container project set; for each project in the container project set, using the API of Docker Hub to extract and collect relevant container build data to construct a container build result prediction data set.

[0058] In the specific implementation, projects that use Docker are screened out based on Github data from Google BigQuery (determine whether the version library contains Dockerfile files), and basic project information data is collected, including: project ID, project name, creator, etc., and deleted or forked projects are further removed to construct a set of candidate projects; based on the project names in the set of candidate projects, the API of the image hosting community Docker Hub is used to screen out open source projects that have hosted images in Docker Hub (based on the project name, determine whether to create a container project in Docker Hub), and further remove container projects that do not contain any build data to form a container project set; for each project in the container project set, Docker is used The Hub's API extracts and collects relevant container build data, including: container project ID, build result (success or failure), build start time, build end time, build image size, associated Dockerfile content, image label encoding, etc., to construct a container build data set; for each build in the container build data set, remove the Docker builds with empty Dockerfile content to form a parsable container build data set; based on the Dockerfile content in the parsable container build data set, remove duplicate container Dockerfiles and only retain container build data with different Dockerfile content to form the final container build result prediction data set.

[0059] Step S20: using the abstract syntax tree in the container build result prediction data set to parse the container configuration file Dockerfile in stages to obtain an AST feature syntax tree.

[0060] Furthermore, the step of using the abstract syntax tree in stages to parse the container configuration file Dockerfile in the container build result prediction data set to obtain the AST feature syntax tree includes: in the container build result prediction data set, using the abstract syntax tree AST to parse the Dockerfile, extracting all instruction nodes, and packaging the instruction node information as parameter leaf nodes; in the parameter leaf nodes, using the abstract syntax tree AST to parse the embedded bash script to extract all parameter nodes; and forming an AST feature syntax tree based on the instruction nodes and the parameter nodes.

[0061] It should be noted that the root node can be customized as "DOCKERFILE" or "ROOT", and the instruction nodes include: FROM, RUN, COPY, ADD, ENV, CMD, EXPOSE, etc.

[0062] It can be understood that the parameter nodes include: IMAGE-NAME, IMAGE-TAG, PORT, etc.

[0063] Step S30: Perform a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encode the configuration code chain to obtain a configuration syntax feature vector.

[0064] Furthermore, the step of depth-first traversing the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector includes: traversing each node in the AST feature syntax tree in a depth-first manner, recording the configuration code token of each node one by one, and connecting all tokens into a linear configuration code chain; numerically encoding the tokens in the configuration code chain to form a configuration syntax feature vector; and setting a vector dimension threshold according to the configuration syntax feature vector, adding "0" to the end of a shorter configuration syntax feature vector to keep the length of all configuration syntax feature vectors consistent.

[0065] It should be noted that the depth-first traversal starts from the root node, and it can be assumed that the left branch is preferred over the right branch.

[0066] For configuration code tokens, non-ASCII characters and comments need to be removed.

[0067] For instruction node token(I n ,n∈N) and parameter node token(P m ,m∈N), the configuration feature vector can be represented as {DOCKERFILE|ROOT,I1,P1,P2,…,I n ,Pm}.

[0068] For the vector dimension threshold, you can choose 100, 200, 500, 1000, or specify it according to the longest configuration syntax feature vector dimension.

[0069] Step S40: extracting the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and using a neural network algorithm to train the configuration feature vector to obtain a container construction result prediction model.

[0070] Furthermore, the steps of extracting the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and using a neural network algorithm to train the configuration feature vector to obtain a container build result prediction model include: parsing the Dockerfile, obtaining feature indicators such as the number of configuration code lines, instruction diversity value, whether there are comment tags, number of comment lines, whether there are maintainer information tags, etc., to construct a configuration structure feature vector; concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector as a model input; searching for a container build result according to a build ID in the container build result prediction data set, and using the corresponding container build result as a model output; based on the container build result prediction data set, using a neural network algorithm to train the input and the output to obtain a container build result prediction model.

[0071] It should be noted that, in the process of parsing Dockerfile, the number of lines of configuration code is counted with a specific Docker instruction or the comment symbol "#" as the starting mark; the instruction diversity value can first extract different instruction tags and remove duplicates, construct an instruction tag sequence, and then use Shannon Entropy to calculate the entropy value of the instruction tag sequence. The larger the entropy value, the greater the diversity value; whether there is a comment tag can be judged by checking whether there is a comment symbol "#" in the configuration (if there is a comment symbol "#", if not, it is "0"), and the number of comment lines can be obtained by counting the number of comment code lines; whether there is a maintainer information tag can be judged by checking whether there is "Maintainer" information (maintainer name, email address, etc.) in the configuration (if there is a comment symbol "#", if not, it is "0").

[0072] The configuration feature vector V can be composed of a configuration syntax feature vector V syntax and the configuration structure feature vector V structure Weighted series formation, the calculation formula is as follows:

[0073] V=x*V syntax +y*Vstructure

[0074] Among them, x and y are the configuration grammar feature vectors V syntax and the configuration structure feature vector V structure The weight of is in the range of [0,1].

[0075] During the model training process, you can use the Keras framework or the scikit-learn library to assist in implementing neural network algorithms, including convolutional neural networks (CNNs), recurrent neural networks (RNNs), etc.

[0076] Step S50: Evaluate the performance of the container construction result prediction model according to the evaluation index, and use a random search algorithm to optimize the parameters of the container construction result prediction model.

[0077] Furthermore, the step of evaluating the performance of the container construction result prediction model according to the evaluation indicators and using a random search algorithm to tune the parameters of the container construction result prediction model includes: based on the container construction result prediction model, using different evaluation indicators to evaluate model performance, including: accuracy, recall rate, F1; in the container construction result prediction model, using a random search algorithm to tune parameters.

[0078] It should be noted that different evaluation indicators are used to evaluate model performance, including accuracy, recall, and F1, to analyze the prediction performance of the model. Among these indicators, the calculation method of accuracy is as follows:

[0079]

[0080] TP is the true positive rate, that is, the probability that a positive example is also a true positive example; FP is the false positive rate, that is, the probability that a positive example is not a true positive example.

[0081] The calculation method of recall is as follows:

[0082]

[0083] Where FN is the false negative rate, that is, the probability that a negative example is not a true negative example;

[0084] F1 represents the trade-off between precision and recall, and can be interpreted as the weighted average of precision and recall. The calculation method is as follows:

[0085]

[0086] Step S60: selecting the optimal parameter combination according to the performance evaluation result, and constructing a final container construction result prediction tool.

[0087] Furthermore, the step of selecting the optimal parameter combination according to the performance evaluation result and constructing the final container construction result prediction tool includes: calculating the average value S of the accuracy, recall rate and F1 under each set of parameters, selecting the parameter combination with the largest S as the optimal parameter combination; and constructing the final container construction result prediction tool based on the optimal parameter combination.

[0088] It should be noted that, in specific implementation, the container construction result prediction data set can be divided into a training set and a test set according to the ratio of 8:2, 7:3, and 6:4, and the 10-fold cross-validation method can also be used to verify the container construction result prediction model.

[0089] This embodiment constructs a container build result prediction data set based on Google Bigquery's open source community data and image hosting community API; uses an abstract syntax tree to parse the container configuration file Dockerfile in stages in the container build result prediction data set to obtain an AST feature syntax tree; performs a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encodes the configuration code chain to obtain a configuration syntax feature vector; extracts the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenates the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and uses a neural network algorithm to train the configuration feature vector to obtain a container build result prediction model; performs a performance evaluation on the container build result prediction model according to an evaluation indicator, and uses a random search algorithm to perform parameter tuning on the container build result prediction model; selects the optimal parameter combination according to the performance evaluation result, and constructs a final container build result prediction tool, thereby achieving the technical effect of automatic prediction of container build results.

[0090] In addition, an embodiment of the present invention further provides a medium on which a prediction program for container construction results is stored. When the prediction program for container construction results is executed by a processor, the steps of the method for predicting container construction results as described above are implemented.

[0091] The embodiments or specific implementations of the device for predicting container construction results of the present invention can refer to the above-mentioned method embodiments, which will not be described in detail here.

[0092] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0093] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0095] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for predicting container construction results, characterized in that: The method comprises: Construct containers based on Google Bigquery's open source community data and image hosting community API to build result prediction datasets; In the container build result prediction dataset, the container configuration file Dockerfile is parsed in stages using an abstract syntax tree to obtain an AST feature syntax tree; Performing a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector; Extract the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenate the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and use a neural network algorithm to train the configuration feature vector to obtain a container build result prediction model; the specific steps of parsing the Dockerfile are: obtain the number of configuration code lines, instruction diversity value, whether there is a comment tag, the number of comment lines, and whether there is a maintainer information tag feature indicator, and construct a configuration structure feature vector; concatenate the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector as a model input; search for a container build result according to the build ID in the container build result prediction data set, and use the corresponding container build result as a model output; based on the container build result prediction data set, use a neural network algorithm to train the input and the output to obtain a container build result prediction model; Performing a performance evaluation on the container construction result prediction model according to the evaluation index, and performing parameter tuning on the container construction result prediction model using a random search algorithm; The optimal parameter combination is selected according to the performance evaluation results to construct a final container construction result prediction tool.

2. The method according to claim 1, characterized in that The step of constructing a container and building a result prediction data set according to the open source community data of Google Bigquery and the image hosting community API includes: Filter out projects that use Docker based on Github data from Google BigQuery; Based on the project names in the candidate project set, the API of the image hosting community Docker Hub is used to filter out open source projects that have images hosted in DockerHub to form a container project set. For each project in the container project set, the API of Docker Hub is used to extract and collect relevant container build data to obtain a container build result prediction data set.

3. The method according to claim 1, characterized in that The step of using the abstract syntax tree to parse the container configuration file Dockerfile in stages in the container build result prediction data set to obtain the AST feature syntax tree includes: In the container build result prediction dataset, the Dockerfile is parsed using the abstract syntax tree AST, all instruction nodes are extracted, and the instruction node information is packaged as a parameter leaf node; In the parameter leaf node, the embedded bash script is parsed using the abstract syntax tree AST to extract all parameter nodes; An AST feature syntax tree is formed according to the instruction nodes and the parameter nodes.

4. The method according to claim 1, characterized in that The step of performing depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector comprises: For the AST feature syntax tree, traverse each node in the tree in a depth-first manner, record the configuration code token of each node one by one, and connect all tokens into a linear configuration code chain; Numerically encoding the tokens in the configuration code chain to form a configuration syntax feature vector; According to the configuration syntax feature vector, a vector dimension threshold is set, and "0" is added after the configuration syntax feature vector with a shorter length, so that the lengths of all configuration syntax feature vectors are kept consistent.

5. The method according to claim 1, characterized in that The step of evaluating the performance of the container construction result prediction model according to the evaluation index and optimizing the parameters of the container construction result prediction model using a random search algorithm includes: A result prediction model is constructed based on the container, and different evaluation indicators are used to evaluate the model performance, including: accuracy, recall, and F1; In the container construction result prediction model, a random search algorithm is used to perform parameter tuning.

6. The method according to claim 5, characterized in that The step of selecting the optimal parameter combination according to the performance evaluation result and constructing the final container construction result prediction tool includes: Calculate the average value S of precision, recall and F1 under each set of parameters, and select the parameter combination with the largest S as the optimal parameter combination; Based on the optimal parameter combination, a final container construction result prediction tool is constructed.

7. A device for predicting container construction results, characterized in that: The device comprises: A data construction module is used to construct a container based on Google Bigquery's open source community data and image hosting community API to build a result prediction dataset; A vector acquisition module, used to parse the container configuration file Dockerfile in stages using an abstract syntax tree in the container build result prediction dataset to obtain an AST feature syntax tree; A vector mapping module, used for performing a depth-first traversal on the AST feature syntax tree to obtain a linear configuration code chain, and numerically encoding the configuration code chain to obtain a configuration syntax feature vector; The model building module is used to extract the structured information of the Dockerfile to obtain a configuration structure feature vector, concatenate the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector, and use a neural network algorithm to train the configuration feature vector to obtain a container build result prediction model; the specific steps of parsing the Dockerfile are: obtaining the number of configuration code lines, instruction diversity value, whether there is a comment tag, the number of comment lines, and whether there is a maintainer information tag feature indicator, and constructing a configuration structure feature vector; concatenating the configuration structure feature vector with the configuration syntax feature vector to form a configuration feature vector as a model input; searching for a container build result according to the build ID in the container build result prediction data set, and using the corresponding container build result as a model output; based on the container build result prediction data set, using a neural network algorithm to train the input and the output to obtain a container build result prediction model; A parameter tuning module, used to evaluate the performance of the container construction result prediction model according to the evaluation index, and to perform parameter tuning on the container construction result prediction model using a random search algorithm; The tool generation module is used to select the optimal parameter combination according to the performance evaluation result and construct the final container construction result prediction tool.

8. A device for predicting container construction results, characterized in that: The device comprises: a memory, a processor, and a prediction program for container construction results stored in the memory and executable on the processor, wherein the prediction program for container construction results is configured to implement the steps of the method for predicting container construction results according to any one of claims 1 to 6.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a prediction program for container construction results, and when the prediction program for container construction results is executed by a processor, the steps of the method for predicting container construction results according to any one of claims 1 to 6 are implemented.