Updating method and device of event prediction model, terminal and storage medium

By introducing methods such as prompt information display, prediction loss determination and historical cumulative gradient update in the event prediction model, the problem of reduction in prediction accuracy caused by user behavior changes is solved, and the prediction accuracy and model robustness are improved.

CN119493802APending Publication Date: 2025-02-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311027721.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the prior art, event prediction models cannot accurately predict user behavior changes, resulting in a decrease in the accuracy of prediction results.

Method used

By introducing methods such as prompt information display, prediction loss determination and historical cumulative gradient update in the event prediction model, the parameters of the event prediction model are updated to adapt to changes in user behavior.

Benefits of technology

Improve the prediction accuracy of the event prediction model and enhance the robustness of the model to prevent abnormal data from affecting parameter updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493802A_ABST
    Figure CN119493802A_ABST
Patent Text Reader

Abstract

The invention provides an event prediction model updating method and device, a terminal and a storage medium, and belongs to the technical field of computers. The method is executed by a terminal, and comprises the following steps: displaying prompt information under the condition that a prediction result of an event prediction model in a (t-1)-th prediction period indicates that a target object triggers a first terminal event in a t-th prediction period; based on a second terminal event triggered by the target object in the t-th prediction period and the prediction result, determining prediction loss of the event prediction model in the t-th prediction period; and updating parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period. According to the scheme, the parameters of the event prediction model are updated in a multi-time updating mode, and the parameters of the event prediction model can be updated in time under the condition that the terminal data are changed, so that the event prediction model is enabled to quickly adapt to the continuously changing terminal data, and the prediction accuracy of the event prediction model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, terminal and storage medium for updating an event prediction model. Background Art

[0002] With the development of computer technology, terminals such as smart phones and tablet computers have gradually become popular in people's daily lives. In order to provide users with more intelligent and personalized services, terminals usually predict user behaviors based on their behavioral habits, such as predicting users' listening behaviors. Therefore, how to more accurately predict user behaviors is a technical problem that needs to be solved.

[0003] In the related art, after authorization by the user, the terminal can collect data generated by the user during the use of the terminal, such as the time period when the user listens to music, watches videos, or plays games. Then, the server trains the prediction model based on the large amount of data collected by the terminal, so that the prediction model can accurately predict the probability of the user listening to music, watching videos, or playing games in the current time period.

[0004] However, using the above training method, since the collected data has a certain timeliness, when the user's behavior habits change, such as the user changes from watching videos before going to bed to listening to music before going to bed, the prediction model cannot accurately predict the user's behavior, resulting in a decrease in the accuracy of the prediction results. Summary of the invention

[0005] The embodiment of the present application provides a method, device, terminal and storage medium for updating an event prediction model, which can improve the accuracy of event prediction model prediction. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a method for updating an event prediction model is provided, the method comprising:

[0007] In the case where the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, displaying prompt information, the event prediction model is used to predict whether the target object triggers the first terminal event based on the terminal data of the first terminal in the prediction period, the prompt information is used to prompt the first terminal event, and t is an integer greater than 1;

[0008] Determining a prediction loss of the event prediction model in the tth prediction period based on a second terminal event triggered by the target object in the tth prediction period and the prediction result;

[0009] Based on the prediction loss and the historical cumulative gradient of the t-th prediction period, the parameters of the event prediction model are updated, and the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, where n is a positive integer less than t.

[0010] According to another aspect of an embodiment of the present application, a device for updating an event prediction model is provided, the device comprising:

[0011] A display module, configured to display prompt information when a prediction result of an event prediction model in a t-1th prediction period indicates that the target object triggers a first terminal event in a tth prediction period, wherein the event prediction model is configured to predict whether the target object triggers the first terminal event based on terminal data of the first terminal in the prediction period, and the prompt information is configured to prompt the first terminal event, and t is an integer greater than 1;

[0012] a determination module, configured to determine a prediction loss of the event prediction model in the tth prediction period based on a second terminal event triggered by the target object in the tth prediction period and the prediction result;

[0013] An updating module is used to update the parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period, wherein the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, and n is a positive integer less than t.

[0014] In some embodiments, the update module includes:

[0015] A determining unit, configured to determine a gradient update amount of the t-th prediction period based on the prediction loss, wherein the gradient update amount is positively correlated with the prediction loss;

[0016] A first updating unit, configured to update the historical accumulated gradient based on the gradient update amount to obtain an updated gradient;

[0017] The second updating unit is used to update the parameters of the event prediction model based on the updated gradient.

[0018] In some embodiments, the determination unit is used to determine the learning rate of the tth prediction period based on the prediction loss, and the learning rate is positively correlated with the prediction loss; multiply the historical cumulative learning rate with the parameters of the event prediction model after the t-1th prediction period to obtain the gradient update amount of the tth prediction period, and the historical cumulative learning rate is the sum of n learning rates from the tnth prediction period to the t-1th prediction period.

[0019] In some embodiments, the second updating unit is used to construct an objective function, which includes the updated gradient, at least one regularization term and the parameters of the event prediction model, and the objective function is used to update the parameters of the event prediction model; taking the minimum value of the objective function as the optimization target, optimizing the objective function, and obtaining the updated parameters of the event prediction model in the objective function in the tth prediction period.

[0020] In some embodiments, the second updating unit is used to determine a first regularization term, which is the L1 norm of the parameters of the event prediction model; determine a second regularization term, which is the L2 norm of the parameters of the event prediction model; construct the objective function based on the first regularization term, the second regularization term and the product term, the first regularization term and the second regularization term are used to regularize the updated gradient, and the product term is the product of the updated gradient and the parameters of the event prediction model.

[0021] In some embodiments, the determination module is also used to determine the prediction loss of the event prediction model in the tth prediction period based on the second terminal event triggered by the target object in the tth prediction period and the prediction result, when the prediction result of the event prediction model in the t-1th prediction period indicates that the target object does not trigger the first terminal event in the tth prediction period.

[0022] In some embodiments, the apparatus further comprises:

[0023] The prediction module is used to predict whether the target object triggers the first terminal event in the t+1th prediction period based on the terminal data of the first terminal in the tth prediction period through the event prediction model, and obtain the prediction result in the tth prediction period.

[0024] In some embodiments, the parameters of the event prediction model are parameter vectors, the terminal data include multiple types of data, and the values ​​of the elements in the parameter vector are used to represent the weight of each type of data;

[0025] The prediction module is used to determine multiple first elements in the parameter vector, where the first elements are non-zero elements; through the event prediction model, based on the values ​​of the multiple first elements, the multiple types of terminal data of the first terminal in the tth prediction period are processed respectively to obtain the prediction results in the tth prediction period.

[0026] In some embodiments, the terminal data is a terminal feature vector, the elements in the terminal feature vector are used to represent the characteristics of the target object using the first terminal, and the dimension of the terminal feature vector is the same as the dimension of the parameter vector;

