CN114970864A - Model updating method and device, electronic equipment and storage medium - Google Patents

Model updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114970864A
CN114970864A CN202210468357.7A CN202210468357A CN114970864A CN 114970864 A CN114970864 A CN 114970864A CN 202210468357 A CN202210468357 A CN 202210468357A CN 114970864 A CN114970864 A CN 114970864A
Authority
CN
China
Prior art keywords
model
fusion model
prediction
difference information
current fusion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210468357.7A
Other languages
Chinese (zh)
Inventor
钟成
周颖婕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhugao Intelligent Technology Shenzhen Co ltd
Original Assignee
Zhugao Intelligent Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhugao Intelligent Technology Shenzhen Co ltd filed Critical Zhugao Intelligent Technology Shenzhen Co ltd
Priority to CN202210468357.7A priority Critical patent/CN114970864A/en
Publication of CN114970864A publication Critical patent/CN114970864A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a model updating method, a model updating device, electronic equipment and a storage medium, wherein the method comprises the following steps: in the process of reasoning a current fusion model in a target service scene, acquiring first prediction difference information of the current fusion model, if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting a fusion coefficient of a sub-model in the current fusion model to generate the target fusion model, if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model, and after the training of the sub-model is completed, adjusting the fusion coefficient of the sub-model in the current fusion model to generate the target fusion model. The performance of the model is automatically detected through the prediction difference information, so that the performance of the model can be found to be abnormal and the model can be updated on line before the performance of the model is reduced to a critical value of a use standard, and the effectiveness of the performance of the model is ensured.

Description

