Model training method and device, application program prediction method and device and electronic equipment
By adding noise to application context vectors in electronic devices for machine learning training, the security issue during model training is solved, data security is improved, and user privacy is protected.
Patent Information
- Application Number
- CN202310229135.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-10
AI Technical Summary
In electronic devices, there are security issues during the model training process, which may lead to the leakage of training data and thus the user's private information.
By obtaining the context vector of the target application, adding noise to it, and generating a noisy context vector for machine learning training, this avoids directly using the original vector for training, thereby improving data security.
It improves data security in the model training process, protects users' private information, and prevents data leakage.
Smart Images

Figure CN118627136A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a model training method, an application prediction method, a device, and an electronic device. Background Art
[0002] At present, with the development of electronic devices, the storage capacity of electronic devices is getting larger and larger, and more and more applications are installed on electronic devices. In some cases, electronic devices can predict applications through models so that corresponding operations can be performed according to the prediction results of the program. However, there are still security issues in the training process of related models. Summary of the invention
[0003] In view of the above problems, the present application proposes a model training method, an application prediction method, a device and an electronic device to improve the above problems.
[0004] In a first aspect, the present application provides a model training method, the method comprising: obtaining context vectors corresponding to each of a plurality of target applications, the context vectors representing applications that are launched before or after the corresponding target application; adding noise to the context vectors corresponding to the plurality of target applications to obtain noise-added context vectors corresponding to the plurality of target applications; performing machine learning training based on the noise-added context vectors corresponding to the plurality of target applications to obtain a target model for predicting the launch of the application through the target model.
[0005] In a second aspect, the present application provides an application prediction method, the method comprising: obtaining application records in an electronic device and a specified number of applications that have been run recently, the application records comprising an application running sequence; inputting the application records and the specified number of applications that have been run recently into a target model, and obtaining a prediction result output by the target model, the target model being obtained based on the above method.
[0006] In the third aspect, the present application provides a model training device, which includes: a vector acquisition unit, used to obtain context vectors corresponding to each of a plurality of target applications, the context vectors representing applications that are started before or after the corresponding target application; a noise adding unit, used to add noise to the context vectors corresponding to the plurality of target applications, to obtain noise-added context vectors corresponding to the plurality of target applications; a model training unit, used to perform machine learning training based on the noise-added context vectors corresponding to the plurality of target applications, to obtain a target model, so as to predict the startup of the application through the target model.
[0007] In a fourth aspect, the present application provides an application prediction device, which includes: a prediction parameter acquisition unit, used to obtain application records in an electronic device and a specified number of applications that have been run recently, wherein the application records include an application running sequence; a prediction unit, used to input the application records and the specified number of applications that have been run recently into a target model to obtain a prediction result output by the target model, wherein the target model is obtained based on the above-mentioned method.
[0008] In a fifth aspect, the present application provides an electronic device, which includes at least a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
[0009] In a sixth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is executed by a processor.
[0010] The present application provides a model training method, an application prediction method, a device, and an electronic device. After obtaining the context vectors corresponding to each of the multiple target applications, noise is first added to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications. Then, based on the context vectors after adding noise corresponding to each of the multiple target applications, machine learning training is performed to obtain a target model for predicting the startup of the application through the target model. Thus, through the above method, after obtaining the context vector representing the application that is started before and after the target application, by adding noise to the context vector, the noisy context vector can be used for machine learning training, without directly applying the initially generated context vector to the training process, thereby improving the data security of the model used for prediction during the training process to protect the privacy of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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 those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A schematic diagram showing an application scenario of the method proposed in an embodiment of the present application;
[0013] Figure 2 A schematic diagram showing another application scenario of the method proposed in an embodiment of the present application;
[0014] Figure 3 A flow chart of a model training method proposed in one embodiment of the present application is shown;
[0015] Figure 4 A schematic diagram showing how to divide a subsequence from an application program running sequence in the implementation of the present application is shown;
[0016] Figure 5 A schematic diagram of determining a context vector of a target application in an implementation of the present application is shown;
[0017] Figure 6 A schematic diagram showing the addition of a context vector and a noise vector in the implementation of the present application is shown;
[0018] Figure 7 A flow chart of a model training method proposed in another embodiment of the present application is shown;
[0019] Figure 8 A flow chart of a model training method proposed in another embodiment of the present application is shown;
[0020] Fig. 9 A flow chart of a model training method proposed in another embodiment of the present application is shown;
[0021] Fig.10 A flowchart of an application startup prediction method proposed in an embodiment of the present application is shown;
[0022] Fig.11 A structural block diagram of another model training device proposed in an embodiment of the present application is shown;
[0023] Fig.12 A structural block diagram of another application startup prediction device proposed in an embodiment of the present application is shown;
[0024] Fig.13 A structural block diagram of another electronic device for executing the model training method or application startup prediction method according to an embodiment of the present application is shown;
[0025] Fig.14 It is a storage unit of an embodiment of the present application for storing or carrying program code for implementing a model training method or an application startup prediction method according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] With the development of technology, electronic devices can predict applications through models so that corresponding operations can be performed according to the program prediction results. However, the inventors found in their research that there are still security issues in the relevant model training process. For example, in the relevant model training process, the stage of inputting training data into the model to be trained may be attacked and cause the training data to be leaked. In addition, the training data may include the user's usage habits of the application, which will cause the user's privacy to be leaked.
[0028] Therefore, after discovering the above problems in the research, the inventor proposed the model training method, application prediction method, device and electronic device in the present application that can improve the above problems. In the method provided in the present application, after obtaining the context vectors corresponding to each of the multiple target applications, noise will be added to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications. After that, based on the context vectors after adding noise corresponding to each of the multiple target applications, machine learning training is performed to obtain a target model for predicting the startup of the application through the target model. Therefore, through the above method, after obtaining the context vector representing the application that is started before and after the target application, by adding noise to the context vector, the noisy context vector can be used for machine learning training, without directly applying the initially generated context vector to the training process, thereby improving the data security of the model used for prediction during the training process to protect the privacy of the user.
[0029] Before further describing the embodiments of the present application in detail, an application environment involved in the embodiments of the present application is introduced.
[0030] The following first introduces the application scenarios involved in the embodiments of the present application.
[0031] In the embodiment of the present application, the model training method or application startup prediction method provided can be executed by an electronic device. In this mode of being executed by an electronic device, all steps in the model training method or application startup prediction method provided by the embodiment of the present application can be executed by the electronic device. For example, Figure 1As shown, in the case where all steps in the application startup prediction method provided in the embodiment of the present application can be executed by an electronic device, all steps can be executed by the processor of the electronic device 100.
[0032] Furthermore, the model training method or application startup prediction method provided in the embodiment of the present application can also be executed by the server. Correspondingly, in this mode of execution by the server, the server can start executing the steps in the model training method or application startup prediction method provided in the embodiment of the present application in response to a trigger instruction. Among them, the trigger instruction can be sent by an electronic device used by the user, or it can be triggered locally by the server in response to some automation events.
[0033] In addition, the model training method or application startup prediction method provided in the embodiment of the present application can also be executed by the electronic device and the server in collaboration. In this mode of collaborative execution by the electronic device and the server, some steps in the model training method or application startup prediction method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 2 As shown, the electronic device 100 can execute the model training method including: obtaining context vectors corresponding to each of the multiple target applications, and adding noise to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications, and then transmitting the context vectors after adding noise corresponding to each of the multiple target applications to the server 200, and then the server 200 performs machine learning training based on the context vectors after adding noise corresponding to each of the multiple target applications to obtain a target model for predicting the startup of the application through the target model, and returns the trained target model to the electronic device 100.
[0034] It should be noted that in this method of collaborative execution by the electronic device and the server, the steps respectively executed by the electronic device and the server are not limited to the methods introduced in the above examples. In actual applications, the steps respectively executed by the electronic device and the server can be dynamically adjusted according to actual conditions.
[0035] It should be noted that the electronic device in the embodiment of the present application is Figure 1 and Figure 2In addition to the smartphone shown in , it can also be a tablet computer, a smart watch, an intelligent voice assistant and other devices. Server 200 can be an independent physical server, or it can be a server cluster or a distributed system composed of multiple physical servers. Among them, in the case where the model training method or application startup prediction method provided in the embodiment of the present application is executed by a server cluster or a distributed system composed of multiple physical servers, different steps in the model training method or the application startup prediction method can be executed by different physical servers respectively, or can be executed in a distributed manner by a server built based on a distributed system.
[0036] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0037] See also Figure 3 , a model training method provided in an embodiment of the present application, the method comprising:
[0038] S110: Obtain context vectors corresponding to each of the plurality of target applications, where the context vectors represent applications started before or after the corresponding target application.
[0039] The target application may be understood as an application for which a corresponding context vector needs to be obtained. In addition, in the embodiment of the present application, there may be multiple ways to determine the target application.
[0040] As a method, the electronic device can record the startup sequence of the application programs, thereby generating an application program running sequence. The startup sequence of the applications in the electronic device is recorded in the application program running sequence. In this way, an application program can be selected from the application program running sequence as a target application program.
[0041] Optionally, the application running sequence can be divided into multiple subsequences according to the startup order. The applications in each subsequence can be sorted according to the startup order, and then the application at a specified sorting position in each subsequence is taken as a target application. In this case, the context vector corresponding to the target application can represent the applications that are started before and after the target application in the subsequence where the target application is located.
[0042] For example, Figure 4 As shown in FIG. 1 , in the application running sequence recorded by the electronic device, there are 9 application startup records, wherein each application startup record corresponds to a started application. Then, based on each subsequence including 3 applications, Fig. 9The application running sequence shown in is divided into subsequences. Then, subsequence L1, subsequence L2 and subsequence L3 are obtained. In subsequence L1, the startup sequence of application A2 is the first, followed by application A3, and finally application A4. In subsequence L2, the startup sequence of application A3 is the first, followed by application A5, and finally application A1. In subsequence L3, the startup sequence of application A6 is the first, followed by application A7, and finally application A8.
[0043] If the specified sorting position is the middle of the arrangement order, then the target application corresponding to subsequence L1 is application A3, and the context vector of application A3 represents that application A2 is started before application A3, and application A4 is started after application A3. The target application corresponding to subsequence L2 is application A5, and the context vector of application A5 represents that application A3 is started before application A5, and application A1 is started after application A5. The target application corresponding to subsequence L3 is application A7, and the context vector of application A7 represents that application A6 is started before application A7, and application A8 is started after application A7.
[0044] As another way, the target application can be determined based on the startup frequency or startup number of the application. It should be noted that in some cases, the frequency and number of startups of applications in electronic devices may be different. For example, instant messaging applications and information applications are often used by users, and the startup frequency or startup number of these categories of applications will be relatively higher. However, for some applications used for information reporting or information query, they may not be used frequently by users. Therefore, the context vector of an application with a relatively higher startup frequency or startup number may have a better model training effect (for example, so that the trained model has a more accurate prediction result), and then the application with a relatively higher startup frequency or startup number can be used as the target application. Optionally, an application with a corresponding startup frequency greater than a specified frequency threshold can be used as the target application, or an application with a corresponding startup number greater than a specified number threshold can be used as the target application.
[0045] In this way, the context vector corresponding to the target application can represent a specified number of applications that are sequentially started before the target application, and a specified number of applications that are sequentially started after the target application. Figure 5As shown, if application A4 and application A6 are determined as target applications, and the specified number is 2, then for application A4, the corresponding context vector can represent application A2 and application A3 that are started before application A4, and application A3 and application A5 that are started after application A4. For application A6, the corresponding context vector can represent application A5 and application A1 that are started before application A6, and application A7 and application A8 that are started after application A6.
[0046] According to the above content, the context vector of the target application represents the applications that are started before and after the target application. Correspondingly, the context vector of the target application can be obtained according to the initial vectors of the applications that are started before and after the target application. Among them, the initial vector of the application represents the running status of the application in the electronic device when the application is started, wherein the running status may include which applications are currently started and which applications are not started. For example, the initial vector of application A1 represents that among the applications installed in the electronic device, application A1 is in the started state, while other applications are not started.
[0047] Optionally, the initial vector can be a multi-dimensional vector with one row. The dimension (number of elements) in the multi-dimensional vector with one row can be the same as the number of applications installed in the electronic device, so that the elements in the vector correspond one-to-one with the installed applications, so as to characterize the currently started application and the unstarted application by the value of the element. Exemplarily, if there are 5 applications installed in the application, then the initial vector of the application can be represented by a multi-dimensional vector with one row including 5 elements. Moreover, each element in the multi-dimensional vector with one row can correspond to an application. For example, in the case where the first element in the multi-dimensional vector with one row represents application A1, the value of the first element in the initial vector of each application represents whether application A1 is started. Exemplarily, if there are 5 applications installed in the electronic device, and the 5 applications include application A1, application A2, application A3, application A4 and application A5. When application A1 is started, the initial vector [1,0,0,0,0] of application A1 can be obtained, wherein the first element is "1" and the other elements are all 0, which indicates that application A1 is currently started, and other applications are not started. Correspondingly, when application A3 is started, the initial vector of application A3 is [0,0,1,0,0], where the third element is "1" and the other elements are all "0", indicating that application A3 is currently started and other applications are not started.
[0048] S120: Add noise to context vectors corresponding to the multiple target applications to obtain context vectors corresponding to each of the multiple target applications after adding noise.
[0049] Among them, the purpose of adding noise to the context vector is to change the original context vector so as to avoid the leakage of user privacy caused by directly using the original context vector for machine learning. It should be noted that in the process of adding noise to the context vector, the method of adding noise to multiple target applications is the same. Therefore, the context vectors corresponding to each of the multiple target applications after adding noise can still represent the applications launched before and after the corresponding target application. Optionally, in the process of adding noise, a noise vector with the same dimension as the context vector can be generated based on a specified method, and then the context vector is added to the noise vector to achieve the addition of noise to the context vector. Among them, adding the context vector to the noise vector can be understood as adding the elements corresponding to the positions in the context vector and the noise vector one by one, and then obtaining the context vector after adding noise. Exemplary, such as Figure 6 As shown, Figure 6 The elements of the context vector shown in include t1, t2, t3, t4 and t5. The elements of the noise vector include n1, n2, n3, n4 and n5, where t1 in the context vector and n1 in the noise vector are corresponding elements (both are the first elements in their respective vectors), and then n1 and t1 can be added to obtain the first element in the context vector after adding noise, and so on, we can get Figure 6 Each element in the context vector after adding noise is shown in .
[0050] S130: Based on the noise-added context vectors corresponding to the multiple target applications, machine learning training is performed to obtain a target model, so as to predict the startup of the application through the target model.
[0051] After obtaining the noise-added context vectors corresponding to the multiple target applications, a corresponding matrix can be generated based on the noise-added context vectors corresponding to the multiple target applications, and the matrix can be used as input to perform machine learning training based on a random forest algorithm to obtain a target model. Random forest refers to a classifier that uses multiple trees to train and predict input training data.
[0052] The model training method provided in this embodiment, after obtaining the context vectors corresponding to each of the multiple target applications, will first add noise to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications, and then, based on the context vectors after adding noise corresponding to each of the multiple target applications, perform machine learning training to obtain a target model for use in predicting the startup of the application through the target model. Thus, through the above method, after obtaining the context vectors representing the applications that are started before and after the target application, by adding noise to the context vectors, the noisy context vectors can be used for machine learning training, without directly applying the initially generated context vectors to the training process, thereby improving the data security of the model used for prediction during the training process to protect the privacy of the user.
[0053] See also Figure 7 , a model training method provided in an embodiment of the present application, the method comprising:
[0054] S210: Obtain context vectors corresponding to each of the plurality of target applications, where the context vectors represent applications started before or after the corresponding target application.
[0055] S220: Obtain respective sensitivities of the plurality of target applications based on respective context vectors of the plurality of target applications.
[0056] In an embodiment of the present application, sensitivity refers to the maximum change in the query result caused by adding or deleting a data record in a data set. As a method, in the process of obtaining sensitivity, the norms of any two elements in the context vector can be compared, and the two elements with the largest corresponding norms can be used as target elements, and the norms of the target elements of multiple target applications can be used as the sensitivity of each of the multiple target applications. Optionally, the sensitivity corresponding to each target application can be calculated by the following formula. The formula is:
[0057]
[0058] The target application is represented as a Context i =(γ1,γ2,…,γ n ) as an example, the γ in the above formula p ,γ q is the corresponding context vector Context i For any two elements in , p and q are their subscripts, max(*) means finding the maximum value, and ||*||1 means the L1 norm.
[0059] S230: Based on the sensitivity, obtain the noise vectors of multiple target applications respectively.
[0060] As a way, random vectors corresponding to multiple target applications respectively can be obtained. The random vectors satisfy a specified probability distribution, and the specified probability distribution is obtained based on the aforementioned sensitivity and elements in the corresponding target applications. Standardize the random vectors corresponding to multiple target applications respectively to obtain the noise vectors of multiple target applications respectively.
[0061] Optionally, obtaining the random vectors corresponding to multiple target applications respectively may include: based on the sensitivities, elements included, and privacy budgets corresponding to multiple target applications respectively, obtain the corresponding specified probability distributions, where the privacy budgets are determined according to the types of the corresponding target applications, and obtain the random vectors corresponding to multiple target applications respectively based on the specified probability distributions. Optionally, the privacy budget allocation can be a function as follows:
[0062]
[0063] Where a, b, and c respectively represent the privacy budgets when the privacy level of the application is high, medium, and low, and a < b < c. Correspondingly, standardizing the random vectors corresponding to multiple target applications respectively to obtain the noise vectors of multiple target applications respectively may include: standardizing the random vectors corresponding to multiple target applications respectively to obtain the noise vectors of multiple target applications respectively that satisfy differential privacy protection.
[0064] Among them, the specified probability distribution can be shown as the following formula:
[0065]
[0066] Where x is a continuous random variable following the above distribution, γ j is a single element in the context vector Context i n is the dimension after the context vector is dimension-reduced, ∑ is the summation symbol, Δf i is the sensitivity corresponding to the application App i ε i is the privacy budget corresponding to the application App i e (*)It is an exponential function with the natural constant e as the base, and |*| represents the absolute value. It should be noted that if the original context vector is reduced in dimension in this embodiment, the aforementioned n represents the number of bits of the context vector after dimension reduction. If the original context vector is not reduced in dimension but noise is added directly, then n represents the dimension of the original context vector. The original context vector can be understood as the initial vector of the application running directly before and after the target application, and the calculated context vector.
[0067] S240: Adding the context vectors of the multiple target applications to the noise vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to the multiple target applications.
[0068] S250: Based on the noise-added context vectors corresponding to the multiple target applications, machine learning training is performed to obtain a target model, so as to predict the startup of the application through the target model.
[0069] The present embodiment provides a model training method, so that after obtaining the context vector representing the application started before and after the target application, by adding noise to the context vector, the noisy context vector can be used for machine learning training, without directly applying the initially generated context vector to the training process, thereby improving the data security of the model used for prediction in the training process to protect the privacy of the user. In addition, in this embodiment, the corresponding sensitivity and the corresponding privacy budget can be calculated based on the target application, and then the corresponding noise vector can be calculated based on the sensitivity and the privacy budget, so that the calculation of the noise vector is more flexible and reliable. Furthermore, the privacy budget can be different for different types of target applications, so that the noise vector can have more variability, so as to further improve the security of the context vector after adding noise. In addition, configuring different privacy budgets for different types of target applications is also conducive to personalized privacy protection.
[0070] See also Figure 8 , a model training method provided in an embodiment of the present application, the method comprising:
[0071] S310: Acquire multiple subsequences from the application program running sequence recorded by the electronic device.
[0072] The application running sequence may be the running sequence of all applications recorded by the electronic device. For example, after the electronic device is started for the first time, it may start recording the running sequence, and then use the application running sequence recorded up to the current time as the running sequence of all applications recorded. In addition, a subsequence may also be obtained based on the application running sequence recorded by the electronic device within a specified time period.
[0073] After obtaining the application program running sequence, the subsequence can be divided from a specified position of the application program running sequence to obtain multiple subsequences. The specified position can be the start position of the application program running sequence or the middle position of the application program running sequence.
[0074] S320: Take the application at the specified sorting position in each subsequence as the target application, and based on the initial vectors of the applications in each subsequence except the corresponding target application, obtain the context vector corresponding to each target application. The initial vector represents the running status of the application in the electronic device when the corresponding application is started, and the context vector represents the applications started before and after the corresponding target application.
[0075] For each subsequence, a target application and a reference application may be included, wherein the reference application is an application other than the target application in each subsequence. As a method, the initial vectors of multiple reference applications in each subsequence may be dimensionally reduced to obtain the reduced-dimensional initial vectors corresponding to each of the multiple reference applications. Based on the reduced-dimensional initial vectors corresponding to each of the multiple reference applications in each subsequence, the inference vector corresponding to the target application in each subsequence is obtained, and the context vector corresponding to the target application is obtained according to the difference between the inference vector of the target application and the initial vector of the target application.
[0076] Optionally, the initial vectors corresponding to the reduced dimensions of the multiple reference applications may be averaged to obtain the corresponding intermediate vectors. The intermediate vectors may be dimensionally upgraded to obtain reference vectors, wherein the dimension of the reference vectors is the same as the dimension of the initial vectors. Based on the reference vectors, the inference vector corresponding to the target application is obtained.
[0077] Optionally, performing dimensionality reduction on the initial vectors of multiple reference applications in each subsequence to obtain the reduced-dimensional initial vectors corresponding to each of the multiple reference applications may include: multiplying the initial vectors of the multiple reference applications in each subsequence by a first auxiliary matrix, respectively, to obtain the reduced-dimensional initial vectors corresponding to each of the multiple reference applications.
[0078] The step of performing dimension upgrading on the intermediate vector to obtain the reference vector may include: multiplying the intermediate vector by a second auxiliary matrix to perform dimension upgrading on the intermediate vector to obtain the reference vector.
[0079] For example, an application in a subsequence can be represented as: App s 、App s+1 …App i …App s+t-1 、App s+t Among them, App s The first application launched in the subsequence, App s+t The last application started in the subsequence. In this case, an application in the middle of the sequence can be used as the target application, and then the target application App i Previously launched applications (e.g., App s 、App s+1 …App i-1 ) and in the target application App i The application launched later (for example, App i+1 …App s+t-1 、App s+t ) corresponds to the initial vector Vec s 、Vec s+1 …Vec i-1 and Vec i+1 …Vec s+t-1 、Vec s+t Multiply each of them by a first auxiliary matrix Rtans1 with m rows and n columns to obtain the initial vectors after dimension reduction corresponding to each of the multiple reference applications, where n is the dimension of the vector after dimension reduction. Optionally, n is less than m, for example, n can be a positive integer around m / 3, where m is the dimension of the initial vector. The multiple initial vectors after dimension reduction can include Mid s 、Mid s+1 …Mid i-1 、Mid i+1 、…、Mid s+t-1 、Mid s+t By averaging the multiple initial vectors after dimensionality reduction, the intermediate vector Should
[0080] For example, the intermediate vector Multiply it by a second auxiliary matrix Trans2 with n rows and m columns to get a reference vector with 1 row and m columns After that, the vector is processed according to the specified formula to obtain the target application Appi The 1-row and m-column inference vector Infer' i =(β1,β2,…,β m ), the specified formula is:
[0081]
[0082] where β i is the inferred vector Infer' i A single element in, e is a natural constant, e (*) It is an exponential function with the natural constant e as base, and ∑ is the summation symbol.
[0083] Among them, the inference vector represents the running status of the application in the electronic device when the target application is started up by inference of the initial vector of the reference application. Because the inference vector is calculated based on the initial vector of the reference application, the initially calculated inference vector may be different from the initial vector of the target application. One of the main reasons for this difference is that the element contents of the first auxiliary matrix and the second auxiliary matrix initially used are randomly set. Therefore, the current first auxiliary matrix and the second auxiliary matrix need to be adjusted according to the difference obtained by subsequent actual calculations.
[0084] Among them, obtaining the context vector corresponding to the target application based on the difference between the inferred vector of the target application and the initial vector of the target application may include: if the difference between the inferred vector of the target application and the initial vector of the target application does not meet the target condition, adjusting the first auxiliary matrix and the second auxiliary matrix to use the first auxiliary matrix that makes the difference between the inferred vector of the target application and the initial vector of the target application meet the target condition as the first target matrix, multiplying the initial vector of the target application by the first target matrix to obtain the context vector of the target application.
[0085] Optionally, the difference between the inferred vector of the target application and the initial vector of the target application may be calculated based on the following formula:
[0086]
[0087] Where err is the calculated difference. i is the initial vector Vec i A single element in β i is the inferred vector Infer′ i A single element in , log is the logarithmic function, and Σ is the summation symbol.
[0088] As a method, the values of the first auxiliary matrix Trans1 and the second auxiliary matrix Trans2 can be adjusted continuously according to the above error within a set limited time until the difference err reaches the minimum threshold err that can be achieved. min . And the first auxiliary matrix that makes the difference err is used as the first target matrix, and then the initial vector Vec of the target application i Multiplying the final adjusted first target matrix can produce the vector Vec i Map high-dimensional discrete to low-dimensional continuous to obtain the context vector Context after compression and dimensionality reduction i =Vec i ×Trans1. Similarly, the context vector of the target application in each subsequence can be obtained.
[0089] S330: Add noise to context vectors corresponding to the multiple target applications to obtain context vectors corresponding to each of the multiple target applications after adding noise.
[0090] S340: Based on the noise-added context vectors corresponding to the multiple target applications, machine learning training is performed to obtain a target model, so as to predict the startup of the application through the target model.
[0091] The present embodiment provides a model training method, so that after obtaining the context vector representing the application launched before and after the target application, by adding noise to the context vector, the noisy context vector can be used for machine learning training, without directly applying the initially generated context vector to the training process, thereby improving the data security of the model used for prediction during the training process to protect the privacy of the user. In addition, in the present embodiment, the initially generated context vector can also be stored in a reduced dimension through the obtained first target matrix, which can help reduce the storage space required for storing the context vector, and also help reduce the amount of calculation during the model training process.
[0092] See also Fig. 9 , a model training method provided in an embodiment of the present application, the method comprising:
[0093] S410: Obtain context vectors corresponding to each of the plurality of target applications, where the context vectors represent applications started before or after the corresponding target application.
[0094] S420: Obtain device state vectors corresponding to each of the multiple target applications.
[0095] Among them, the running state of the electronic device can characterize the running condition of the electronic device itself. It should be noted that the operation of some applications may correspond to the running state of the electronic device. For example, the user may be accustomed to listening to music through headphones, so when the electronic device is in a state of establishing a connection with the headphones, it is likely to trigger the start of the music playback program. Furthermore, when the user triggers the electronic device to establish a WiFi connection, it is likely to use the electronic device to run a game program or a short video program. Therefore, combining the running state of the electronic device can help to more accurately predict the application startup situation. Among them, the device state vector of the target application characterizes the running state of the electronic device when the target application is running. There can be multiple running states of the electronic device, for example, the running state can include charging state, network state, external device connection state and sensor state, etc., and the state content of each running state can be multiple. In this case, the device state vector of the electronic device can include state vectors corresponding to multiple running states.
[0096] Exemplarily, the correspondence between the target application program acquired by the electronic device and the running status may be shown in the following table:
[0097] Application package name Day of the week Charging status Network Status Headphone status Other Status com.example1 Monday Charing Wifi on … com.example1 Tuesday Charing 4G on … com.example3 Tuesday Uncharging 4G off … … … … … … … com.example2 Sunday Uncharging 5G off …
[0098] Among them, the application package name can be the package name of the currently launched application. It should be noted that the operating status initially collected by the electronic device is usually in text form. For example, the collected charging status is either "Charing" or "Uncharging". In this case, in order to facilitate subsequent machine learning training, the text-based operating status can be converted into a numerical form. After the conversion, it can be shown in the following table:
[0099]
[0100]
[0101] As shown in the table above, the column of application package name corresponds to the initial vector corresponding to the application, and the running state corresponding to the application can be converted into the corresponding vector for representation. Among them, for a certain running state, the number of state contents included and the dimension of the corresponding state vector can be the same, so that the running state can be converted into the corresponding state vector by using a unique hot encoding method. Exemplarily, for the charging state, the state content can be "Charing" or "Uncharging", then the dimension of the state vector corresponding to the charging state is 2. For example, "Charing" is represented by (1, 0) and "Uncharging" is represented by (0, 1). For another example, for the network state, the state content can be "WiFi", "4G" and "5G". In this case, a three-dimensional vector can be used as the state vector corresponding to the network state, and the three state contents of the network state can be represented by the state vector.
[0102] S430: Add noise to context vectors corresponding to the multiple target applications to obtain context vectors corresponding to each of the multiple target applications after adding noise.
[0103] S440: Perform machine learning training based on the noise-added context vectors and device state vectors corresponding to each of the multiple target applications to obtain a target model.
[0104] As a method, the random response mechanism in local differential privacy can be used to perturb the device state vector to add noise to the device state vector. Optionally, different privacy weights can be assigned to each operating state according to the sensitivity of the operating state. i , where the higher the privacy weight, the greater the privacy protection.
[0105] Introduce the above privacy weights into the decision function of random response;
[0106]
[0107] In i Represents a single element in the device state vector before the disturbance, whose value is 0 or 1. j Represents a single element in the device state vector after the disturbance, whose value is 0 or 1, p(Out j |In i ) indicates that the i Map to output Out j The conditional probability of j=i indicates that the element maintains the true value before and after the disturbance, and j≠i indicates that the element takes the opposite value before and after the disturbance. Indicates the privacy weight iThe probability that the element outputs the true value is It's about Weight i A monotonically decreasing function of Weight i The bigger, The smaller it is, the smaller the probability of outputting the true value is, and the higher the degree of disturbance interference is.
[0108] The context vectors after adding noise and the device state vectors after adding noise corresponding to the multiple target applications can be respectively formed into matrices as training sets. For example, a first matrix can be formed based on the context vector after adding noise, and a second matrix can be formed based on the device state vector after adding noise.
[0109] The present application provides a model training method, which first adds noise to the context vectors corresponding to the multiple target applications after obtaining the context vectors corresponding to each of the multiple target applications, so as to obtain the context vectors after adding noise corresponding to each of the multiple target applications, and then performs machine learning training based on the context vectors after adding noise corresponding to each of the multiple target applications to obtain a target model for predicting the startup of the application through the target model. Moreover, in this implementation, in addition to obtaining the context vector of the target application, the device state vector corresponding to the target application is also obtained, so as to perform machine learning training together with the context vector and the device state vector, so that the trained model can predict the application more accurately. Moreover, introducing different privacy weights into the decision function according to the device states of different sensitivities is also conducive to realizing personalized privacy protection.
[0110] See also Fig.10 , an application prediction method provided by an embodiment of the present application, the method comprising:
[0111] S510: Acquire application records in the electronic device and a specified number of recently executed applications, wherein the application records include an application execution sequence.
[0112] The specified number of applications that have been recently run may include applications that have been run from a specified time to the current time. For example, the specified time may be 1 hour ago, 1 day ago, or 1 week ago or a longer time. The specified number may be 3, 5 or even more. Furthermore, it may also be determined based on the number of applications installed in the electronic device. For example, the specified number may be one tenth of the number of installed applications, or half of the number of installed applications.
[0113] S520: Input the application records and a specified number of recently run applications into a target model to obtain a prediction result output by the target model, where the target model is obtained based on the above method.
[0114] As a method, the prediction result output by the target model is obtained, including: obtaining the result vector output by the target model, reducing the number of digits after the decimal point retained for each element in the result vector, obtaining the result vector to be processed, sorting the elements in the result vector to be processed, and taking the elements sorted in the front specified position in the sorted result as the prediction result.
[0115] For example, if m applications are installed in the electronic device, the result vector output by the target model may be Pred=(δ1, δ2, ..., δ m ). Each element in the result vector represents the probability that the m applications of the electronic device are estimated to be started. Optionally, the result vector Pred = (δ1, δ2, ..., δ m ) for each element, reduce the number of decimal places to be retained, and reduce the original u-bit decimal places to v-bits (u>v). After erasing the digits after the v-bit decimal point of the result vector, sort the elements in the result vector in descending order, select the applications and probabilities represented by the top N elements for output, and the final result vector (prediction result) is Pred′=(δ i , δ i+j , ..., δ i+N )(1≤i, j<i+N≤m), where the element with the largest value is the application that the user is most likely to open next.
[0116] For example, in the embodiment of the present application, when there are 80 applications installed in the electronic device, the content of each element in the result vector output by the target model may be as shown in the following table:
[0117] Application 1 Application 2 Application 3 … Application 78 Application 79 Application 80 0.000247 0.620342 0.094034 … 0.000238 0.001443 0.000432
[0118] As shown in the table above, the result vector output by the target model will include 80 elements, each of which represents the probability of the corresponding application being opened next. After decimal point processing and element sorting based on the result vector, the output prediction results can be shown in the following table:
[0119] Application 2 Application 3 Application 12 Application 47 Application 64 0.620 0.094 0.052 0.063 0.048
[0120] In the above table, only the top five applications ranked by probability are shown, and application 2 is determined to be the application that the user is most likely to open next.
[0121] The application prediction method provided by the present application can predict the application more accurately. In addition, the decimal point of the obtained result vector can be processed and the elements can be sorted before the result is output, which is conducive to preventing the output result from leaking the privacy of the user.
[0122] It should be noted that, in the embodiment of the present application, after obtaining the prediction result, the corresponding control operation can be performed according to the prediction result. Optionally, after obtaining the prediction result, the application predicted by the prediction result to be used can be obtained as the predicted application, and it can be detected whether the predicted application has been started. If not, the predicted application can be started in the background first, so that when the user needs to use the predicted application, it can be directly switched from the background to the foreground, thereby improving the startup efficiency of the application. Furthermore, optionally, after obtaining the prediction result, if the electronic device is performing a memory recovery operation, the memory used by the predicted application may not be recovered.
[0123] See also Fig.11 , a model training device 600 provided in an embodiment of the present application, the device 600 includes:
[0124] The vector acquisition unit 610 is used to acquire context vectors corresponding to each of the plurality of target applications, where the context vectors represent applications started before and after the corresponding target application.
[0125] The noise adding unit 620 is used to add noise to the context vectors corresponding to the multiple target applications to obtain the noise-added context vectors corresponding to each of the multiple target applications.
[0126] The model training unit 630 is used to perform machine learning training based on the noise-added context vectors corresponding to each of the multiple target applications to obtain a target model, so as to predict the startup of the application through the target model.
[0127] As a method, the noise adding unit 620 is specifically used to obtain the sensitivity of each of the multiple target applications based on the context vectors of each of the multiple target applications; obtain the noise vector of each of the multiple target applications based on the sensitivity; add the context vectors of each of the multiple target applications to the corresponding noise vectors to obtain the context vectors of each of the multiple target applications after adding noise.
[0128] Optionally, the noise adding unit 620 is specifically used to obtain a random vector corresponding to each of the multiple target applications, where the random vector satisfies a specified probability distribution, and the specified probability distribution is obtained based on the sensitivity and the elements in the corresponding target application; the random vectors corresponding to each of the multiple target applications are standardized to obtain a noise vector corresponding to each of the multiple target applications.
[0129] Optionally, the noise adding unit 620 is specifically used to obtain a corresponding specified probability distribution based on the sensitivity, included elements and privacy budget corresponding to each of the multiple target applications, where the privacy budget is determined according to the type of the corresponding target application; and obtain a random vector corresponding to each of the multiple target applications based on the specified probability distribution. In this way, the noise adding unit 620 is specifically used to perform standardization processing on the random vectors corresponding to each of the multiple target applications to obtain a noise vector corresponding to each of the multiple target applications that satisfies differential privacy protection.
[0130] Optionally, the noise adding unit 620 is specifically used to compare the norms of any two elements in the context vector; take the two elements with the largest corresponding norms as target elements; and take the norms of the target elements of multiple target applications as the sensitivity of each of the multiple target applications.
[0131] As a method, the vector acquisition unit 610 is specifically used to obtain multiple subsequences from the application running sequence recorded by the electronic device; taking the application at a specified sorting position in each subsequence as the target application, based on the initial vectors of the applications other than the corresponding target application in each subsequence, obtain the context vector corresponding to each target application, and the initial vector represents the running status of the application in the electronic device when the corresponding application is started.
[0132] Optionally, the vector acquisition unit 610 is specifically used to reduce the dimension of the initial vectors of multiple reference applications in each subsequence to obtain the reduced-dimensional initial vectors corresponding to each of the multiple reference applications, where the reference application is an application other than the target application in each subsequence; based on the reduced-dimensional initial vectors corresponding to each of the multiple reference applications in each subsequence, obtain a speculation vector corresponding to the target application in each subsequence; and obtain a context vector corresponding to the target application based on the difference between the speculation vector of the target application and the initial vector of the target application.
[0133] Optionally, the vector acquisition unit 610 is specifically used to perform an average calculation on the reduced-dimensional initial vectors corresponding to each of multiple reference applications to obtain a corresponding intermediate vector; perform dimensionality upgrade on the intermediate vector to obtain a reference vector, wherein the dimension of the reference vector is the same as that of the initial vector; and obtain a speculation vector corresponding to the target application based on the reference vector.
[0134] Optionally, the vector acquisition unit 610 is specifically used to multiply the initial vectors of multiple reference applications in each subsequence by the first auxiliary matrix to obtain the initial vectors after dimensionality reduction corresponding to each of the multiple reference applications; and to increase the dimension of the intermediate vector to obtain the reference vector, including: multiplying the intermediate vector by the second auxiliary matrix to increase the dimension of the intermediate vector to obtain the reference vector. And if the difference between the inferred vector of the target application and the initial vector of the target application does not meet the target condition, the first auxiliary matrix and the second auxiliary matrix are adjusted to use the first auxiliary matrix that makes the difference between the inferred vector of the target application and the initial vector of the target application meet the target condition as the first target matrix; and the initial vector of the target application is multiplied by the first target matrix to obtain the context vector of the target application.
[0135] As a method, the vector acquisition unit 610 is also used to obtain the device state vectors corresponding to each of the multiple target applications, and the device state vectors represent the device state of the electronic device when the target application is running. In this way, the model training unit 630 is specifically used to perform machine learning training to obtain the target model based on the context vectors and device state vectors corresponding to each of the multiple target applications after adding noise.
[0136] Optionally, the model training unit 630 is specifically used to add noise to the device state vector to obtain the device state vector after adding noise corresponding to each of the multiple target applications; based on the context vector after adding noise corresponding to each of the multiple target applications and the device state vector after adding noise, machine learning training is performed to obtain the target model.
[0137] As a method, the model training unit 630 is specifically used to generate a corresponding matrix based on the noise-added context vectors corresponding to each of the multiple target applications; use the matrix as input and perform machine learning training based on the random forest algorithm to obtain a target model.
[0138] See also Fig.12 , an application prediction device 700 provided in an embodiment of the present application, the device 700 includes:
[0139] The prediction parameter acquisition unit 710 is used to acquire application records in the electronic device and a specified number of applications that have been recently run, wherein the application records include an application run sequence;
[0140] The prediction unit is used to input the application records and the specified number of applications that have been recently run into the target model 720, and obtain the prediction results output by the target model. The target model is obtained based on the above method.
[0141] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.
[0142] The following will be combined Fig.13 An electronic device provided by the present application is described.
[0143] See also Fig.13 Based on the above model training method, application startup prediction method, and device, the embodiment of the present application also provides another electronic device 2000 that can execute the above model training method and application startup prediction method. The electronic device 2000 includes one or more (only one is shown in the figure) processors 102, a memory 104, and a network module 106 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above embodiments, and the processor 102 can execute the program stored in the memory 104.
[0144] Among them, the processor 202 may include one or more processing cores. The processor 202 uses various interfaces and lines to connect various parts within the entire electronic device 2000, and executes various functions and processes data of the electronic device 2000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 204, and calling data stored in the memory 204. Optionally, the processor 202 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 202 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) 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 display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 202, but may be implemented separately through a communication chip.
[0145] The memory 204 may include a random access memory (RAM) or a read-only memory (ROM). The memory 204 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 204 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 implementing 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.
[0146] The network module 206 is used to implement information exchange between the electronic device 2000 and other devices, for example, transmission of device control instructions, operation request instructions, and status information acquisition instructions, etc. When the electronic device 2000 is specifically a different device, the corresponding network module 206 may be different.
[0147] The sensor module 208 may include at least one sensor. Specifically, the sensor module 208 may include but is not limited to: a light sensor, a motion sensor, a pressure sensor, an infrared heat sensor, a distance sensor, an acceleration sensor, and other sensors.
[0148] Among them, the pressure sensor can be a sensor that detects the pressure generated by pressing on the electronic device 2000. That is, the pressure sensor detects the pressure generated by the contact or pressing between the user and the electronic device, such as the pressure generated by the contact or pressing between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the electronic device 2000, and the magnitude of the pressure.
[0149] Among them, the acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of the electronic device 2000 (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. In addition, the electronic device 2000 can also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, etc., which will not be repeated here.
[0150] The audio acquisition device 210 is used to collect audio signals. Optionally, the audio acquisition device 210 includes a plurality of audio acquisition devices. The audio acquisition device may be a microphone. For example, in one embodiment, the audio acquisition device 210 may include two microphones, in which one of the microphones may correspond to an analog-to-digital converter, and the other microphone may correspond to an analog-to-digital converter with two different analog gains. In another embodiment, the audio acquisition device 210 may include three microphones. In this embodiment, two of the microphones (e.g., a main microphone and a secondary microphone) may each correspond to an analog-to-digital converter, and the other microphone (e.g., a camera microphone) may correspond to an analog-to-digital converter with two different analog gains.
[0151] As a method, the network module of the electronic device 2000 is a radio frequency module, which is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. For example, the radio frequency module can exchange information with an external device through the electromagnetic waves sent or received, and then receive audio signals sent by the external device.
[0152] Please refer to Fig.14 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0153] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0154] In summary, the model training method, application prediction method, device and electronic device provided by the present application, after obtaining the context vectors corresponding to each of the multiple target applications, will first add noise to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications, and then, based on the context vectors after adding noise corresponding to each of the multiple target applications, perform machine learning training to obtain a target model for predicting the startup of the application through the target model. Therefore, through the above method, after obtaining the context vector representing the application that is started before and after the target application, by adding noise to the context vector, the noisy context vector can be used for machine learning training, without directly applying the initially generated context vector to the training process, thereby improving the data security of the model used for prediction during the training process to protect the privacy of the user.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements 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 the present application.
Claims
1. A model training method, characterized in that: The method comprises: Obtaining context vectors corresponding to each of the plurality of target applications, wherein the context vectors represent applications started before and after the corresponding target application; Adding noise to the context vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to each of the multiple target applications; Based on the noise-added context vectors corresponding to each of the multiple target applications, machine learning training is performed to obtain a target model, so as to predict the startup of the application through the target model.
2. The method according to claim 1, characterized in that The adding noise to the context vectors corresponding to the multiple target applications to obtain the context vectors corresponding to each of the multiple target applications after adding noise includes: Based on the respective context vectors of the plurality of target applications, sensitivities of the plurality of target applications are obtained; Based on the sensitivity, obtaining noise vectors of respective multiple target applications; The context vectors of the multiple target applications are added to the noise vectors corresponding to the multiple target applications to obtain the context vectors after adding noise corresponding to the multiple target applications.
3. The method according to claim 2, characterized in that Based on the sensitivity, obtaining noise vectors of respective target applications includes: Obtaining random vectors corresponding to each of the plurality of target applications, the random vectors satisfying a specified probability distribution, the specified probability distribution being obtained based on the sensitivity and an element in the corresponding target application; The random vectors corresponding to the multiple target applications are standardized to obtain the noise vectors corresponding to the multiple target applications.
4. The method according to claim 3, characterized in that The step of obtaining random vectors corresponding to the plurality of target applications comprises: Obtaining a corresponding specified probability distribution based on the sensitivity, the included elements, and the privacy budget corresponding to each of the plurality of target applications, wherein the privacy budget is determined according to the type of the corresponding target application; Obtaining random vectors corresponding to each of the plurality of target applications based on the specified probability distribution; The step of normalizing the random vectors corresponding to the plurality of target applications to obtain the noise vectors corresponding to the plurality of target applications comprises: The random vectors corresponding to the multiple target applications are standardized to obtain the noise vectors corresponding to the multiple target applications that meet the differential privacy protection.
5. The method according to claim 2, characterized in that: The obtaining of the sensitivity of the plurality of target applications based on the respective context vectors of the plurality of target applications comprises: Compare the norms of any two elements in the context vector; The two elements with the largest corresponding norm are taken as the target elements; The norms of the target elements of the multiple target applications are used as the sensitivities of the multiple target applications.
6. The method according to claim 1, characterized in that The obtaining of context vectors corresponding to the plurality of target applications respectively includes: Acquire multiple subsequences from an application program running sequence recorded by the electronic device; The application at the specified sorting position in each subsequence is taken as the target application, and based on the initial vectors of the applications in each subsequence except the corresponding target application, a context vector corresponding to each target application is obtained, and the initial vector represents the running status of the application in the electronic device when the corresponding application is started.
7. The method according to claim 6, characterized in that The obtaining of the context vector corresponding to each target application based on the initial vectors of the applications other than the corresponding target application in each subsequence includes: Performing dimensionality reduction on initial vectors of multiple reference applications in each subsequence to obtain dimensionality-reduced initial vectors corresponding to each of the multiple reference applications, wherein the reference applications are applications other than the target application in each subsequence; Based on the reduced-dimensional initial vectors corresponding to the multiple reference applications in each subsequence, a conjecture vector corresponding to the target application in each subsequence is obtained; A context vector corresponding to the target application is obtained according to a difference between the inferred vector of the target application and the initial vector of the target application.
8. The method according to claim 7, characterized in that The step of obtaining a prediction vector corresponding to a target application in each subsequence based on the reduced-dimensional initial vectors corresponding to each of the multiple reference applications in each subsequence includes: Performing average calculation on the initial vectors after dimension reduction corresponding to each of the plurality of reference applications to obtain a corresponding intermediate vector; Performing dimension upgrading on the intermediate vector to obtain a reference vector, wherein the dimension of the reference vector is the same as the dimension of the initial vector; A speculation vector corresponding to the target application is obtained based on the reference vector.
9. The method according to claim 8, characterized in that The step of reducing the dimension of the initial vectors of the multiple reference applications in each subsequence to obtain the reduced dimension initial vectors corresponding to the multiple reference applications includes: Multiplying the initial vectors of the multiple reference applications in each subsequence by the first auxiliary matrix to obtain the reduced-dimensional initial vectors corresponding to the multiple reference applications; The step of increasing the dimension of the intermediate vector to obtain a reference vector comprises: multiplying the intermediate vector by a second auxiliary matrix to increase the dimension of the intermediate vector to obtain a reference vector; The obtaining, according to the difference between the inferred vector of the target application and the initial vector of the target application, a context vector corresponding to the target application, comprises: If the difference between the inferred vector of the target application and the initial vector of the target application does not satisfy the target condition, the first auxiliary matrix and the second auxiliary matrix are adjusted to use the first auxiliary matrix that makes the difference between the inferred vector of the target application and the initial vector of the target application satisfy the target condition as the first target matrix; The initial vector of the target application is multiplied by the first target matrix to obtain a context vector of the target application.
10. The method according to claim 1, characterized in that The method further comprises: Acquire a device state vector corresponding to each of the plurality of target applications, wherein the device state vector represents a device state of the electronic device when the target application is running; The step of performing machine learning training to obtain a target model based on the noise-added context vectors corresponding to each of the plurality of target applications includes: Based on the noise-added context vectors corresponding to each of the multiple target applications and the device state vector, machine learning training is performed to obtain a target model.
11. The method according to claim 10, characterized in that The performing machine learning training to obtain a target model based on the context vectors after adding noise corresponding to each of the multiple target applications and the device state vector comprises: Adding noise to the device state vector to obtain the device state vectors after adding noise corresponding to each of the plurality of target applications; Based on the context vectors after adding noise and the device state vectors after adding noise corresponding to each of the multiple target applications, machine learning training is performed to obtain a target model.
12. The method according to claim 1, characterized in that The step of performing machine learning training to obtain a target model based on the noise-added context vectors corresponding to each of the plurality of target applications includes: Generate a corresponding matrix based on the noise-added context vectors corresponding to each of the plurality of target applications; The matrix is used as input and machine learning training is performed based on a random forest algorithm to obtain a target model.
13. An application prediction method, characterized in that: The method comprises: Acquire application records in the electronic device and a specified number of recently run applications, wherein the application records include an application run sequence; The application records and a specified number of recently run applications are input into a target model to obtain a prediction result output by the target model, wherein the target model is obtained based on the method described in any one of claims 1-12.
14. The method according to claim 13, characterized in that The obtaining of the prediction result output by the target model includes: Obtaining a result vector output by the target model; reducing the number of digits after the decimal point of each element in the result vector to obtain a result vector to be processed; The elements in the result vector to be processed are sorted, and the elements in the sorted result that are ranked at the front specified position are used as the prediction results.
15. A model training device, characterized in that: The device comprises: A vector acquisition unit, used to acquire context vectors corresponding to each of the plurality of target applications, wherein the context vectors represent applications started before and after the corresponding target application; A noise adding unit, configured to add noise to the context vectors corresponding to the plurality of target applications, to obtain the context vectors corresponding to the plurality of target applications after adding noise; The model training unit is used to perform machine learning training based on the noise-added context vectors corresponding to each of the multiple target applications to obtain a target model, so as to predict the startup of the application through the target model.
16. An application prediction device, characterized in that: The device comprises: A prediction parameter acquisition unit, used to acquire application records in the electronic device and a specified number of recently run applications, wherein the application records include application run sequences; A prediction unit is used to input the application record and a specified number of recently run applications into a target model to obtain a prediction result output by the target model, wherein the target model is obtained based on the method described in any one of claims 1-12.
17. An electronic device, characterized in that: The method comprises a processor and a memory; one or more programs are stored in the memory and are configured to be executed by the processor to implement any of the methods of claims 1-12, or to implement any of the methods of claims 13-14.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method described in any one of claims 1 to 12 is executed, or the method described in any one of claims 13 to 14 is implemented.