[0027] The prediction module is used to obtain the numerical values ​​of the multiple first elements according to the index of the multiple first elements through the event prediction model, and the index of the first element is the dimension identifier of the first element in the parameter vector; through the event prediction model, according to the numerical values ​​of the multiple first elements, process the multiple second elements respectively to obtain the prediction results within the t-th prediction period, the multiple second elements are elements in the terminal feature vector, and the dimension identifiers of the multiple second elements in the terminal feature vector correspond one-to-one to the dimension identifiers of the multiple first elements in the parameter vector.

[0028] In some embodiments, the prediction module is further used to store the value of any first element based on the index of the first element; and determine the multiple second elements in the terminal feature vector based on the indexes of the multiple first elements through the event prediction model.

[0029] According to another aspect of an embodiment of the present application, a terminal is provided, comprising a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the event prediction model updating method as described in the above aspects.

[0030] According to another aspect of an embodiment of the present application, a chip is provided, which includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal, it is used to implement the event prediction model updating method described in the above aspects.

[0031] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the event prediction model updating method as described in the above aspects.

[0032] According to another aspect of an embodiment of the present application, a computer program product is provided, which stores at least one program code, and the at least one program code is used to be executed by a processor to implement the event prediction model updating method described in the above aspect.

[0033] The embodiment of the present application provides an update scheme for an event prediction model. In the process of updating the event prediction model, the terminal updates the parameters of the event prediction model by means of multiple updates. Since after each update, the event prediction model can process the terminal data in this update process to obtain a prediction result. Therefore, when the terminal data changes, the terminal can timely update the parameters of the event prediction model according to the prediction loss and historical cumulative gradient of the last update, so that the event prediction model can quickly adapt to the changing terminal data. In addition, updating the parameters of the event prediction model according to the prediction loss and historical cumulative gradient can not only improve the accuracy of the prediction results, but also retain the influence of the gradient of some historical update processes on this parameter update, and prevent this parameter update from being affected by a small amount of abnormal data, thereby improving the robustness of the event prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0036] Figure 2 It is a flowchart of a method for updating an event prediction model provided in an embodiment of the present application;

[0037] Figure 3 is a flowchart of another method for updating an event prediction model provided in an embodiment of the present application;

[0038] Figure 4 is a schematic diagram of a gradient update provided in an embodiment of the present application;

[0039] Figure 5 is a schematic diagram of an update event prediction model provided in an embodiment of the present application;

[0040] Figure 6 It is a structural schematic diagram of an event prediction model updating device provided in an embodiment of the present application;

[0041] Figure 7 It is a structural schematic diagram of another device for updating an event prediction model provided in an embodiment of the present application;

[0042] Figure 8 It is a structural block diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0044] In this article, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0045] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the terminal data involved in this application is obtained with full authorization.

[0046] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 can be directly or indirectly connected to the server 102 through wired or wireless communication.

[0047] Optionally, the terminal 101 can be a mobile phone, desktop computer, laptop computer, tablet computer, smart watch and other types of terminals. Optionally, the terminal 101 installs and runs various types of applications, such as video, audio, news and reading applications. Users can log in to the application through the terminal 101 and use the services provided by the application. Accordingly, after the user's authorization, the terminal collects terminal data generated by the user using the terminal. Among them, the terminal data includes data generated by the user using the functions of the terminal or using the applications installed on the terminal. The terminal generates a prediction model or prediction algorithm based on the collected terminal data, so that the user's behavioral intention can be accurately predicted through the prediction model or prediction algorithm, thereby providing users with more intelligent and personalized services. The above-mentioned application is associated with the server 102, and the server 102 provides background services.

[0048] Optionally, the server 102 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 use a distributed computing architecture for collaborative computing.

[0049] Figure 2 is a flow chart of a method for updating an event prediction model provided in an embodiment of the present application. The method is executed by the first terminal, see Figure 2 , the method comprising:

[0050] 201. When the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, the first terminal displays a prompt message, the first terminal is the terminal used by the target object, the event prediction model is used to predict whether the target object triggers the first terminal event based on the terminal data of the first terminal in the prediction period, the prompt message is used to prompt the first terminal event, and t is an integer greater than 1.

[0051] In an embodiment of the present application, the first terminal is a terminal of various types such as a smart phone, tablet computer, laptop computer, desktop computer, smart watch, etc. used by the target object. The target object is a user using the first terminal. The target object may also be a user account logged in by the first terminal. For ease of description, the target object is referred to as a user below. When a user uses the first terminal, various terminal events are triggered, generating various types of terminal data. For example, when a user uses a Bluetooth headset to listen to the audio output by an audio-type application installed on the first terminal, the generated terminal data includes at least one of the type of application used by the user, the time period when the user uses the application, the Bluetooth connection status of the first terminal, the network connection status of the first terminal, and the power level of the first terminal.

[0052] In order to provide users with more accurate, intelligent and personalized recommendation services, the first terminal is deployed with multiple event prediction models. The event prediction model is used to periodically predict terminal events that may be triggered by the user based on the above terminal data. Among them, each event prediction model is used to predict a terminal event. For example, the above multiple event prediction models may include an event prediction model for predicting whether the user plays audio, an event prediction model for predicting whether the user watches a video, and an event prediction model for predicting whether the user turns on navigation, etc.

[0053] For any event prediction model, when the prediction result of the event prediction model in the t-1th prediction period indicates that the user triggers the first terminal event in the t-1th prediction period, the first terminal displays a prompt message to prompt the user of the first terminal event. For example, if the event prediction model is an event prediction model for predicting whether the user turns on navigation, then when the prediction result in the t-1th prediction period indicates that the user will turn on navigation in the next prediction period, the first terminal displays a prompt message of "Do you want to turn on navigation for you". Therefore, if the user has the intention to turn on navigation, the user can trigger the first terminal event of turning on navigation by confirming the prompt message. Accordingly, the first terminal automatically turns on navigation without the user manually turning on navigation, thereby improving the efficiency of human-computer interaction.

[0054] 202. The first terminal determines a prediction loss of the event prediction model in the tth prediction period based on the second terminal event triggered by the target object in the tth prediction period and the prediction result.

[0055] In an embodiment of the present application, the second terminal event is an event actually triggered by the user in the tth prediction period. If the user performs a confirmation operation on the prompt information in the tth prediction period, the second terminal event is the same as the first terminal event. If the user ignores the prompt information or triggers other terminal events in the tth prediction period, the second terminal event is different from the first terminal event. Therefore, the first terminal determines the prediction loss of the event prediction model in the tth prediction period based on the prediction results of the event prediction model in the t-1th prediction period and the terminal event actually triggered by the target object in the tth prediction period.

[0056] 203. The first terminal updates the parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period, where the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, where n is a positive integer less than t.

