Model training and carbon emission data filling method based on hybrid heuristic optimization

By using a hybrid heuristic optimization method and combining the manta ray foraging and whale hunting strategies to optimize KNN hyperparameters, the problems of insufficient efficiency and effectiveness in filling carbon emission data were solved, and high-precision and low-cost data repair effects were achieved.

CN120806288APending Publication Date: 2025-10-17ZHONGSHAN POWER SUPPLY BUREAU OF GUANGDONG POWER GRID
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511282378.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The efficiency and effectiveness of carbon emission data filling in existing technologies are insufficient, and the KNN algorithm is highly dependent on hyperparameter selection, resulting in poor data filling results.

Method used

A hybrid heuristic optimization method is adopted, combining the foraging strategy of manta rays and the predation strategy of whales. The hyperparameter combination of KNN is optimized through an adaptive alternation mechanism. Dynamic weight factors are used to balance global search and local development. Chain foraging and spiral update strategies are introduced, combined with an elite retention mechanism, to optimize the carbon emission data filling model.

Benefits of technology

It significantly improves the efficiency and effectiveness of carbon emission data filling, achieves high-precision and low-computing-cost data repair, and is suitable for power system and industrial monitoring scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120806288A_ABST
    Figure CN120806288A_ABST
Patent Text Reader

Abstract

The invention provides a model training and carbon emission data filling method based on hybrid heuristic optimization. A hybrid heuristic algorithm combining a global search strategy and a local development strategy is adopted, and an adaptive alternating mechanism is introduced to dynamically adjust the execution probability of the two strategies, so that the problem that traditional model hyper-parameter selection depends on experience is solved. A target optimization function is defined based on carbon emission data distribution, and it is ensured that the optimization direction is aligned with the actual data restoration requirement; the hyper-parameter combination is converted into an individual capable of being iteratively optimized through population initialization, and a search basis is provided for an algorithm; the adaptive alternating mechanism preferentially executes global search in the earlier stage of iteration to expand a solution space, emphasizes local development in the later stage to perform fine tuning, avoids premature convergence and improves convergence precision; and finally, an optimal hyper-parameter combination is obtained through screening, so that the defect that a single optimization algorithm is easy to fall into local optimum is overcome, and low-cost and high-precision construction of a carbon emission data filling model is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of carbon emission analysis, and particularly relates to a model training and carbon emission data filling method based on hybrid heuristic optimization. BACKGROUND

[0002] Carbon emission data plays an important role in both economic and environmental factors, so it is necessary to obtain effective carbon emission data for related data analysis work. However, it is difficult to obtain complete carbon emission data at present, so it is necessary to detect, correct and fill in missing data for carbon emission data.

[0003] Among them, KNN, as a low-cost and efficient data filling algorithm in the field of artificial intelligence, plays an important role in such work. For example, in the power system, carbon emission data may be missing due to monitoring equipment failure, transmission interruption or other reasons, in order to ensure the continuity of carbon emission prediction and monitoring, KNN algorithm can be used to fill in the missing carbon emission data; in energy-intensive industries (such as steel, fertilizer and other industries), carbon emission data may be missing due to sudden events in operation or data transmission errors, at this time, KNN can use carbon emission data of other time points or similar facilities to supplement the missing data; in city management, air quality is closely related to carbon emission, in order to still be able to carry out carbon emission prediction in the case of missing data of monitoring stations, KNN is often used to fill in the missing carbon emission data of each monitoring point. These cases all reflect the practicality of KNN algorithm in carbon emission data missing filling application, but the effect of KNN algorithm is highly dependent on the selection of hyperparameters, how to effectively select hyperparameters to achieve good results when filling in data missing by using KNN algorithm is a problem to be solved.

[0004] Therefore, a model training method based on hybrid heuristic optimization and its corresponding carbon emission data filling method are needed to improve the efficiency and effectiveness of data filling. SUMMARY

[0005] The purpose of the present application is to at least solve one of the above technical defects, in particular, the technical defect of insufficient efficiency and effectiveness of carbon emission data filling in the prior art.

[0006] In a first aspect, the present application provides a model training method based on hybrid heuristic optimization, the method comprising:

[0007] determining a target optimization function according to the data distribution of the carbon emission original data set;

[0008] The target optimization function is used to indicate the accuracy of anomaly data repair of the to-be-optimized model.

[0009] initializing a population of a hybrid heuristic algorithm;

[0010] Each individual in the population represents a combination of hyperparameters to be optimized corresponding to the model to be optimized, the hybrid heuristic algorithm comprises a global search strategy and a local development strategy;

[0011] According to the adaptive alternating mechanism, the global search strategy and the local development strategy are executed, and a plurality of optimized hyperparameter combinations are obtained through a preset number of iterations;

[0012] According to the performance of each of the optimized hyperparameter combinations, the model parameters of the model to be optimized are determined, and a carbon emission data filling model is obtained.

[0013] As an optional implementation, the global search strategy is simulated according to a manta ray foraging strategy, and the local development strategy is simulated according to a whale predation strategy;

