Method for generating self-adaptive programs based on artificial intelligence, intelligent agent, and electronic device

By determining diversity information and adjusting temperature parameters, the method addresses the imbalance between exploration and exploitation in program generation, resulting in efficient and diverse program outcomes.

JP2026053488APending Publication Date: 2026-03-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-03-25

AI Technical Summary

Technical Problem

Existing methods for generating programs lack the ability to dynamically adjust selective pressure based on population diversity, leading to imbalances between exploration and exploitation, which affects the efficiency and diversity of program generation.

Method used

A method that determines diversity information of a target population and adjusts temperature parameters accordingly to select parent programs, performing evolutionary iterations to generate self-adaptive programs, enhancing the balance between exploration and utilization.

Benefits of technology

The method enables the efficient generation of diverse and high-performance programs by dynamically adjusting temperature parameters based on population diversity, improving the matching between temperature parameters and program diversity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026053488000001_ABST
    Figure 2026053488000001_ABST
Patent Text Reader

Abstract

This invention provides a method for generating self-adaptive programs based on artificial intelligence, an intelligent agent, and an electronic device. [Solution] The method involves determining diversity information to indicate the programmatic diversity of the target population, determining temperature parameters to adjust the selection pressure based on the diversity information, selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, and performing evolutionary iterations based on the first parent program and the second parent program to obtain the target program.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the computer technology field, and more particularly to the field of artificial intelligence, including deep learning, large-scale models, intelligent agents, coding agents, and programming assistance. Specifically, it relates to a method for generating self-adaptive programs based on artificial intelligence, an intelligent agent, an electronic device, and a storage medium. [Background technology]

[0002] Evolutionary algorithms are a series of optimization algorithms inspired by biological evolutionary theory. They search for optimal or approximate optimal solutions in a solution space by simulating mechanisms such as natural selection, heredity, and mutation. Evolutionary algorithms are already widely applied in fields such as engineering design, bioinformatics, and artificial intelligence. For example, in the field of artificial intelligence, they can be applied to program generation and the optimization of scientific computation models. [Overview of the project] [Problems that the invention aims to solve]

[0003] This application provides a method for generating self-adaptive programs based on artificial intelligence, an intelligent agent, an electronic device, and a storage medium. The specific technical proposal is as follows: [Means for solving the problem]

[0004] According to one aspect of the present invention, a method for generating a self-adaptive program based on artificial intelligence is provided. A step of determining diversity information of a target population, wherein the diversity information is for indicating the programmatic diversity of the target population, A step of determining a temperature parameter based on the diversity information, wherein the temperature parameter is for adjusting the selective pressure. The steps include selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, The process includes the step of performing evolutionary iterations based on the first parent program and the second parent program to obtain a target program.

[0005] According to another aspect of the present application, an intelligent agent is provided, A first decision module for determining diversity information of a target population, wherein the diversity information is for indicating the programmatic diversity of the target population. A second decision module for determining temperature parameters based on the diversity information, wherein the temperature parameters are for adjusting the selective pressure. A selection module for selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, Includes a generator module for obtaining a target program by performing evolutionary iterations based on the first parent program and the second parent program.

[0006] According to another aspect of the present application, an electronic device is provided, At least one processor, Includes a memory that is communicably connected to at least one of the processors, The memory stores instructions that can be executed by the at least one processor, and the execution of these instructions by the at least one processor enables the at least one processor to perform the method described in the above embodiment.

[0007] According to another aspect of the present application, a non-temporary computer-readable storage medium is provided which stores computer instructions, wherein the computer instructions cause the computer to perform the method described in the above embodiment.

[0008] According to another aspect of the present application, the steps of the method described in the above embodiment are realized when a computer program is provided and the computer program is executed by a processor.

[0009] The artificial intelligence-based self-adaptive program generation method, intelligent agent, electronic device, and storage medium according to the embodiment of the present invention determine diversity information of a target population, determine temperature parameters based on the diversity information, select a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, and perform evolutionary iterations on the target population based on the first parent program and the second parent program to obtain a target program. As a result, the temperature parameters can be dynamically adjusted based on the diversity information of the population during the evolutionary iteration process, improving the degree of matching between the temperature parameters and the program diversity of the population, thereby enabling the self-adaptive selection of parent programs based on the temperature parameters, enhancing the ability to balance exploration and utilization in the evolutionary process, and ultimately enabling the efficient generation of diverse and high-performance programs.

[0010] Furthermore, the information described in this section is not intended to identify the essential or important features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will be more easily understood from the following specification. [Brief explanation of the drawing]

[0011] The drawings are provided to better understand this solution and do not limit the scope of this application. [Figure 1] This is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by one embodiment of the present invention. [Figure 2] This is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present invention. [Figure 3]It is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present application. [Figure 4] It is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present application. [Figure 5] It is a schematic configuration diagram of an intelligent agent provided by an embodiment of the present application. [Figure 6] It is a block diagram of an electronic device for realizing an artificial intelligence-based self-adaptive program generation method according to an embodiment of the present application.

Mode for Carrying Out the Invention

[0012] Hereinafter, exemplary embodiments of the present application will be described in combination with the drawings. For the sake of easy understanding, various details of the embodiments of the present application are included, but they should be considered merely as examples. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the described embodiments without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and brevity, the following description omits the description of well-known functions and structures.

[0013] In addition, the acquisition, storage, use, processing, etc. of data in the technical solution of the present application all comply with the relevant regulations of national laws and regulations and do not violate public order and good customs.

[0014] Hereinafter, an artificial intelligence-based self-adaptive program generation method, an intelligent agent, an electronic device, and a storage medium according to an embodiment of the present application will be described with reference to the drawings.

[0015] FIG. 1 is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by an embodiment of the present application.

[0016] The artificial intelligence-based self-adaptive program generation method according to the embodiment of the present application can be executed by the intelligent agent according to the embodiment of the present application, and the intelligent agent can be set in an electronic device.

[0017] Here, the electronic device may be any device with computing capabilities, such as a personal computer, mobile terminal, or server, and the mobile terminal may be a hardware device with various operating systems, touchscreens, and / or displays, such as an in-car device, mobile phone, tablet, personal digital assistant, or wearable device.

[0018] As shown in Figure 1, the method for generating a self-adaptive program based on artificial intelligence includes the following steps.