[0057] In an embodiment of the present application, the first terminal updates the parameters of the event prediction model in the tth prediction period according to the prediction loss and the historical cumulative gradient in the tth prediction period, so that the event prediction model can adapt to the changing terminal data. The historical cumulative gradient is the sum of the gradients of the previous n prediction periods of the current prediction period. The previous n prediction periods of the current prediction period are from the tnth prediction period to the t-1th prediction period.

[0058] Among them, according to the parameters of the time prediction model based on the historical cumulative gradient, the influence of the gradient of some historical prediction cycles on the parameter update of this round can be retained, preventing the parameter update of this round from being affected by a small amount of abnormal data, thereby improving the robustness of the event prediction model. In addition, since n is less than t, in the process of each parameter update, only the n prediction cycles closest to the current prediction cycle are selected to avoid the influence of the gradient of the historical prediction cycle on the parameter update, which causes the event prediction model to be unable to adapt to the changing terminal data in time.

[0059] The embodiment of the present application provides a method for updating an event prediction model. In the process of updating the event prediction model, the terminal updates the parameters of the event prediction model by means of multiple updates. Since after each update, the event prediction model can process the terminal data in this update process to obtain a prediction result. Therefore, when the terminal data changes, the terminal can timely update the parameters of the event prediction model according to the prediction loss and historical cumulative gradient of the last update, so that the event prediction model can quickly adapt to the changing terminal data. In addition, updating the parameters of the event prediction model according to the prediction loss and historical cumulative gradient can not only improve the accuracy of the prediction results, but also retain the influence of the gradient of some historical update processes on this parameter update, and prevent this parameter update from being affected by a small amount of abnormal data, thereby improving the robustness of the event prediction model.

[0060] Figure 3 is a flowchart of another method for updating an event prediction model provided in an embodiment of the present application. The method is executed by the first terminal, see Figure 3 , the method comprising:

[0061] 301. When the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, the first terminal displays a prompt message, the first terminal is the terminal used by the target object, the event prediction model is used to predict whether the target object triggers the first terminal event based on the terminal data of the first terminal in the prediction period, the prompt message is used to prompt the first terminal event, and t is an integer greater than 1.

[0062] In an embodiment of the present application, the first terminal is a terminal of various types such as a smart phone, tablet computer, laptop computer, desktop computer, smart watch, etc. used by the target object. The target object is a user using the first terminal. The target object may also be a user account logged in by the first terminal. In the process of using the first terminal by the target object, various terminal events will be triggered and various types of terminal data will be generated. For example, if the target object uses a Bluetooth headset to listen to the audio output by an audio-type application installed on the first terminal, the terminal data generated includes at least one of the type of application used by the target object, the time period during which the target object uses the application, the Bluetooth connection status of the first terminal, the network connection status of the first terminal, and the power level of the first terminal.

[0063] In order to provide more accurate, intelligent and personalized recommendation services to the target object, the first terminal is deployed with multiple event prediction models. The event prediction model is used to periodically predict the terminal events that may be triggered by the target object based on the above terminal data. Among them, each event prediction model is used to predict a terminal event. For example, the above multiple event prediction models may include an event prediction model for predicting whether the target object plays audio, an event prediction model for predicting whether the target object watches a video, and an event prediction model for predicting whether the target object turns on navigation, etc.

[0064] For any event prediction model, when the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, the first terminal displays a prompt message to prompt the target object with the first terminal event. For example, if the event prediction model is an event prediction model for predicting whether the target object turns on navigation, then when the prediction result in this prediction period indicates that the target object will turn on navigation in the next prediction period, the first terminal displays a prompt message of "Do you want to turn on navigation for you". Therefore, if the target object has the intention to turn on navigation, the target object can trigger the first terminal event of turning on navigation by confirming the prompt message. Accordingly, the first terminal automatically turns on navigation without the need for the target object to manually turn on navigation, thereby improving the efficiency of human-computer interaction.

[0065] In some embodiments, the prompt information may be a prompt text for prompting the first terminal event, such as "whether to turn on navigation for you", "whether to turn on mute for you", "whether to turn on power saving mode for you", etc.; the prompt information may also be a prompt picture or a prompt animation; the prompt information may also be a prompt audio. Wherein, in the case where the prompt information is a prompt audio, the first terminal may play the prompt audio through a speaker or an audio output device connected to the first terminal (such as a wired headset, a Bluetooth headset, a Bluetooth speaker, or a car speaker, etc.). In addition, the first terminal may also display multiple types of prompt information at the same time, such as playing the prompt audio corresponding to the prompt text while displaying the prompt text. The embodiment of the present application does not limit the specific manner in which the first terminal displays the prompt information and the specific form of the prompt information.

[0066] In some embodiments, when the prediction result indicates that the target object does not trigger the first terminal event in the tth prediction period, the first terminal does not display the prompt information, thereby avoiding interference with the target object. However, even if the prompt information is not displayed, the first terminal can still determine the prediction loss of the event prediction model in the tth prediction period based on the second terminal event triggered by the target object in the tth prediction period and the above prediction results. Therefore, in the case where the second terminal event is the first terminal event, that is, when the prediction result indicates that the target object does not trigger the first terminal event in the tth prediction period, but the target object actually triggers the first terminal event, the first terminal can also determine the prediction loss of the event prediction model in the tth prediction period.

[0067] In some embodiments, the prediction result of the event prediction model in the t-1th prediction period can indicate the probability that the target object triggers the first terminal event in the tth prediction period. For example, the prediction result is a value between 0-1. The larger the value of the prediction result, the higher the probability that the target object triggers the first terminal event in the tth prediction period; the smaller the value of the prediction result, the lower the probability that the target object triggers the first terminal event in the tth prediction period. Therefore, when the value of the prediction result is not less than the preset value, the prediction result indicates that the target object triggers the first terminal event in the tth prediction period; when the value of the prediction result is less than the preset value, the prediction result indicates that the target object does not trigger the first terminal event in the tth prediction period. Among them, the preset value can be a preset value, such as 0.5, 0.6, and the embodiments of the present application are not limited to this.

[0068] 302. The first terminal determines a prediction loss of the event prediction model in the tth prediction period based on the second terminal event triggered by the target object in the tth prediction period and the prediction result.

[0069] In an embodiment of the present application, the second terminal event is an event actually triggered by the target object in the tth prediction period. If the target object performs a confirmation operation on the prompt information in the tth prediction period, the second terminal event is the same as the first terminal event. If the target object ignores the prompt information or triggers other terminal events in the tth prediction period, the second terminal event is different from the first terminal event. Therefore, the first terminal determines the prediction loss of the event prediction model in the tth prediction period based on the prediction results of the event prediction model in the t-1th prediction period and the terminal event actually triggered by the target object in the tth prediction period.