[0014] According to the adaptive alternating mechanism, the global search strategy and the local development strategy are executed, and a plurality of optimized hyperparameter combinations are obtained through a preset number of iterations;

[0015] A dynamic weight factor is determined, and a reference random number is determined;

[0016] The dynamic weight factor is used to indicate a first probability of each individual in the population executing the global search strategy and a second probability of executing the local development strategy in the current iteration round,

[0017] The first probability decreases with the increase of the number of iterations, the second probability increases with the increase of the number of iterations, and the event of each individual executing the global search strategy and the event of executing the local development strategy are opposite;

[0018] According to the dynamic weight factor and the reference random number, each individual in the population is iteratively executed the global search strategy or the local development strategy;

[0019] When the reference random number is less than the first probability, the global search strategy is executed for the corresponding individual, and when the reference random number is greater than or equal to the first probability, the local development strategy is executed for the corresponding individual;

[0020] When the number of iterations reaches a preset number or the target optimization function converges, a plurality of optimized hyperparameter combinations are obtained according to the values of each individual in the current population.

[0021] As an optional implementation, the manta ray foraging strategy comprises:

[0022] A chain foraging sub-strategy for adaptively adjusting the search direction according to the current optimal individual position, and a spiral foraging sub-strategy for introducing a random disturbance term and a decay factor;

[0023] The chain foraging sub-strategy is used to improve population diversity, and the spiral foraging sub-strategy is used to expand the search space.

[0024] As an optional implementation, the whale foraging strategy includes:

[0025] A contraction attack sub-strategy for approaching the optimal solution through a linearly decreasing contraction coefficient, and a spiral update sub-strategy for generating a spiral path based on the distance between the current individual and the optimal solution;

[0026] The initial value of the contraction coefficient is a preset upper limit and decreases with the number of iterations.

[0027] As an optional implementation, in the process of iteratively performing the global search strategy or the local development strategy on each individual in the population according to the dynamic weight factor, the method further includes:

[0028] After each iteration, compare the performance parameters of each individual in the population obtained in this iteration with the optimal individual obtained in the last iteration;

[0029] Retain the individual whose performance parameter is improved in this iteration, and retain the individuals ranked in the top preset percentage in terms of performance parameter in this iteration as the iteration population in the next iteration;

[0030] The performance parameter is calculated based on the output result of the target optimization function.

[0031] In a second aspect, the application provides a carbon emission data filling method based on a hybrid heuristic optimization, which includes:

[0032] Obtaining a carbon emission original data set;

[0033] According to a pre-trained carbon emission data filling model, updating the abnormal data or missing data in the carbon emission original data set to obtain a target carbon emission data set after filling;

[0034] The carbon emission data filling model is trained according to the model training method based on the hybrid heuristic optimization of the first aspect.

[0035] In a third aspect, the application provides a model training device based on a hybrid heuristic optimization, which includes:

[0036] A determination module is configured to determine a target optimization function according to the data distribution of a carbon emission original data set;

[0037] The target optimization function is used to indicate an anomaly data repair accuracy of the model to be optimized.

[0038] A processing module is configured to initialize a population of a hybrid heuristic algorithm.

[0039] Each individual in the population represents a combination of hyperparameters to be optimized corresponding to the model to be optimized, and the hybrid heuristic algorithm includes a global search strategy and a local development strategy.

[0040] The processing module is further configured to execute the global search strategy and the local development strategy according to an adaptive alternating mechanism, and obtain a plurality of combinations of hyperparameters optimized through a preset number of iterations.

[0041] The processing module is further configured to determine model parameters of the model to be optimized according to performances of the combinations of hyperparameters optimized, and obtain a carbon emission data filling model.

[0042] In a fourth aspect, the present application provides a carbon emission data filling device based on a hybrid heuristic optimization, which comprises:

[0043] An acquisition module is configured to acquire a carbon emission original data set.

[0044] An execution module is configured to update abnormal data or missing data in the carbon emission original data set according to a pre-trained carbon emission data filling model, and obtain a target carbon emission data set filled.

[0045] The carbon emission data filling model is obtained by training the model training device based on the hybrid heuristic optimization according to the third aspect.

[0046] In a fifth aspect, the present application provides a computer device, which comprises one or more processors and a memory, and the memory stores computer readable instructions, and the computer readable instructions are executed by the one or more processors to perform the steps of the method according to the first aspect or the second aspect.

[0047] In a sixth aspect, the present application provides a storage medium, which stores computer readable instructions, and the computer readable instructions are executed by one or more processors to make the one or more processors perform the steps of the method according to the first aspect or the second aspect.

[0048] From the above technical solutions, the embodiments of the present application have the following advantages:

[0049] Based on any of the above embodiments, the application solves the problem of traditional KNN highly dependent on hyperparameter selection in carbon emission data filling through a hybrid heuristic optimization framework. First, based on the distribution of carbon emission data, a target optimization function is defined to ensure that the optimization target is directly related to the accuracy of anomaly repair. Second, the global search ability of the manta ray foraging strategy and the local development ability of the whale predation strategy are combined to achieve adaptive alternating execution of the two strategies through a dynamic weight factor. Early emphasis on chain foraging improves population diversity, and later bias towards surrounding attack fine convergence avoids single algorithm falling into local optimum. The chain foraging strategy introduces random disturbance to expand the search space, and the spiral update strategy uses distance to generate path to enhance local exploration. The elite reservation mechanism continuously filters high-quality solutions to accelerate convergence. The above mechanisms significantly optimize the hyperparameter combination of KNN, enabling the model to efficiently repair data missing caused by device failure or transmission interruption in power system monitoring, industrial carbon emission and other scenarios. The finally trained filling model balances high precision and low computational cost, effectively improving the efficiency and effectiveness of data filling. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0051] Figure 1 The flowchart of the model training method based on hybrid heuristic optimization provided by an embodiment of the present application is shown in the figure.

[0052] Figure 2 The effect diagram of the data filling method not using hybrid heuristic optimization provided by an embodiment of the present application is shown in the figure.

[0053] Figure 3 The effect diagram of the data filling method using hybrid heuristic optimization provided by an embodiment of the present application is shown in the figure.

[0054] Figure 4 The internal structure diagram of the computer device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0056] Carbon emission data plays an important role in both economic and environmental factors, so it is necessary to obtain effective carbon emission data for related data analysis work. However, it is difficult to obtain complete carbon emission data at present, so it is necessary to detect, correct and fill in missing data for carbon emission data.

[0057] Among them, KNN, as a low-cost and efficient data filling algorithm in the field of artificial intelligence, plays an important role in such work. For example, in the power system, carbon emission data may be missing due to monitoring equipment failure, transmission interruption or other reasons, in order to ensure the continuity of carbon emission prediction and monitoring, KNN algorithm can be used to fill in the missing carbon emission data; In energy-intensive industries (such as steel, fertilizer and other industries), carbon emission data may be missing due to sudden events in operation or data transmission errors, at this time, KNN can use carbon emission data at other time points or similar facilities to supplement the missing data; In city management, air quality is closely related to carbon emission, in order to still be able to carry out carbon emission prediction in the case of missing data of monitoring station, KNN is often used to fill in the missing carbon emission data of each monitoring point. These cases all reflect the practicality of KNN algorithm in filling in the missing carbon emission data, but the effect of KNN algorithm is highly dependent on the selection of hyperparameters, how to effectively select hyperparameters to achieve good results when filling in the missing data with KNN algorithm is a problem to be solved.

[0058] KNN algorithm relies on the selection of hyperparameters when filling in the missing carbon emission data, how to efficiently find the optimal combination of hyperparameters to ultimately achieve high-quality filling of missing carbon emission data. The technical problem to be solved by the present application is to propose a hybrid heuristic algorithm, and to optimize the hyperparameters of the KNN algorithm using the algorithm, so as to obtain higher quality of missing data filling effect.

[0059] To sum up, the technical concept of the present application is that the present application solves the problem that the traditional KNN highly depends on the selection of hyperparameters in carbon emission data filling by using a hybrid heuristic optimization framework. First, a target optimization function is defined based on the distribution of carbon emission data to ensure that the optimization target is directly related to the accuracy of anomaly repair. Second, the global search ability of the manta ray foraging strategy and the local development ability of the whale predation strategy are combined, and the adaptive alternating execution of the two strategies is realized through a dynamic weight factor. In the early stage, the chain foraging strategy is focused on improving population diversity, and in the later stage, the surrounding attack is focused on fine convergence to avoid the local optimum of a single algorithm. The chain foraging strategy introduces random disturbance to expand the search space, and the spiral update strategy uses distance to generate a path to enhance local exploration. The elite retention mechanism continuously filters high-quality solutions to accelerate convergence. The above mechanisms significantly optimize the combination of KNN hyperparameters, enabling the model to efficiently repair data missing caused by device failure or transmission interruption in power system monitoring, industrial carbon emission, and other scenarios. The finally trained filling model balances high precision and low computational cost, effectively improving the efficiency and effectiveness of data filling.

[0060] The method provided by the present application is described in detail below according to the corresponding embodiments in some practical application scenarios. The present application optimizes the KNN algorithm and provides a hybrid heuristic algorithm of the whale optimization algorithm and the manta ray foraging optimization algorithm, i.e., the whale-manta hybrid algorithm, thereby optimizing the hyperparameters of KNN. Compared with some swarm intelligence optimization algorithms such as the whale optimization algorithm, the particle swarm optimization algorithm, and the artificial ecosystem optimization algorithm, the method has higher convergence precision, stronger global search and detailed local optimization ability, can better optimize the hyperparameters of the KNN algorithm, and effectively promotes the high-quality filling of missing carbon emission data under low-cost conditions.

[0061] Figure 1 The flowchart of the model training method based on hybrid heuristic optimization provided by an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the present application provides a model training and carbon emission data filling method based on hybrid heuristic optimization, which comprises the following steps.

[0062] S101, determining a target optimization function according to the data distribution of the carbon emission original data set;

[0063] The target optimization function is used to indicate the accuracy of anomaly data repair of the model to be optimized.

[0064] The target optimization function depends on the data distribution of the original data set and the model optimization target. In the application scenario of KNN, it can be the filling accuracy or error rate of the KNN algorithm on the data set under different hyperparameter combinations. For example, the target optimization function can be:

[0065]

[0066] wherein, is the combination of hyperparameters to be optimized, K represents how many nearest neighbor data are selected to fill in the missing values, distance represents the method of measuring the similarity between data points, and weighting is a classification variable representing different weight strategies.

[0067] The performance of KNN is affected by the hyperparameter K value and the distance measurement method (such as Euclidean distance, Manhattan distance, etc.). Given the objective function, the hyperparameters of KNN are optimized using a hybrid heuristic optimization algorithm, and finally the high-quality filling of missing carbon emission data is realized.

[0068] S102, initialize the population of the hybrid heuristic algorithm;

[0069] wherein each individual in the population represents a set of hyperparameters to be optimized corresponding to the model to be optimized, and the hybrid heuristic algorithm includes a global search strategy and a local development strategy;

[0070] In the scenario of the present application, the initialization step is to initialize the population individuals in the global search strategy (manta ray foraging strategy) and local development strategy (whale predation strategy) algorithms, and each individual represents a potential KNN hyperparameter combination.

[0071] For example, the optimization problem is:

[0072]

[0073] wherein, is the search space, d is the dimension, and X represents the search individual.

[0074] If the population size is initialized to N, the value of each individual can be:

[0075]

[0076] wherein, and are the upper and lower bounds of the search space, is a random number.

[0077] It should be noted that the random number has other uses in the present application, such as determining the strategy currently required to be executed by each population individual, which will be specifically described in the related embodiments.

[0078] S103, according to the adaptive alternating mechanism, execute the global search strategy and the local development strategy, and obtain a plurality of optimized hyperparameter combinations through a preset number of iterations;

[0079] The local development capability of the whale optimization algorithm and the global search capability of the mobula optimization algorithm are combined, and a self-adaptive alternating mechanism is used to dynamically adjust the search mode until convergence.

[0080] S104, according to the performance of each optimized super parameter combination, determine the model parameters of the model to be optimized, and obtain the carbon emission data filling model.

[0081] In this application, K-fold cross-validation can be used to evaluate the performance of the KNN model under different parameter combinations. The best-performing super parameter combination is selected as the final KNN model setting. Train the KNN model under the optimized super parameter setting to ensure the effectiveness and performance improvement of the algorithm.

[0082] This embodiment solves the problem of relying on experience in traditional KNN super parameter selection by combining a hybrid heuristic algorithm with global search strategy and local development strategy, and introducing a self-adaptive alternating mechanism to dynamically adjust the execution probability of the two strategies. First, define the target optimization function based on the distribution of carbon emission data to ensure that the optimization direction aligns with the actual data repair needs. Second, convert the super parameter combination into an individual that can be iteratively optimized through population initialization, providing a search basis for the algorithm. Then, the self-adaptive alternating mechanism prioritizes global search in the early iteration to expand the solution space, and focuses on local development in the later period to fine-tune, avoiding premature convergence while improving convergence accuracy. Finally, filter the optimal super parameter combination to train the model, significantly improving the accuracy of abnormal data repair. This method overcomes the defect of single optimization algorithm easily falling into local optimum, and realizes the construction of low-cost and high-precision carbon emission data filling model.

[0083] In fact, the main steps and mechanisms of the hybrid heuristic optimization algorithm provided in this application include:

[0084] Introduction of hybrid algorithm:

[0085] Define a dynamic weight factor to balance the use of global search strategy and local development strategy:

[0086]

[0087] Where T is the maximum number of iterations, and t is the current number of iterations.

[0088] For each individual, execute the global search strategy with probability Execute the global search strategy with probability Execute the local development strategy. As can be seen, with the increase of the number of iterations, each individual will pay more attention to local development, while the early stage focuses on global rough search.

[0089] The global search strategy simulates the chain foraging and spiral foraging strategies of mobula.

[0090] The chain foraging strategy is used to expand the searchable range and increase species population diversity:

[0091]

[0092] in: is the adaptive control factor, It is the optimal solution at present.

[0093] The spiral foraging strategy simulates a manta ray moving in a spiral around a food source:

[0094]

[0095] Where: b is the attenuation factor, is the perturbation random term.

[0096] The local development strategy achieves local optimization through encirclement attack and bubble net predation.

[0097] Bubble net encirclement stage:

[0098]

[0099] in, 、 Gradually shrink, is a random number.

[0100] Spiral Update Phase:

[0101]

[0102] Among them, D represents the distance between the current position and the optimal solution, and b represents the spiral morphology parameter.

[0103] Adaptive alternation mechanism:

[0104] To ensure a balance between global search and local development:

[0105]

[0106] Elite retention mechanism:

[0107] In order to prevent the effect from degrading, the population must be updated after each iteration, and the new population retains the performance of the previous iteration. The union of individuals with and all individuals with better performance than historical individuals.

[0108]

[0109] Termination conditions:

[0110] When the maximum number of iterations T is reached or the objective function converges, the optimal solution is returned:

[0111]

[0112] The specific implementation of each step and each mechanism will be specifically introduced below.

[0113] As an optional implementation, the global search strategy is obtained according to a manta ray foraging strategy simulation, and the local development strategy is obtained according to a whale predation strategy simulation;

[0114] The global search strategy and the local development strategy are executed according to the adaptive alternating mechanism, and an optimized plurality of hyperparameter combinations is obtained through a preset number of iterations, including:

[0115] A dynamic weight factor is determined, and a reference random number is determined;

[0116] The dynamic weight factor is used to indicate a first probability of each individual in the population executing the global search strategy and a second probability of each individual in the population executing the local development strategy in the current iteration round,

[0117] The first probability decreases with the increase of the number of iterations, the second probability increases with the increase of the number of iterations, and the event of each individual executing the global search strategy and the event of each individual executing the local development strategy are opposite;

[0118] According to the dynamic weight factor and the reference random number, each individual in the population iteratively executes the global search strategy or the local development strategy;

[0119] When the reference random number is less than the first probability, the global search strategy is executed for the corresponding individual, and when the reference random number is greater than or equal to the first probability, the local development strategy is executed for the corresponding individual;

[0120] When the number of iterations reaches a preset number or the target optimization function converges, an optimized plurality of hyperparameter combinations is obtained according to the values of each individual in the current population.

[0121] The embodiment quantifies the execution probability of global search and local development through a dynamic weight factor, and realizes adaptive switching by associating the number of iterations. The manta ray foraging strategy enhances the diversity of the early population, and the whale predation strategy strengthens the local convergence ability in the later period. The dynamic weight factor makes the first probability decrease with the iteration and the second probability increase, ensuring extensive exploration of the solution space in the early stage and focusing on fine search of the optimal solution neighborhood in the later stage. The introduction of the reference random number strictly separates the execution conditions of the two strategies, avoids strategy conflicts, and maintains the stability of the algorithm. This mechanism significantly improves the optimization efficiency of the hyperparameter combination, quickly approaches the global optimal solution within a preset number of iterations, and guarantees the high precision and robustness of the model.

[0122] As an optional implementation, the manta ray foraging strategy comprises:

[0123] a chain foraging sub-strategy of adaptively adjusting the search direction according to the current optimal individual position, and a spiral foraging sub-strategy of introducing a random disturbance term and a decay factor;

[0124] The chain foraging sub-strategy is used to improve population diversity, and the spiral foraging sub-strategy is used to expand the search space.

[0125] In this embodiment, the chain foraging sub-strategy adaptively adjusts the search direction by tracking the current optimal individual position, guides the population to move to a high-potential area, maintains the difference between individuals to improve diversity, and prevents premature convergence of the algorithm; the spiral foraging sub-strategy generates a spiral path around the optimal solution to expand the search range and avoid missing potential optimal solutions. Both of them break through the search limitations of traditional heuristic algorithms, significantly improve the comprehensiveness and efficiency of global exploration, and provide a wider high-quality solution space for hyperparameter optimization.

[0126] As an optional implementation, the whale predation strategy comprises:

[0127] an encirclement attack sub-strategy of approaching the optimal solution by a linearly decreasing contraction coefficient, and a spiral update sub-strategy of generating a spiral path based on the distance between the current individual and the optimal solution;

[0128] The initial value of the contraction coefficient is a preset upper limit and decreases with the number of iterations.

[0129] In this embodiment, the encirclement attack sub-strategy uses a linearly decreasing contraction coefficient to gradually reduce the search radius, initially locates the optimal solution area in a large range, and then finely adjusts in a small step to achieve stable convergence; the spiral update sub-strategy generates a spiral path according to the distance between the individual and the optimal solution, simulates the whale bubble net predation behavior, and explores the optimal solution from multiple angles in the local space. Dynamic regulation of the contraction coefficient balances the convergence speed and accuracy, avoids local oscillation, and significantly improves the local development efficiency and accuracy of the hyperparameter combination.

[0130] As an optional implementation, in the process of iteratively performing the global search strategy or the local development strategy on each individual in the population according to the dynamic weight factor, the method further comprises:

[0131] After each iteration, compare the performance parameters of each individual in the population obtained in this iteration with the optimal individual obtained in the last iteration;

[0132] Retain the individual whose performance parameter is improved in this iteration, and retain the individuals ranked in the top preset percentage in terms of the performance parameter in this iteration as the iteration population for the next time;

[0133] wherein the performance parameter is calculated based on an output result of the target optimization function.

[0134] The embodiment ensures that high-quality solutions continuously participate in subsequent optimization by retaining performance-improved individuals and top-ranking elite individuals after each iteration. The dynamic comparison mechanism of the performance parameter preferentially selects hyperparameter combinations with higher anomaly repair accuracy, avoiding the loss of high-quality solutions; the elite retention strategy maintains the competitiveness of the population, accelerating the convergence of the algorithm to a high-quality solution set. This operation significantly improves the stability and efficiency of the optimization process, providing hyperparameter combinations with higher reliability for model training.

[0135] As an optional embodiment, the application provides a carbon emission data filling method based on hybrid heuristic optimization, which comprises:

[0136] obtaining a carbon emission original data set;

[0137] updating the abnormal data or missing data in the carbon emission original data set according to the pre-trained carbon emission data filling model to obtain a target carbon emission data set after filling;

[0138] wherein the carbon emission data filling model is trained according to the model training method based on hybrid heuristic optimization of any embodiment.

[0139] Figure 2 An effect diagram of the data filling method not applying hybrid heuristic optimization provided by an embodiment of the application is shown in the following figure, Figure 3 An effect diagram of the data filling method applying hybrid heuristic optimization provided by an embodiment of the application is shown in the following figure, according to Figure 2 and Figure 3 It can be found that the filling model obtained by training has good filling accuracy when processing actual carbon emission data. The KNN model based on the hybrid heuristic optimization framework locks the optimal hyperparameter combination through the global-local collaborative search mechanism, significantly improving the accuracy of data filling; the adaptive alternating mechanism ensures that the model considers both repair accuracy and generalization ability. This method efficiently repairs missing data caused by equipment failure or transmission interruption in power system, industrial monitoring and other scenarios, providing a complete and reliable data basis for carbon footprint analysis.

[0140] The application also provides a model training device based on hybrid heuristic optimization, which comprises:

[0141] A determination module is configured to determine a target optimization function according to the data distribution of the carbon emission original data set.

[0142] The target optimization function is used to indicate the anomaly data repair accuracy of the model to be optimized.

[0143] a processing module configured to initialize a population of a hybrid heuristic algorithm;

[0144] Each individual in the population represents a combination of hyperparameters to be optimized corresponding to the model to be optimized, and the hybrid heuristic algorithm comprises a global search strategy and a local development strategy.

[0145] The processing module is further configured to execute the global search strategy and the local development strategy according to an adaptive alternating mechanism, and obtain a plurality of optimized combinations of hyperparameters through a preset number of iterations.

[0146] The processing module is further configured to determine model parameters of the model to be optimized according to the performance of each of the optimized combinations of hyperparameters, and obtain a carbon emission data filling model.

[0147] The embodiment solves the problem of relying on experience in traditional KNN hyperparameter selection by combining a hybrid heuristic algorithm of global search strategy and local development strategy, and introducing an adaptive alternating mechanism to dynamically adjust the execution probability of the two strategies. First, a target optimization function is defined based on the distribution of carbon emission data to ensure that the optimization direction aligns with the actual data repair needs. Second, the population initialization converts the combination of hyperparameters into an individual that can be iteratively optimized, providing a search basis for the algorithm. Then, the adaptive alternating mechanism prioritizes global search in the early iteration to expand the solution space, and focuses on local development in the later period to fine-tune, avoiding premature convergence while improving convergence accuracy. Finally, the optimal combination of hyperparameters is selected to train the model, significantly improving the accuracy of abnormal data repair. This method overcomes the defect of single optimization algorithm easily falling into local optimum, and realizes the construction of low-cost and high-precision carbon emission data filling model.

[0148] As an optional implementation, the global search strategy is obtained according to the manta ray foraging strategy simulation, and the local development strategy is obtained according to the whale predation strategy simulation.

[0149] The processing module executes the global search strategy and the local development strategy according to the adaptive alternating mechanism, and obtains a plurality of optimized combinations of hyperparameters through a preset number of iterations. The specific way includes:

[0150] determining a dynamic weight factor and a reference random number;

[0151] The dynamic weight factor is used to indicate a first probability of each individual in the population executing the global search strategy and a second probability of executing the local development strategy in the current iteration round,

[0152] and the first probability decreases with the increase of the iteration number, the second probability increases with the increase of the iteration number, and the event of each individual executing the global search strategy and the event of executing the local development strategy are opposite;

[0153] According to the dynamic weight factor and the reference random number, iteratively execute the global search strategy or the local development strategy for each individual in the population;

[0154] Wherein, when the reference random number is less than the first probability, the global search strategy is executed for the corresponding individual, and when the reference random number is greater than or equal to the first probability, the local development strategy is executed for the corresponding individual.

[0155] When the iteration number reaches a preset number or the target optimization function converges, obtain a plurality of optimized hyperparameter combinations according to the values of each individual in the current population.

[0156] The embodiment quantifies the execution probability of global search and local development through a dynamic weight factor, and realizes adaptive switching in association with the iteration number. The manta ray foraging strategy enhances the population diversity in the early stage, and the whale predation strategy strengthens the local convergence ability in the later stage. The dynamic weight factor makes the first probability decrease with the iteration and the second probability increase, ensuring extensive exploration of the solution space in the early stage and fine search in the optimal solution neighborhood in the later stage. The introduction of the reference random number strictly separates the execution conditions of the two strategies, avoids strategy conflicts, and maintains the stability of the algorithm. This mechanism significantly improves the optimization efficiency of hyperparameter combinations, quickly approaches the global optimal solution within a preset iteration number, and ensures the high precision and robustness of the model.

[0157] As an optional embodiment, the manta ray foraging strategy comprises:

[0158] A chain foraging sub-strategy for adaptively adjusting the search direction according to the current optimal individual position, and a spiral foraging sub-strategy for introducing a random disturbance term and a decay factor;

[0159] Wherein, the chain foraging sub-strategy is used to improve the population diversity, and the spiral foraging sub-strategy is used to expand the search space.

[0160] In the embodiment, the chain foraging sub-strategy adaptively adjusts the search direction by tracking the current optimal individual position, guides the population to move to the high potential area, maintains the difference between individuals to improve the diversity, and prevents the algorithm from converging too early. The spiral foraging sub-strategy generates a spiral path around the optimal solution to expand the search range, avoiding missing potential optimal solutions. The two strategies break through the search limitations of traditional heuristic algorithms, significantly improve the comprehensiveness and efficiency of global exploration, and provide a wider high-quality solution space for hyperparameter optimization.

[0161] As an optional implementation, the whale predation strategy comprises:

[0162] The surrounding attack sub-strategy approaches the optimal solution by a linearly decreasing contraction coefficient, and the spiral update sub-strategy generates a spiral path based on the distance between the current individual and the optimal solution;

[0163] The initial value of the contraction coefficient is a preset upper limit and decreases with the number of iterations.

[0164] In this embodiment, the surrounding attack sub-strategy gradually reduces the search radius by using a linearly decreasing contraction coefficient, initially locates the optimal solution region in a large range, and then finely adjusts in a small step to achieve stable convergence; the spiral update sub-strategy generates a spiral path according to the distance between the individual and the optimal solution, simulates the whale bubble net predation behavior, and explores the optimal solution from multiple angles in the local space. The dynamic regulation of the contraction coefficient balances the convergence speed and accuracy, avoids local oscillation, and significantly improves the local development efficiency and accuracy of the hyperparameter combination.

[0165] As an optional implementation, the processing module is further configured to, in the process of iteratively performing the global search strategy or the local development strategy on each individual in the population according to the dynamic weight factor:

[0166] After each iteration, compare the performance parameter of each individual in the population obtained in this iteration with the optimal individual obtained in the last iteration;

[0167] Retain the individual whose performance parameter is improved in this iteration, and retain the individuals ranked in the top preset percentage in terms of the performance parameter in this iteration as the iteration population in the next iteration;

[0168] The performance parameter is calculated based on the output result of the target optimization function.

[0169] The embodiment retains the individuals with improved performance and the elite individuals ranked in the top after each iteration, ensuring that high-quality solutions continuously participate in subsequent optimization. The dynamic comparison mechanism of the performance parameter preferentially selects hyperparameter combinations with higher repair accuracy, avoiding the loss of high-quality solutions; the elite retention strategy maintains the competitiveness of the population and accelerates the convergence of the algorithm to a high-quality solution set. This operation significantly improves the stability and efficiency of the optimization process and provides hyperparameter combinations with higher reliability for model training.

[0170] The application also provides a carbon emission data filling device based on a hybrid heuristic optimization, which comprises:

[0171] An acquisition module configured to acquire a carbon emission original data set;

[0172] The execution module is configured to update the abnormal data or missing data in the carbon emission raw data set according to the pre-trained carbon emission data filling model, and obtain a target carbon emission data set after filling.

[0173] The carbon emission data filling model is trained according to the foregoing model training device based on a hybrid heuristic optimization.

[0174] The embodiment applies the trained filling model to process actual carbon emission data. The KNN model based on the hybrid heuristic optimization framework locks the optimal hyperparameter combination through a global-local collaborative search mechanism, and significantly improves the accuracy of data filling. The adaptive alternating mechanism ensures that the model considers both repair accuracy and generalization ability. This method efficiently repairs missing data caused by equipment failure or transmission interruption in power systems, industrial monitoring and other scenarios, and provides a complete and reliable data foundation for carbon footprint analysis.

[0175] It should be noted that the division of each module of the above device is only a logical functional division, and all or part of it can be integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by the processing element; all can be implemented in the form of hardware; some modules can be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware. For example, the processing module can be a separate processing element, or it can be integrated into a chip of the above device, in addition, it can also be stored in the form of program code in the memory of the above device, and the function of the above determination module is called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each module can be completed by the integrated logic circuit of the hardware or the instruction of the software in the processor element.

[0176] Schematically, as Figure 4 shown, Figure 4 The computer device 300 can be provided as a server. Referring to Figure 4 , the computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301, for storing instructions executable by the processing component 302, such as an application program. The application program stored in the memory 301 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute the instructions to perform the method of any of the above embodiments.

[0177] The computer device 300 can further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 can operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0178] Those skilled in the art can understand that, Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0179] The embodiment of the present application provides a storage medium, the storage medium stores computer readable instructions, and the computer readable instructions are executed by one or more processors to make the one or more processors execute the method provided by any one of the embodiments.

[0180] Finally, it should be noted that in this document, relational terms such as first and second and the like can only be used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising", or any other variation thereof are intended to cover non-exclusive inclusions, such that a process, method, article, or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0181] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The various embodiments can be combined as needed, and the same and similar parts refer to each other.