[0019] Step 101: Determine the diversity information of the target population.

[0020] In this invention, for a target problem in a target field, several programs distributed randomly or using a large-scale model are generated, each distributed to at least one initial population. By performing individual evolutionary iterations for each initial population, a program that solves the target problem can be selected from the population at the end of evolution.

[0021] For example, the target fields may be, but are not limited to, the fields of automation algorithm discovery, scientific computational model optimization, autonomous driving strategy optimization, or generative AI (artificial intelligence), or other fields.

[0022] Here, the target problem may be a problem that can be solved by program within the target domain.

[0023] For example, if the target field is automated algorithm discovery, a researcher might want to automatically discover new and efficient algorithms for a specific problem (e.g., community discovery on large graph data).

[0024] This invention makes it possible to determine the diversity information of the current target population in any evolutionary repetition process.

[0025] For illustrative purposes, the target population may be any one population corresponding to the target problem, the target population may contain at least one program, and the diversity information may indicate the program diversity of the target population. Also, for ease of distinction, the program belonging to the target population may be called the first candidate program.

[0026] For example, diversity information can include diversity indices, diversity levels, etc. Here, the diversity indices may be numerical values, and the diversity indices of a target population can be used to indicate the level of program diversity in the target population. For example, a higher diversity indice indicates higher program diversity in the target population, and the diversity level of a target population can also be used to indicate the level of program diversity in the target population. For example, a higher diversity level indicates higher program diversity in the target population.

[0027] For example, the diversity information of programs in a target cluster can be determined based on the similarity between first-choice programs in the target population.

[0028] For example, if there are multiple target populations, the diversity information for each target population can be determined individually.

[0029] The target population may be one or more, and is not limited to this in this application.

[0030] Step 102: Determine the temperature parameters based on the diversity information.

[0031] Here, the temperature parameter can be used to adjust the selective pressure. For example, a larger temperature parameter leans more towards exploration, while a smaller temperature parameter leans more towards exploitation.

[0032] In this invention, temperature parameters can be determined based on diversity information, in combination with the current number of evolutionary iterations.

[0033] For example, the current number of evolutionary iterations can be used to introduce an annealing mechanism, and based on diversity information, the annealing mechanism can be combined to determine the current temperature parameter.

[0034] For example, as the number of evolutionary iterations increases, the temperature parameter decreases, and utilization becomes more prevalent in the later stages of evolutionary iterations. If the target population has high programmatic diversity, the temperature parameter can be reduced based on diversity information to promote utilization. If programmatic diversity is low, the temperature parameter can be increased based on diversity information to enhance randomness and encourage exploration.

[0035] Step 103: Based on temperature parameters, a first parent program and a second parent program corresponding to the first parent program are selected from the target population.

[0036] In this invention, the selection probability of a first candidate program in a target population is determined based on temperature parameters, a first parent program is selected from the first candidate programs based on this selection probability, and a second parent program is selected from the first candidate programs for the first parent program.

[0037] For example, the selection probability of a first candidate program can be determined based on its fitness and temperature parameters. Here, the fitness of the first candidate program can be calculated using a target function defined for the target problem.

[0038] For example, if the target area is autonomous driving strategy optimization, and the goal is to generate a logic program to control vehicle obstacle avoidance and route planning, the target functions could be safety, smoothness, traffic efficiency, etc., in an autonomous driving simulation environment.

[0039] Step 104: Evolutionary iterations are performed based on the first parent program and the second parent program to obtain the target program.

[0040] In this invention, crossover mutation operations are performed on the first and second parent programs to generate child programs, and the first candidate program with low fitness in the target population can be replaced with the child program to obtain a new population. If the evolutionary iteration termination condition is not met, the new population is used as the target population, and the next evolutionary iteration is performed until the evolutionary iteration termination condition is met, to obtain the final population, and the target program can be selected from the final population.

[0041] For example, if there is one child program, the least fit first candidate program in the target population can be replaced with the child program. If there are multiple child programs, the same number of least fit first candidate programs in the target population as there are child programs can be replaced with multiple child programs. It can be seen that the number of programs in the new population can be the same as the number of programs in the target program.

[0042] For example, the evolutionary iteration termination condition may be, but is not limited to, reaching a predetermined number of iterations, finding a solution that satisfies performance requirements, or any other condition.

[0043] For example, if there are five target populations, and evolutionary iterations are performed for each target population, and the condition for evolutionary iteration termination is met, then five populations will ultimately be obtained. From these five final populations, the program with the highest fitness can be selected as the target program, or the program with the highest fitness can be selected from each population, and these five programs can be selected as the target programs.

[0044] The above method for selecting a target program is merely illustrative and can be chosen according to actual needs; it is not limited to this application.

[0045] As an example of application, the self-adaptive program generation method based on artificial intelligence according to the embodiment of this application is applicable to AI-driven research-type intelligent agents such as automated algorithm discovery and scientific computational model optimization, as well as to automated software development such as code generation, code optimization, and automatic program repair, and is applicable to generative AI fields such as AI-generated art and complex system design, or to other situations where innovative solutions need to be sought through evolutionary iteration.

[0046] In the embodiment of the present invention, diversity information of the target population is determined, temperature parameters are determined based on the diversity information, a first parent program and a second parent program corresponding to the first parent program are selected from the target population based on the temperature parameters, and evolutionary iterations are performed on the target population based on the first parent program and the second parent program to obtain a target program. As a result, the temperature parameters can be dynamically adjusted based on the diversity information of the population during the evolutionary iteration process, improving the degree of matching between the temperature parameters and the program diversity of the population, thereby enabling the self-adaptive selection of parent programs based on the temperature parameters, enhancing the ability to balance exploration and utilization in the evolutionary process, and ultimately enabling the efficient generation of diverse and high-performance programs.

[0047] Figure 2 is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present invention.

[0048] As shown in Figure 2, the method for generating a self-adaptive program based on artificial intelligence includes the following steps.

[0049] Step 201: Feature extraction is performed on the first candidate program in the target population to obtain the first embedding vector.

[0050] Here, the first embedding vector can represent the syntactic and semantic structure of the first candidate program.

[0051] In this invention, for any one first candidate program in a target population, a large-scale model can be used to extract key features of the first candidate program code itself and generate a first embedding vector that represents its syntactic and semantic structure.

[0052] Step 202: Perform a format conversion process on the first candidate program and obtain the conversion result.