[0070] In some embodiments, the terminal determines the true label of the target object feedback based on the first terminal event and the second terminal event. When the second terminal event is the same as the first terminal event, the true label is 1; when the second terminal event is different from the first terminal event, the true label is 0. Then, the terminal determines the prediction loss in the tth prediction cycle through the loss function using the true label and the probability indicated by the above prediction result. Among them, when the true label is 1, the higher the probability indicated by the prediction result, the smaller the prediction loss; the lower the probability indicated by the prediction result, the greater the prediction loss, that is, the prediction loss is negatively correlated with the probability indicated by the prediction result. When the true label is 0, the prediction loss is positively correlated with the probability indicated by the prediction result.

[0071] In some embodiments, the terminal event includes multiple sub-terminal events. The prediction results of the event prediction model can also indicate the probability of the target object triggering multiple sub-terminal events. Therefore, in the process of the first terminal determining the predicted loss within any prediction period, the weight of the sub-terminal event can be determined according to the depth of the sub-terminal event triggered by the target object. Among them, the depth is used to reflect the complexity of the sub-terminal event triggered by the target object, and the weight is used to reflect the contribution of the prediction result of the sub-terminal event to the predicted loss of the terminal event. For example, the weight of the terminal event is 0.5, the weight of the first-level sub-terminal event of the terminal event is 0.3, and the weight of the second-level sub-terminal event of the terminal event is 0.2. Then, the first terminal performs weighted summation of the predicted losses of the terminal event and the sub-terminal events at all levels according to the weight of the terminal event and the weight of the sub-terminal events at all levels, and obtains the predicted loss within the t-th prediction period.

[0072] For example, the first terminal event is to turn on navigation. The first-level sub-terminal events of the first terminal event are to turn on A navigation and turn on B navigation. The second-level sub-terminal events of the first terminal are to turn on A navigation and navigate to the target location "xx company"; turn on A navigation and navigate to the target location "xxx shopping mall"; turn on B navigation and navigate to the target location "xx company" and turn on B navigation and navigate to the target location "xxx shopping mall". When the prediction result of the event prediction model in the t-1th prediction period indicates that the target object turns on A navigation and navigates to the target location "xx company", the first terminal displays a prompt message "Do you want to turn on A navigation for you, and the navigation destination is xx company". In response to the target object confirming the prompt message in the tth prediction period and modifying the target location to "xx community", it indicates that the event prediction model successfully predicted the first terminal event and the first-level sub-terminal event of the first terminal event, but failed to successfully predict the second-level sub-terminal event. Therefore, the true label of the first terminal event and the first-level sub-terminal event is 1, and the true label of the second-level sub-terminal event is 0. The terminal determines the prediction loss of the terminal event and the prediction loss of the sub-terminal events at each level respectively according to the probability of the target object indicated by the above three real labels and the prediction results triggering the above terminal event and the sub-terminal events at each level. Then, the first terminal performs a weighted summation of the prediction loss of the terminal event and the prediction loss of the sub-terminal events at each level according to the weight of the terminal event and the weight of the sub-terminal events at each level to obtain the prediction loss in the t-th prediction period.

[0073] 303. The first terminal determines a gradient update amount for the t-th prediction period based on the prediction loss, where the gradient update amount is positively correlated with the prediction loss.

[0074] In an embodiment of the present application, after the first terminal determines the prediction loss of the event prediction model in the tth prediction period, the gradient update amount of the event prediction model in the tth prediction period is determined according to the prediction loss. Among them, the gradient update amount is used to indicate the update amplitude of the gradient in the current prediction period. The larger the prediction loss, the lower the accuracy of the prediction result, so the gradient update amplitude is increased to make the update speed of the event prediction model parameters faster and improve the efficiency of parameter update.

[0075] In some embodiments, the first terminal determines the gradient update amount of the t-th prediction period according to the historical cumulative learning rate. In each prediction period, after the first terminal determines the prediction loss of the prediction period, the first terminal determines the learning rate of the prediction period according to the prediction loss. Among them, the learning rate is positively correlated with the prediction loss, and the learning rate is used to control the amplitude of parameter update. The first terminal determines the sum of the learning rates of the first n prediction periods of the current prediction period as the cumulative learning rate of the current prediction period. In the case where the current prediction period is the t-th prediction period, the first n prediction periods of the current prediction period are the tn-th prediction period to the t-1-th prediction period. Among them, n can be a preset value, such as 3, 4 or 5, and the embodiment of the present application does not limit this. Then, the first terminal multiplies the historical cumulative learning rate with the parameters of the event prediction model after the t-1-th prediction period to obtain the gradient update amount of the t-th prediction period. Among them, the gradient update amount is positively correlated with the historical cumulative learning rate.

[0076] 304. The first terminal updates the historical accumulated gradient based on the gradient update amount to obtain an updated gradient, where the historical accumulated gradient is the sum of n gradients from the tnth prediction period to the t-1th prediction period, where n is a positive integer less than t.

[0077] In an embodiment of the present application, the first terminal determines the sum of the n gradients from the tnth prediction period to the t-1th prediction period as the historical cumulative gradient of the tth prediction period. The historical cumulative gradient is the gradient to be updated in the tth prediction period. The first terminal updates the historical cumulative gradient according to the gradient update amount of the tth prediction period to obtain an updated gradient. Therefore, the difference between the updated gradient and the historical cumulative gradient is the gradient update amount of the tth prediction period. Since each time the gradient is updated, the updated gradient is the sum of the gradients of the n adjacent prediction periods before the current prediction period. Therefore, each gradient update will be affected by the gradients of the previous n adjacent prediction periods, so that the gradient update will not be affected by a small number of abnormal terminal data.

[0078] It should be noted that the embodiment of the present application is described by taking the number of historical prediction cycles selected in each prediction cycle as n as an example. In some embodiments, in each prediction cycle, before the first terminal determines the historical cumulative gradient and historical cumulative learning rate of the prediction cycle, the first terminal determines the target number of historical prediction cycles selected in the current prediction cycle. Then, the first terminal determines the historical cumulative gradient and historical cumulative learning rate of the current prediction cycle based on the gradient and learning rate of the adjacent target number of prediction cycles before the current prediction cycle. Therefore, using the above method, the number of historical prediction cycles selected in different prediction cycles may be the same or different, and the embodiment of the present application does not limit it. In addition, after the first terminal determines the target number of historical prediction cycles selected in this prediction cycle, the first terminal may also arbitrarily select a target number of consecutive prediction cycles before the current prediction cycle, and the target number of consecutive prediction cycles may not be adjacent to the current prediction cycle. For example, when the current prediction cycle is the tth prediction cycle and the target number of historical prediction cycles selected within the tth prediction cycle is 3, the first terminal can select the t-2th prediction cycle to the t-4th prediction cycle, and determine the historical cumulative gradient and historical cumulative learning rate of the tth prediction cycle based on the gradient and learning rate from the t-2th prediction cycle to the t-4th prediction cycle.

[0079] 305. The first terminal updates parameters of the event prediction model based on the updated gradient.

[0080] In an embodiment of the present application, the first terminal updates the parameters of the event prediction model according to the update direction indicated by the updated gradient, so that the updated event prediction model can output more accurate prediction results based on the terminal data in the current prediction period.