Model updating method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a model updating method, a model updating apparatus, an electronic device, and a computer-readable storage medium.
Background
The artificial intelligence model is mainly divided into two stages of training and reasoning from the application point of view. And in the training stage, a large amount of historical data which occur under a specific scene is used for optimizing and training the model to obtain a pre-training model which accords with the expectation. And inputting real-time data to the pre-training model in an inference stage in the production environment to obtain an inference result of the model.
However, from the practical application, the situation and the data under a specific scene are changed all the time, the pre-training model based on the historical structure and the data also has the problem of 'freshness', and if the model is not updated for a long time, the inference accuracy rate is inevitably worse and worse.
Taking photovoltaic power prediction of a photovoltaic power station as an example, the photovoltaic power prediction accuracy depends on factors such as weather modes and weather conditions, along with the change of the factors such as the weather modes and the weather conditions, the data processing performance of the model is gradually reduced, even the model fails, and for the conditions such as the reduction of the model performance or the model failure, the model is updated and upgraded manually after the photovoltaic power prediction is seriously abnormal or is found to be reduced to a critical value of a use standard in an examination stage. Therefore, by adopting the model updating mode, the model can not be updated in time easily, and a large amount of labor cost is consumed.
Disclosure of Invention
Embodiments of the present invention provide a model updating method, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve or partially solve the problems that a model cannot be updated in time and a large amount of labor cost is consumed in the related art.
The embodiment of the invention discloses a model updating method, which comprises the following steps:
acquiring first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target service scene; the current fusion model is obtained by fusing at least two sub-models;
if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model;
if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
Optionally, in the process of reasoning by the current fusion model in the target service scene, acquiring first prediction difference information of the current fusion model, where the acquiring includes:
acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data;
inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model;
and comparing the first prediction information with reference information corresponding to the real-time scene data to obtain first prediction difference information.
Optionally, the adjusting the fusion coefficient of the sub-model in the current fusion model to generate the target fusion model includes:
acquiring first model training data aiming at the current fusion model; the first model training data comprise first historical scene data and reference information corresponding to the first historical scene data;
inputting the first historical scene data into a current fusion model to obtain second prediction information;
comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information;
and adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
Optionally, the training the sub-models in the current fusion model includes:
acquiring second model training data for the sub-model; the second model training data comprises second historical scene data and reference information corresponding to the second historical scene data;
and training the submodel by adopting the second historical scene data to obtain the trained submodel.
Optionally, the training the submodel by using the second historical scene data to obtain a trained submodel includes:
inputting the second historical scene data into a current fusion model to obtain third prediction information;
comparing the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information;
and when the third prediction difference information meets the training end condition corresponding to the target service scene, obtaining a sub-model after training is finished.
Optionally, the third prediction difference information satisfying the training end condition includes: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
Optionally, each sub-model in the current fusion model has a corresponding model library, and the training of the sub-models by using the second historical scene data to obtain the trained sub-models includes:
training each model in the model base by adopting a certain amount of second historical scene data;
and after the training of each model in the model base is finished, selecting a model with the minimum prediction difference information from the model base as a trained sub-model.
Optionally, after the generating the target fusion model, the method further includes:
acquiring test scene data and reference information corresponding to the test scene data; the test scene data is real-time scene data or historical scene data within a certain time;
inputting the test scene data into the current fusion model to obtain fourth prediction information, and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information;
fourth prediction difference information that specifies reference information corresponding to the fourth prediction information and the test scenario data, and fifth prediction difference information that specifies reference information corresponding to the fifth prediction information and the test scenario data;
and if the performance of the target fusion model represented by the fifth prediction difference information is superior to that of the current fusion model represented by the fourth prediction difference information, replacing the current fusion model in the target service scene with the target fusion model.
Optionally, after the comparing the prediction difference information of the current fusion model with the prediction difference information of the target fusion model, the method further includes:
if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, returning to the process of executing the current fusion model inference in the target service scene to obtain the first prediction information of the current fusion model, or returning to the process of executing the current fusion model inference in the target service scene by taking the target fusion model as the current fusion model to obtain the first prediction information of the current fusion model.
Optionally, the method further comprises:
and if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, sending an alarm to a worker.
The embodiment of the invention also discloses a model updating device, which comprises:
the difference information acquisition module is used for acquiring first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target service scene; the current fusion model is obtained by fusing at least two sub-models; if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, executing a first model updating module; if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, executing a second model updating module;
the first model updating module is used for adjusting the fusion coefficient of the sub-models in the current fusion model to generate a target fusion model;
the second model updating module is used for training the sub-models in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
Optionally, the difference information obtaining module includes
The first data acquisition submodule is used for acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data;
the first information prediction submodule is used for inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model;
and the first difference determining submodule is used for comparing the first prediction information with the reference information to obtain first prediction difference information.
Optionally, the first model updating module includes:
the second data acquisition submodule is used for acquiring first model training data aiming at the current fusion model; the first model training data comprises first historical scene data and reference information corresponding to the first historical scene data;
the second information prediction submodule is used for inputting the first historical scene data into the current fusion model to obtain second prediction information;
the second difference determining submodule is used for comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information;
and the coefficient adjusting submodule is used for adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
Optionally, the second model updating module includes:
a third data acquisition submodule for acquiring second model training data for the sub-models; the second model training data comprises second historical scene data and reference information corresponding to the second historical scene data;
and the sub-model training sub-module is used for training the sub-model by adopting the second historical scene data to obtain the trained sub-model.
Optionally, the sub-model training sub-module includes:
the information prediction unit is used for inputting the second historical scene data into a current fusion model to obtain third prediction information;
a difference determining unit, configured to compare the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information;
and the training ending unit is used for obtaining a trained sub-model when the third prediction difference information meets the training ending condition corresponding to the target service scene.
Optionally, the third prediction difference information satisfying the training end condition includes: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
Optionally, each of the submodels in the current fusion model has a corresponding model library, and the submodel training submodule includes:
the model training unit is used for training each model in the model base by adopting a certain amount of the second historical scene data;
and the model selection unit is used for selecting the model with the minimum prediction difference information from the model base as the trained sub-model after the training of each model in the model base is finished.
Optionally, the method further comprises:
the data acquisition module is used for acquiring test scene data and reference information corresponding to the test scene data; the test scene data is real-time scene data or historical scene data within a certain time;
the information prediction module is used for inputting the test scene data into the current fusion model to obtain fourth prediction information and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information;
a difference determining module, configured to determine fourth prediction difference information of the fourth prediction information and reference information corresponding to the test scenario data, and determine fifth prediction difference information of the fifth prediction information and the reference information corresponding to the test scenario data;
and the model replacing module is used for replacing the current fusion model in the target service scene by the target fusion model if the performance of the target fusion model represented by the fifth prediction difference information is better than the performance of the current fusion model represented by the fourth prediction difference information.
Optionally, the method further comprises:
and the return execution module is used for returning to execute the difference information acquisition module if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, or returning to execute the difference information acquisition module by taking the target fusion model as the current fusion model.
Optionally, the method further comprises:
and the alarm sending module is used for sending an alarm to a worker if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed is a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages: the method comprises the steps of obtaining first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target business scene, adjusting a fusion coefficient of a sub-model in the current fusion model to generate a target fusion model if the first prediction difference information meets a first prediction abnormal condition corresponding to the target business scene, training the sub-model in the current fusion model if the first prediction difference information meets a second prediction abnormal condition corresponding to the target business scene, and adjusting the fusion coefficient of the sub-model in the current fusion model to generate the target fusion model after the sub-model is trained. In the process of reasoning of the current fusion model, the performance of the current fusion model is automatically detected through the first prediction difference information of the current fusion model, so that the performance abnormality of the current fusion model can be found in advance before the performance of the current fusion model is lower than a critical value of a use standard, the effectiveness of the performance of the current fusion model is ensured, and the safety risk and the economic loss caused by the inaccuracy of the output prediction information of the current fusion model are avoided. Meanwhile, the model can be prevented from being upgraded manually, and the maintenance cost of the current fusion model is reduced.
In addition, the performance degradation condition of the current fusion model can be determined according to the first prediction difference information, and different updating modes are adopted to adapt to online updating of the current fusion model, so that the updating efficiency of online updating of the current fusion model is improved, and the online updating cost is reduced. Specifically, when the performance of the current fusion model is greatly reduced, the submodel in the current fusion model is trained, and after the submodel training is completed, the fusion coefficient of the submodel in the current fusion model is adjusted to ensure the accuracy and the effectiveness of the fusion model. When the performance of the current fusion model is reduced, the fusion coefficient of the submodel in the current fusion model is adjusted, increment training is not required to be carried out on each submodel in the current fusion model, the accuracy and the effectiveness of the fusion model are guaranteed, meanwhile, the collection of training samples can be effectively reduced, the collection cost of the training samples is effectively reduced, and the data collection cost is reduced.
Drawings
FIG. 1 is a schematic flow chart of a model updating method provided in an embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of another model updating method provided in an embodiment of the present invention;
FIG. 3 is a schematic flow chart of online model update provided in an embodiment of the present invention;
fig. 4 is a block diagram of a model updating apparatus provided in an embodiment of the present invention;
fig. 5 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The artificial intelligence model is widely applied to various fields of entertainment, education, traffic, industry and the like. For example, in a photovoltaic power station in the industrial field, the photovoltaic power of the photovoltaic power station can be predicted through a trained artificial intelligence model, so that the control and scheduling performance of the photovoltaic power station is improved, and the safe and stable operation of a power grid accessed by high-ratio photovoltaic power generation is guaranteed.
However, as factors such as weather modes and weather conditions change and the environmental monitor and the photovoltaic module age, data processing performance of the model gradually decreases, and even the model fails, and for the cases such as the model performance decrease or the model failure, the model is often updated and upgraded manually after serious abnormality occurs in photovoltaic power prediction or the photovoltaic power is found to decrease to a critical value of a use standard in an examination stage. Therefore, by adopting the model updating mode, the model can not be updated in time easily, and a large amount of labor cost is consumed.
Based on the above, one of the core invention points of the present invention is to perform automatic performance detection and online update on the current fusion model during the inference process of the current fusion model, and may find the performance abnormality of the current fusion model in advance and perform online update on the current fusion model before the model performance is reduced to the critical value of the usage standard. The problem that the models cannot be updated in time and a large amount of labor cost is consumed is solved.
Referring to fig. 1, a flow diagram of a model updating method provided in the embodiment of the present invention is shown, which may specifically include the following steps:
step 101: in the process of reasoning of a current fusion model in a target service scene, first prediction difference information of the current fusion model is obtained.
The current fusion model is obtained by fusing at least two sub-models; the target service scene can be a wind power generation scene, a photovoltaic power generation scene and the like, and the target service scene is not limited in the embodiment of the invention.
The first prediction difference information represents the difference between the prediction information and the real information output in the inference process of the current fusion model, and the first prediction difference information can be used for evaluating the model performance of the current fusion model.
Specifically, in the process of reasoning by the current fusion model in the target service scene, the prediction information output by the reasoning of the current fusion model is compared with the real information output by the target service scene to obtain first prediction difference information of the current fusion model.
When the first prediction difference information of the current fusion model is obtained, whether the performance of the current fusion model is abnormal or not can be judged through the first prediction difference information of the current fusion model, for example, when the first prediction difference information meets a prediction abnormal condition, the performance of the fusion model is abnormal. The predicted exception condition may be set according to actual needs of the target service scenario, for example, the predicted exception condition may be a specific detection threshold. As an example, it can be determined whether the fusion model has abnormal performance in a plurality of ways, specifically as follows: when first prediction difference information meets a prediction abnormal condition for one time, judging that the performance of the current fusion model is abnormal; when the first prediction difference information continuously exists for multiple times and meets the prediction abnormity condition, judging that the performance of the current fusion model is abnormal; and thirdly, when the average value of the first prediction difference information for a plurality of times meets the prediction abnormity condition, judging that the performance of the current fusion model is abnormal.
When the first prediction difference information represents that the performance of the current fusion model is abnormal, the fact that the performance of the current fusion model is close to the edge of the use standard is indicated, therefore, the current fusion model needs to be updated on line, a target fusion model with better performance is generated to replace the current fusion model, and the effectiveness of the performance of the fusion model is guaranteed.
When determining that the performance of the current fusion model is abnormal according to the first prediction difference information, updating the current fusion model by adopting different model updating modes based on the performance abnormal degree of the current fusion model, which is specifically as follows:
step 102: and if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
The sub-models in the current fusion model can be fused in a simple function manner such as voting and linear weighting, and can also be fused in a complex nonlinear model.
Accordingly, the fusion coefficient may include a linear fusion coefficient and a non-linear fusion coefficient based on the difference of the fusion mode of the current fusion model. Taking a linear fusion coefficient as an example, each sub-model in the fusion model is obtained by fusing through linear weighting, the weight coefficient of each sub-model is a linear fusion coefficient, and the adjustment of the fusion coefficient is the adjustment of the weight coefficient of each sub-model.
Specifically, if the first preset difference information meets a first prediction abnormal condition corresponding to the target service scene, it indicates that the performance of the current fusion model is reduced less, and the performance of the current fusion model can be restored only by adjusting the fusion coefficient of the submodel in the current fusion model, so that incremental training of each submodel in the current fusion model is not needed, and only a small amount of training data is needed to fine-tune the fusion coefficient of the submodel in the current fusion model to generate the target fusion model to replace the current fusion model.
Step 103: if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
Specifically, when the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, it is indicated that the performance degradation of the current fusion model is large, the fusion coefficient of the submodel in the current fusion model is adjusted alone, and the performance of the current fusion model may not be recovered, so that the submodel in the current fusion model needs to be incrementally trained, and after the training of the submodel is completed, the fusion coefficient of the submodel in the current fusion model is adjusted to generate the target fusion model.
The first prediction difference information can be used for representing the abnormal degree of the running performance of the current fusion model, different model updating modes can be selected for different abnormal degrees, and the first prediction abnormal condition can be a condition for updating the model by selecting the first updating mode under the condition that the performance of the current fusion model is reduced less; the second prediction abnormal condition may be a condition for selecting a second updating mode to update the model when the performance of the current fusion model is greatly reduced. As an example, the first prediction difference information may be a first prediction difference value, and for the current fusion model, the first prediction exception condition may be set to a first threshold value, and the second prediction exception condition may be set to a second threshold value, where the second threshold value is greater than the first threshold value, and the first threshold value and the second threshold value are values greater than 0.
When the first prediction difference value is larger than the first threshold and smaller than the second threshold, the situation that the performance of the current fusion model is reduced less is indicated, therefore, the first updating mode is selected to update the current fusion model, a small amount of training data is adopted to adjust the fusion coefficient of the sub-models in the current fusion model, the target fusion model is generated to replace the current fusion model, and the effectiveness of the performance of the fusion model is guaranteed.
When the first prediction difference value is larger than or equal to the second threshold value, the situation that the performance of the current fusion model is greatly reduced is indicated, the second updating mode is selected to update the current fusion model, the sub-models in the current fusion model are trained, after the sub-models are trained, the fusion coefficient of the sub-models in the current fusion model is adjusted, the target fusion model is generated to replace the current fusion model, and the effectiveness of the performance of the fusion model is guaranteed.
It should be noted that, in the model updating method, the detection manner of the performance of the current fusion model corresponding to the target service scene is performed in the process of normal operation of the target service scene and the current fusion model corresponding to the target service scene, and specifically, whether the performance of the current fusion model is abnormal may be determined according to each prediction of the current fusion model, but is not limited to this, and the performance of the current fusion model may also be determined according to the service scene and the processing capability of the device by specifically selecting a time interval, for example, once every other day, three days, a week, or the like.
In the model updating method, in the process of reasoning the current fusion model in a target service scene, first prediction difference information of the current fusion model is obtained, and the performance of the current fusion model is automatically detected through the first prediction difference information of the current fusion model, so that the performance of the current fusion model can be found to be abnormal in advance before the performance of the current fusion model is lower than a use standard, the effectiveness of the performance of the fusion model is ensured, and the safety risk and economic loss caused by the inaccuracy of output prediction information of the current fusion model are avoided. Meanwhile, the model can be prevented from being manually upgraded, and the maintenance cost of the current fusion model is reduced.
In addition, the performance degradation condition of the current fusion model can be determined according to the first prediction difference information, and different updating modes are adopted to adapt to online updating of the current fusion model, so that the updating efficiency of online updating of the current fusion model is improved, and the online updating cost is reduced. Specifically, when the performance of the current fusion model is greatly reduced, the submodel in the current fusion model is trained, and after the submodel training is completed, the fusion coefficient of the submodel in the current fusion model is adjusted to ensure the accuracy and the effectiveness of the fusion model. When the performance of the current fusion model is reduced, the fusion coefficient of the submodel in the current fusion model is adjusted, increment training is not required to be carried out on each submodel in the current fusion model, the accuracy and the effectiveness of the fusion model are guaranteed, meanwhile, the collection of training samples can be effectively reduced, the collection cost of the training samples is effectively reduced, and the data collection cost is reduced.
Referring to fig. 2, a flow diagram of another model updating method provided in the embodiment of the present invention is shown, which may specifically include the following steps:
step 201: acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data.
The scene data is data corresponding to the target service scene, and the real-time scene data may be scene data of a current time, scene data from a certain time before the current time to the current time, or predicted scene data from a certain time after the current time to the current time. Taking a photovoltaic power generation scene as an example, the real-time scene data may be a predicted irradiance, a predicted temperature, a predicted humidity, a predicted wind speed, a predicted pressure, and the like.
The reference information is real information generated by the target service scene under the real-time scene data, and the reference information is used for evaluating the prediction information after the model outputs the prediction information based on the real-time scene data.
Specifically, in the process of running a target service scene, real-time scene data corresponding to the target service scene and reference information corresponding to the real-time scene data are acquired. Taking a photovoltaic power generation scene as an example, because the real-time scene data may be predicted scene data generated based on weather forecast data or/and actual measurement data, the real-time scene data of the photovoltaic power generation scene is acquired before photovoltaic power generation, the photovoltaic power is predicted through the real-time scene data, then the real photovoltaic power is output in the process of power generation of the photovoltaic power generation scene, and the real photovoltaic power output is acquired as reference information.
Step 202: and inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model.
The current fusion model is obtained by fusing at least two sub-models, and aiming at some complex service scenes, the problems of easy falling into local optimization, low prediction precision, large error amplitude and the like exist in the single model, so that multiple models can be combined, the prediction error amplitude of each single model is reduced, and the prediction precision is improved.
The structure or/and the trained data of each sub-model in the current fusion model are different. As an example, each sub-model in the current fusion model may be a model pre-trained in a different manner for the same training data set, or a model pre-trained in the same or different manner for different training data sets. The different training data sets may refer to different data included in the training data sets, for example, the data in the training data set a includes solar irradiance, wind speed, and temperature, and the data in the training data set B includes solar irradiance, temperature, and humidity. The different training data sets may also mean that the data included in the training data set are the same, but the time spans corresponding to the data are different, for example, the data in the training data set a and the training data set B both include solar irradiance, wind speed, temperature, and humidity, but the data in the training data set a is the data acquired on a certain day, and the data in the training data set B is the data acquired on a certain week.
Specifically, in the process of reasoning of the current fusion model, the acquired real-time scene data corresponding to the target service scene is input into the current fusion model, and first prediction information for the real-time scene data is output. The first prediction information is prediction information of the target service scene within a period of time in the future, and the time length predicted by the current fusion model is not limited by the invention. Taking a photovoltaic power generation scene as an example, photovoltaic power generation power prediction generally refers to prediction of photovoltaic power change in a period of time in the future, and from the prediction time length, the prediction can be divided into ultra-short term prediction, short term prediction and medium and long term prediction. The ultra-short term generally means to predict power change within 4 hours in the future, the short term generally means to predict photovoltaic power change within 7 days in the future, and the medium-long term is mostly counted in months or years.
Step 203: and comparing the first prediction information with reference information corresponding to the real-time scene data to obtain first prediction difference information.
Specifically, after first prediction information of the current fusion model and reference information corresponding to the real-time scene data are obtained, the first prediction information and the reference information are compared to obtain first prediction difference information. Since the reference information is real information output by the target service scene, the performance of the current fusion model can be evaluated by the first prediction difference information determined by the first prediction information and the reference information corresponding to the first prediction information. Taking a photovoltaic power generation scene as an example, the current fusion model predicts the photovoltaic power generation power (first prediction information) of the photovoltaic power generation field in a future day, actually measures the real photovoltaic power generation power output (reference information) of the day in the photovoltaic power generation process, and obtains the difference between the predicted photovoltaic power generation power and the real photovoltaic power generation power output by comparing the predicted photovoltaic power generation power and the real photovoltaic power generation power output, so as to determine the prediction precision of the current fusion model, namely the first prediction difference information.
Step 204: and if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
The sub-models in the current fusion model can be fused in a simple function mode such as voting and linear weighting, and can also be fused in a complex nonlinear model. Taking the example that each sub-model in the current fusion model is fused by linear weighting, the weighted coefficient of each sub-model is the fusion coefficient, and the adjustment of the fusion coefficient is the adjustment of the weighted coefficient of each sub-model.
Specifically, if the first preset difference information meets a first prediction abnormal condition corresponding to a target service scene, it indicates that performance of the current fusion model is reduced less, and performance of the current fusion model can be restored only by adjusting a fusion coefficient of a submodel in the current fusion model, so that incremental training of each submodel in the current fusion model is not needed, only a small amount of training data is needed to fine-tune the fusion coefficient of the submodel in the current fusion model, and the target fusion model is generated to replace the current fusion model.
Step 205: if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
Specifically, when the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, it is indicated that the performance degradation of the current fusion model is large, the fusion coefficient of the submodel in the current fusion model is adjusted alone, and the performance of the current fusion model may not be recovered, so that the submodel in the current fusion model needs to be incrementally trained, and after the training of the submodel is completed, the fusion coefficient of the submodel in the current fusion model is adjusted to generate the target fusion model.
The first prediction difference information can be used for representing the abnormal degree of the operation performance of the current fusion model, different model updating modes can be selected for different abnormal degrees, and the first prediction abnormal condition can be a condition for updating the model by selecting the first updating mode under the condition that the performance of the current fusion model is reduced less; the second prediction abnormal condition may be a condition for selecting a second updating mode to update the model when the performance of the current fusion model is greatly reduced. As an example, the first prediction difference information may be a first prediction difference value, and for the current fusion model, the first prediction exception condition may be set to a first threshold value, and the second prediction exception condition may be set to a second threshold value, where the second threshold value is greater than the first threshold value, and the first threshold value and the second threshold value are values greater than 0.
When the first prediction difference value is larger than the first threshold and smaller than the second threshold, the situation that the performance of the current fusion model is reduced less is indicated, therefore, the first updating mode is selected to update the current fusion model, a small amount of training data is adopted to adjust the fusion coefficient of the sub-models in the current fusion model, the target fusion model is generated to replace the current fusion model, and the effectiveness of the performance of the fusion model is guaranteed.
When the first prediction difference value is larger than or equal to the second threshold value, the situation that the performance of the current fusion model is greatly reduced is indicated, the second updating mode is selected to update the current fusion model, the sub-models in the current fusion model are trained, after the sub-models are trained, the fusion coefficient of the sub-models in the current fusion model is adjusted, the target fusion model is generated to replace the current fusion model, and the effectiveness of the performance of the fusion model is guaranteed.
In the above exemplary embodiment, different updating manners may be adopted to adapt to online updating of the current fusion model according to the performance degradation condition of the current fusion model, so that the updating efficiency of online updating of the current fusion model may be improved, and the online updating cost may be reduced. When the performance of the current fusion model is greatly reduced, the submodel in the current fusion model is trained, and after the submodel training is completed, the fusion coefficient corresponding to the submodel in the current fusion model is adjusted to ensure the accuracy and the effectiveness of the fusion model. When the performance of the current fusion model is reduced, only the fusion coefficient of the submodel in the current fusion model is adjusted, and incremental training of each submodel in the current fusion model is not needed, so that the collection of training samples can be effectively reduced while the accuracy and the effectiveness of the fusion model are ensured, and the data collection cost is reduced.
In an exemplary embodiment, the adjusting the fusion coefficients of the sub-models in the current fusion model to generate the target fusion model includes: acquiring first model training data aiming at the current fusion model; the first model training data comprises first historical scene data and reference information corresponding to the first historical scene data; inputting the first historical scene data into a current fusion model to obtain second prediction information; comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information; and adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
The first historical scene data is obtained by recording historical scene data corresponding to the target service scene, the reference information is obtained by recording real information output by the target service scene in operation under the first historical scene data, and the first historical scene data and the reference information corresponding to the first historical scene data can be associated in a labeling mode so as to facilitate training of the current fusion model by the first historical scene data.
Specifically, the acquired first historical scene data is input into the current fusion model to obtain second prediction information, and then the second prediction information is compared with reference information corresponding to the first historical scene data to obtain second prediction difference information. For example, a loss function value of the reference information in which the second prediction information corresponds to the first historical scene data may be calculated as the second prediction difference information using a loss function. And then, the fusion coefficient of the sub-model in the current fusion model is adjusted through the second prediction difference information so as to improve the performance of the current fusion model.
As an example, the second prediction difference information may be a second prediction difference value, the larger the second prediction difference value is, the worse the performance of the current fusion model is, the less accurate the predicted information is, the smaller the second prediction difference value is, the better the performance of the current fusion model is, and the more accurate the predicted information is.
Therefore, the fusion coefficient of the submodel in the current fusion model can be adjusted based on the second prediction difference information, so that the smaller the second prediction difference value output after the fusion coefficient is adjusted, when the second prediction difference value is smaller than a specified preset threshold value or the second prediction difference value is converged, the current fusion model is indicated to be trained, the target fusion model is obtained to replace the current fusion model, and the effectiveness of the performance of the fusion model is ensured.
In an exemplary embodiment, the training the sub-models in the current fusion model includes: acquiring second model training data for the sub-model; the second model training data comprises second historical scene data and reference information corresponding to the second historical scene data; and training the submodel by adopting the second historical scene data to obtain the trained submodel.
The second historical scene data is obtained by recording historical scene data corresponding to the target service scene aiming at training data of the sub-model, the reference information is obtained by recording real information output by the target service scene in the second historical scene data, and the second historical scene data and the reference information corresponding to the second historical scene data can be associated in a labeling mode so as to facilitate training of the sub-model by using the second historical scene data.
Specifically, when the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, the second historical scene data and the reference information corresponding to the second historical scene data are adopted to train each submodel in the current fusion model, and the trained submodel is obtained.
As an example, there are various ways of training each sub-model in the current fusion model by using the second historical scene data and the reference information corresponding to the second historical scene data, which are specifically as follows:
in an exemplary embodiment, the training the submodel with the second historical scene data to obtain a trained submodel includes: inputting the second historical scene data into a current fusion model to obtain third prediction information; comparing the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information; and when the third prediction difference information meets the training end condition corresponding to the target service scene, obtaining a trained sub-model.
Wherein the third prediction difference information meeting the training end condition includes: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
Specifically, the second historical scene data may be input into the current fusion model to obtain third prediction information, and the third prediction information may be compared with reference information corresponding to the second historical scene data to obtain third prediction difference information. For example, a loss function value of the reference information corresponding to the third prediction information and the second historical scene data may be calculated by using a loss function as the third prediction difference information, and when the third prediction difference information meets a training end condition corresponding to the target service scene, that is, when the third prediction difference information is smaller than a preset threshold or the third prediction difference information converges, the training of the sub-model is ended, so as to obtain a trained sub-model.
In an exemplary embodiment, the training the submodel with the second historical scene data to obtain a trained submodel includes: training each model in the model base by adopting a certain amount of second historical scene data; and after the training of each model in the model base is finished, selecting a model with the minimum prediction difference information from the model base as a trained sub-model.
Each sub-model in the current fusion model is provided with a corresponding model base, and each model base comprises a plurality of models with the same structure.
Specifically, each model in the model base is trained by using a certain amount of second historical scene data, after the second historical scene data is used up, the prediction difference information (model performance) of each model in the model base is compared, and the model with the minimum prediction difference information, namely the model with the optimal model performance, is selected as the sub-model after training.
In an exemplary embodiment, after the generating the target fusion model, the method further includes: acquiring test scene data and reference information corresponding to the test scene data; inputting the test scene data into the current fusion model to obtain fourth prediction information, and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information; fourth prediction difference information that specifies reference information corresponding to the fourth prediction information and the test scenario data, and fifth prediction difference information that specifies reference information corresponding to the fifth prediction information and the test scenario data; and if the performance of the target fusion model represented by the fifth prediction difference information is better than the performance of the current fusion model represented by the fourth prediction difference information, replacing the current fusion model in the target service scene with the target fusion model.
The test scene data is real-time scene data of a target service scene or historical scene data within a certain time, and the test scene data is used for detecting whether the target fusion model is suitable for the target service scene at the present moment and in a future period of time, so that the real-time scene data or the historical scene data within the certain time is required for detection; the reference information is obtained by recording real information output by the target service scene running under the test scene data, and the test scene data and the corresponding reference information can be associated by adopting a labeling mode so as to be convenient for detecting the performance of the target fusion model by adopting the test scene data.
Specifically, the test scene data is respectively input into the current fusion model and the target fusion model, so that fourth prediction information output by the current fusion model and fifth prediction information output by the target fusion model are obtained, fourth prediction difference information of reference information corresponding to the fourth prediction information and the test scene data is determined, and fifth prediction difference information of the reference information corresponding to the fifth prediction information and the test scene data is determined. And then, the performance of the current fusion model and the performance of the target fusion model are judged by comparing the fourth prediction difference information with the fifth prediction difference information, and if the performance of the target fusion model represented by the fifth prediction difference information is superior to the performance of the current fusion model represented by the fourth prediction difference information, the target fusion model is deployed in a target service scene to replace the current fusion model in the target service scene, so that the accuracy and the effectiveness of the fusion model are ensured.
In an exemplary embodiment, after the comparing the predicted difference information of the current fusion model with the predicted difference information of the target fusion model, the method further comprises: if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, returning to the process of executing the current fusion model inference in the target service scene to obtain the first prediction information of the current fusion model, or returning to the process of executing the current fusion model inference in the target service scene by taking the target fusion model as the current fusion model to obtain the first prediction information of the current fusion model.
Specifically, if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, indicating that the current fusion model fails to be updated online, the current fusion model needs to be updated online again, specifically, there are two ways, the first way is to directly return to the process of performing the current fusion model inference in the target service scene, obtain the first prediction information step of the current fusion model, and perform online update again on the current fusion model, and the second way is to use the target fusion model as the current fusion model, return to the process of performing the current fusion model inference in the target service scene, obtain the first prediction information step of the current fusion model, and perform online update again on the basis of the target fusion model failed to be updated. Until the performance of the obtained target fusion model is superior to that of the current fusion model.
In an exemplary embodiment, further comprising: and if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, sending an alarm to a worker.
The sending of the alarm to the staff may be specifically performed by a system prompt, sending an alarm short message, a telephone, and the like, which is not limited in the embodiment of the present invention.
Specifically, if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, it indicates that the current fusion model of the current fusion model fails to be updated online at this time, and therefore, an alarm of the online update failure of the model is sent to a worker to remind the worker to inquire the reason of the online update failure of the model, so as to prevent the subsequent online update from failing again due to the same reason.
For better understanding of the model updating method in the embodiment of the present invention, an exemplary description is made with reference to fig. 3.
Model online reasoning: and in the running process or before the running of the target service scene, acquiring real-time scene data corresponding to the target service scene from the data stream, and outputting the real-time scene data into the current fusion model to obtain first prediction information output by the current fusion model.
Judging the performance of the model: in the process of running a target service scene, reference information corresponding to real-time scene data is obtained from a data stream, first prediction information is compared with the reference information corresponding to the real-time scene data to obtain first prediction difference information, and the performance of the current fusion model is judged according to the first prediction difference information.
And (3) updating the model on line: if the first prediction difference information represents that the performance of the current fusion model is slightly reduced, performing online fine adjustment on the fusion coefficient of each model in the current fusion model to generate a target fusion model; and if the first prediction difference information represents that the performance of the current fusion model is greatly reduced, performing incremental training on the submodel in the current fusion model, and after the submodel training is completed, performing fine tuning on the fusion coefficient of the submodel in the current fusion model to generate the target fusion model.
And (3) evaluating the performance of the model: and comparing the performance of the target fusion model with the performance of the current fusion model, and deploying the target fusion model to replace the current fusion model if the performance of the target fusion model is higher than the performance of the current fusion model. And if the performance of the target fusion model is lower than that of the current fusion model, indicating that the online updating of the model fails, re-performing the online updating operation of the model, or simultaneously returning an alarm to a worker to remind the worker to inquire the reason of the online updating failure of the model.
In the above exemplary embodiment, in the process of reasoning for the current fusion model, the performance of the current fusion model is automatically detected through the first prediction difference information between the first prediction information output by the current fusion model and the reference information, and before the performance of the current fusion model is lower than the use standard, the performance of the current fusion model is found to be abnormal in advance and the current fusion model is updated online, so that the effectiveness of the performance of the current fusion model is ensured, and the safety risk and economic loss of the current fusion model caused by the inaccurate output prediction information are avoided. Meanwhile, the model can be prevented from being manually upgraded, and the maintenance cost of the current fusion model is reduced.
In addition, different updating modes can be adopted to adapt to the online updating of the current fusion model according to the performance degradation condition of the current fusion model, so that the updating efficiency of the online updating of the current fusion model is improved, and the online updating cost is reduced. Specifically, when the performance of the current fusion model is greatly reduced, the submodel in the current fusion model is trained, and after the submodel training is completed, the fusion coefficient of the submodel in the current fusion model is adjusted to ensure the accuracy and the effectiveness of the fusion model. When the performance of the current fusion model is reduced, the fusion coefficient of the submodel in the current fusion model is adjusted, increment training is not required to be carried out on each submodel in the current fusion model, the accuracy and the effectiveness of the fusion model are guaranteed, meanwhile, the collection of training samples can be effectively reduced, the collection cost of the training samples is effectively reduced, and the data collection cost is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4, a block diagram of a structure of a model updating apparatus provided in the embodiment of the present invention is shown, and specifically, the structure may include the following modules:
a difference information obtaining module 401, configured to obtain first predicted difference information of a current fusion model in a target service scene during inference of the current fusion model; the current fusion model is obtained by fusing at least two sub-models; if the first prediction difference information meets a first prediction exception condition corresponding to the target service scene, executing a first model updating module 402; if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, executing a second model updating module 403;
the first model updating module 402 is configured to adjust a fusion coefficient of the sub-model in the current fusion model to generate a target fusion model;
the second model updating module 403 is configured to train the sub-models in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
Optionally, the difference information obtaining module 401 includes
The first data acquisition submodule is used for acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data;
the first information prediction submodule is used for inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model;
and the first difference determining submodule is used for comparing the first prediction information with the reference information to obtain first prediction difference information.
In an exemplary embodiment, the first model updating module 402 includes:
the second data acquisition submodule is used for acquiring first model training data aiming at the current fusion model; the first model training data comprises first historical scene data and reference information corresponding to the first historical scene data;
the second information prediction submodule is used for inputting the first historical scene data into the current fusion model to obtain second prediction information;
the second difference determining submodule is used for comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information;
and the coefficient adjusting submodule is used for adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
In an exemplary embodiment, the second model updating module 403 includes:
a third data acquisition submodule for acquiring second model training data for the sub-models; the second model training data comprises second historical scene data and reference information corresponding to the second historical scene data;
and the sub-model training sub-module is used for training the sub-model by adopting the second historical scene data to obtain the trained sub-model.
In an exemplary embodiment, the submodel training submodule includes:
the information prediction unit is used for inputting the second historical scene data into a current fusion model to obtain third prediction information;
the difference determining unit is used for comparing the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information;
and the training ending unit is used for obtaining a trained sub-model when the third prediction difference information meets the training ending condition corresponding to the target service scene.
In an exemplary embodiment, the third prediction difference information satisfying the training end condition includes: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
In an exemplary embodiment, each of the submodels in the current fusion model has a corresponding model library, and the submodel training submodule includes:
the model training unit is used for training each model in the model base by adopting a certain amount of the second historical scene data;
and the model selection unit is used for selecting the model with the minimum prediction difference information from the model base as the trained sub-model after the training of each model in the model base is finished.
In an exemplary embodiment, further comprising:
the data acquisition module is used for acquiring test scene data and reference information corresponding to the test scene data; the test scene data is real-time scene data or historical scene data within a certain time;
the information prediction module is used for inputting the test scene data into the current fusion model to obtain fourth prediction information and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information;
a difference determining module, configured to determine fourth prediction difference information of the fourth prediction information and reference information corresponding to the test scenario data, and determine fifth prediction difference information of the fifth prediction information and the reference information corresponding to the test scenario data;
and the model replacing module is used for replacing the current fusion model in the target service scene by the target fusion model if the performance of the target fusion model represented by the fifth prediction difference information is better than the performance of the current fusion model represented by the fourth prediction difference information.
In an exemplary embodiment, further comprising:
and the return execution module is used for returning to execute the difference information acquisition module if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, or taking the target fusion model as the current fusion model.
In an exemplary embodiment, further comprising:
and the alarm sending module is used for sending an alarm to a worker if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information.
In the model updating device, in the process of reasoning the current fusion model, the automatic performance detection and the online updating of the current fusion model are performed through the first prediction difference information of the first prediction information and the reference information output by the current fusion model, so that the performance abnormity of the current fusion model can be found in advance before the performance of the current fusion model is lower than the use standard, the effectiveness of the performance of the current fusion model is ensured, and the safety risk and the economic loss of the current fusion model caused by the inaccuracy of the output prediction information are avoided. Meanwhile, the model can be prevented from being manually upgraded, and the maintenance cost of the current fusion model is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
acquiring first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target service scene; the current fusion model is obtained by fusing at least two sub-models;
if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model;
if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
In an exemplary embodiment, the obtaining first prediction difference information of the current fusion model during inference of the current fusion model in the target service scenario includes:
acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data;
inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model;
and comparing the first prediction information with reference information corresponding to the real-time scene data to obtain first prediction difference information.
In an exemplary embodiment, the adjusting the fusion coefficients of the sub-models in the current fusion model to generate the target fusion model includes:
acquiring first model training data aiming at the current fusion model; the first model training data comprises first historical scene data and reference information corresponding to the first historical scene data;
inputting the first historical scene data into a current fusion model to obtain second prediction information;
comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information;
and adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
In an exemplary embodiment, the training the sub-models in the current fusion model includes:
acquiring second model training data for the sub-model; the second model training data comprise second historical scene data and reference information corresponding to the second historical scene data;
and training the submodel by adopting the second historical scene data to obtain the trained submodel.
In an exemplary embodiment, the training the submodel with the second historical scene data to obtain a trained submodel includes:
inputting the second historical scene data into a current fusion model to obtain third prediction information;
comparing the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information;
and when the third prediction difference information meets the training end condition corresponding to the target service scene, obtaining a trained sub-model.
In an exemplary embodiment, the third prediction difference information satisfying the training end condition includes: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
In an exemplary embodiment, each of the submodels in the current fusion model has a corresponding model library, and the training of the submodel using the second historical scene data to obtain a trained submodel includes:
training each model in the model base by adopting a certain amount of second historical scene data;
and after the training of each model in the model base is finished, selecting a model with the minimum prediction difference information from the model base as a trained sub-model.
In an exemplary embodiment, after the generating the target fusion model, the method further includes:
acquiring test scene data and reference information corresponding to the test scene data; the test scene data is real-time scene data or historical scene data within a certain time;
inputting the test scene data into the current fusion model to obtain fourth prediction information, and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information;
fourth prediction difference information that specifies reference information corresponding to the fourth prediction information and the test scenario data, and fifth prediction difference information that specifies reference information corresponding to the fifth prediction information and the test scenario data;
and if the performance of the target fusion model represented by the fifth prediction difference information is better than the performance of the current fusion model represented by the fourth prediction difference information, replacing the current fusion model in the target service scene with the target fusion model.
In an exemplary embodiment, after the comparing the predicted difference information of the current fusion model with the predicted difference information of the target fusion model, the method further includes:
if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, taking the target fusion model as the current fusion model, and returning to the process of executing the current fusion model inference in the target service scene to obtain the first prediction information of the current fusion model, or taking the target fusion model as the current fusion model, and returning to the process of executing the current fusion model inference in the target service scene to obtain the first prediction information of the current fusion model.
In an exemplary embodiment, further comprising:
and if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, sending an alarm to a worker.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In yet another embodiment provided by the present invention, as shown in fig. 6, there is further provided a computer-readable storage medium 601, which stores instructions that, when executed on a computer, cause the computer to execute the model updating method described in the above embodiment.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the model updating method described in the above embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (13)