[0053] Exemplary examples of format conversion processes may include, but are not limited to, pseudocode conversion and structured format conversion. Here, pseudocode conversion is used to convert program code into pseudocode, and structured format conversion is used to convert a program into a structured representation.

[0054] To further improve the accuracy of the program representation, in some embodiments, the first candidate program may be analyzed to obtain code feature information of the first candidate program, the first candidate program conversion may be converted into pseudocode describing the functional intent of the first candidate program based on the code feature information, and the conversion result may be obtained based on the pseudocode.

[0055] Exemplary examples of code feature information may include, but are not limited to, the functional intent, goals, structure, and control flow of the code of the first candidate program.

[0056] For example, based on code feature information, a large-scale model can be used to generate pseudocode for the first candidate program.

[0057] For example, the conversion result may include pseudocode for the first candidate program, or it may include conversion results in other forms, but is not limited to these.

[0058] This allows for the capture of program characteristics at an abstract logic level by analyzing the first candidate program, converting it into pseudocode based on the code feature information obtained from the analysis, and performing feature extraction on the conversion result including the pseudocode.

[0059] In some embodiments, the first candidate program can be analyzed to obtain a structured representation of the first candidate program, and the conversion result can be obtained based on the structured representation.

[0060] Exemplary examples of structured representations include, but are not limited to, abstract syntax trees and control flowcharts.

[0061] For example, the conversion result may include, but is not limited to, a structured representation of the first candidate program, or other forms of conversion results.

[0062] This makes it easier to capture program characteristics at a structural level by analyzing the first candidate program into a structured representation.

[0063] Selectively, the format conversion process can be performed on the first candidate program using one of the two format conversion methods.

[0064] Selectively, these two format conversion methods can be used to perform format conversion on the first candidate program, in which case the conversion result may include pseudocode, structured representation, etc., of the first candidate program.

[0065] Step 203: Feature extraction is performed on the transformation result to obtain the second embedding vector.

[0066] In this invention, based on the type of the conversion result, a second embedding vector can be obtained by performing feature extraction on the conversion result using a corresponding feature extraction method.

[0067] In some embodiments, if the conversion result includes pseudocode for the first candidate program, feature extraction can be performed on the pseudocode to obtain a second embedding vector. Here, the second embedding vector can represent the program characteristics of the first candidate program at the abstract logic level.

[0068] In some embodiments, if the conversion result includes a structured representation of the first candidate program, a GNN (Graph Neural Network) can be used to extract features from the structured representation and obtain a second embedding vector. Here, the second embedding vector can represent the program characteristics of the first candidate program at the structural level.

[0069] In some embodiments, if the conversion result includes pseudocode and structured representation of the first candidate program, feature extraction can be performed on the pseudocode and structured representation respectively, and the extracted feature vectors can be merged to obtain a second embedding vector.

[0070] Step 204: The first embedding vector and the second embedding vector are merged to obtain a merged representation vector.

[0071] In this application, the first embedding vector and the second embedding vector can be merged by splicing or weighted averaging to obtain a merged representation vector of the first candidate program.

[0072] For example, if the second embedding vector is obtained by performing feature extraction on the pseudocode of the first candidate program, then by fusing the first and second embedding vectors, a fused representation vector that can reflect both the program code level and the functional intent level can be obtained.

[0073] Step 205: Obtain diversity information based on the fused representation vector.

[0074] In this invention, the cosine distance between pairs of first candidate programs is determined based on the fused representation vectors of the pairs of first candidate programs in the target population. The average cosine distance between the first candidate programs in the target population is determined based on the average value of the cosine distances of all pairs of first candidate programs in the target population. Based on this average cosine distance, diversity information of the target population can be obtained. By calculating the average cosine distance between the first candidate programs based on the fused representation vectors of the first candidate programs, the accuracy of the calculation can be improved, and consequently, the accuracy of the diversity information can be improved.

[0075] Here, a larger average cosine distance suggests a higher degree of program diversity in the target population.

[0076] For example, the mean cosine distance can be used as a diversity index, and diversity information can be obtained based on this diversity index. Here, the diversity index may be a numerical value, and the diversity index can represent the level of program diversity in the target population.

[0077] To further enhance the robustness of the metric, for example, auxiliary features of the target population can be obtained, and the mean cosine distance and auxiliary features can be fused to obtain a diversity index. Here, the diversity index may be a composite function of the distribution situation reflected by the core metric and auxiliary metrics, and a multidimensional, highly fidelity diversity index can be obtained, for example, by weighted combinations.

[0078] Exemplary examples of auxiliary features may include, but are not limited to, the code length of the first candidate program, the fitness of the first candidate program, and the average edit distance between the first candidate programs.

[0079] For example, the edit distance between pairs of first candidate programs in the target population can be calculated, and the average edit distance between first candidate programs in the target population can be determined based on the average of the edit distances between all pairs of first candidate programs in the target population.

[0080] Here, the edit distance between the two first candidate programs can be used to measure the differences between the two first candidate program codes.

[0081] This allows for a multidimensional representation of the program based on the average cosine distance, combined with the code length of the introduced program, the fitness of the program, and the average edit distance of the population, thereby improving the accuracy and robustness of the diversity metric.

[0082] Step 206: Determine the temperature parameters based on the diversity information.

[0083] Step 207: Based on temperature parameters, a first parent program and a second parent program corresponding to the first parent program are selected from the target population.

[0084] In this application, steps 206 to 207 can be described by referring to any implementation of each embodiment of this application; therefore, their explanation is omitted here.

[0085] Step 208: Evolutionary iterations are performed based on the first parent program and the second parent program to obtain the target program.

[0086] In some embodiments, a large-scale model is used to perform crossover mutation operations on the first and second parent programs to generate child programs, and then evolutionary iterations are performed based on the child programs to obtain the target program. Here, the process of performing evolutionary iterations based on child programs can be found in the embodiments described above and will not be explained here.

[0087] For example, a prompt template containing program generation task information can be obtained, the prompt template can be populated based on the first and second parent programs to obtain prompt information, and a child program can be generated by performing a crossover mutation operation using a large-scale model based on the prompt information.

[0088] Here, the program generation task information is used to instruct the large-scale model to perform the program generation task.

[0089] For example, program generation task information may include, but is not limited to, program generation tasks and program generation requirements.