[0081] In some embodiments, the event prediction model can be represented by a logistic regression algorithm as shown in the following formula (1). The logistic regression algorithm is used to process the input terminal data to obtain a prediction result, which can indicate the probability of the target object triggering the first terminal event.

[0082]

[0083] Where x is the terminal data. y is the prediction result. The value range of y is (0,1). T is the transpose of the weight matrix. The weight matrix includes the weights of various terminal data. The weights in the weight matrix correspond to the parameters of the event prediction model. Therefore, the first terminal updates the parameters of the event prediction model, that is, updates the weight w in the weight matrix.

[0084] In some embodiments, the first terminal updates the parameter w of the event prediction model by constructing an objective function and performing minimum optimization on the objective function. The first terminal constructs the objective function through the updated gradient, at least one regularization term, and the parameters of the event prediction model. The objective function is used to update the parameter w of the event prediction model. The first terminal optimizes the objective function with the minimum value of the objective function as the optimization target, and obtains the updated parameters of the event prediction model in the objective function in the tth prediction cycle. When the objective function takes the minimum value, or the difference between the value of the objective function and the minimum value is less than the difference threshold, it can be considered that the objective function has reached the optimization target. When the objective function reaches the optimization target, the parameters of the event prediction model in the objective function are the parameters of the event prediction model updated in the tth prediction cycle.

[0085] In some embodiments, the first terminal constructs an objective function by regularizing the updated gradient using the L1 norm and the L2 norm. The first terminal determines the L1 norm of the parameter w of the event prediction model as the first regularization term in the objective function, and determines the L2 norm of the parameter w of the event prediction model as the second regularization term in the objective function. The first regularization term and the second regularization term are used to regularize the updated gradient. The first terminal determines the product of the updated gradient and the parameter of the event prediction model as the product term in the objective function. Then, the first terminal constructs the objective function based on the first regularization term, the second regularization term, and the product term.

[0086] Since the first regularization term can make the parameters of the event prediction model tend to 0, therefore, by updating the parameters of the event prediction model through the objective function with the first regularization term, it is possible to remove redundant parameters in the event prediction model, simplify the complexity of the event prediction model, and thus reduce the amount of computation and memory space occupied by the event prediction model. Since the second regularization term can make the parameters of the event prediction model tend to smaller values. Therefore, by updating the parameters of the event prediction model through the objective function with the second regularization term, it is possible to reduce the impact of the disturbance of the terminal data on the parameter update, thereby improving the robustness of the event prediction model.

[0087] Among them, the terminal can construct the objective function shown in the following formula (2) through the first regularization term, the second regularization term and the product term, and update the parameter w of the event prediction model according to the objective function.

[0088]

[0089] in, is the objective function. is the parameter of the event prediction model. This parameter is a parameter vector, and the elements in the parameter vector are used to represent the weights of different types of terminal data. is the updated gradient. Therefore, the first term in the objective function is the product term. The first regular term is the L1 norm of parameter w. The second regularization term is the L2 norm of parameter w. Where λ1 and λ2 are the penalty parameters of L1 norm and L2 norm respectively. σ (t-n:t-1) is the historical cumulative learning rate of the t-th prediction period, that is, the sum of the n learning rates from the tn-th prediction period to the t-1-th prediction period. The target optimization object of the objective function is The optimization goal is to minimize the objective function. The first terminal can determine the parameters in the objective function when the objective function satisfies the optimization goal through the above formula (2). That is, the updated parameter in the tth prediction period

[0090] In addition, the first terminal can determine the updated gradient in the t-th prediction period by the gradient update formula shown in the following formula (3):

[0091]

[0092] in, is the historical cumulative gradient of the t-th prediction period, that is, the sum of the n gradients from the tn-th prediction period to the t-1-th prediction period. is the gradient update amount of the t-th prediction cycle, which is also the historical cumulative learning rate σ (t-n:t-1) and the parameters of the event prediction model after the t-1th prediction period The product of .

[0093] In order to explain the above gradient update process more clearly, Figure 4 The schematic diagram of gradient update shown in FIG. 1 illustrates the process of updating the gradient in the t-th prediction cycle. Figure 4 As shown, g t to g t-4 are the gradients from the t-th prediction period to the t-4th prediction period. When the current prediction period is the t-th prediction period and the number of historical prediction periods selected by the first terminal is 3, the first terminal calculates the sum of the three gradients from the t-1st prediction period to the t-3rd prediction period, that is, g t-1 to g t-3 The sum of the historical cumulative gradients of the t-th forecast period Then, the first terminal updates the amount according to the gradient Update the historical cumulative gradient to obtain the updated gradient in the tth prediction period

[0094] 306. The first terminal predicts whether the target object triggers the first terminal event in the t+1th prediction period based on the terminal data of the first terminal in the tth prediction period through the event prediction model, and obtains the prediction result in the tth prediction period.

[0095] In an embodiment of the present application, after the first terminal updates the parameters of the event prediction model in the tth prediction period, the terminal data of the first terminal in the tth prediction period can be processed according to the updated event prediction model to obtain the prediction result of the tth prediction period. Among them, the prediction result of the tth prediction period can indicate whether the target object triggers the first terminal event in the t+1th prediction period. Therefore, in each prediction period, the first terminal can process the recent terminal data of the first terminal according to the event prediction model after the most recent parameter update, so that the prediction result can adapt to the constantly changing terminal data and improve the accuracy of the prediction result.

[0096] In some embodiments, the parameters of the event prediction model are parameter vectors, the terminal data include multiple types of data, and the values ​​of the elements in the parameter vector are used to represent the weight of each type of terminal data. Due to the parameter update process, many elements in the parameter vector of the event prediction model will be updated to 0. Moreover, the element with a value of 0 only indicates that the corresponding type of terminal data is not processed, and has no other practical meaning. Therefore, in the process of the first terminal processing multiple types of terminal data through the parameter vector, the first terminal determines multiple first elements in the parameter vector. Among them, the first element is a non-0 element. Then, the first terminal processes the multiple types of terminal data of the first terminal in the t-th prediction period according to the values ​​of the multiple first elements through the event prediction model, and obtains the prediction result in the t-th prediction period. Therefore, only processing the terminal data through the non-0 first element in the parameter vector can reduce the number of elements involved in the calculation, reduce the calculation amount of the event prediction model, and improve the processing speed of the event prediction model.

[0097] In some embodiments, the terminal data is a terminal feature vector, and the elements in the terminal feature vector are used to represent the characteristics of the target object using the first terminal. The dimension of the terminal feature vector is the same as the dimension of the parameter vector. Therefore, in the terminal feature vector, the elements corresponding to the elements that do not participate in the calculation in the above parameter vector do not participate in the calculation. Therefore, the first terminal can determine multiple second elements participating in the calculation in the terminal feature vector based on the above multiple first elements participating in the calculation. First, for any first element, the first terminal determines the index of the first element based on the dimension identifier of the first element in the parameter vector. Then, the terminal stores the value of the first element based on the index of the first element. Then, the first terminal determines multiple second elements in the terminal feature vector based on the indexes of multiple first elements through the event prediction model.

[0098] For example, when the parameter vector is {0, 0, 0, 0.6, 0.1} and the terminal feature vector is {0.1, 0, 0, 0.9, 1}, the first terminal determines two first elements in the parameter vector: 0.6 and 0.1, and determines that the dimension identifiers of the two first elements are 4 and 5 respectively. Then, the first terminal records the index and value of the first element through the lookup table shown in Table 1 below. Then, the first terminal determines two second elements in the terminal feature vector: 0.9 and 1 according to the index recorded in the lookup table through the event prediction model.

[0099] Table 1

[0100] index Numeric 4 0.6 5 0.1

[0101] In some embodiments, the first terminal processes the multiple second elements respectively through the multiple first elements to obtain the prediction results within the t-th prediction period. First, the first terminal obtains the values ​​of the multiple first elements in the above-mentioned lookup table according to the indexes of the multiple first elements through the event prediction model. Then, the first terminal processes the multiple second elements respectively according to the values ​​of the multiple first elements through the event prediction model to obtain the prediction results within the t-th prediction period. Among them, the dimension identifiers of the multiple second elements in the terminal feature vector correspond one-to-one to the dimension identifiers of the multiple first elements in the parameter vector.

[0102] For example, the first terminal processes the two second elements with values ​​of 0.9 and 1 in the terminal feature vector respectively according to the first elements with values ​​of 0.6 and 0.1 through the event prediction model, and obtains the prediction result in the t-th prediction period as follows: 0.6*0.9+0.1*1=0.64. The prediction result shows that the target object has a 64% probability of triggering the first terminal event, so the first terminal displays a prompt message to prompt the target object with the first terminal event.

[0103] By storing the indexes and values ​​of multiple non-zero elements in the parameter vector through the above-mentioned lookup table, it is not only convenient for the first terminal to find the value of the first element, but also convenient for the first terminal to determine multiple second elements in the terminal feature vector according to the index, and there is no need to store other elements in the parameter vector whose values ​​are 0, which further optimizes the storage structure of the parameters and reduces the memory space required for storing the parameters.

[0104] It should be noted that in each prediction cycle, after the first terminal updates the parameters of the event prediction model, it can send the parameter matrix (parameter vector) of the event prediction model to the Parameter Ops module (an optimized storage structure and computing architecture). Then, the parameter matrix is ​​processed by the Parameter Ops module to store the indexes and values ​​of multiple first elements in the parameter vector in a lookup table, index table or other storage structure. Before the first terminal processes the terminal feature vector through the event prediction model, the first terminal reads the indexes and values ​​of the multiple first elements stored in the Parameter Ops module to determine the multiple second elements in the terminal feature vector based on the multiple indexes, and processes the multiple second elements respectively according to the values ​​of the first elements to obtain prediction results.

[0105] In addition, in each prediction cycle, in response to the first terminal obtaining the prediction result of the event prediction model in the current prediction cycle, the first terminal sends the prediction result to the Parameter Ops module, and the Parameter Ops module stores the prediction result of the event prediction model. Therefore, in response to the second terminal event triggered by the target object in the next prediction cycle, the first terminal updates the event prediction model according to the second terminal event and the prediction result of the previous prediction cycle stored in the Parameter Ops module. Using the above method, a forward prediction process of the event prediction model can not only obtain the prediction result of the current prediction cycle, but also apply the prediction result in the parameter update process of the next prediction cycle, thereby reducing the calculation process of the parameter update and reducing the power consumption of the parameter update.

[0106] In addition, since one event prediction model corresponds to one terminal event, the first terminal usually updates multiple event prediction models in parallel. Figure 5 The schematic diagram of updating the event prediction model shown in the figure shows that the first terminal can update three event prediction models in parallel. For any event prediction model, the first terminal determines the prediction loss of the current prediction period based on the prediction result and true label of the event prediction model in the previous prediction period. Then, the first terminal updates the parameters of the event prediction model in the current prediction period based on the prediction loss. Among them, the prediction periods of different event prediction models may be the same or different, and the embodiments of the present application are not limited to this.

[0107] The scheme shown in the above embodiment is an explanation of the update process of the event prediction model deployed on the first terminal, taking the first terminal as an example. In some embodiments, the first terminal can also migrate the event prediction model that has reached convergence, that is, the event prediction model whose parameter updates tend to be stable, to the second terminal, thereby reducing the time spent on updating the event prediction model at the second terminal. Among them, the terminal data of the second terminal is relatively similar to the terminal data of the first terminal. It should be noted that before migrating the event prediction model, the terminal data of the first terminal and the terminal data of the second terminal can be analyzed only after authorization by the user of the first terminal and the user of the second terminal.

[0108] The embodiment of the present application provides a method for updating an event prediction model. In the process of updating the event prediction model, the terminal updates the parameters of the event prediction model by means of multiple updates. Since after each update, the event prediction model can process the terminal data in this update process to obtain a prediction result. Therefore, when the terminal data changes, the terminal can timely update the parameters of the event prediction model according to the prediction loss and historical cumulative gradient of the last update, so that the event prediction model can quickly adapt to the changing terminal data. In addition, updating the parameters of the event prediction model according to the prediction loss and historical cumulative gradient can not only improve the accuracy of the prediction results, but also retain the influence of the gradient of some historical update processes on this parameter update, and prevent this parameter update from being affected by a small amount of abnormal data, thereby improving the robustness of the event prediction model.

[0109] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0110] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0111] Figure 6 is a schematic diagram of the structure of an event prediction model update device provided in an embodiment of the present application. Figure 6 The device includes: a display module 601, a determination module 602 and an update module 603.

[0112] Display module 601, used for displaying prompt information when the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, the event prediction model is used to predict whether the target object triggers the first terminal event based on the terminal data of the first terminal in the prediction period, and the prompt information is used to prompt the first terminal event, and t is an integer greater than 1;

[0113] A determination module 602, configured to determine a prediction loss of the event prediction model in the tth prediction period based on a second terminal event triggered by the target object in the tth prediction period and the prediction result;

[0114] The updating module 603 is used to update the parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period, where the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, and n is a positive integer less than t.

[0115] In some embodiments, Figure 7 is a schematic diagram of the structure of another device for updating an event prediction model provided in an embodiment of the present application, see Figure 7 , the update module 603 includes:

[0116] A determining unit 6031 is used to determine a gradient update amount of the t-th prediction period based on the prediction loss, where the gradient update amount is positively correlated with the prediction loss;

[0117] A first updating unit 6032 is used to update the historical accumulated gradient based on the gradient update amount to obtain an updated gradient;

