Jam prediction method, device, terminal device and computer readable storage medium
By using the stuck prediction model in the terminal device and predicting the rendering time based on the computing power parameters and the amount of rendering operations, the problem that the existing technology cannot predict the stuck in advance is solved, and the effect of avoiding the stuck is achieved.
Patent Information
- Application Number
- CN202210355749.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-04-06
AI Technical Summary
Existing technology cannot predict in advance whether an electronic device will freeze, making it impossible to avoid the freeze phenomenon.
By obtaining the computing power parameters of the terminal device in the first time period and the rendering operation amount in the second time period, use the trained lag prediction model to predict the rendering time in the second time period, and predict in advance whether lag will occur. And accurately predict the duration of lag.
This enables the terminal device to predict and avoid jamming in advance, improving the flexibility in handling impending jamming.
Smart Images

Figure CN114741192B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a freeze prediction method, apparatus, terminal device, and computer-readable storage medium. Background Art
[0002] With the rapid advancement of science and technology and living standards, electronic devices such as personal computers and smart phones have become common consumer electronic products in people's daily lives. At present, electronic devices are usually equipped with a graphics processing unit (GPU), which enables electronic devices to complete image rendering and have certain image processing capabilities. However, the performance of the graphics processor of electronic devices is limited. When the computing workload of image rendering in a short period of time is too large, the graphics processor cannot complete the image rendering in time and output it to the display module of the electronic device, which easily causes the display of the electronic device to freeze.
[0003] At present, the method of detecting whether an electronic device is stuck is usually to collect display information to analyze the cause of the stuck after the electronic device is stuck. The electronic device cannot respond to the impending stuck in advance, resulting in the unavoidable stuck phenomenon. Therefore, how to predict whether an electronic device will be stuck in advance and accurately has become a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a freeze prediction method to solve the problem that when the computational workload of image rendering is too large in a short period of time, the graphics processor cannot complete the image rendering and output it to the display module of the electronic device in time, resulting in freezes in the display of the electronic device.
[0005] A first aspect of an embodiment of the present application provides a jamming prediction method, which is applied to a terminal device, and the method includes:
[0006] Obtaining a computing capability parameter of the terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0007] The predicted rendering time of the terminal device in the second time period is obtained through the trained jamming prediction model according to the computing power parameters and the rendering computing amount in the first time period.
[0008] A first aspect of an embodiment of the present application provides a freeze prediction method, which allows a terminal device to predict in advance whether freeze will occur in a second time period, and when it is predicted that freeze will occur in the second time period, the specific freeze duration can be accurately predicted based on the predicted rendering time, so that the terminal device can respond in advance according to the specific freeze duration to avoid the occurrence of freezes, thereby improving the processing flexibility of the terminal device in the face of impending freezes.
[0009] A second aspect of an embodiment of the present application provides a freeze prediction device, including:
[0010] A collection module, used to obtain a computing capability parameter of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0011] A prediction module is used to obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and the rendering computing amount in the first time period through a trained jamming prediction model.
[0012] A third aspect of an embodiment of the present application provides a display device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the jamming prediction method provided in the first aspect of the embodiment of the present application when executing the computer program.
[0013] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the jamming prediction method provided in the first aspect of the embodiments of the present application are implemented.
[0014] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art 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 paying any creative work.
[0016] Figure 1 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0017] Figure 2 This is a schematic diagram of a first process of the jam prediction method provided in an embodiment of the present application;
[0018] Figure 3 It is a timing diagram of predicting rendering time by using a trained jam prediction model when a terminal device outputs a rendered picture provided by an embodiment of the present application;
[0019] Figure 4 This is a second flow chart of the jam prediction method provided in the embodiment of the present application;
[0020] Figure 5 This is a third flow chart of the jam prediction method provided in the embodiment of the present application;
[0021] Figure 6 This is a fourth flow chart of the jam prediction method provided in the embodiment of the present application;
[0022] Figure 7 It is a schematic diagram of the architecture of the construction, training, screening and application of the jam prediction model provided in the embodiment of the present application;
[0023] Figure 8 It is a structural schematic diagram of the jamming prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0025] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0028] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0029] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0030] In applications, the current method of detecting whether an electronic device is stuck is usually to collect display information to analyze the cause of the stuck after the electronic device is stuck. The electronic device cannot respond to the impending stuck in advance, resulting in the unavoidable stuck phenomenon. Therefore, how to predict whether an electronic device will be stuck in advance and accurately has become a problem that needs to be solved urgently.
[0031] In response to the above technical problems, an embodiment of the present application provides a jamming prediction method, by obtaining a computing power parameter of a terminal device in a first time period and a rendering computation amount in a second time period; wherein the first time period and the second time period are continuous; and obtaining a predicted rendering time of the terminal device in the second time period based on the computing power parameter and the rendering computation amount in the first time period through a trained jamming prediction model. This method can predict in advance whether the terminal device will experience jamming in the second time period, and when it is predicted that jamming will occur in the second time period, the specific jamming duration can be accurately predicted based on the predicted rendering time, so that the terminal device can respond in advance based on the specific jamming duration to avoid the occurrence of jamming, thereby improving the processing flexibility of the terminal device in the face of impending jamming.
[0032] The jam prediction method provided in the embodiment of the present application can be applied to any terminal device equipped with a graphics processor. The terminal device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device.
[0033] Figure 1The schematic diagram of the structure of the terminal device 1 is shown as an example. The terminal device 1 may include a processor 10, a graphics processor 11, a memory 20, a power module 30, an audio module 40, a camera module 50, a sensor module 60, an input module 70, a display module 80 and a wireless communication module 90. The audio module 40 may include a speaker 41 and a microphone 42, the camera module 50 may include a short-focus camera 51, a long-focus camera 52 and a flash 53, the sensor module 60 may include an infrared sensor 61, an acceleration sensor 62, a position sensor 63, a fingerprint sensor 64, an iris sensor 65 and a gyroscope sensor 66, the input module 70 may include a touch panel 71 and an external input unit 72, and the wireless communication module 90 may include wireless communication units such as Bluetooth, ZigBee, optical wireless communication, wireless local area network (WLAN), and near field communication (NFC).
[0034] In applications, the processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0035] In the application, the graphics processor 11 can be an integrated graphics card (Integrated Graphics) or a discrete graphics card (Discrete Graphics Card) according to the way it is connected to the motherboard, and can be a personal computer graphics processor (Personal Computer Graphics Processing Unit), a server graphics processor (Server Graphics Processing Unit) and a mobile graphics processor (Mobile Graphics Processing Unit) according to the type of terminal device it is equipped with; the graphics processor 11 can also be a microprocessor that runs graphics operations. Among them, when the graphics processor 11 is an integrated graphics card, it can be integrated into the motherboard of the terminal device, or it can be integrated into the processor 10 of the terminal device. The embodiment of the present application does not impose any restrictions on the specific type of the graphics processor 11.
[0036] In application, the memory 20 may be an internal storage unit of the terminal device in some embodiments, such as a hard disk or memory of the terminal device. In other embodiments, the memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Further, the memory may also include both an internal storage unit of the terminal device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0037] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 1. In other embodiments of the present application, the terminal device 1 may include more or fewer components than those illustrated, or may combine certain components, or different components, for example, it may also include an output device, a network access device, etc. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0038] like Figure 2 As shown, the jamming prediction method provided in the embodiment of the present application is applied to a terminal device, and includes the following steps S201 and S202:
[0039] Step S201: Obtain computing capability parameters of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous.
[0040] In the application, the first time period represents the time period in which the terminal device outputs the rendered image. When the terminal device outputs the rendered image in real time in the first time period, the computing power parameters of the terminal device in the first time period can be obtained. The computing power parameters may include CPU usage (Usage), CPU frequency (Frequency), GPU usage and GPU frequency, etc. The terminal device can obtain the above computing power parameters by reading the operating conditions of the CPU and GPU.
[0041] In the application, the second time period is continuous with the first time period and is after the first time period. When the terminal device outputs the rendered picture in real time in the first time period, it will send the picture that needs to be rendered in the second time period to the GPU. The GPU can obtain the rendering operation amount based on the picture that needs to be rendered in the second time period. Specifically, the GPU can first determine the number of pictures that need to be rendered in the second time period, that is, the number of frames in the second time period, and obtain the rendering operation amount for rendering each picture. The rendering operation amount in the second time period can be obtained by adding the rendering operation amount of each picture. The CPU of the terminal device can obtain the rendering operation amount in the second time period by reading the operation status of the GPU, or it can set the GPU to send the rendering operation amount of the second time period to the CPU after obtaining it.
[0042] It should be noted that the time lengths of the first time period and the second time period may be equal or unequal, and the specific time lengths of the first time period and the second time period may be set according to actual needs.
[0043] Step S202: Obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and rendering computing amount in the first time period through the trained jamming prediction model.
[0044] In the application, the input of the trained jam prediction model is the computing power parameter and the rendering operation amount, and the output is the predicted rendering time. It should be noted that the rendering operation amount and the predicted rendering time are negatively correlated; the computing power parameter and the predicted rendering time are positively correlated, that is, the stronger the computing power of the terminal device, the faster the rendering speed. The trained jam prediction model can determine the rendering speed of the terminal device according to the computing power parameter, and thus obtain the predicted rendering time according to the current rendering speed and rendering operation amount.
[0045] In the application, by inputting the computing power parameter in the first time period and the rendering computing amount in the second time period into the trained jam prediction model, the predicted rendering time in the second time period can be obtained. The working principle is to assume that the computing power parameter of the terminal device in the second time period is consistent with the computing power parameter in the first time period, and obtain the rendering time required to complete the rendering budget in the second time period, so as to predict the rendering time of the second time period in the first time period, and to predict in advance whether the terminal device will jam. According to the predicted rendering time, the jam duration of the electronic device can be accurately predicted. Specifically, the predicted jam duration of the terminal device in the second time period can be obtained according to the time difference between the predicted rendering time and the first preset time. When the above time difference is greater than 0, it means that the GPU cannot complete the rendering in time in the second time period, and the terminal device will jam in the second time period, and the larger the time difference, the longer the predicted jam duration; when the above time difference is less than or equal to 0, it means that the GPU can complete the rendering in the second time period, and the terminal device will not jam in the second time period. The first preset time can be determined according to the duration of the terminal device outputting the rendering screen, and can be specifically determined according to the second time period (for example, equal to the second time period). The embodiment of the present application does not impose any restrictions on the specific duration of the first preset time.
[0046] Figure 3 The timing diagram exemplarily shows the prediction of rendering time by the trained jamming prediction model when the terminal device outputs a rendered picture. It should be noted that the embodiment of the present application only exemplarily illustrates the prediction of the predicted rendering time of the second time period in the first time period. The jamming prediction method for adjacent time periods (for example, predicting the predicted rendering time of the third time period in the second time period) can refer to the above-mentioned jamming prediction method for predicting the predicted rendering time of the second time period in the first time period, which will not be repeated here.
[0047] In the application, by obtaining the computing power parameters of the terminal device in a first time period and the rendering calculation amount in a second time period; wherein the first time period and the second time period are continuous; obtaining the predicted rendering time of the terminal device in the second time period according to the computing power parameters and the rendering calculation amount in the first time period through the trained jamming prediction model, it is possible to predict in advance whether the terminal device will jam in the second time period, and when it is predicted that jamming will occur in the second time period, the specific jamming duration can be accurately predicted according to the predicted rendering time, so that the terminal device can respond in advance according to the specific jamming duration to avoid the occurrence of jamming, thereby improving the processing flexibility of the terminal device in the face of impending jamming.
[0048] like Figure 4 As shown, based on Figure 2 The corresponding embodiment, in one embodiment, includes the following steps S401 to S405:
[0049] The following describes the construction, training and screening methods of the jam prediction model through steps S401 to S403:
[0050] Step S401, perform a rendering operation according to the training task, obtain first training information, and construct at least one jamming prediction model to be trained; wherein the first training information includes hardware information of the terminal device, a first computing capability parameter, a first rendering computing amount, and a first rendering time.
[0051] In the application, the training task can be to control the terminal device to render a preset image, or it can be to render a user-specified image during the daily operation of the terminal device (for example, drawing images, running games, or playing videos, etc., which require the image processor to render the image).
[0052] In the application, when the terminal device performs rendering operations according to the training task, the operation status of the GPU can be collected to obtain training information, and the training information may include parameters such as computing power parameters, rendering computing volume and rendering time. According to the different uses of the training information, the training information can be divided into first training information and second training information, wherein the first training information is used to build a jam prediction model, and the second training information is used to train the jam prediction model. It should be noted that when building the jam prediction model, it is also necessary to obtain the hardware information of the terminal device, so the first training information also includes the hardware information of the terminal device, which may specifically include the memory (Random Access Memory, RAM) capacity, memory frequency, CPU model, GPU model and motherboard model of the terminal device. Among them, according to the CPU model, the performance information such as the number of cores, frequency range, cache capacity of the corresponding model of the CPU can be determined; similarly, according to the GPU signal, the performance information such as the number of cores, frequency range, cache capacity of the corresponding model of the GPU can be determined; according to the motherboard model, the performance information such as the CPU power supply voltage, GPU power supply voltage, memory power supply voltage of the corresponding model of the motherboard can be determined.
[0053] In the application, the hardware information of the terminal device can characterize the basic computing power of the terminal device, which is a constant in the jam prediction model; the first / second computing power parameters can characterize the actual computing power of the terminal device when performing rendering operations, and the first / second computing power parameters, the first rendering operation amount, and the first rendering time are all independent variables in the jam prediction model. The hardware information of the terminal device, the first computing power parameter, the first rendering operation amount, and the first rendering time are input into the machine learning model, and the model parameters of the jam prediction model can be preliminarily determined to complete the construction of the jam prediction model. The specific construction method can refer to the description of the following steps S501 and S502.
[0054] Step S402: Execute a rendering operation according to the training task to obtain second training information to train at least one jam prediction model to be trained; wherein the second training information includes a second computing capability parameter, a second rendering computing amount, and a second rendering time.
[0055] In the application, after the construction of the jam prediction model is completed, the jam prediction model to be trained needs to be trained. Specifically, the dependent variable second computing power parameter and the second rendering computing amount can be input into the jam prediction model, and the jam prediction model to be trained is trained according to the second rendering time and the output dependent variable predicted rendering time to improve the accuracy of the predicted rendering time output by the jam prediction model. The specific training method can refer to the description of the following steps S503 to S506.
[0056] Step S403: Obtain a comprehensive performance score of at least one jam prediction model to be trained, and filter out a trained jam prediction model.
[0057] In the application, during the training process of each to-be-trained jam prediction model, or after the training times of each to-be-trained jam prediction model reaches a preset optimization times, the comprehensive performance score of each to-be-trained jam prediction model can be obtained, and the to-be-trained jam prediction model with the highest comprehensive performance score can be screened as the trained jam prediction model, thereby obtaining the jam prediction model with the best performance in predicting rendering time among the multiple to-be-trained jam prediction models, so as to improve the prediction accuracy of the jam prediction model. The specific screening method can refer to the description of steps S507 to S509 below.
[0058] Step S404: obtaining a computing capability parameter of the terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0059] Step S405: Obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and rendering computing amount in the first time period through the trained jamming prediction model.
[0060] In the application, step S404 and step S405 are consistent with the jamming prediction method provided by the above-mentioned step S201 and step S202, and are not described again here.
[0061] In the application, by performing a rendering operation according to a training task, obtaining the first training information and the second training information, and constructing at least one jamming prediction model to be trained according to the hardware information of the terminal device, the first computing capability parameter, the first rendering computation amount and the first rendering time, the jamming prediction model can be constructed based on the actual hardware information of the terminal device, so that the jamming prediction model can be applicable to terminal devices of different hardware platforms, thereby improving the applicability of the jamming prediction model; by training at least one jamming prediction model to be trained according to the second computing capability parameter, the second rendering computation amount and the second rendering time, the jamming prediction model can be trained according to the second training information generated by the terminal device during the actual rendering operation, thereby ensuring the training effect and improving the accuracy of the predicted rendering time obtained by the trained jamming prediction model; by obtaining a comprehensive performance score of at least one jamming prediction model to be trained and screening out a trained jamming prediction model, a jamming prediction model with the best comprehensive performance can be screened out from a plurality of jamming prediction models to be trained, thereby further improving the accuracy of the predicted rendering time obtained by the jamming prediction model.
[0062] like Figure 5 As shown, based on Figure 4 The corresponding embodiment, in one embodiment, includes the following steps S501 to S511:
[0063] Step S501: performing a rendering operation according to a first training task to obtain hardware information of a terminal device, a first computing capability parameter, a first rendering computing amount, and a first rendering time;
[0064] Step S502: using the hardware information of the terminal device, the first computing capability parameter and the first rendering computing amount as independent variables, and the first rendering time as the dependent variable, and using at least one machine learning model to construct at least one jamming prediction model to be trained; wherein, a machine learning model is used to construct a jamming prediction model to be trained.
[0065] In the application, when constructing the jam prediction model to be trained, the hardware information of the terminal device, the first computing capability parameter and the first rendering computing amount are used as independent variables, and the first rendering time is used as the dependent variable. The model structure of the jam prediction model to be trained is determined according to the selected machine learning (Machine Learning) model, which can be different types of machine learning models such as linear regression (LR) model, polynomial regression (PR) model or recurrent neural network (RNN) model.
[0066] In one embodiment, the linear regression model is used to construct the relationship of the jam prediction model to be trained:
[0067] Time=α1Configuration+α2Computing+α3Calculation+ε;
[0068] Among them, Time represents the first rendering time, Configuration represents the numerical value corresponding to the hardware information of the terminal device, Computing represents the first computing power parameter, Calculation represents the first rendering calculation amount, α1 represents the model parameter of the numerical value corresponding to the hardware information of the terminal device, α2 represents the model parameter of the first computing power parameter, α3 represents the model parameter of the first rendering calculation amount, and ε represents the first preset model parameter.
[0069] In one embodiment, the relationship of using a polynomial regression model to construct a jam prediction model to be trained is:
[0070]
[0071] Wherein, β0 represents the second preset model parameter, β1 represents the first comprehensive model parameter, β2 represents the second comprehensive model parameter, and β n represents the nth comprehensive model parameter, where n is a positive integer greater than or equal to 1.
[0072] It should be noted that the above-mentioned relationship formula of the jamming prediction model to be trained is illustrative, and the embodiments of the present application do not impose any limitations on the type of jamming prediction model to be trained, the type of machine learning model used, or the specific relationship formula.
[0073] Step S503: performing a rendering operation according to the second training task to obtain a second computing capability parameter, a second rendering computing amount, and a second rendering time of the terminal device;
[0074] Step S504: for each jam prediction model to be trained, obtain a predicted rendering time according to the second computing capability parameter and the second rendering computation amount through the jam prediction model to be trained.
[0075] In the application, for each jam prediction model to be trained, after the construction of the jam prediction model to be trained is completed, the second computing power parameter and the second rendering operation amount can be input into the jam prediction model to be trained, so that the jam prediction model to be trained outputs the predicted rendering time. Among them, the hardware information of the terminal device is a constant, so the independent variables input into the jam prediction model to be trained are the second computing power parameter and the second rendering operation amount, and the output dependent variable is the predicted rendering time.
[0076] Step S505: construct a loss function according to the predicted rendering time and the second rendering time.
[0077] In the application, each set of input second computing capability parameters and second rendering computing amount has a corresponding second rendering time and a corresponding predicted rendering time. For each set of second training information, the corresponding second rendering time is used as the true value, and the corresponding predicted rendering time is used as the predicted value, and a loss function is constructed based on the true value and the predicted value to quantify the accuracy of the predicted rendering time output by the current jamming prediction model to be trained.
[0078] In applications, the loss function can be different types of loss functions such as 0-1 loss function, L1 norm loss function (Mean Absolute Error Loss Function), logarithmic loss function (Logistic Loss Function), square loss function (Quadratic Loss Function), exponential loss function (Exponential Loss Function), cross entropy loss function (Cross Entropy Loss Function), etc. The type of loss function can be selected according to actual needs.
[0079] Step S506: Optimize the jam prediction model to be trained according to the loss function.
[0080] In the application, for each jamming prediction model to be trained, each time a set of second training information is input into the jamming prediction model to be trained, a corresponding loss function can be obtained, and based on the loss function, the current jamming prediction model to be trained can be optimized to adjust the model parameters of the current jamming prediction model to be trained, so that the accuracy of the predicted rendering time output by the jamming prediction model to be trained is continuously improved.
[0081] Step S507: for each jam prediction model to be trained, after the number of optimizations of the jam prediction model to be trained reaches a preset number of optimizations, obtain the predicted rendering time after the most recent k optimizations;
[0082] Step S508: Obtain a comprehensive performance score of the jam prediction model to be trained according to the second rendering time and the predicted rendering time after the most recent k optimizations.
[0083] In the application, the target optimization number of the jamming prediction model to be trained can be determined by setting a preset optimization number, or the target optimization number of the predicted rendering time output by the jamming prediction model to be trained can be determined by setting a preset accuracy of the predicted rendering time, so as to set the training requirements for the jamming prediction model to be trained. The embodiments of the present application do not impose any restrictions on the training requirements for the jamming prediction model to be trained.
[0084] In the application, when the target optimization times of the jamming prediction model to be trained are determined by setting a preset number of optimization times, after the optimization times reach the preset number of optimization times, the k predicted rendering times output by the jamming prediction model to be trained after the most recent k optimizations can be obtained, and each predicted rendering time can be subtracted from the corresponding second rendering time to obtain k error times, so as to obtain a comprehensive performance score of the jamming prediction model to be trained based on the k error times.
[0085] In one embodiment, step S508 includes:
[0086] Obtain a stability performance score and an accuracy performance score of the jam prediction model to be trained based on the predicted rendering time and the second rendering time after the most recent k optimizations;
[0087] According to the stability performance score and the accuracy performance score of the jam prediction model to be trained, a comprehensive performance score of the jam prediction model to be trained is calculated.
[0088] In the application, after obtaining k error times, the variance or standard deviation of the k error times can be calculated to reflect the volatility of the k error times, and the stability performance score of the jamming prediction model to be trained can be obtained. The size of the variance or standard deviation of the k error times is negatively correlated with the stability performance score, that is, the smaller the volatility of the k error times, the higher the stability performance score; the average value of the k error times can be calculated to obtain the average error time, and the accuracy performance score of the jamming prediction model to be trained can be obtained. The size of the average error time is negatively correlated with the accuracy performance score, that is, the smaller the average error time, the higher the accuracy performance score.
[0089] In the application, according to the stability performance score and accuracy performance score of the jam prediction model to be trained, the relationship formula for calculating the comprehensive performance score of the jam prediction model to be trained is:
[0090] Synthesize=eta1Stability+eta2Veracity;
[0091] Wherein, Synthesize represents the comprehensive performance score, Stability represents the stability performance score, Veracity represents the accuracy performance score, η1 represents the proportion of the stability performance score, and η2 represents the proportion of the accuracy performance score. η1 can be equal to 0.3, η2 can be equal to 0.7, and the values of η1 and η2 can be set according to actual needs. The embodiment of the present application does not impose any restrictions on the specific sizes of η1 and η2.
[0092] Step S509: Filter and obtain the trained jam prediction models according to the comprehensive performance score of each jam prediction model to be trained.
[0093] In the application, the comprehensive performance score of each jamming prediction model to be trained can be obtained, and the jamming prediction model to be trained with the highest comprehensive performance score can be screened as the trained jamming prediction model, so as to obtain the jamming prediction model with the best performance in predicting rendering time among multiple jamming prediction models to be trained, so as to improve the prediction accuracy of the jamming prediction model.
[0094] Step S510: Obtain computing capability parameters of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0095] Step S511: Obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and rendering computing amount in the first time period through the trained jamming prediction model.
[0096] In the application, step S510 and step S511 are consistent with the jamming prediction method provided by the above-mentioned step S201 and step S202, and will not be repeated here.
[0097] In the application, by constructing and training multiple types of jam prediction models to be trained, the jam prediction model with the best comprehensive performance can be screened out from the multiple types of jam prediction models to be trained, thereby improving the accuracy of the predicted rendering time output by the jam prediction model.
[0098] like Figure 6 As shown, based on Figure 5 The corresponding embodiment, in one embodiment, includes the following steps S601 to S613:
[0099] Step S601: performing a rendering operation according to a first training task to obtain hardware information of a terminal device, a first computing capability parameter, a first rendering computing amount, and a first rendering time;
[0100] Step S602: using the hardware information of the terminal device, the first computing capability parameter and the first rendering computing amount as independent variables, and the first rendering time as the dependent variable, using at least one machine learning model to construct at least one jamming prediction model to be trained; wherein, a machine learning model is used to construct a jamming prediction model to be trained.
[0101] Step S603: performing a rendering operation according to the second training task to obtain a second computing capability parameter, a second rendering computing amount, and a second rendering time of the terminal device;
[0102] Step S604: for each jam prediction model to be trained, obtain a predicted rendering time according to the second computing capability parameter and the second rendering computing amount through the jam prediction model to be trained;
[0103] Step S605: construct a loss function according to the predicted rendering time and the second rendering time;
[0104] Step S606: Optimize the jam prediction model to be trained according to the loss function.
[0105] Step S607: for each jam prediction model to be trained, after the optimization times of the jam prediction model to be trained reaches a preset optimization times, obtain the predicted rendering time after the most recent k optimizations;
[0106] Step S608: Obtain a comprehensive performance score of the jam prediction model to be trained according to the second rendering time and the predicted rendering time after the most recent k optimizations;
[0107] Step S609: Screening and obtaining the trained jam prediction model according to the comprehensive performance score of each jam prediction model to be trained;
[0108] Step S610: Obtain computing capability parameters of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0109] Step S611: Obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and rendering computing amount in the first time period through the trained jamming prediction model.
[0110] In the application, steps S601 to S611 are consistent with the jamming prediction method provided by the above steps S501 to S511 and will not be repeated here.
[0111] Step S612: Obtain a frame rate stability score in the second time period according to the predicted rendering time of each frame in the second time period.
[0112] In the application, after obtaining the predicted rendering time in the second time period through the trained jamming prediction model, the predicted rendering time of each frame in the second time period can be obtained, and the frame rate stability score in the second time period can be obtained. Specifically, the frame rate stability score in the second time period can be obtained by calculating the method or standard deviation of the predicted rendering time of each frame in the second time period to obtain the frame rate stability in the second time period. The size of the variance or standard deviation of the predicted rendering time of each frame in the second time period is negatively correlated with the frame rate stability score.
[0113] Step S613: When the frame rate stability score is less than the first preset stability score or the predicted rendering time is greater than the first preset time, adjust the computing power parameter to improve the computing power of the terminal device in the second time period.
[0114] In the application, the preset stability score and the first preset time can be set to quantify whether the terminal device is stuck. Specifically, when the frame rate stability score is less than the first preset stability score, or when the preset rendering time is greater than the first preset time, it can be determined that the terminal device is stuck. At this time, the computing power parameters can be adjusted to improve the computing power of the terminal device in the second time period. Specifically, the computing power of the terminal device in the second time period can be improved by increasing any one or more parameters of the CPU usage rate, CPU frequency, GPU usage rate and GPU frequency.
[0115] In the application, after determining that the terminal device has a freeze, the stability score difference between the preset stability score and the first preset stability score can also be calculated, and the stability score difference level to which the stability score difference belongs can be determined. Each stability score difference level has a corresponding preset computing power parameter level, and each preset computing power parameter level is set with any one or any multiple parameters of specific CPU usage, CPU frequency, GPU usage or GPU frequency; similarly, the time difference between the preset rendering time and the first preset time can also be calculated, and the time difference level to which the time difference belongs can be determined. Each time difference level has a corresponding preset computing power parameter level to achieve multi-level adjustment of the preset computing parameters. Different levels of preset computing parameter adjustments can be made according to the actual freeze situation of the terminal device, thereby eliminating the freeze phenomenon while reducing power consumption and achieving a balance between performance and power consumption.
[0116] In the application, when adjusting the computing power parameters, a smooth parameter adjustment sequence can be formed through interpolation operation between the current computing power parameters and the target computing power parameters, so that the current computing power parameters approach the target computing power parameters frame by frame, which can ensure that the display screen will not produce sudden changes and improve the display effect of the terminal device.
[0117] In one embodiment, after step S612, the method further includes:
[0118] When the frame rate stability score is greater than or equal to the second preset stability score and the predicted rendering time in the second time period is less than or equal to the second preset time, the computing power parameter is adjusted to reduce the computing power of the terminal device in the second time period.
[0119] In the application, when the frame rate stability score is greater than or equal to the second preset stability score, or when the preset rendering time is less than or equal to the first preset time, it can be determined that the terminal device has not experienced any lag. At this time, the computing power parameters can be reduced to reduce the computing power of the terminal device in the second time period to reduce the power consumption of the terminal device.
[0120] It should be noted that the specific sizes of the first preset stability score, the second preset stability frequency, the first preset time, and the second preset time can be set according to actual needs, and the number of levels of stability score difference level, preset computing power parameter level, and time difference level and the specific values of each level can be set according to actual needs.
[0121] Figure 7 An exemplary architecture diagram of the construction, training, screening and application of the jam prediction model is shown, wherein the specific method for obtaining training information can refer to step S601 and step S603, the specific method for constructing and training the jam prediction model can refer to step S602 and steps S604 to S606, the specific method for screening the jam prediction model with the best overall performance can refer to steps S607 to S609, the specific method for predicting the rendering time through the trained jam prediction model can refer to steps S610 and step S611, and the specific method for adjusting the computing power according to the jam situation can refer to steps S612 and step S613, which will not be repeated here.
[0122] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0123] like Figure 8 As shown, the embodiment of the present application also provides a jam prediction device 8, which is used to execute the steps in the jam prediction method embodiment applied to the terminal device. The jam prediction device can be a virtual appliance in the terminal device, which is run by the processor of the terminal device, or it can be the terminal device itself.
[0124] like Figure 8 As shown, the jam prediction device 8 provided in the embodiment of the present application includes:
[0125] A collection module 81 is used to obtain a computing capability parameter of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous;
[0126] The prediction module 82 is used to obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and the rendering computing amount in the first time period through the trained jamming prediction model.
[0127] In application, each module in the jam prediction device 8 can be a software program module, or can be implemented by different logic circuits integrated in the processor, or can be implemented by multiple distributed processors.
[0128] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0129] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The functional modules in the embodiment can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, the specific names of the functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0130] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned embodiments of the jamming prediction method can be implemented.
[0131] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0132] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0134] In the embodiments provided in the present application, it should be understood that the disclosed terminal device and method can be implemented in other ways. For example, the terminal device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0135] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A jam prediction method, It is characterized in that Applied to a terminal device, the method comprises: Obtaining a computing capability parameter of the terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous; The predicted rendering time of the terminal device in the second time period is obtained through the trained jamming prediction model according to the computing power parameters and the rendering computing amount in the first time period.
2. The jam prediction method according to claim 1, It is characterized in that Before obtaining the predicted rendering time of the terminal device in the second time period according to the computing power parameter and the rendering computing amount in the first time period by using the trained jam prediction model, the method further includes: Performing a rendering operation according to the training task to obtain first training information to construct at least one jamming prediction model to be trained; wherein the first training information includes hardware information of the terminal device, a first computing capability parameter, a first rendering computing amount, and a first rendering time; Performing a rendering operation according to the training task to obtain second training information to train the at least one jamming prediction model to be trained; wherein the second training information includes a second computing capability parameter, a second rendering computing amount, and a second rendering time; Obtain a comprehensive performance score of at least one of the to-be-trained jam prediction models, and filter out a trained jam prediction model.
3. The jam prediction method according to claim 2, It is characterized in that The performing of the rendering operation according to the training task to obtain the first training information to construct at least one jam prediction model to be trained includes: Performing a rendering operation according to the first training task to obtain hardware information of the terminal device, a first computing capability parameter, a first rendering computing amount, and a first rendering time; Taking the hardware information of the terminal device, the first computing capability parameter and the first rendering computing amount as independent variables, and the first rendering time as the dependent variable, at least one machine learning model is used to construct at least one jamming prediction model to be trained; wherein, a machine learning model is used to construct a jamming prediction model to be trained.
4. The jam prediction method according to claim 2, It is characterized in that The performing a rendering operation according to the training task to obtain second training information to train the at least one jam prediction model to be trained includes: Performing a rendering operation according to the second training task to obtain a second computing capability parameter, a second rendering computing amount, and a second rendering time of the terminal device; For each of the jam prediction models to be trained, obtaining a predicted rendering time according to the second computing capability parameter and the second rendering computing amount through the jam prediction model to be trained; constructing a loss function according to the predicted rendering time and the second rendering time; The jam prediction model to be trained is optimized according to the loss function.
5. The jam prediction method according to claim 2, It is characterized in that The obtaining of a comprehensive performance score of the at least one jam prediction model to be trained, and screening to obtain a trained jam prediction model, includes: For each of the jam prediction models to be trained, after the number of optimizations of the jam prediction model to be trained reaches a preset number of optimizations, obtaining the predicted rendering time after the most recent k optimizations; Obtaining a comprehensive performance score of the to-be-trained jam prediction model according to the second rendering time and the predicted rendering time after the most recent k optimizations; According to the comprehensive performance score of each jam prediction model to be trained, the trained jam prediction model is screened and obtained; Wherein, k is a positive integer.
6. The jam prediction method according to claim 5, It is characterized in that The obtaining, according to the second rendering time and the predicted rendering time after the most recent k optimizations, a comprehensive performance score of the jamming prediction model to be trained, comprises: Obtaining a stability performance score and an accuracy performance score of the to-be-trained jam prediction model according to the predicted rendering time and the second rendering time after the most recent k optimizations; According to the stability performance score and the accuracy performance score of the jam prediction model to be trained, the comprehensive performance score of the jam prediction model to be trained is calculated.
7. The jam prediction method according to any one of claims 1 to 6, It is characterized in that After obtaining the predicted rendering time of the terminal device in the second time period according to the computing power parameter and the rendering computing amount in the first time period by using the trained jam prediction model, the method further includes: Obtaining a frame rate stability score within the second time period according to the predicted rendering time of each frame within the second time period; When the frame rate stability score is less than a first preset stability score or the predicted rendering time is greater than a first preset time, the computing power parameter is adjusted to improve the computing power of the terminal device in the second time period.
8. A jam prediction device, It is characterized in that include: A collection module, used to obtain a computing capability parameter of a terminal device in a first time period and a rendering computing amount in a second time period; wherein the first time period and the second time period are continuous; A prediction module is used to obtain the predicted rendering time of the terminal device in the second time period according to the computing power parameters and the rendering computing amount in the first time period through a trained jamming prediction model.
9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the jamming prediction method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the jamming prediction method as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data processing method, data processing server, jamming detection method and server
CN110225417A
Video lag prediction method and device, computer equipment and storage medium
CN111263225A
CPU frequency adjustment method and device, electronic equipment and storage medium
CN112631415A
Rendering method and device
CN113289330A
Lag detection method and device, lag detection server and storage medium
CN113395512A