[0090] For example, a prompt template may include program output requirements, program generation examples, etc., and the program output requirements may include output format requirements, requirements for the number of programs to be output, etc.

[0091] For example, prompt information could be something like, "Analyze the strengths and weaknesses of these two programs and combine them to create a new, better-performing program."

[0092] This allows us to control the direction of mutation by using a large-scale model to perform crossover mutation operations on selected parent programs to generate new child programs, thereby improving the quality of child programs and increasing the efficiency of evolutionary iterations.

[0093] In the embodiment of the present invention, feature extraction is performed on a first candidate program in the target population to obtain embedding vectors representing the syntactic and semantic structure of the program, a format conversion process is performed on the first candidate program, feature extraction is performed on the converted result to obtain embedding vectors corresponding to other program formats, and these two embedding vectors are fused to obtain a multidimensional fused representation vector, thereby further improving the accuracy of the program representation.

[0094] Figure 3 is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present invention.

[0095] As shown in Figure 3, the method for generating a self-adaptive program based on artificial intelligence includes the following steps.

[0096] Step 301: Determine the diversity information of the target population.

[0097] In this application, step 301 can be described by referring to any implementation of each embodiment of this application; therefore, a description is omitted here.

[0098] Step 302: Perform a modulo operation on the first number based on the current number of evolutionary iterations to obtain the second number.

[0099] Here, the difference between the first value and the total number of evolutionary iterations may be greater than a predetermined threshold, and the first value may be a hyperparameter that is much larger than the total number of evolutionary iterations.

[0100] Step 303: Determine the temperature parameter based on the ratio of the second value to the first value and the diversity index.

[0101] In related technologies, temperature parameters are usually determined based solely on the number of evolutionary iterations. However, if population diversity is relatively low, it may not be possible to strengthen exploration capabilities in a timely manner. Conversely, if diversity is high, it may not be possible to fully utilize the currently high-fitness individuals, resulting in a relatively poor ability to balance exploration and utilization.

[0102] Based on this, in this application, the diversity information of the target population may include a diversity index of the target population, and the temperature parameter can be determined by combining this diversity index with the ratio of a second value to a first value.

[0103] In some embodiments, a first difference value between the target value and the diversity index can be determined, a fourth value can be determined with the base as the third value and the exponent as the first difference value, a second difference value between the target value and the ratio can be determined, and the temperature parameter can be determined based on the product of the second difference value and the fourth value.

[0104] For example, the target number may be equal to 1, or it may be any other number; however, it is not limited to this.

[0105] For example, the first difference value can be obtained by subtracting the diversity index from the target value.

[0106] For example, the third value may be a number greater than 1.

[0107] For example, the product of the second difference value and the fourth value can be used as the temperature parameter.

[0108] To further improve the accuracy of the temperature parameter, an initial temperature value can be set to control selection randomness, and the product of this initial temperature value, the second difference value, and the fourth numerical value can be used as the temperature parameter.

[0109] As an example, taking the target value as 1 and the base third value as e, the temperature parameter of the target population can be calculated using the following equation (1).

number

[0110] In equation (1) above

number

[0111] This allows the temperature parameter to decay as the number of evolutionary iterations increases, while simultaneously dynamically adjusting it through an exponential function based on a diversity index. This enables lowering the temperature parameter when diversity is high to promote utilization, and raising it when diversity is low to encourage exploration, thereby achieving a dynamic balance between exploration and utilization in the evolutionary process.

[0112] Step 304: Based on temperature parameters, a first parent program and a second parent program corresponding to the first parent program are selected from the target population.

[0113] Step 305: Evolutionary iterations are performed based on the first and second parent programs to obtain the target program.

[0114] In this application, steps 304 to 305 can be explained by referring to any implementation of each embodiment of this application.

[0115] In the embodiment of the present invention, a modulo operation is performed on a first value based on the current number of evolutionary iterations. The temperature parameter is determined based on the ratio of the second value obtained by the modulo operation to the first value, which is much larger than the total number of evolutionary iterations, and the diversity index of the target population. By determining the temperature parameter in combination with this ratio and the diversity index of the target population, the temperature parameter is attenuated as the number of evolutionary iterations increases, not only shifting later selection towards utilization, but also improving the adaptability of the temperature parameter by adjusting it through the diversity index of the target population, thereby enhancing the ability to balance exploration and utilization in the evolutionary process.

[0116] Figure 4 is a schematic flowchart of an artificial intelligence-based self-adaptive program generation method provided by another embodiment of the present invention.

[0117] As shown in Figure 4, the method for generating a self-adaptive program based on artificial intelligence includes the following steps.

[0118] Step 401: Determine the diversity information of the target population.

[0119] Step 402: Determine the temperature parameters based on the diversity information.

[0120] In this application, steps 401 to 402 can be described by referring to any implementation of each embodiment of this application; therefore, their explanation is omitted here.

[0121] Step 403: Based on the temperature parameters, determine the target cluster from at least one cluster of the target population.

[0122] In this application, the target population may include at least one cluster, and each cluster may include at least one program. Furthermore, for ease of distinction, a program belonging to a cluster may be referred to as a second candidate program.

[0123] In some embodiments, a representation score can be determined for at least one cluster out of at least one cluster, and a target cluster can be selected from at least one cluster of the target cluster based on the representation score of at least one cluster.

[0124] Here, the representation score of any one cluster can be used to measure the relationship between the program quality of any one cluster and the cluster size.

[0125] For example, the expression score of one cluster can be determined based on the fitness of the second candidate program in any one cluster and the number of second candidate programs in any one cluster; the selection probability of one cluster can be determined based on the temperature parameter and the expression score; and a target cluster can be selected from at least one cluster in the target population based on the selection probability of at least one cluster in the target population.

[0126] For example, the average fitness of second candidate programs in any one cluster can be calculated based on the fitness of the second candidate programs in that cluster, and the ratio of the average fitness to the number of second candidate programs in that cluster can be determined as the representation score.

[0127] For example, the maximum fitness among the second-choice programs can be determined, and the representation score can be determined based on the ratio of the maximum fitness to the number of second-choice programs. For instance, the ratio of the maximum fitness to the number of second-choice programs can be determined as the representation score.

[0128] As an example, the expression score of each cluster can be calculated by the following formula (2).

Number