[0118] The second updating unit 6033 is used to update the parameters of the event prediction model based on the updated gradient.

[0119] In some embodiments, determination unit 6031 is used to determine the learning rate of the tth prediction period based on the prediction loss, and the learning rate is positively correlated with the prediction loss; the historical cumulative learning rate is multiplied by the parameters of the event prediction model after the t-1th prediction period to obtain the gradient update amount of the tth prediction period, and the historical cumulative learning rate is the sum of n learning rates from the tnth prediction period to the t-1th prediction period.

[0120] In some embodiments, the second updating unit 6033 is used to construct an objective function, which includes an updated gradient, at least one regularization term, and parameters of the event prediction model. The objective function is used to update the parameters of the event prediction model; the objective function is optimized with the minimum value of the objective function as the optimization target to obtain the updated parameters of the event prediction model in the objective function in the tth prediction cycle.

[0121] In some embodiments, the second updating unit 6033 is used to determine a first regularization term, which is the L1 norm of the parameters of the event prediction model; determine a second regularization term, which is the L2 norm of the parameters of the event prediction model; construct an objective function based on the first regularization term, the second regularization term and the product term, the first regularization term and the second regularization term are used to regularize the updated gradient, and the product term is the product of the updated gradient and the parameters of the event prediction model.

[0122] In some embodiments, the determination module 602 is also used to determine the prediction loss of the event prediction model in the t prediction period based on the second terminal event triggered by the target object in the t prediction period and the prediction result, when the prediction result of the event prediction model in the t-1 prediction period indicates that the target object does not trigger the first terminal event in the t prediction period.

[0123] In some embodiments, the apparatus further comprises:

[0124] The prediction module 604 is used to predict whether the target object triggers the first terminal event in the t+1th prediction period based on the terminal data of the first terminal in the tth prediction period through the event prediction model, and obtain the prediction result in the tth prediction period.

[0125] In some embodiments, the parameters of the event prediction model are parameter vectors, the terminal data includes multiple types of data, and the values ​​of the elements in the parameter vector are used to represent the weight of each type of data;

[0126] The prediction module 604 is used to determine multiple first elements in the parameter vector, where the first element is a non-zero element; through the event prediction model, according to the values ​​of the multiple first elements, the various types of terminal data of the first terminal in the tth prediction period are processed respectively to obtain the prediction result in the tth prediction period.

[0127] In some embodiments, the terminal data is a terminal feature vector, the elements in the terminal feature vector are used to represent the characteristics of the target object using the first terminal, and the dimension of the terminal feature vector is the same as the dimension of the parameter vector;

[0128] Prediction module 604 is used to obtain the numerical values ​​of multiple first elements according to the indexes of multiple first elements through an event prediction model, where the index of the first element is the dimension identifier of the first element in the parameter vector; through the event prediction model, multiple second elements are processed respectively according to the numerical values ​​of the multiple first elements to obtain the prediction results within the tth prediction period, where the multiple second elements are elements in the terminal feature vector, and the dimension identifiers of the multiple second elements in the terminal feature vector correspond one-to-one to the dimension identifiers of the multiple first elements in the parameter vector.

[0129] In some embodiments, the prediction module 604 is further used to store the value of the first element based on the index of the first element for any first element; and determine multiple second elements in the terminal feature vector based on the indexes of multiple first elements through the event prediction model.

[0130] The embodiment of the present application provides an updating device for an event prediction model. In the process of updating the event prediction model, the terminal updates the parameters of the event prediction model by means of multiple updates. Since after each update, the event prediction model can process the terminal data in this update process to obtain a prediction result. Therefore, when the terminal data changes, the terminal can timely update the parameters of the event prediction model according to the prediction loss and historical cumulative gradient of the last update, so that the event prediction model can quickly adapt to the changing terminal data. In addition, updating the parameters of the event prediction model according to the prediction loss and historical cumulative gradient can not only improve the accuracy of the prediction results, but also retain the influence of the gradient of part of the historical update process on this parameter update, and prevent this parameter update from being affected by a small amount of abnormal data, thereby improving the robustness of the event prediction model.

[0131] It should be noted that the event prediction model update device provided in the above embodiment, when implementing its function, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the event prediction model update device provided in the above embodiment and the event prediction model update method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0132] An embodiment of the present application provides a terminal, which includes a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the event prediction model update method provided by the above-mentioned various method embodiments.

[0133] Figure 8 800 is a block diagram of a terminal provided in an embodiment of the present application. In some embodiments, the terminal 800 is a terminal such as a smart phone, a tablet computer, a wearable device, etc. that can access a wireless local area network as a wireless station. The terminal 800 in the present application includes at least one or more of the following components: a processor 810, a memory 820, and at least two wireless links 830.

[0134] In some embodiments, the processor 810 includes one or more processing cores. The processor 810 uses various interfaces and lines to connect various parts of the entire terminal 800, and executes various functions and processes data of the terminal 800 by running or executing program codes stored in the memory 820, and calling data stored in the memory 820. In some embodiments, the processor 810 is implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 810 can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content that needs to be displayed on the display screen; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 810, but may be implemented by a separate chip.

[0135] In some embodiments, the processor 810 is used to control the working conditions of at least two wireless links 830. Accordingly, the processor 810 is a processor integrated with a wireless fidelity (Wireless Fidelity, Wi-Fi) chip. The Wi-Fi chip is a chip with dual Wi-Fi processing capabilities. For example, the Wi-Fi chip is a dual-band dual concurrent (Dual Band Dual Concurrent, DBDC) chip, or a dual-band synchronous (Dual Band Simultaneous, DBS) chip, etc.

[0136] In some embodiments, the memory 820 includes a random access memory (RAM), and in some embodiments, the memory 820 includes a read-only memory (ROM). In some embodiments, the memory 820 includes a non-transitory computer-readable storage medium. The memory 820 can be used to store program codes. The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data created according to the use of the terminal 800 (such as audio data, a phone book), etc.

[0137] In some embodiments, the memory 820 stores reception schemes for receiving beacon frames of different wireless links 830, as well as identifiers of access nodes connected to different wireless links 830, identifiers of wireless links 830, and the like.

[0138] The at least two wireless links 830 are used to connect different access points (APs) to receive downlink data sent by the APs, wherein the different access points are access points in the same router or access points in different routers.

[0139] In some embodiments, the terminal 800 also includes a display screen. The display screen is a display component for displaying a user interface. In some embodiments, the display screen is a display screen with a touch function, through which the user can use any suitable object such as a finger or a touch pen to perform touch operations on the display screen. In some embodiments, the display screen is usually arranged on the front panel of the terminal 800. In some embodiments, the display screen is designed to be a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. In some embodiments, the display screen is also designed to be a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.

[0140] In addition, those skilled in the art will appreciate that the structure of the terminal 800 shown in the above drawings does not limit the terminal 800, and the terminal 800 includes more or fewer components than shown in the drawings, or combines certain components, or arranges components differently. For example, the terminal 800 also includes components such as a microphone, a speaker, an input unit, a sensor, an audio circuit, a module, a power supply, and a Bluetooth module, which will not be described in detail here.

