Incremental model training method and device based on streaming data, and electronic device

By using a dual-model architecture and micro-batch training technology to incrementally train models on streaming data, the problem of untimely model updates in existing technologies is solved, enabling real-time model updates and lifelong learning, thereby improving user experience and business metrics.

CN114528935BActive Publication Date: 2026-02-10DINGDAO ZHILIAN (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210150386.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2026-02-10
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

Existing incremental model training methods cannot be updated in a timely manner in streaming data scenarios, and cannot reflect users' behavioral interests in a short period of time, resulting in large model errors and failing to improve user experience and business metrics.

Method used

A dual-model architecture is adopted. By acquiring real-time features of raw streaming data, the main model and the auxiliary model are trained alternately using micro-batch training technology. Incremental training and online inference services are performed during each alternation training process. At the same time, the incrementally trained model is corrected using the full feature library of historical time periods.

Benefits of technology

It enables on-demand training and real-time updates of models, improves the speed of model updates and deployment, can track changes in user behavior in a timely manner, reflects data patterns over a longer period of time, avoids forgetting historical features, and achieves lifelong learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528935B_ABST
    Figure CN114528935B_ABST
Patent Text Reader

Abstract

The application provides a kind of based on the incremental model training method, device and electronic equipment of stream data, the method comprises: obtaining original stream data;Extract the real-time feature of the original stream data, join to full-amount feature library;According to initial training model, determine main model and vice model, and based on the real-time feature, using the way of micro-batch training, the main model and vice model are alternately trained multiple times, and an incremental training model is obtained;In each alternately training process, one of the main model and vice model is incrementally trained, and another one is used simultaneously for online inference service;Based on the full-amount feature library obtained in the history time period, the incremental training model is corrected to obtain a corrected training model.The application realizes real-time and uninterrupted online inference service by using double model alternately for micro-batch incremental training and online inference service, so that the model can track and respond to real user behavior changes more timely.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and more specifically, to an incremental model training method, apparatus, and electronic device based on streaming data. Background Technology

[0002] Incremental model training, as a method in machine learning, has received widespread attention. In this approach, input data is continuously used to expand the knowledge of the existing model, i.e., further training the model; it represents a dynamic learning technique. Existing traditional machine learning training schemes, such as offline methods, involve feature engineering the data to generate a full feature library, then using machine learning algorithms to train the full feature data, and finally deploying the generated model online for inference.

[0003] Most current incremental model training methods are based on offline scenarios. They involve training with some or all of the full feature data, and then retraining and updating the model using new feature data. While this achieves the goal of incremental model training, it fails to meet the requirements of real-time model training and error evaluation in practical business scenarios. Furthermore, in the face of streaming data scenarios widely used in modern business systems, current incremental learning techniques cannot better fit the data patterns in streaming data, and it is difficult to update the model in a timely manner. Consequently, it cannot reflect user behavior and interests in a short period of time, and it cannot help improve user experience and business metrics. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide an incremental model training method, apparatus and electronic device based on streaming data, which adopts a dual-model architecture to perform incremental model training, updating and online inference processes based on the original model, thereby improving the problems existing in the prior art.

[0005] In a first aspect, embodiments of this application provide an incremental model training method based on streaming data. The method includes: acquiring raw streaming data; extracting real-time features from the raw streaming data and adding them to a full feature library; determining a primary model and a secondary model based on an initial training model, and performing multiple alternating trainings on the primary model and the secondary model using micro-batch training based on the real-time features to obtain an incremental training model; in each alternating training process, performing incremental training on one of the primary model and the secondary model, while simultaneously using the other for online inference services, wherein the model used for incremental training in each alternating training process is different from the previous alternating training process; and correcting the incremental training model based on the full feature library obtained within a historical time period to obtain a corrected training model.

[0006] Optionally, the step of correcting the incremental training model based on the full feature library obtained within the historical time period to obtain a corrected training model includes: obtaining the evaluation results of the incremental training model according to user business metrics, including click-through rate, browsing duration, playback duration, new users, retention rate, daily active users, monthly active users, and conversion rate; and correcting the incremental training model based on the evaluation results and the full feature library obtained within the historical time period to obtain a corrected training model.

[0007] In the above implementation process, by using all features within the historical time period for model correction, the influence of short-term user behavior interests on the model can be eliminated, reflecting the real data patterns more comprehensively, and thus reflecting the patterns of user behavior changes more comprehensively and accurately.

[0008] Optionally, the step of using micro-batch training based on the real-time features to perform multiple alternating trainings on the main model and the sub-model to obtain an incremental training model includes: pre-setting trigger conditions according to the actual business scenario, wherein the trigger condition is whether the amount of real-time feature data reaches a preset feature data amount; determining whether the amount of real-time feature data meets the preset trigger condition, and if so, triggering the micro-batch training instruction to perform micro-batch training and updating on the main (or sub-)model to obtain the trained incremental training model.

[0009] In the above implementation process, through trigger-based design, when the amount of real-time feature data reaches the preset feature data amount, the model can perform incremental training on its own to learn new features, thereby realizing on-demand training and updating of the model.

[0010] Optionally, the initial training model is a model obtained by training the full feature data of the full feature library offline; the main model and the sub-model are trained alternately until the incremental training process of the model ends.

[0011] Optionally, the online inference service involves deploying the incremental training model as an online service on a server or in the cloud. The business system triggers the inference service in an intelligent service scenario through interaction with the user, passing in some contextual information from the user. The online inference service returns the inference result to the business system based on the incremental training model, and after processing by the business system, it is returned to the user.

[0012] In the above implementation process, by using the incremental training model to provide real-time online inference services, the online inference service is carried out uninterruptedly, and the inference model can be updated synchronously as the incremental model training is updated.

[0013] Optionally, extracting real-time features from the raw streaming data and adding them to the full feature library includes: using real-time computing technology in big data to extract real-time features from the raw streaming data, wherein the real-time computing technology is the Flink real-time computing framework; and adding the real-time extracted features to the full feature library.

[0014] Optionally, the real-time extracted features are stored using a message queue for incremental model training, wherein the message queue is a Kafka distributed publish-subscribe messaging system.

[0015] In the above implementation process, by adopting a feature message queue approach, trigger-based model training is performed. When the amount of real-time feature data reaches the preset feature data amount, the model can perform incremental training on its own to learn new features, thereby realizing on-demand training and updating of the model.

[0016] Secondly, embodiments of this application also provide an incremental model training apparatus based on streaming data. The apparatus includes: an acquisition module for acquiring raw streaming data; an extraction module for extracting real-time features from the raw streaming data and adding them to a full feature library; a training module for determining a main model and a sub-model based on an initial training model, and performing multiple alternating trainings on the main model and sub-model using micro-batch training based on the real-time features to obtain an incremental training model; in each alternating training process, incremental training is performed on one of the main model and sub-model, while the other is used simultaneously for online inference services, wherein the model used for incremental training in each alternating training process is different from the previous alternating training process; an inference module for deploying the real-time updated incremental training model as an online inference service to achieve real-time online inference services using the latest model; and a correction module for correcting the incremental training model based on the full feature library obtained within a historical time period to obtain a corrected training model.

[0017] Thirdly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor runs the computer program, it executes the steps in any of the above-described implementations of the incremental model training method based on streaming data.

[0018] Fourthly, embodiments of this application also provide a readable storage medium storing a computer program, which, when run by a processor, executes the steps in any of the above-described implementations of the incremental model training method based on streaming data.

[0019] In summary, this application provides an incremental model training method, apparatus, and electronic device based on streaming data. By employing real-time computing technology to extract features from raw streaming data in real time, and combining micro-batch training technology to perform triggered incremental training on the initial training model, the model can be trained on demand. Furthermore, by adopting a dual-model rotation approach of main model and sub-model, the update and deployment speed of the model is significantly improved, enabling real-time and uninterrupted online inference services. This allows for more timely tracking and response to real user behavior changes. Then, the model is corrected based on the online evaluation results, so that the model can reflect data patterns over a longer period of time, avoid forgetting historical features, and achieve the goal of lifelong learning. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating an incremental model training method based on streaming data, provided for an embodiment of this application;

[0022] Figure 2 A schematic diagram of the dual-model switching process in an incremental model training method based on streaming data provided in an embodiment of this application;

[0023] Figure 3 A flowchart illustrating another incremental model training method based on streaming data provided in this application embodiment;

[0024] Figure 4 This is a schematic diagram of the structure of an incremental model training device based on streaming data, provided in an embodiment of this application.

[0025] Figure 5 This is a schematic diagram of the structure of an electronic device for incremental model training based on streaming data, provided in an embodiment of this application.

[0026] Icons: 400 - Model training device; 410 - Acquisition module; 420 - Extraction module; 430 - Training module; 440 - Inference module; 450 - Correction module; 500 - Model training electronic device; 510 - Processor; 520 - Memory; 530 - Bus. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. In the description of this application, terms such as "main" and "secondary" are used only to distinguish descriptions and should not be construed as indicating or implying relative importance. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.

[0028] Please see Figure 1 , Figure 1 A flowchart illustrating an incremental model training method based on streaming data, provided in this application embodiment, includes the following steps:

[0029] S1: Obtain the raw stream data.

[0030] The original stream data is a sequence of data that arrives sequentially, in large quantities, rapidly, and continuously. Generally, the data stream can be regarded as a dynamic data set that grows infinitely over time.

[0031] Optionally, the raw streaming data can be at least one of the following: log files generated by users using mobile or web applications, online shopping data, in-game player activity, social networking information, financial trading halls or geospatial services, and telemetry data from connected devices or instruments within a data center. This data can be applied in fields such as network monitoring, sensor networks, aerospace, meteorological monitoring and control, and financial services. For example, companies can analyze raw streaming data to gain in-depth understanding of all aspects of their business and customer activities, such as service usage (for metering / billing), server activity, website clicks, and the geographic location of devices, people, and physical objects, enabling them to respond quickly to new situations. For example, companies can continuously analyze social media streams to track changes in public perception of their brands and products and react promptly when necessary.

[0032] S2: Extract the real-time features of the raw streaming data and add them to the full feature library.

[0033] The full feature library stores all features extracted within a historical time period for subsequent model adjustments, preventing the forgetting of historical features due to long-term learning of new features. The extracted real-time features, while being stored in the full feature library, also need to be sent to a message queue (Kafka) for storage, so that they can be used by downstream training modules.

[0034] Optionally, real-time feature extraction is performed on the raw streaming data by employing real-time computing technology in big data. The real-time computing technology is the Flink real-time computing framework, and the extracted features are stored in a message queue, which is the Kafka distributed publish-subscribe messaging system.

[0035] In some embodiments, feature extraction may involve data cleaning, sampling, etc., of the raw streaming data. Data cleaning can remove dirty data, such as some unreliable samples. In classification problems, data sampling can be performed using random sampling, stratified sampling, etc., to solve the problem of imbalance between positive and negative samples.

[0036] In some embodiments, the feature extraction may also be a preprocessing of the original streaming data, such as normalization, standardization, discretization, binarization, dummy coding, hashing, etc.

[0037] In some embodiments, feature extraction may also involve feature selection of the original streaming data to remove redundant and noisy features. The feature selection method may be a filter feature selection, which evaluates the correlation between individual features and result values, sorts and retains the top relevant features, or a wrapper feature selection—a recursive feature deletion algorithm, which treats feature selection as a feature subset search problem, filters out various feature subsets, evaluates the results using a model, or an embedding feature selection, which analyzes the importance of features based on a model, such as feature selection using regularization methods.

[0038] In some embodiments, the original streaming data can also be dimensionality reduced offline, for example, by using Principal Component Analysis (PCA) or Linear Discriminant Analysis (LDA). According to actual business needs, the data can be dimensionality reduced in advance to accelerate the online real-time feature extraction rate, speed up model training, and thus achieve timely model updates.

[0039] Taking raw streaming data as online shopping data generated by users using mobile or web applications as an example, real-time features of the raw streaming data can be extracted using real-time computing technology. This may include: cleaning the raw streaming data, such as removing users who have never bought anything in the past 30 days; and may also include: the total number of clicks / favorites / add-to-cart / purchases for each user on different types of products, the time each user purchased products, the popularity of products or their ranking in categories, the total number of people interacting with products, etc.

[0040] S3: Determine the main model and the sub-model based on the initial training model, and perform multiple alternating trainings on the main model and the sub-model using micro-batch training based on the real-time features to obtain an incremental training model; In each alternating training process, perform incremental training on one of the main model and the sub-model, and simultaneously use the other for online inference services. The model used for incremental training in each alternating training process is different from the previous alternating training process.

[0041] The initial training model is obtained by training the entire feature data of the full feature library offline. The micro-batch training uses a small portion of the training set to train the model during the model training process. In the incremental model training method based on streaming data provided in this application, the batch size of the small portion of training samples is determined according to the preset feature data volume. The online inference service is different from model training. Training learns a certain ability from existing data, while inference simplifies and uses the ability to quickly and efficiently operate on unknown data to obtain the expected results. The online inference service uses the trained incremental training model as the inference model to provide online inference services to users.

[0042] Optionally, the step of using micro-batch training based on the real-time features to perform multiple alternating trainings on the main model and the sub-model to obtain an incremental training model includes: pre-setting trigger conditions according to the actual business scenario, wherein the trigger condition is whether the amount of real-time feature data reaches a preset feature data amount; determining whether the amount of real-time feature data meets the preset trigger condition, and if so, triggering the micro-batch training instruction to perform micro-batch training and updating on the main (or sub-)model to obtain the trained incremental training model.

[0043] Optionally, the main model and the sub-model are trained alternately until the incremental training process ends. The end of the incremental training process refers to termination through manual intervention, which may involve setting thresholds. If certain business metrics fall below or exceed the set thresholds, incremental training is stopped, and the incrementally trained model is corrected.

[0044] In the above implementation process, through triggered micro-batch incremental model learning, the on-demand training and updating of the model can be fully realized, reducing manual operation, automating the incremental training of the model, and better fitting the data patterns in streaming data, thereby updating the model in a timely manner and enabling the model to better reflect the user's short-term behavioral interests.

[0045] Optionally, the online inference service involves deploying the incremental training model as an online service on a server or in the cloud. The business system triggers the inference service in an intelligent service scenario through interaction with the user, passing in some contextual information from the user. The online inference service returns the inference result to the business system based on the incremental training model, and after processing by the business system, it is returned to the user.

[0046] In the above implementation process, by adopting a dual-model rotation approach of main model and sub-model, online model training and real-time online inference services can be realized simultaneously. Moreover, the model used for online inference services is also updated synchronously as the model training is updated, which solves the problem of not being able to provide inference services during model copying, thereby significantly improving the speed of model update and deployment.

[0047] Taking raw streaming data, specifically online shopping data generated by users using mobile or web applications, as an example, according to the method described above, real-time features related to the online shopping data are extracted from the raw streaming data, such as a user's browsing time / number of clicks / total purchases / number of favorites / number of items added to cart. Micro-batch training is used to incrementally train and update the main model and sub-model, and to provide online inference services, so that the incrementally trained model can reflect the user's demand or preference for each product through historical behavior. The real-time updated incrementally trained model is deployed as an online inference service. Through the interaction between the business system and the user, the online inference service is triggered in intelligent service scenarios such as intelligent recommendation, collecting some contextual information of a user, such as the names of products previously searched or the product interfaces browsed. Then, the business system processes the inference results of the incrementally trained model and returns them to the user to complete the intelligent recommendation.

[0048] S4: Based on the full feature library obtained within the historical time period, the incremental training model is corrected to obtain the corrected training model;

[0049] Optionally, the step of correcting the incremental training model based on the full feature library obtained within the historical time period to obtain a corrected training model includes: obtaining the evaluation results of the incremental training model according to user business metrics, including click-through rate, browsing duration, playback duration, new users, retention rate, daily active users, monthly active users, and conversion rate; and correcting the incremental training model based on the evaluation results and the full feature library obtained within the historical time period to obtain a corrected training model.

[0050] The user business metrics can be set according to different business needs; the historical time period can be a relatively long time interval, such as the last few months, the last six months, or even the last few years, and can also be flexibly adjusted according to actual needs; the historical forgetting feature refers to the almost complete forgetting of previously learned content after learning new knowledge, which is also a catastrophic forgetting problem in deep learning; the correction method is similar to the idea of ​​transfer learning, which uses an already trained incremental training model to adjust the model parameters according to the data patterns of the historical forgetting feature, so as to complete the model correction process and enable the corrected model to better reflect the data patterns of a longer time dimension.

[0051] In the above implementation process, the full features of the full feature library within the historical time period are used for correction, which can eliminate the influence of user behavior and interests on the model in the short term. This allows the corrected model to not only reflect the patterns of recent data, but also the patterns of data over a longer period of time. This effectively solves the problem of avoiding forgetting historical features in deep learning, thereby reflecting the patterns of user behavior changes more comprehensively and accurately, and also achieving the goal of lifelong learning of the model.

[0052] Taking raw streaming data, such as online shopping data generated by users using mobile or web applications, as an example, if users need to be segmented based on relevant online shopping streaming data, and the recently learned features are all behavioral characteristics of highly active users, then by evaluating the user business indicators of the model's effectiveness, it can be found that the existing model's response to the behavioral characteristics of low-activity users is weakening. At this time, model correction is needed. Relevant features of online shopping data from the past three months can be used to correct the existing model to eliminate the impact of short-term user behavior interests on the model.

[0053] The aforementioned incremental model training method based on streaming data employs real-time computing technology to extract features from the raw streaming data in real time. It combines micro-batch training technology to perform triggered incremental training on the initial training model, enabling on-demand model training. Furthermore, by using a dual-model rotation approach with a main model and a secondary model, it significantly improves the speed of model updates and deployment, achieving real-time and uninterrupted online inference services. This allows for more timely tracking and response to real-world changes in user behavior. The model is then corrected based on online evaluation results, ensuring it reflects data patterns over a longer period, avoids forgetting historical features, and achieves the goal of lifelong learning.

[0054] Please see Figure 2 , Figure 2 A schematic diagram of the dual-model switching process in an incremental model training method based on streaming data provided in this application embodiment includes the following steps:

[0055] S21: Obtain the real-time characteristics of the extracted raw streaming data.

[0056] Optionally, the acquired real-time features are added to the full feature library and simultaneously sent to the message queue Kafka for storage, so that they can be used by downstream training modules.

[0057] S22: The main model is incrementally trained using micro-batch training to obtain the trained incremental training model 1.

[0058] Optionally, by combining micro-batch training technology, the main model can be trained incrementally based on the real-time features to achieve on-demand training and updating of the model.

[0059] S23: Deploy the sub-model as an online inference service.

[0060] Optionally, before S22 and S23, the method further includes determining the main model and the sub-model based on the initial training model. The initial training model is a model obtained by training the entire feature data of the full feature library in advance when the model is offline. In the method of this application, there is no limitation on whether the main model or the sub-model is incrementally trained first. In some other embodiments, S22 may be to incrementally train the sub-model using micro-batch training. In this case, S23 is to deploy the main model as an online inference service.

[0061] S24: Use the master model trained with micro-batch for online inference services.

[0062] Optionally, after micro-batch training, the master model is updated to incremental training model 1, and online inference service is performed using incremental training model 1.

[0063] S25: Duplicate incremental training model 1 to update the sub-model for use in the next micro-batch training.

[0064] Optionally, after replacing the sub-model with the primary model for online inference service, incrementally training model 1 is copied to update the sub-model, and the updated sub-model is used for the next micro-batch training. During the sub-model update process, the primary model is responsible for the online inference service, solving the problem of not being able to provide online inference service during model copying.

[0065] S26: The sub-model is incrementally trained using micro-batch training to obtain the trained incremental model 2.

[0066] S27: Duplicate incrementally trained model 2 to update the master model for the next micro-batch training.

[0067] The aforementioned dual-model rotation process, through alternating micro-batch training and online inference services for the primary and secondary models, simultaneously enables on-demand online model training and real-time uninterrupted online inference services. This improves the speed of model updates and deployment, and the model used for online inference services is updated synchronously with the incremental training of the primary model, resolving the issue of unavailable online inference services during model copying. During the alternating training process, the micro-batch training technique, combined with real-time extracted features, effectively addresses the real-time nature of model training, accelerating model updates and enabling more timely tracking and response to real-world user behavior changes.

[0068] Please see Figure 3 , Figure 3 A flowchart illustrating another incremental model training method based on streaming data provided in this application embodiment includes the following steps:

[0069] S31: Obtain raw stream data.

[0070] Optionally, the raw streaming data may be log data collected from HTTP, Database, and DataSync by the log collection program Flume.

[0071] S32: Send the raw stream data to the message queue Kafka.

[0072] Optionally, the log collection program Flume can be used to collect and read raw streaming data and synchronize it to the message queue Kafka for caching, making it convenient for subsequent calls.

[0073] S33: Extract the real-time features of the raw streaming data.

[0074] Optionally, real-time computing technologies such as Flink or Spark can be used to consume the data in Kafka, such as for cleaning and field matching. This step is the same as step S2 above and will not be described again here.

[0075] S34: Add the real-time features to the full feature library and send them to the message queue Kafka for storage.

[0076] Optionally, the extracted real-time features can be stored in the full feature library and then sent to the message queue Kafka for storage, so that they can be used by the downstream training module.

[0077] S35: Determine the main model and the sub-model based on the initial training model, and use micro-batch training to alternately perform incremental training, updating and online inference services on the main model and the sub-model based on the real-time features. After multiple micro-batch trainings, an incremental training model is obtained.

[0078] The initial training model is a model obtained by pre-training the full feature data of the full feature library in an offline environment; the online inference service can be deployed on a server to help users handle inference tasks by leveraging the server's high performance; the online inference service can also deploy the model on mobile devices, such as mobile phones or embedded devices in the Internet of Things; in each alternating training process, one of the main model and the sub-model is incrementally trained while the other is used for online inference service, and the model used for incremental training in each alternating training process is different from the model used in the previous alternating training process.

[0079] In some embodiments, the online inference framework used by the online inference service may be Tensorflow, PyTorch, TensorRT, Xgboost, OpenVINO, Mediapipe, or a self-developed inference framework.

[0080] S36: Evaluate the incremental training model based on user business metrics.

[0081] Optionally, user business metrics can be set as new users, retention, daily active users (DAU), monthly active users (MAU), and conversion rate for a product, app, or platform. New users can refer to the daily or monthly new users of the product, app, or platform. Retention refers to the retention status of newly registered users over a subsequent period, which can be daily retention. DAU refers to daily active users, specifically users who have previously registered and logged in and then logged in to the product, app, or platform again after the registration date. MAU refers to the number of monthly unique active users, which is the sum of the daily DAUs within a month and then deduplicating the unique users.

[0082] S37: Based on the evaluation results and the full feature library obtained within the historical time period, the initial incremental training model is modified to obtain the modified training model.

[0083] Optionally, based on the evaluation results of the model obtained from the above business indicators, by setting some thresholds, when some business indicators are lower or higher than the set thresholds, the incremental training of the main model and the sub-model is stopped, and the obtained incremental training model is corrected to obtain the corrected training model.

[0084] Optionally, after S37, the method further includes transferring the corrected training model back to the initial training model, and performing incremental training, model evaluation, and model correction again according to S35-S37.

[0085] In the above embodiments, the real-time computing technology can also be real-time computing frameworks such as Storm and Spark Streaming, and the message queue can also be Redis, ActiveMQ, etc. The algorithms described here are generally related to big data real-time computing technologies. Whether it's data acquisition, synchronization, storage, or computation, these are all mature technologies in the industry, and there are many algorithm choices available, so they will not be listed further.

[0086] The aforementioned incremental model training method based on streaming data employs real-time computing technology to extract features from raw streaming data in real time. It uses a feature message queue approach combined with micro-batch training technology to perform triggered incremental training on the initial training model, enabling on-demand model training. Furthermore, it adopts a dual-model rotation approach with a main model and a secondary model, significantly improving the model update and deployment speed. This achieves real-time and uninterrupted online inference services, allowing for more timely tracking and response to real user behavior changes. The model is then corrected based on online evaluation results, enabling it to reflect data patterns over a longer period, avoid forgetting historical features, and achieve the goal of lifelong learning.

[0087] Please see Figure 4 , Figure 4 This is a schematic diagram of an incremental model training device based on streaming data provided in an embodiment of this application. The model training device 400 includes: an acquisition module 410 for acquiring raw streaming data; an extraction module 420 for extracting real-time features from the raw streaming data and adding them to a full feature library; a training module 430 for acquiring an initial training model and dividing it into a main model and a sub-model, and using micro-batch training based on the real-time features to alternately perform incremental training and updates of the main model and the sub-model and provide online inference services; an inference module 440 for deploying the real-time updated incremental training model as an online inference service to achieve real-time online inference services using the latest model; and a correction module 450 for correcting the incremental training model based on the full feature library obtained within a historical time period to obtain a corrected training model.

[0088] For a detailed description of the above incremental model training device, please refer to the description of the relevant method steps in the above embodiments.

[0089] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 500 includes a memory 510 and a processor 520. The memory 510 and the processor 520 are connected via a bus 530. The memory 510 stores a computer program. When the processor 520 reads and runs the computer program, the electronic device 500 can execute all or part of the process of the method in the above embodiment to realize incremental model training based on streaming data.

[0090] It should be understood that the electronic device can be a personal computer (PC), tablet computer, smartphone, or other electronic device with logical computing capabilities.

[0091] This application also provides a readable storage medium storing a computer program, which is read and run by a processor to execute steps in an incremental model training method based on streaming data.

[0092] The above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and are not intended to limit it. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in this application, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this invention. Therefore, the protection scope of this invention should be determined by the protection scope of the claims.

Claims

1. A method for training an incremental model based on streaming data, characterized in that, include: Acquire raw stream data, which is online shopping data generated by a user using a mobile or web application; Real-time features of the raw stream data are extracted and added to the full feature library. The extraction of real-time features of the raw stream data includes, but is not limited to: data cleaning, sampling, feature selection, removal of redundant and noise features, and dimensionality reduction. The primary and secondary models are determined based on the initial training model, and the primary and secondary models are trained alternately multiple times using micro-batch training based on the real-time features to obtain an incremental training model. In each alternating training process, one of the primary and secondary models is incrementally trained, while the other is used for online inference services. The model used for incremental training in each alternating training process is different from the previous alternating training process. The incremental training model is corrected based on the full feature library obtained within the historical time period to obtain the corrected training model. The online inference service involves deploying the incremental training model as an online service on a server or in the cloud. The business system triggers the call to the online inference service in the context of intelligent service through the interaction with the user, and passes in some contextual information from the user. The online inference service returns the inference result to the business system based on the incremental training model, and the business system processes the result and returns it to the user. The incremental training model is corrected based on the full feature library obtained within the historical time period to obtain a corrected training model, including: The evaluation results of the incremental training model are obtained based on user business metrics, including click-through rate, browsing duration, playback duration, new users, retention rate, daily active users, monthly active users, and conversion rate. Based on the evaluation results and the full feature library obtained within the historical time period, the incremental training model is modified to obtain the modified training model.

2. The method according to claim 1, characterized in that, Based on the real-time features, the main model and the sub-model are trained alternately multiple times using micro-batch training to obtain an incremental training model, including: Based on the actual business scenario, trigger conditions are set in advance, and the trigger conditions are whether the real-time feature data volume reaches the preset feature data volume. Determine whether the amount of data for the real-time features meets the preset triggering conditions. If so, trigger the micro-batch training instruction to perform micro-batch training and update the main model or the sub-model to obtain the trained incremental training model.

3. The method according to claim 1, characterized in that, The initial training model is a model obtained by training the full feature data of the full feature library offline; the main model and the sub-model are trained alternately until the incremental training process of the model ends.

4. The method according to claim 1, characterized in that, The extraction of real-time features from the raw stream data and their addition to the full feature library includes: Real-time computing technology in big data is used to extract features from the raw streaming data in real time. The real-time computing technology is the Flink real-time computing framework. The features extracted in real time are added to the full feature library.

5. The method according to claim 4, characterized in that, The method further includes storing the real-time extracted features using a message queue for incremental model training, wherein the message queue is a Kafka distributed publish-subscribe messaging system.

6. An incremental model training device based on streaming data, characterized in that, include: The acquisition module is used to acquire raw stream data, which is online shopping data generated by the user using a mobile or web application. The extraction module is used to extract real-time features from the raw stream data and add them to the full feature library. The extraction of real-time features from the raw stream data includes, but is not limited to: data cleaning, sampling, feature selection, removal of redundant and noise features, and dimensionality reduction. The training module is used to determine the main model and the sub-model based on the initial training model, and to perform multiple alternating trainings on the main model and the sub-model using micro-batch training based on the real-time features to obtain an incremental training model. In each alternating training process, one of the main model and the sub-model is used for incremental training, while the other is used for online inference services. The model used for incremental training in each alternating training process is different from the previous alternating training process. The inference module is used to deploy the incrementally trained model, which is updated in real time, as an online inference service, so as to realize real-time online inference service with the latest model; The correction module is used to correct the incremental training model based on the full feature library obtained within the historical time period, so as to obtain the corrected training model. The online inference service involves deploying the incremental training model as an online service on a server or in the cloud. The business system triggers the call to the online inference service in the context of intelligent service through the interaction with the user, and passes in some contextual information from the user. The online inference service returns the inference result to the business system based on the incremental training model, and the business system processes the result and returns it to the user. The incremental training model is corrected based on the full feature library obtained within the historical time period to obtain a corrected training model, including: The evaluation results of the incremental training model are obtained based on user business metrics, including click-through rate, browsing duration, playback duration, new users, retention rate, daily active users, monthly active users, and conversion rate. Based on the evaluation results and the full feature library obtained within the historical time period, the incremental training model is modified to obtain the modified training model.

7. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the incremental model training method based on streaming data as described in any one of claims 1 to 5.

8. A readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the incremental model training method based on streaming data as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A streaming data recommendation method based on feature evolution

    CN109508424A

  • Image processing method and device

    CN113705301A