[0182] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A model training method based on hybrid heuristic optimization, characterized in that: The method comprises: Determine the target optimization function based on the data distribution of the original carbon emission data set; The target optimization function is used to indicate the abnormal data repair accuracy of the model to be optimized; Initialize the population of the hybrid heuristic algorithm; Each individual in the population represents a set of hyperparameter combinations to be optimized corresponding to the model to be optimized, and the hybrid heuristic algorithm includes a global search strategy and a local development strategy; Executing the global search strategy and the local development strategy according to the adaptive alternation mechanism, and obtaining optimized multiple hyperparameter combinations after a preset number of iterations; According to the performance of each of the optimized hyperparameter combinations, the model parameters of the model to be optimized are determined to obtain a carbon emission data filling model.

2. The method according to claim 1, characterized in that The global search strategy is obtained by simulating the manta ray's foraging strategy, and the local development strategy is obtained by simulating the whale's predation strategy; The global search strategy and the local development strategy are executed according to the adaptive alternation mechanism to obtain optimized multiple hyperparameter combinations after a preset number of iterations, including: Determine the dynamic weight factor and the reference random number; The dynamic weight factor is used to indicate the first probability of each individual in the population executing the global search strategy and the second probability of executing the local development strategy in the current iteration round. The first probability decreases as the number of iterations increases, the second probability increases as the number of iterations increases, and the event of each individual executing the global search strategy is opposed to the event of executing the local development strategy; Iteratively executing the global search strategy or the local development strategy on each individual in the population according to the dynamic weight factor and the reference random number; When the reference random number is less than the first probability, the global search strategy is executed for the corresponding individual; when the reference random number is greater than or equal to the first probability, the local development strategy is executed for the corresponding individual; When the number of iterations reaches a preset number or the target optimization function converges, multiple optimized hyperparameter combinations are obtained based on the values ​​of each of the individuals in the current population.

3. The method according to claim 2, characterized in that The manta ray foraging strategies include: A chain foraging sub-strategy that adaptively adjusts the search direction according to the current optimal individual position, and a spiral foraging sub-strategy that introduces a random perturbation term and a decay factor; The chain foraging sub-strategy is used to improve population diversity, and the spiral foraging sub-strategy is used to expand the search space.

4. The method according to claim 2, characterized in that The whale's hunting strategy includes: The encirclement attack sub-strategy approaches the optimal solution through a linearly decreasing shrinkage coefficient, and the spiral update sub-strategy generates a spiral path based on the distance between the current individual and the optimal solution; The initial value of the shrinkage coefficient is a preset upper limit and decreases with the number of iterations.

5. The method according to any one of claims 2 to 4, characterized in that: In the process of iteratively executing the global search strategy or the local development strategy on each individual in the population according to the dynamic weight factor, the method further comprises: After each iteration, the performance parameters of each individual in the population obtained in this iteration are compared with the performance parameters of the best individual obtained in the previous iteration; Retain the individuals whose performance parameters have been improved in this iteration, and retain the individuals whose performance parameters rank in the top preset percentage in this iteration as the population for the next iteration; The performance parameters are calculated based on the output results of the target optimization function.

6. A carbon emission data filling method based on hybrid heuristic optimization, characterized in that: The method comprises: Obtain the original carbon emission data set; According to the pre-trained carbon emission data filling model, abnormal data or missing data in the original carbon emission data set are updated to obtain a filled target carbon emission data set; The carbon emission data filling model is obtained by training using the model training method based on hybrid heuristic optimization according to any one of claims 1 to 5.

7. A model training device based on hybrid heuristic optimization, characterized in that: The device comprises: A determination module is used to determine the target optimization function based on the data distribution of the original carbon emission data set; The target optimization function is used to indicate the abnormal data repair accuracy of the model to be optimized; The processing module is used to initialize the population of the hybrid heuristic algorithm; Each individual in the population represents a set of hyperparameter combinations to be optimized corresponding to the model to be optimized, and the hybrid heuristic algorithm includes a global search strategy and a local development strategy; The processing module is further configured to execute the global search strategy and the local development strategy according to an adaptive alternating mechanism, and obtain optimized multiple hyperparameter combinations after a preset number of iterations; The processing module is further used to determine the model parameters of the model to be optimized based on the performance of each of the optimized hyperparameter combinations, and obtain a carbon emission data filling model.

8. A carbon emission data filling device based on hybrid heuristic optimization, characterized in that: The device comprises: Acquisition module, used to obtain the original carbon emission data set; An execution module is configured to update abnormal data or missing data in the original carbon emission data set according to a pre-trained carbon emission data filling model to obtain a filled target carbon emission data set; Wherein, the carbon emission data filling model is obtained by training using the model training device based on hybrid heuristic optimization according to claim 7.

9. A computer device, characterized in that: The method comprises one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the method according to any one of claims 1 to 5 or claim 6 are performed.

10. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, enable the one or more processors to perform the steps of the method according to any one of claims 1 to 5 or claim 6.