[0141] The present application also provides a computer-readable storage medium, which stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the event prediction model updating method shown in the above embodiments.

[0142] The present application also provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a terminal, it is used to implement the event prediction model update method shown in the above embodiments.

[0143] The present application also provides a computer program product, which stores at least one program code, and the at least one program code is used to be executed by a processor to implement the event prediction model updating method shown in the above embodiments.

[0144] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0145] Those skilled in the art can understand that all or part of the steps in the method for updating the event prediction model of the above embodiment can be completed by hardware, or can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for updating an event prediction model, characterized in that: Applied to a first terminal, where the first terminal is a terminal used by a target object, the method includes: In the case where the prediction result of the event prediction model in the t-1th prediction period indicates that the target object triggers the first terminal event in the tth prediction period, displaying prompt information, the event prediction model is used to predict whether the target object triggers the first terminal event based on the terminal data of the first terminal in the prediction period, the prompt information is used to prompt the first terminal event, and t is an integer greater than 1; Determining a prediction loss of the event prediction model in the tth prediction period based on a second terminal event triggered by the target object in the tth prediction period and the prediction result; Based on the prediction loss and the historical cumulative gradient of the t-th prediction period, the parameters of the event prediction model are updated, and the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, where n is a positive integer less than t.

2. The method according to claim 1, characterized in that The updating of the parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period includes: Based on the prediction loss, determining a gradient update amount for the t-th prediction period, wherein the gradient update amount is positively correlated with the prediction loss; Based on the gradient update amount, the historical accumulated gradient is updated to obtain an updated gradient; Based on the updated gradient, the parameters of the event prediction model are updated.

3. The method according to claim 2, characterized in that The step of determining the gradient update amount of the t-th prediction period based on the prediction loss includes: Based on the prediction loss, determining a learning rate for the t-th prediction period, wherein the learning rate is positively correlated with the prediction loss; The historical cumulative learning rate is multiplied by the parameters of the event prediction model after the t-1th prediction period to obtain the gradient update amount of the tth prediction period, and the historical cumulative learning rate is the sum of n learning rates from the tnth prediction period to the t-1th prediction period.

4. The method according to claim 2, characterized in that: The updating of the parameters of the event prediction model based on the updated gradient includes: Constructing an objective function, the objective function including the updated gradient, at least one regularization term, and parameters of the event prediction model, the objective function being used to update the parameters of the event prediction model; The objective function is optimized with the minimum value of the objective function as the optimization target to obtain the updated parameters of the event prediction model in the objective function in the t-th prediction period.

5. The method according to claim 4, characterized in that The constructing of the objective function comprises: Determining a first regularization term, where the first regularization term is an L1 norm of a parameter of the event prediction model; Determining a second regularization term, where the second regularization term is an L2 norm of a parameter of the event prediction model; The objective function is constructed based on the first regularization term, the second regularization term and the product term, wherein the first regularization term and the second regularization term are used to regularize the updated gradient, and the product term is the product of the updated gradient and the parameters of the event prediction model.

6. The method according to claim 1, characterized in that The method further comprises: When the prediction result of the event prediction model in the t-1th prediction period indicates that the target object does not trigger the first terminal event in the tth prediction period, the prediction loss of the event prediction model in the tth prediction period is determined based on the second terminal event triggered by the target object in the tth prediction period and the prediction result.

7. The method according to claim 1, characterized in that The method further comprises: Through the event prediction model, based on the terminal data of the first terminal in the tth prediction period, it is predicted whether the target object triggers the first terminal event in the t+1th prediction period to obtain the prediction result in the tth prediction period.

8. The method according to claim 7, characterized in that The parameters of the event prediction model are parameter vectors, the terminal data include multiple types of data, and the values ​​of the elements in the parameter vectors are used to represent the weight of each type of data; The predicting, using the event prediction model, whether the target object triggers the first terminal event in the t+1th prediction period based on the terminal data of the first terminal in the tth prediction period, and obtaining the prediction result in the tth prediction period includes: Determine a plurality of first elements in the parameter vector, wherein the first elements are non-zero elements; Through the event prediction model, according to the values ​​of the multiple first elements, the terminal data of various types of the first terminal in the tth prediction period are processed respectively to obtain the prediction result in the tth prediction period.

9. The method according to claim 8, characterized in that The terminal data is a terminal feature vector, the elements in the terminal feature vector are used to represent the features of the target object using the first terminal, and the dimension of the terminal feature vector is the same as the dimension of the parameter vector; The method of processing the terminal data of multiple types of the first terminal in the t-th prediction period respectively according to the values ​​of the multiple first elements through the event prediction model to obtain the prediction result in the t-th prediction period includes: Obtaining, by means of the event prediction model, values ​​of the plurality of first elements according to indexes of the plurality of first elements, where the index of the first element is a dimension identifier of the first element in the parameter vector; Through the event prediction model, multiple second elements are processed respectively according to the numerical values ​​of the multiple first elements to obtain the prediction results within the tth prediction period, the multiple second elements are elements in the terminal feature vector, and the dimension identifiers of the multiple second elements in the terminal feature vector correspond one-to-one to the dimension identifiers of the multiple first elements in the parameter vector.

10. The method according to claim 9, characterized in that The method further comprises: For any first element, based on the index of the first element, store the value of the first element; The plurality of second elements are determined in the terminal feature vector based on the indexes of the plurality of first elements through the event prediction model.

11. An event prediction model updating device, characterized in that: The device comprises: A display module, configured to display prompt information when a prediction result of an event prediction model in a t-1th prediction period indicates that the target object triggers a first terminal event in a tth prediction period, wherein the event prediction model is configured to predict whether the target object triggers the first terminal event based on terminal data of the first terminal in the prediction period, and the prompt information is configured to prompt the first terminal event, and t is an integer greater than 1; a determination module, configured to determine a prediction loss of the event prediction model in the tth prediction period based on a second terminal event triggered by the target object in the tth prediction period and the prediction result; An updating module is used to update the parameters of the event prediction model based on the prediction loss and the historical cumulative gradient of the t-th prediction period, wherein the historical cumulative gradient is the sum of n gradients from the tn-th prediction period to the t-1-th prediction period, and n is a positive integer less than t.

12. A terminal, characterized in that: The terminal includes a processor and a memory; the memory stores at least one program code, and the at least one program code is used to be executed by the processor to implement the event prediction model updating method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The storage medium stores at least one program code, and the at least one program code is used to be executed by a processor to implement the event prediction model updating method as described in any one of claims 1 to 10.

14. A computer program product comprising a computer program, characterized in that The computer program product stores at least one program code, and the at least one program code is used to be executed by a processor to implement the event prediction model updating method as described in any one of claims 1 to 10.