1. A model update method, comprising:
acquiring first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target service scene; the current fusion model is obtained by fusing at least two sub-models;
if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model;
if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, training the sub-model in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
2. The method according to claim 1, wherein the obtaining of the first prediction difference information of the current fusion model during the inference of the current fusion model in the target service scenario comprises:
acquiring real-time scene data corresponding to a target service scene and reference information corresponding to the real-time scene data;
inputting the real-time scene data into a current fusion model corresponding to the target service scene to obtain first prediction information of the current fusion model;
and comparing the first prediction information with reference information corresponding to the real-time scene data to obtain first prediction difference information.
3. The method of claim 1, wherein the adjusting the fusion coefficients of the sub-models in the current fusion model to generate a target fusion model comprises:
acquiring first model training data aiming at the current fusion model; the first model training data comprises first historical scene data and reference information corresponding to the first historical scene data;
inputting the first historical scene data into a current fusion model to obtain second prediction information;
comparing the second prediction information with reference information corresponding to the first historical scene data to obtain second prediction difference information;
and adjusting the fusion coefficient of the sub-model in the current fusion model based on the second prediction difference information to generate a target fusion model.
4. The method of claim 1, wherein training the sub-models in the current fusion model comprises:
acquiring second model training data for the sub-model; the second model training data comprises second historical scene data and reference information corresponding to the second historical scene data;
and training the submodel by adopting the second historical scene data to obtain the trained submodel.
5. The method of claim 4, wherein the training the submodel with the second historical context data to obtain a trained submodel comprises:
inputting the second historical scene data into a current fusion model to obtain third prediction information;
comparing the third prediction information with reference information corresponding to second historical scene data to obtain third prediction difference information;
and when the third prediction difference information meets the training end condition corresponding to the target service scene, obtaining a trained sub-model.
6. The method of claim 5, wherein the third prediction difference information satisfying an end-of-training condition comprises: the third prediction difference information is less than a preset threshold or the third prediction difference information converges.
7. The method of claim 4, wherein each of the submodels in the current fusion model has a corresponding model library, and the training of the submodel using the second historical scene data to obtain the trained submodel comprises:
training each model in the model base by adopting a certain amount of second historical scene data;
and after the training of each model in the model base is finished, selecting a model with the minimum prediction difference information from the model base as a trained sub-model.
8. The method of claim 1, further comprising, after said generating the target fusion model:
acquiring test scene data and reference information corresponding to the test scene data; the test scene data is real-time scene data or historical scene data within a certain time;
inputting the test scene data into the current fusion model to obtain fourth prediction information, and respectively inputting the test scene data into the target fusion model to obtain fifth prediction information;
fourth prediction difference information for specifying reference information corresponding to the fourth prediction information and the test scenario data, and fifth prediction difference information for specifying reference information corresponding to the fifth prediction information and the test scenario data;
and if the performance of the target fusion model represented by the fifth prediction difference information is better than the performance of the current fusion model represented by the fourth prediction difference information, replacing the current fusion model in the target service scene with the target fusion model.
9. The method of claim 8, further comprising, after the comparing the predicted difference information of the current fusion model with the predicted difference information of the target fusion model:
if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, returning to the process of executing the current fusion model inference in the target service scene to obtain the first prediction information of the current fusion model, or returning to the process of executing the current fusion model inference in the target service scene by taking the target fusion model as the current fusion model to obtain the first prediction information of the current fusion model.
10. The method of claim 9, further comprising:
and if the performance of the target fusion model represented by the fifth prediction difference information is inferior to or equal to the performance of the current fusion model represented by the fourth prediction difference information, sending an alarm to a worker.
11. A model updating apparatus, comprising:
the difference information acquisition module is used for acquiring first prediction difference information of a current fusion model in the process of reasoning the current fusion model in a target service scene; the current fusion model is obtained by fusing at least two sub-models; if the first prediction difference information meets a first prediction abnormal condition corresponding to the target service scene, executing a first model updating module; if the first prediction difference information meets a second prediction abnormal condition corresponding to the target service scene, executing a second model updating module;
the first model updating module is used for adjusting the fusion coefficient of the sub-models in the current fusion model to generate a target fusion model;
the second model updating module is used for training the sub-models in the current fusion model; and after the sub-model training is finished, adjusting the fusion coefficient of the sub-model in the current fusion model to generate a target fusion model.
12. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-10.
13. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-10.
CN202210468357.7A 2022-04-29 2022-04-29 Model updating method and device, electronic equipment and storage medium Pending CN114970864A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210468357.7A CN114970864A (en) 2022-04-29 2022-04-29 Model updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210468357.7A CN114970864A (en) 2022-04-29 2022-04-29 Model updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114970864A true CN114970864A (en) 2022-08-30

