Model training method, data prediction method, computing device and readable storage medium
By constructing genetic populations and iteratively optimizing the structure of the proxy model, the problem of performance degradation of tower crane data prediction model in long-term use is solved, and accurate data prediction of tower crane stress and displacement is achieved.
Patent Information
- Application Number
- CN202411665048.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-25
AI Technical Summary
The problem of the failure of accurate data for long-term tower cranes in the prior art is mainly due to the changes in structural data, sample size and training times during the training process of the algorithm model, resulting in a decline in model performance, and even overfitting, which makes it impossible to accurately predict the stress and displacement of the tower crane.
By determining the number of nodes per layer of the proxy model as an optimization variable, genetic populations are constructed, and the genetic population is iterated based on a moderate function until the target genetic population meets the iterative conditions are obtained, so as to obtain the optimal structure of the proxy model and train the data prediction agent model of the tower crane.
Without relying on the experience of modelers, the optimal structure of the agent model can be obtained stably, and the accurate stress and displacement data of the tower crane used for a long time can be obtained, solving the problems of model overfitting and performance degradation.
Smart Images

Figure CN119514729A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and specifically to a model training method, a data prediction method, a computing device, and a readable storage medium. Background Art
[0002] With the rapid development of tower crane manufacturing technology, tower cranes are widely used in a variety of scenarios. After tower cranes and other tower cranes are put into use, due to the poor structural stress of the components and the difference between the actual use conditions and the preset use conditions, fatigue damage to the components is likely to occur. Usually, a variety of sensors are installed at the key components of the tower crane to detect data such as displacement and stress during the operation of the tower crane. The remaining life of the tower crane is predicted based on the signals detected by the sensors to obtain the quality analysis results of the tower crane and avoid safety accidents.
[0003] Since tower cranes are usually in harsh working conditions, a large amount of continuous abnormal data is likely to appear when sensors collect signals. The method of analyzing tower crane data through algorithm models has gradually been widely used. However, in the actual training process of the algorithm model, changes in the structural data of the algorithm model, as well as changes in the sample size and training times will affect the performance of the algorithm model, and even cause the algorithm model to overfit, and thus fail to obtain accurate data for tower cranes that have been used for a long time. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a model training method, a data prediction method, a computing device and a readable storage medium to solve the problem in the prior art that accurate data cannot be obtained for tower cranes that have been in use for a long time.
[0005] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a model training method, which includes:
[0006] The number of nodes in each layer of the proxy model is determined as an optimization variable, and the test error of the training proxy model under a preset sample and a preset number of training times is determined as an appropriate function;
[0007] According to the optimization variables, a genetic population is constructed, wherein the genetic population includes a plurality of individuals, and the individuals are codes of the optimization variables;
[0008] Based on the fitness function, iterate the genetic population until the target genetic population that meets the iteration conditions is obtained;
[0009] According to the best individuals in the target genetic population, the optimal structure of the agent model is obtained;
[0010] The optimal structure of the agent model is trained to obtain the data prediction agent model of the tower crane.
[0011] In the embodiment of the present application, a genetic population is constructed according to the optimized variables, including:
[0012] Binary encode the optimization variables and determine the number of encoding bits of the encoded optimization variables;
[0013] Generate a first number of individuals corresponding to the number of coding digits;
[0014] Based on the first number of individuals, a genetic population is constructed.
[0015] In the embodiment of the present application, the optimal structure of the proxy model is obtained according to the optimal individual in the target genetic population, including:
[0016] Decompile the best individuals in the target genetic population to determine the optimal number of nodes in each layer;
[0017] According to the optimal number of nodes in each layer, the optimal structure of the proxy model is obtained.
[0018] In the embodiment of the present application, binary encoding is performed on the optimization variable, and the number of encoding bits of the encoded optimization variable is determined, including:
[0019] Get the number of input nodes and output nodes in the optimization variable;
[0020] The minimum value between the number of input nodes and the number of output nodes is determined as the lower limit value of the optimization variable;
[0021] Calculate the upper limit value of the optimization variable based on the number of input nodes and the number of output nodes;
[0022] The optimization variable is binary-coded according to the lower limit value and the upper limit value, and the coding bit number of the encoded optimization variable is determined.
[0023] In the embodiment of the present application, based on the fitness function, iterating the genetic population until obtaining the target genetic population that meets the iteration condition includes:
[0024] Based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals;
[0025] According to the preset population size, preset crossover rate and preset mutation rate, the breeding population is iterated to obtain the iterated genetic population;
[0026] When the iteration condition is not met, the step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals is repeated until the iteration condition is met, and the obtained iterated genetic population is determined as the target genetic population.
[0027] In the embodiment of the present application, based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals, including:
[0028] drawing a second number of individuals from the genetic population;
[0029] Based on the fitness function, select an excellent individual from the second number of individuals;
[0030] When the number of excellent individuals is less than the third number, repeatedly performing the step of extracting the second number of individuals from the genetic population until the third number of excellent individuals is obtained;
[0031] A breeding population is constructed based on the third number of excellent individuals.
[0032] In the embodiment of the present application, based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals, including:
[0033] Get the agent model parameters corresponding to each individual;
[0034] For each individual, a preset proxy model is trained according to the proxy model parameters, and an actual fitness function value corresponding to the trained preset proxy model is obtained;
[0035] According to the actual fitness function value corresponding to each individual, the evaluation value of each individual is determined respectively;
[0036] Based on the evaluation value of each individual, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals.
[0037] A second aspect of the present application provides a data prediction method, the data prediction method comprising:
[0038] Obtain real-time operation data of tower crane;
[0039] The real-time operation data is input into the data prediction agent model to obtain the prediction data of the tower crane, wherein the data prediction agent model is obtained according to the above-mentioned model training method.
[0040] A third aspect of the present application provides a computing device, including:
[0041] a memory configured to store instructions;
[0042] A processor is configured to call instructions from a memory and implement the above-mentioned model training method or the above-mentioned data prediction method when executing the instructions.
[0043] A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned model training method or the above-mentioned data prediction method.
[0044] The present application provides a model training method, including: determining the number of nodes in each layer of the proxy model as an optimization variable, determining the test error of the training proxy model under a preset sample and a preset number of training times as a fitness function; constructing a genetic population according to the optimization variable, and the individual is the encoding of the optimization variable; iterating the genetic population based on the fitness function until a target genetic population that meets the iteration conditions is obtained; obtaining the optimal structure of the proxy model according to the optimal individual in the target genetic population; training the optimal structure of the proxy model to obtain a data prediction proxy model for a tower crane. By optimizing the proxy model parameters of the tower crane through the genetic population, the optimal structure of the proxy model can be stably obtained without relying on the experience of the modeling personnel, and then the proxy model can be used to obtain accurate stress and displacement data of the tower crane that has been used for a long time.
[0045] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0047] Figure 1 A schematic diagram of a process flow of a model training method according to an embodiment of the present application is schematically shown;
[0048] Figure 2 An example diagram of an individual crossover according to an embodiment of the present application is schematically shown;
[0049] Figure 3 An example diagram of an individual variation according to an embodiment of the present application is schematically shown;
[0050] Figure 4 A flow chart of a data prediction method according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0052] It should be noted that if directional indication is involved in the embodiments of the present application, the directional indication is only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0053] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0054] Example 1
[0055] Figure 1 The following schematically shows a flow chart of a model training method according to an embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a model training method, which includes the following steps:
[0056] S110, determining the number of nodes in each layer of the proxy model as an optimization variable, and determining the test error of the training proxy model under a preset sample and a preset number of training times as a fitness function.
[0057] In this embodiment, the optimization goal is to obtain the proxy model of the optimal structure. The number of layers of the proxy model is set according to actual needs and is not limited here. For ease of understanding, the proxy model in the example of this application includes a first layer and a second layer, the first layer is the input layer and the number of input nodes is X1, and the second layer is the output layer and the number of output nodes is X2.
[0058] The number of nodes in each layer of the proxy model is determined as an optimization variable. Since the proxy model evaluation criteria are a small number of samples and iterative training, the proxy model has a high prediction accuracy when tested. The proxy model has a good performance. The proxy model has a low prediction accuracy when tested. The proxy model has a poor performance. The test error of the training proxy model under the preset samples and the preset number of training times is determined as a moderate function. The optimization problem constructed in this embodiment is:
[0059] minf(x1,x2)=nettesterror(x1,x2)
[0060] st a1≤x1≤b1
[0061] a2≤x2≤b2
[0062] Among them, f(x1,x2) is the fitness function, that is, the optimization objective function, x1 is the number of nodes in the first layer of the proxy model, x2 is the number of nodes in the second layer of the proxy model, a1 is the lower limit of the number of nodes in the first layer, b1 is the upper limit of the number of nodes in the first layer, a2 is the lower limit of the number of nodes in the second layer of the proxy model, and b2 is the upper limit of the number of nodes in the second layer of the proxy model.
[0063] It should be understood that the fitness function of the genetic algorithm is also defined as the test error of the training agent model under the preset sample and the preset number of training times. The size and type of the preset sample are set according to actual needs and are not limited here. The value of the preset number of training times is also set according to actual needs and is not limited here.
[0064] S120, constructing a genetic population according to the optimized variables, wherein the genetic population includes a plurality of individuals, and the individuals are codes of the optimized variables.
[0065] According to the optimization variables, the optimization variables are encoded, that is, the parameters of the proxy model are encoded. By representing the optimization variables as genomes, multiple individuals are generated. Based on the generated multiple individuals, an initialized genetic population is randomly constructed. In this embodiment, each group of chromosomes of each individual represents the number of nodes of one layer of the proxy model.
[0066] In the embodiment of the present application, a genetic population is constructed according to the optimized variables, including:
[0067] Binary encode the optimization variables and determine the number of encoding bits of the encoded optimization variables;
[0068] Generate a first number of individuals corresponding to the number of coding digits;
[0069] Based on the first number of individuals, a genetic population is constructed.
[0070] Binary encode the optimization variable to determine the number of bits of the encoded optimization variable. For ease of understanding, assume that the interval of the optimization variable is [5,37], and the optimization variable is binary encoded to obtain the code 1010111010, that is, the number of bits of the encoded optimization variable is determined to be 10 bits.
[0071] A first number of individuals are generated corresponding to the number of coding bits, that is, a first number of individuals with a coding bit of 10 are generated. A genetic population is constructed based on the first number of individuals.
[0072] In the embodiment of the present application, the optimal structure of the proxy model is obtained according to the optimal individual in the target genetic population, including:
[0073] Decompile the best individuals in the target genetic population to determine the optimal number of nodes in each layer;
[0074] According to the optimal number of nodes in each layer, the optimal structure of the proxy model is obtained.
[0075] The optimal individual in the target genetic population is decompiled to determine the optimal number of nodes in each layer. Specifically, assuming that the encoding of the optimal individual is 1110110000, the optimal individual is decompiled to determine that the number of nodes in the first layer of the proxy model is 43, and the number of nodes in the second layer of the proxy model is 21.
[0076] According to the optimal number of nodes in each layer, the optimal structure of the proxy model is obtained. It should be understood that the optimal structure of the proxy model also includes other layers, which are set according to actual needs and can be hidden layers, etc., which are not limited here.
[0077] In the embodiment of the present application, binary encoding is performed on the optimization variable, and the number of encoding bits of the encoded optimization variable is determined, including:
[0078] Get the number of input nodes and output nodes in the optimization variable;
[0079] The minimum value between the number of input nodes and the number of output nodes is determined as the lower limit value of the optimization variable;
[0080] Calculate the upper limit value of the optimization variable based on the number of input nodes and the number of output nodes;
[0081] The optimization variable is binary-coded according to the lower limit value and the upper limit value, and the coding bit number of the encoded optimization variable is determined.
[0082] The number of input nodes and the number of output nodes in the optimization variable are obtained. Since the first layer of the proxy model in this embodiment is the input layer and the second layer is the output layer, the number of nodes in the first layer is the number of input nodes, and the number of nodes in the second layer is the number of output nodes.
[0083] The minimum value between the number of input nodes and the number of output nodes is determined as the lower limit value of the optimization variable, that is, a1=min(I, O), where I is the number of input nodes, O is the number of output nodes, and a1 is the lower limit value of the optimization variable.
[0084] Based on the number of input nodes and the number of output nodes, the upper limit value of the optimization variable is calculated, that is, Among them, I is the number of input nodes, O is the number of output nodes, and b1 is the upper limit value of the optimization variable.
[0085] According to the lower limit and the upper limit, the optimization variable is binary-encoded to determine the number of bits of the encoded optimization variable. Since the optimization variable in this embodiment is a binary variable, a 2n-bit binary code is required to map the variable space. For ease of understanding, in the embodiment of this application, it is assumed that the optimization change is [5, 37], then a 10-bit code is required to express the real-time interval, the code is 1010111010, the first five bits are converted to decimal as 21, and the last five bits are converted to decimal as 26, and the first five bits of the variable interval mapped to 26 = 21 × [(37-5) / (2 5 )]+5, the last five digits of the variable interval are mapped to 31.
[0086] S130, iterating the genetic population based on the fitness function until a target genetic population that meets the iteration condition is obtained.
[0087] Through the defined fitness function, each individual in the genetic population is evaluated, and then the excellent individuals in the genetic population are selected. Through crossover and mutation of excellent individuals, the genetic population is iterated until the target genetic population that meets the iteration conditions is obtained.
[0088] In the embodiment of the present application, based on the fitness function, iterating the genetic population until obtaining the target genetic population that meets the iteration condition includes:
[0089] Based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals;
[0090] According to the preset population size, preset crossover rate and preset mutation rate, the breeding population is iterated to obtain the iterated genetic population;
[0091] When the iteration condition is not met, the step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals is repeated until the iteration condition is met, and the obtained iterated genetic population is determined as the target genetic population.
[0092] Based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals. According to a preset population size, a preset crossover rate and a preset mutation rate, the breeding population is iterated to obtain an iterated genetic population.
[0093] See also Figure 2 , Figure 2 An example diagram of an individual crossover according to an embodiment of the present application is schematically shown.
[0094] As shown in the figure, two excellent individuals can be used as parent 1 and parent 2, the encoding of parent 1 is 1010101101, and the encoding of parent 2 is 0011010001. The two optimized individuals are crossed to obtain offspring 1 and offspring 2. The encoding of offspring 1 is 1010011101, and the encoding of offspring 2 is 0011100001.
[0095] See also Figure 3 , Figure 3 An example diagram of an individual variation according to an embodiment of the present application is schematically shown.
[0096] As shown in the figure, the code of the individual before mutation is 0011100001, and one coding position of the individual is used as the mutation point and the mutation is performed. The code of the individual after mutation is 0011110001. It should be understood that the values of the preset crossover rate and the preset mutation rate are set according to actual needs and are not limited here. For ease of understanding, the preset crossover rate in the embodiment of the present application is 0.8, and the mutation rate is 0.1.
[0097] In the case where the iteration condition is not met, the step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals is repeatedly performed until the iteration condition is met, and the obtained iterated genetic population is determined as the target genetic population. The iteration condition is set according to actual needs and is not limited here. For ease of understanding, the iteration condition in the embodiment of the present application is that the number of iterations reaches 200 times, or the optimal evaluation is iterated 5 times in a row, and the change is less than 1%.
[0098] In the embodiment of the present application, based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals, including:
[0099] drawing a second number of individuals from the genetic population;
[0100] Based on the fitness function, select an excellent individual from the second number of individuals;
[0101] When the number of excellent individuals is less than the third number, repeatedly performing the step of extracting the second number of individuals from the genetic population until the third number of excellent individuals is obtained;
[0102] A breeding population is constructed based on the third number of excellent individuals.
[0103] In this embodiment, a tournament selection method is used to select breeding individuals to obtain a plurality of excellent individuals. A second number of individuals are extracted from the genetic population. Based on the fitness function, an excellent individual is extracted from the second number of individuals. When the number of excellent individuals is less than the third number, the step of extracting the second number of individuals from the genetic population is repeated until the third number of excellent individuals is obtained.
[0104] Specifically, n individuals are extracted from the genetic population, and one excellent individual is selected from the n individuals. The process of extracting n individuals from the genetic population and one excellent individual is repeated k times to obtain k excellent individuals. The k excellent individuals are used as breeding individuals to construct a breeding population.
[0105] In the embodiment of the present application, based on the fitness function, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals, including:
[0106] Get the agent model parameters corresponding to each individual;
[0107] For each individual, a preset proxy model is trained according to the proxy model parameters, and an actual fitness function value corresponding to the trained preset proxy model is obtained;
[0108] According to the actual fitness function value corresponding to each individual, the evaluation value of each individual is determined respectively;
[0109] Based on the evaluation value of each individual, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals.
[0110] According to the coding of each individual, reverse coding is performed to obtain the proxy model parameters corresponding to each individual. For each individual, a preset proxy model is trained according to the proxy model parameters, and the actual fitness function value corresponding to the trained preset proxy model is obtained. According to the actual fitness function value corresponding to each individual, the evaluation value of each individual is determined respectively. In this embodiment, the fitness function is a test error, and the test error is obtained according to the actual fitness function value corresponding to the individual. The lower the test error corresponding to the individual, the better the individual is, that is, the higher the individual evaluation value is. Based on the evaluation value of each individual, excellent individuals corresponding to high evaluation values are extracted from the genetic population to obtain a breeding population including at least two excellent individuals.
[0111] S140, obtaining the optimal structure of the agent model according to the optimal individuals in the target genetic population.
[0112] According to the best individual in the target genetic population, the optimal structure of the proxy model is obtained. Specifically, the best individual in the target genetic population is determined, and the optimal structure of the proxy model is obtained by decompiling the best individual.
[0113] S150, training the optimal structure of the agent model to obtain a data prediction agent model for the tower crane.
[0114] When the optimal structure of the proxy model is obtained, the optimal structure of the proxy model is trained to obtain the data prediction proxy model of the tower crane. It should be understood that the type of data that can be predicted by the data prediction proxy model is set according to actual needs, which can be stress or displacement, and is not limited here.
[0115] When using a learning algorithm to build a proxy model, the proxy model parameters directly affect the training speed and final accuracy of the learning algorithm. When the number of nodes in the proxy model is too small, the proxy model built by the learning algorithm may not be able to fit well. When the number of nodes in the proxy model is too large, the required number of training samples and training times will continue to increase, and the proxy model may even overfit. In addition, the number of nodes required for the proxy model varies for different application scenarios of tower cranes. For example, classification algorithms usually require fewer nodes than nonlinear relationship fitting. Usually, the proxy model parameters can only be selected manually based on the experience of the modeler.
[0116] The present application provides a model training method, including: determining the number of nodes in each layer of the proxy model as an optimization variable, determining the test error of the training proxy model under a preset sample and a preset number of training times as a fitness function; constructing a genetic population according to the optimization variable, and the individual is the encoding of the optimization variable; iterating the genetic population based on the fitness function until a target genetic population that meets the iteration conditions is obtained; obtaining the optimal structure of the proxy model according to the optimal individual in the target genetic population; training the optimal structure of the proxy model to obtain a data prediction proxy model for a tower crane. By optimizing the proxy model parameters of the tower crane through the genetic population, the optimal structure of the proxy model can be stably obtained without relying on the experience of the modeling personnel, and then the proxy model can be used to obtain accurate stress and displacement data of the tower crane that has been used for a long time.
[0117] Example 2
[0118] Figure 4 The following schematically shows a flow chart of a data prediction method according to an embodiment of the present application. Figure 4 As shown, the embodiment of the present application provides a data prediction method, which includes the following steps:
[0119] S210, obtaining real-time operation data of the tower crane.
[0120] Tower cranes are also called tower cranes. When it is necessary to obtain the predicted data of tower cranes, the real-time operation data of tower cranes is obtained. It should be understood that the real-time operation data is set according to actual needs, and can be load data such as the lifting weight, lifting amplitude, rotation angle and wind speed of the tower crane. The predicted data is also set according to actual needs, and can be stress and displacement, etc., which are not limited here.
[0121] S220, inputting the real-time operation data into a data prediction agent model to obtain prediction data of the tower crane, wherein the data prediction agent model is obtained according to the above-mentioned model training method.
[0122] The real-time operation data is input into the data prediction proxy model to obtain the prediction data of the tower crane output by the data prediction proxy model. This embodiment optimizes the proxy model parameters of the tower crane through the genetic population, and can stably obtain the optimal structure of the proxy model without relying on the experience of the modeling personnel. The optimal structure of the proxy model is trained to obtain the data prediction proxy model, and then the proxy model can be used to obtain the accurate stress and displacement data of the tower crane used for a long time.
[0123] The present application also provides a computing device, including:
[0124] a memory configured to store instructions;
[0125] A processor is configured to call instructions from a memory and implement the above-mentioned model training method or the above-mentioned data prediction method when executing the instructions.
[0126] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the problem of not being able to obtain accurate data for tower cranes that have been used for a long time can be solved by adjusting kernel parameters.
[0127] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0128] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned model training method or the above-mentioned data prediction method.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0134] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0135] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0136] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0137] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A model training method, characterized in that: The model training method comprises: The number of nodes in each layer of the proxy model is determined as an optimization variable, and the test error of the training proxy model under a preset sample and a preset number of training times is determined as an appropriate function; According to the optimization variables, a genetic population is constructed, wherein the genetic population includes a plurality of individuals, and the individuals are codes of the optimization variables; Iterating the genetic population based on the fitness function until a target genetic population that meets an iteration condition is obtained; According to the best individuals in the target genetic population, the optimal structure of the agent model is obtained; The optimal structure of the agent model is trained to obtain a data prediction agent model for a tower crane.
2. The model training method according to claim 1, characterized in that: The step of constructing a genetic population according to the optimized variables comprises: Binary encoding the optimization variable to determine the number of bits of the encoded optimization variable; Generate a first number of individuals corresponding to the number of encoding bits; A genetic population is constructed based on the first number of individuals.
3. The model training method according to claim 2, characterized in that: The method of obtaining the optimal structure of the agent model according to the optimal individual in the target genetic population includes: Decompiling the best individuals in the target genetic population to determine the optimal number of nodes in each layer; According to the optimal number of nodes in each layer, the optimal structure of the proxy model is obtained.
4. The model training method according to claim 2, characterized in that: The step of performing binary encoding on the optimization variable and determining the number of encoding bits of the encoded optimization variable comprises: Obtaining the number of input nodes and the number of output nodes in the optimization variable; Determine the minimum value between the number of input nodes and the number of output nodes as the lower limit value of the optimization variable; Calculating an upper limit value of the optimization variable based on the number of input nodes and the number of output nodes; The optimization variable is binary-coded according to the lower limit value and the upper limit value, and the number of coding bits of the encoded optimization variable is determined.
5. The model training method according to claim 1, characterized in that: The step of iterating the genetic population based on the fitness function until a target genetic population satisfying an iteration condition is obtained comprises: Based on the fitness function, extracting excellent individuals from the genetic population to obtain a breeding population including at least two excellent individuals; Iterating the breeding population according to a preset population size, a preset crossover rate, and a preset mutation rate to obtain an iterated genetic population; When the iteration condition is not met, the step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals is repeated until the iteration condition is met, and the obtained iterated genetic population is determined as the target genetic population.
6. The model training method according to claim 5, characterized in that: The step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals comprises: drawing a second number of individuals from the genetic population; Based on the fitness function, selecting an excellent individual from the second number of individuals; When the number of the excellent individuals is less than the third number, repeatedly extracting the second number of individuals from the genetic population until the third number of excellent individuals is obtained; A breeding population is constructed based on the third number of excellent individuals.
7. The model training method according to claim 5, characterized in that: The step of extracting excellent individuals from the genetic population based on the fitness function to obtain a breeding population including at least two excellent individuals comprises: Obtaining agent model parameters corresponding to each of the individuals; For each of the individuals, training a preset proxy model according to the proxy model parameters, and obtaining an actual fitness function value corresponding to the trained preset proxy model; Determining the evaluation value of each of the individuals according to the actual fitness function value corresponding to each of the individuals; Based on the evaluation value of each of the individuals, excellent individuals are extracted from the genetic population to obtain a breeding population including at least two excellent individuals.
8. A data prediction method, characterized in that: The data prediction method comprises: Obtain real-time operation data of tower crane; The real-time operation data is input into a data prediction agent model to obtain prediction data of the tower crane, wherein the data prediction agent model is obtained according to the model training method according to any one of claims 1 to 7.
9. A computing device, characterized in that include: a memory configured to store instructions; A processor is configured to call the instructions from the memory and to implement the model training method according to any one of claims 1 to 7, or the data prediction method in claim 8 when executing the instructions.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for causing a machine to execute the model training method according to any one of claims 1 to 7, or the data prediction method according to claim 8.