[0129] Thus, while encouraging the selection of clusters containing high-performance programs by the numerator, i.e., the maximum fitness, the monopoly of large clusters can be suppressed by the denominator, i.e., the number of second candidate programs, providing opportunities for small clusters representing new directions, and thereby achieving the goal of selecting clusters with fewer exploration times and high expression scores.

[0130] Exemplarily, based on the temperature parameter and the expression score, the selection probability of any one cluster can be determined through an exponential function.

[0131] As an example, the selection probability of each cluster can be calculated by the following formula (3).

Number

[0132] This allows for the determination of a cluster's representation score based on the fitness of any one of the second candidate programs in that cluster and the number of second candidate programs in that cluster. By determining the selection probability of the cluster based on the temperature parameter and the representation score, the cluster selection pressure can be dynamically adjusted based on the temperature parameter, thereby achieving self-adaptive cluster selection.

[0133] Step 404: Select the first parent program from the target cluster.

[0134] In this invention, the second candidate programs in the target cluster can be ranked in order of their fitness, and the top pre-set number of second candidate programs can be determined as the first parent program. This allows for the selection of relatively high-quality programs for generating child programs, and enables continuous improvement of program quality in the population through evolutionary iteration.

[0135] For example, the second candidate program with the highest fitness in the target cluster can be designated as the first parent program.

[0136] For example, the number of target clusters may be one or more. If there are multiple target clusters, a first parent program can be selected from among the target clusters for each target cluster. Therefore, the number of first parent programs may be one or more, and is not limited to this.

[0137] Step 405: Based on the first parent program, select the second parent program from the target population.

[0138] In order to continuously improve the quality of programs in a population, this invention allows for the selection of a program from a target population to which any one first parent program belongs, which can appropriately crossover or mutate with the first parent program.

[0139] In some embodiments, the cosine distance is calculated for any one first candidate program in the target population based on the fused representation vector of the first parent program and the fused representation vector of the first candidate program. Based on the cosine distance, the degree of difference between the first parent program and the first candidate program is determined, and the first candidate program with the greatest degree of difference from the first parent program in the target population can be designated as the second parent program. Here, the larger the cosine distance between programs, the greater the degree of difference between programs.

[0140] Furthermore, the method for obtaining the fused representation vector of the first parent program can be found by referring to the method for obtaining the fused representation vector of the first candidate program in the above embodiment, and will not be explained here.

[0141] In some embodiments, diversity information of the target population may include a diversity index. For any one first candidate program in the target population, the degree of difference between the first parent program and the first candidate program is determined based on the fused representation vector of the first parent program and the fused representation vector of the first candidate program. Based on the diversity index of the target population, a first weight for the fitness and a second weight for the difference of the first candidate program are determined. Based on the first and second weights, the fitness and difference of the first candidate program are weighted to obtain an overall score for the first candidate program. Based on the overall score, a second parent program can be selected from the target population.

[0142] Here, the overall score of the first candidate program can be used to represent comprehensive information regarding the quality of the first candidate program and its degree of difference from the first parent program.

[0143] For example, the diversity index can be normalized to obtain a normalized index, which can then be determined as the first weight, and the difference between the target value and the normalized index can be determined as the second weight.

[0144] For example, the diversity index can be normalized using the following method: determine the ratio of the diversity index to the score threshold, and the minimum value between this ratio and the target value can be used as the normalization index.

[0145] For example, if the score threshold is t and the target value is 1, then the normalized index

number

[0146] As an example, the overall score of the first candidate program can be calculated using the following formula (4).

number

[0147] This means that when population diversity is high, fitness is given relatively greater weight, leading to a tendency to select and utilize high-performing individuals. When diversity is low, difference is given relatively greater weight, leading to a tendency to select a first candidate program that is significantly different from the first parent program and introduce new genes, thereby strengthening exploration and improving the ability to balance exploration and utilization.

[0148] For example, selecting a second parent program from the target population based on the above overall score can be achieved in the following way: Based on the overall score of any one first candidate program and the sum of the overall scores of each first candidate program in the target population, the probability of selecting any one first candidate program can be determined, and based on the probability of selecting each first candidate program in the target population, a second parent program can be selected from the target population.

[0149] For example, if there are multiple first parent programs, one second parent program can be selected for each first parent program using the method described above.

[0150] This allows us to determine the fitness weights of the first candidate program and the weights of the differences between the first parent program and the first candidate program based on diversity indicators, dynamically determine an overall score through weighting, and select a second parent program based on the overall score, thereby selecting a second parent program that is appropriate for crossover mutation with respect to the first parent program.

[0151] Step 406: Evolutionary iterations are performed based on the first parent program and the second parent program to obtain the target program.

[0152] In this application, step 406 can be implemented using any of the embodiments described herein, and such implementations are omitted here.

[0153] In some embodiments, crossover mutation operations are performed on the first and second parent programs to generate child programs, the cluster to which the child programs belong in the target population is determined, the child programs are placed in the cluster in place of programs with low fitness in the target population to complete population updating, and a new population can be obtained. If the evolutionary iteration termination condition is not met, the next evolutionary iteration is performed with the new population as the target population until the evolutionary iteration termination condition is met, to obtain the final population, and the target program can be selected from the final population. Here, the method for generating child programs is omitted here as it can be found in other embodiments.

[0154] For example, each time a child program is generated, it is determined whether the reclustering condition is met. If the reclustering condition is not met, the cluster closest to the child program in the target population is determined, the child program is placed in that cluster, replacing the low-fitting program in the target population to obtain a new population. If the reclustering condition is met, the low-fitting program in the target population is deleted, the child program and the remaining programs in the target population are reclustered to obtain at least one new cluster, thereby completing the population update and obtaining a new population.

[0155] For example, the reclustering condition may be, but is not limited to, that the number of child programs generated since the last reclustering has reached a predetermined number, or that the number of evolution iterations has reached a predetermined number, or other conditions.

[0156] In the embodiments of the present invention, the quality of the first parent program can be ensured by autonomously selecting a target cluster from at least one cluster of the target population based on temperature parameters, and subsequently selecting a first parent program from the target cluster. Furthermore, the quality of the second parent program can be improved by selecting a second parent program based on the first parent program, and the quality of the child program can be improved by generating a new child program based on the first and second parent programs.

[0157] The self-adaptive program generation method based on artificial intelligence according to the embodiment of this application is widely applicable to fields where solutions need to be generated through evolution, and will be explained below using automated algorithm discovery as an example.

[0158] Scenario Description: A researcher wants to automatically discover a new, efficient algorithm for a specific problem (e.g., community discovery on large graph data). Application process: Initialization: Researchers define the target function of the problem, i.e., the score function, and evaluate it based, for example, on the modularity Q value and computational efficiency of the algorithm. As the initial population, they randomly generate initial community discovery algorithm programs or generate them using a large-scale model. Start of evolution iteration: Evaluation and Representation: A score is calculated for each population, and a fused representation vector is generated for each program. Simultaneously, a diversity index is calculated for each population. Selection: Each population independently selects a first parent program and then selects multiple pairs (first parent program, second parent program). Generation: The code and analysis of each pair (first parent program, second parent program) are input into a large-scale model, and new child programs are generated by "crossing over" and "mutating" them using prompt information. For example, the prompt information might be "analyze the strengths and weaknesses of these two programs and combine them to create a new, better-performing program." Replacement and migration: Newly generated child programs are returned to the population, replacing programs with low fitness levels within the population. Furthermore, periodic individual movement between populations is possible; that is, the most fit individuals in one population are moved to another, thereby promoting gene exchange. Termination: The evolution process is repeated until the termination condition is met (for example, until a given algebra is reached or a solution that satisfies the performance requirements is found). Final output: From the final population obtained, researchers can select a variety of high-performance community discovery algorithms for selection and analysis.

[0159] In the field of autonomous driving strategy optimization, the present invention can be applied to generate a logic program for controlling vehicle obstacle avoidance and path planning through evolutionary iteration, and the target function may be safety, smoothness, or traffic efficiency in a simulated environment.

[0160] In the field of game AI design, the present invention can be applied to generate a decision tree or state machine program that controls the behavior of a game NPC (Non-Player Character) through evolutionary iteration, where the target function may be the win rate in competition against the player or other AI.

[0161] Furthermore, the present invention can be extended to the field of drug molecule design, where the chemical formula or structure of a molecule is generated by evolutionary iteration, and the target function may be the binding energy with the target, etc.

[0162] The self-adaptive program generation method based on artificial intelligence according to the embodiment of the present invention has the following beneficial effects. (1) Raise the upper limit of problem solving: By effectively avoiding premature convergence, we can move beyond local optima and increase the likelihood of discovering truly groundbreaking and novel solutions that human experts could not have conceived. (2) Accelerate innovation efficiency: The self-adaptive selection strategy intelligently allocates computing resources to the most promising evolutionary direction, making it more efficient than a fixed strategy in both exploring new fields and deepening existing areas of advantage, and shortening the development cycle of the second-child programs mentioned above. (3) Enhance the diversity of results: Accurate diversity metrics and maintenance mechanisms ensure that the final product is a high-quality solution with a variety of styles, providing users with a richer range of choices. (4) Improve the level of automation: Self-adaptive properties reduce reliance on artificial parameter adjustments (e.g., temperature annealing rate), improving the robustness and automation of evolutionary iterations.

[0163] To realize the above embodiment, the present invention further provides an intelligent agent. Figure 5 is a schematic diagram of an intelligent agent provided by one embodiment of the present invention.

[0164] As shown in Figure 5, the intelligent agent 500 is A first decision module 510 for determining diversity information of a target population, wherein the diversity information is for indicating the programmatic diversity of the target population. A second determination module 520 for determining temperature parameters based on the diversity information, wherein the temperature parameters are for adjusting the selective pressure. A selection module 530 for selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, Includes a generator module for obtaining a target program by performing evolutionary iterations based on the first parent program and the second parent program.

[0165] Selectively, the first decision module 510, Feature extraction is performed on the first candidate program in the target population to obtain a first embedding vector, where the first embedding vector represents the syntactic and semantic structure of the first candidate program. The first candidate program is subjected to a format conversion process, and the conversion result is obtained. Feature extraction is performed on the above transformation result to obtain a second embedding vector. The first embedding vector and the second embedding vector are merged to obtain a merged representation vector. Based on the aforementioned fused representation vector, the diversity information is obtained.

[0166] Selectively, the first decision module 510, Based on the aforementioned fused representation vector, the average cosine distance between the first candidate programs is determined. Based on the average cosine distance, the diversity information is obtained.

[0167] Selectively, the diversity information includes diversity indicators, and the first decision module 510, The auxiliary features of the target population are obtained, where the auxiliary features include one or more of the code length of the first candidate program, the fitness of the first candidate program, and the average edit distance between the first candidate programs. The mean cosine distance and the auxiliary features are combined to obtain the diversity index.

[0168] Selectively, the first decision module 510, The first candidate program is analyzed to obtain the code feature information of the first candidate program. Based on the code feature information, pseudocode for the first candidate program is obtained. The conversion result is obtained based on the pseudocode.

[0169] Selectively, the first decision module 510, The first candidate program is analyzed to obtain a structured representation of the first candidate program. The conversion result is obtained based on the structured representation.

[0170] Selectively, the diversity information includes diversity indicators, and the second decision module 520, A modulo operation is performed on the first value based on the current number of evolutionary iterations to obtain a second value, and here, if the difference between the first value and the total number of evolutionary iterations is greater than a preset threshold, The temperature parameter is determined based on the ratio of the second value to the first value and the diversity index.

[0171] Selectively, the second decision module 520, Determine the first difference between the target value and the diversity index. Determine a fourth value, where the base is the third value and the exponent is the aforementioned first difference value. Determine the second difference between the target value and the ratio. The temperature parameter is determined based on the product of the second difference value and the fourth numerical value.

[0172] Selectively, the selection module 530 is, Based on the temperature parameters, a target cluster is determined from at least one cluster of the target population. Select the first parent program from the target cluster, Based on the first parent program, the second parent program is selected from the target population.

[0173] Selectively, the selection module 530 is, For any one of the at least one clusters, a representation score is determined for that cluster based on the fitness of the second candidate program in that cluster and the number of second candidate programs in that cluster, where the representation score is used to measure the relationship between the program quality and cluster size of the cluster. Based on the temperature parameter and the representation score, the selection probability of any one of the clusters is determined. Based on the selection probability, the target cluster is selected from the at least one cluster.

[0174] Selectively, the selection module 530 is, The fitness of the second candidate program is determined to be the highest, The representation score is determined based on the ratio of the maximum fitness to the number of second candidate programs.

[0175] Selectively, the diversity information includes diversity indicators, and the selection module 530 is Based on the fused representation vector of the first parent program and the fused representation vector of the first candidate program in the target population, the degree of difference between the first parent program and the first candidate program is determined. Based on the diversity index, the first weight of the fitness of the first candidate program and the second weight of the difference are determined. The overall score of the first candidate program is obtained by weighting the sum of the first weights and the second weights described below, the fitness of the first candidate program, and the difference. Based on the overall score, the second parent program is selected from the target population.

[0176] Selectively, the selection module 530 normalizes the diversity index to obtain a normalized index. The normalization index is determined as the first weight, The difference between the target value and the normalization index is determined as the second weight.

[0177] Selectively, the generation module 540 is, Using a large-scale model, cross-mutation operations are performed on the first parent program and the second parent program to generate child programs. The target program is obtained by performing evolutionary iterations based on the aforementioned child program.

[0178] The above description of the program generation method is also applicable to the intelligent agent of this embodiment, so the explanation is omitted here.

[0179] In the embodiment of the present invention, diversity information of the target population is determined, temperature parameters are determined based on the diversity information, a first parent program and a second parent program corresponding to the first parent program are selected from the target population based on the temperature parameters, and evolutionary iterations are performed on the target population based on the first parent program and the second parent program to obtain a target program. As a result, the temperature parameters can be dynamically adjusted based on the diversity information of the population during the evolutionary iteration process, improving the degree of matching between the temperature parameters and the program diversity of the population, thereby enabling the self-adaptive selection of parent programs based on the temperature parameters, enhancing the ability to balance exploration and utilization in the evolutionary process, and ultimately enabling the efficient generation of diverse and high-performance programs.

[0180] According to embodiments of the present application, the present application further provides an electronic device, a readable storage medium, and a computer program.

[0181] Figure 6 shows a schematic block diagram of an exemplary electronic device 600 that can carry out embodiments of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, mobile phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the description herein and / or the implementation of the application as required.

[0182] As shown in Figure 6, device 600 includes a computing unit 601 that can perform various appropriate operations and processes based on computer programs stored in ROM (Read-Only Memory) 602 or computer programs loaded from storage unit 608 into RAM (Random Access Memory) 603. RAM 603 can contain various programs and data necessary for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are connected to each other via bus 604. An I / O (Input / Output) interface 605 is similarly connected to bus 604.

[0183] Multiple components within device 600, including input units 606 such as a keyboard and mouse, output units 607 such as monitors and speakers of various types, storage units 608 such as magnetic disks and optical disks, and communication units 609 such as a network card, modem, and wireless communication transmitter / receiver, are connected to the I / O interface 605. The communication unit 609 allows device 600 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunications networks.

[0184] The computing unit 601 may be a variety of general-purpose and / or dedicated processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing units that execute machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs each of the methods and processes described above, for example, the method for generating a self-adaptive program based on artificial intelligence. For example, in some embodiments, the method for generating a self-adaptive program based on artificial intelligence can be implemented as a computer software program tangibly contained in a machine-readable medium such as a storage unit 608. In some embodiments, part or all of the computer program is loaded and / or installed into device 600 via ROM 602 and / or communication unit 609. When a computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the artificial intelligence-based self-adaptive program generation method described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the artificial intelligence-based self-adaptive program generation method via any other suitable method (e.g., via firmware).

[0185] Various embodiments of the systems and technologies described herein can be implemented as digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System on Chip), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may be implemented as one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be an application-specific or general-purpose programmable processor, which can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, at least one input device, and at least one output device.

[0186] Program code for performing the method of this application can be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, a dedicated computer, or other programmable data processing device, so that when executed by the processor or controller, the functions / operations defined by the flowchart and / or block diagrams are performed. The program code may run entirely on a machine, partially on a machine, as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0187] In the context of this application, a machine-readable medium may be a tangible medium that contains or can store a program used by or in combination with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above. More specific examples of machine-readable storage media include one or more line-based electrical connections, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory), or flash memory, optical fibers, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0188] To provide user interaction, the systems and technologies described herein can be implemented on a computer, which may have a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor), and a keyboard and pointing device (e.g., a mouse or trackball), through which the user can provide input to the computer. Other types of devices may also provide user interaction; for example, the feedback provided to the user may be any form of sensing feedback (e.g., visual feedback, auditory feedback, or haptic feedback), and may receive input from the user in any form (including acoustic input and voice input or haptic input).

[0189] The systems and technologies described herein can be implemented in a computing system including backend components (e.g., as a data server), a computing system including middleware components (e.g., an application server), a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser, through which the user interacts with embodiments of the systems and technologies described herein), or in a computing system including any combination of such backend components, middleware components, and frontend components. The components of the system can be interconnected by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0190] A computer system can include clients and servers. Clients and servers are generally geographically separated and typically interact via a communication network. The client-server relationship is established by computer programs running on corresponding computers that have a client-server relationship with each other. A server may be a cloud server, also called a cloud computing server or cloud host, a host product in a cloud computing service system that addresses the management difficulties and limited scalability inherent in traditional physical hosts and VPS (Virtual Private Server) services. A server may be a server in a distributed system, or a server combined with blockchain technology.

[0191] According to embodiments of the present application, the present application further provides a computer program which, when executed by a processor, performs an artificial intelligence-based self-adaptive program generation method provided in the above embodiments of the present application.

[0192] Furthermore, the steps can be rearranged, added, or deleted using the various forms of flows shown above. For example, each step described in this application may be performed in parallel, sequentially, or in a different order, as long as the desired results of the proposed technology disclosed herein can be achieved.

[0193] The specific embodiments described above do not limit the scope of protection of this disclosure. Those skilled in the art will understand that various modifications, combinations, partial combinations, and substitutions can be made depending on the design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for generating a self-adaptive program based on artificial intelligence, A step of determining diversity information of a target population, wherein the diversity information is for indicating the programmatic diversity of the target population, A step of determining a temperature parameter based on the diversity information, wherein the temperature parameter is for adjusting the selective pressure, A step of selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, The process includes the step of performing evolutionary iterations based on the first parent program and the second parent program to obtain a target program, A method for generating self-adaptive programs based on artificial intelligence.

2. The step of determining the diversity information of the target population is: A step of extracting features from a first candidate program in the target population to obtain a first embedding vector, wherein the first embedding vector represents the syntactic and semantic structure of the first candidate program. The steps include performing a format conversion process on the first candidate program and obtaining the conversion result, The steps include: performing feature extraction on the conversion result to obtain a second embedding vector; The steps include: fusing the first embedding vector and the second embedding vector to obtain a fused representation vector; The step of obtaining diversity information based on the fused representation vector includes: A method for generating a self-adaptive program based on artificial intelligence as described in claim 1.

3. The step of obtaining the diversity information based on the aforementioned fused representation vector is: The steps include determining the average cosine distance between the first candidate programs based on the fused representation vector, The step of obtaining diversity information based on the average cosine distance is included. A method for generating a self-adaptive program based on artificial intelligence as described in claim 2.

4. The aforementioned diversity information includes diversity indicators, The step of obtaining the diversity information based on the average cosine distance is: A step of obtaining auxiliary features of the target population, wherein the auxiliary features include one or more of the code length of the first candidate program, the fitness of the first candidate program, and the average edit distance between the first candidate programs. The step of fusing the average cosine distance and the auxiliary features to obtain the diversity index includes, A method for generating a self-adaptive program based on artificial intelligence as described in claim 3.

5. The step of performing a format conversion process on the first candidate program and obtaining the conversion result is: The steps include analyzing the first candidate program and obtaining the code feature information of the first candidate program, The steps include obtaining pseudocode for the first candidate program based on the code feature information, The steps include obtaining the conversion result based on the pseudocode, A method for generating a self-adaptive program based on artificial intelligence as described in claim 2.

6. The step of performing a format conversion process on the first candidate program and obtaining the conversion result is: The steps include analyzing the first candidate program and obtaining a structured representation of the first candidate program, The steps include obtaining the conversion result based on the structured representation, A method for generating a self-adaptive program based on artificial intelligence as described in claim 2.

7. The aforementioned diversity information includes diversity indicators, The step of determining the temperature parameter based on the diversity information is: A step of obtaining a second value by performing a modulo operation on a first value based on the current number of evolutionary iterations, wherein the difference between the first value and the total number of evolutionary iterations is greater than a preset threshold, The step of determining the temperature parameter based on the ratio of the second value to the first value and the diversity index, A method for generating a self-adaptive program based on artificial intelligence as described in claim 1.

8. The step of determining the temperature parameter based on the ratio of the second value to the first value and the diversity index is as follows: The steps include determining a first difference between the target value and the diversity index, The steps include determining a fourth value where the base is the third value and the exponent is the first difference value, The steps include determining a second difference value between the target value and the ratio, The step of determining the temperature parameter based on the product of the second difference value and the fourth numerical value, A method for generating a self-adaptive program based on artificial intelligence as described in claim 7.

9. The step of selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters is: A step of determining a target cluster from at least one cluster of the target population based on the temperature parameter, The step of selecting the first parent program from the target cluster, The step of selecting a second parent program from the target population based on the first parent program, A method for generating a self-adaptive program based on artificial intelligence as described in claim 1.

10. The step of determining a target cluster from at least one cluster of the target population based on the temperature parameter is: A step of determining a representation score for any one of the at least one clusters based on the fitness of the second candidate program in the cluster and the number of second candidate programs in the cluster, wherein the representation score is used to measure the relationship between the program quality and cluster size of the cluster. A step of determining the selection probability of any one of the clusters based on the temperature parameter and the representation score, The step of selecting the target cluster from the at least one cluster based on the selection probability, A method for generating a self-adaptive program based on artificial intelligence as described in claim 9.

11. The step of determining the representation score of any one of the clusters based on the fitness of the second candidate programs in any one of the clusters and the number of the second candidate programs is: The steps include determining the maximum fitness among the second candidate programs, The step of determining the representation score based on the ratio of the maximum fitness to the number of second candidate programs, A method for generating a self-adaptive program based on artificial intelligence as described in claim 10.

12. The aforementioned diversity information includes diversity indicators, The step of selecting the second parent program from the target population based on the first parent program is: A step of determining the degree of difference between the first parent program and the first candidate program based on the fused representation vector of the first parent program and the fused representation vector of the first candidate program in the target population, A step of determining a first weight of the fitness of the first candidate program and a second weight of the difference based on the diversity index, A step of obtaining an overall score for the first candidate program by weighting the fitness and difference of the first candidate program based on the first weight and the second weight, The step of selecting the second parent program from the target population based on the overall score, A method for generating a self-adaptive program based on artificial intelligence as described in claim 9.

13. The step of determining the first weight of the fitness of the first candidate program and the second weight of the difference based on the diversity index is as follows: The steps include: normalizing the aforementioned diversity index to obtain a normalized index; The steps include determining the normalization index as the first weight, The step includes determining the difference between the target value and the normalized index as the second weight, A method for generating a self-adaptive program based on artificial intelligence as described in claim 12.

14. The step of obtaining a target program by performing evolutionary iterations based on the first parent program and the second parent program is: The steps include: generating child programs by performing cross-mutation operations on the first parent program and the second parent program using a large-scale model; The step of performing evolutionary iterations based on the child program to obtain the target program, A method for generating a self-adaptive program based on artificial intelligence as described in claim 1.

15. An intelligent agent, A first decision module for determining diversity information of a target population, wherein the diversity information is for indicating the programmatic diversity of the target population, A second determination module for determining temperature parameters based on the diversity information, wherein the temperature parameters are for adjusting the selective pressure, A selection module for selecting a first parent program and a second parent program corresponding to the first parent program from the target population based on the temperature parameters, Includes a generator module for obtaining a target program by performing evolutionary iterations based on the first parent program and the second parent program, Intelligent agent.

16. It is an electronic device, At least one processor, Includes a memory that is communicably connected to at least one of the processors, The memory stores instructions that can be executed by the at least one processor, and the execution of these instructions by the at least one processor causes the at least one processor to perform the method according to any one of claims 1 to 14. Electronic devices.

17. A non-temporary computer-readable storage medium storing computer instructions, wherein the computer instructions cause a computer to perform the method according to any one of claims 1 to 14. A non-temporary, computer-readable storage medium.

18. A computer program, in which the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are realized. Computer program.