Family

ID=82978627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210468357.7A Pending CN114970864A (en) 2022-04-29 2022-04-29 Model updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114970864A (en)

Similar Documents

Publication Publication Date Title
US9141915B2 (en) Method and apparatus for deriving diagnostic data about a technical system
CN110209560B (en) Data anomaly detection method and detection device
CN113283630A (en) Air quality prediction method, device, equipment and computer readable storage medium
US11604461B2 (en) Method and apparatus for monitoring the condition of subsystems within a renewable generation plant or microgrid
AU2020309879B2 (en) Failure probability assessment system and method therefor
WO2020197533A1 (en) Surrogate of a simulation engine for power system model calibration
CN113868953B (en) Multi-unit operation optimization method, device and system in industrial system and storage medium
US20200380618A1 (en) Systems and methods for enhanced power system model validation
CN116306798A (en) Ultra-short time wind speed prediction method and system
CN117117819A (en) Photovoltaic power generation short-term power prediction method, system, equipment and medium
CN111667093A (en) Medium-and-long-term wind power generation calculation method and device
CN112128950B (en) Machine room temperature and humidity prediction method and system based on multiple model comparisons
CN113988398A (en) Wind turbine generator power prediction method and device, electronic equipment and storage medium
CN111105050B (en) Fan maintenance plan generation method, device, equipment and storage medium
CN114970864A (en) Model updating method and device, electronic equipment and storage medium
CN111783883A (en) Abnormal data detection method and device
CN114091357B (en) Traffic flow prediction method, traffic flow prediction device, electronic device, and storage medium
Aizpurua et al. Probabilistic power transformer condition monitoring in smart grids
CN115935822A (en) Method, system, device and medium for predicting long-term degradation trend of computer parameters
CN115037599A (en) Communication network fault early warning method, device, equipment and medium
CN115660917A (en) Early warning method, device and medium for abnormal grain temperature in one-storey house
JP7297816B2 (en) Method and Computing System for Performing Asset Predictive Health Analysis
CN110955286B (en) Poultry egg monitoring method and device
Gallego-Castillo et al. Wind power probabilistic forecast in the reproducing kernel Hilbert space
CN115051384B (en) Frequency modulation performance evaluation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination