CN107832155B - Method and device for replacing algorithm, storage medium and electronic equipment - Google Patents

Method and device for replacing algorithm, storage medium and electronic equipment Download PDF

Info

Publication number
CN107832155B
CN107832155B CN201711124541.5A CN201711124541A CN107832155B CN 107832155 B CN107832155 B CN 107832155B CN 201711124541 A CN201711124541 A CN 201711124541A CN 107832155 B CN107832155 B CN 107832155B
Authority
CN
China
Prior art keywords
algorithm
application
cleaned
preset
background
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711124541.5A
Other languages
Chinese (zh)
Other versions
CN107832155A (en
Inventor
梁昆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711124541.5A priority Critical patent/CN107832155B/en
Publication of CN107832155A publication Critical patent/CN107832155A/en
Application granted granted Critical
Publication of CN107832155B publication Critical patent/CN107832155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a method and a device for replacing an algorithm, a storage medium and electronic equipment. The method comprises the following steps: when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned or not, recording the background application which is output by the first algorithm and allowed to be cleaned; after the recorded background application which is allowed to be cleaned is cleaned, detecting whether the cleaned application is used by a user within a preset first time range; if the cleaned application is detected to be used by a user within a preset first time range, determining that an output result of the first algorithm has an error, and acquiring a second algorithm; and replacing the first algorithm with the second algorithm for judging whether the background application is allowed to be cleaned. The method and the device can improve the matching degree between the algorithm used by the terminal and the actual situation of the user.

Description

Method and device for replacing algorithm, storage medium and electronic equipment
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a method and an apparatus for replacing an algorithm, a storage medium, and an electronic device.
Background
The application of artificial intelligence technology is becoming more and more extensive and in-depth. In the artificial intelligence technology, the terminal equipment can learn the behavior habits of the user, and intelligently make certain decisions and execute corresponding operations according to the learned behavior habits of the user, so that the terminal equipment is more intelligent. For example, the terminal may learn the application use behavior of the user by using a certain algorithm, determine whether the application located in the background of the terminal is cleanable according to the learned behavior habit of the user, and clean the cleanable application from the background.
Disclosure of Invention
The embodiment of the application provides a method and a device for replacing an algorithm, a storage medium and electronic equipment, which can improve the matching degree between the algorithm used by a terminal and the actual situation of a user.
The embodiment of the application provides a method for replacing an algorithm, which comprises the following steps:
when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned or not, recording the background application which is output by the first algorithm and allowed to be cleaned;
after the recorded background application which is allowed to be cleaned is cleaned, detecting whether the cleaned application is used by a user within a preset first time range;
if the cleaned application is detected to be used by a user within a preset first time range, determining that an output result of the first algorithm has an error, and acquiring a second algorithm;
and replacing the first algorithm with the second algorithm for judging whether the background application is allowed to be cleaned.
The embodiment of the present application provides a device for replacing an algorithm, including:
the recording module is used for recording the background application which is output by the first algorithm and allowed to be cleaned when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned;
the detection module is used for detecting whether the cleaned application is used by a user within a preset first time range after the recorded background application which is allowed to be cleaned is cleaned;
the first obtaining module is used for determining that an output result of the first algorithm has an error and obtaining a second algorithm if the cleaned application is detected to be used by a user within a preset first time length range;
and the replacing module is used for replacing the first algorithm by using the second algorithm and judging whether the background application is allowed to be cleaned.
Embodiments of the present application provide a storage medium, on which a computer program is stored, which, when executed on a computer, causes the computer to execute the steps in the method for replacing an algorithm provided in the embodiments of the present application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is used to execute the steps in the method for replacing the algorithm provided in the embodiment of the present application by calling the computer program stored in the memory.
According to the method and the device, when it is determined that the result of the cleanable background application output by the first algorithm is wrong, that is, it is determined that the first algorithm is not suitable for learning the behavior habit of the current user, and when the cleanable background application is judged according to the learned behavior habit of the user, the second algorithm is used for replacing the first algorithm to learn the behavior habit of the user and accordingly judging whether the background application can be cleaned or not. Therefore, the embodiment can improve the matching degree between the learning algorithm and the actual situation of the user.
Drawings
The technical solution and the advantages of the present invention will be apparent from the following detailed description of the embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a method for replacing an algorithm according to an embodiment of the present application.
Fig. 2 is another schematic flow chart of a method for replacing an algorithm provided in an embodiment of the present application.
Fig. 3 to fig. 7 are schematic scene diagrams of a method for replacing an algorithm according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an apparatus for replacing an algorithm according to an embodiment of the present application.
Fig. 9 is another schematic structural diagram of an apparatus for replacing an algorithm according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Fig. 11 is another schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
As will be described in detail below.
It can be understood that the execution subject of the embodiment of the present application may be a terminal device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for replacing an algorithm according to an embodiment of the present application, where the flowchart may include:
in step S101, when determining whether the background application of the terminal is allowed to be cleaned by using the configured first algorithm, the background application that is output by the first algorithm and allowed to be cleaned is recorded.
The terminal can learn the application use behaviors of the user by using a certain algorithm, judge whether the application in the background of the terminal can be cleaned or not according to the learned behavior habits of the user, and clean the application which can be cleaned from the background. However, the usage behavior habits of different users are greatly different, so when learning the behavior habits of the users by using a certain algorithm and further judging whether the background application can be cleaned, the algorithm may be suitable for the user a but not suitable for the user b.
In step S101 in this embodiment, when determining whether the background application of the terminal is a cleanable application by using the first algorithm currently configured for the terminal, the terminal may record the cleanable background application output by the first algorithm.
For example, if the terminal determines that the application A, B, C currently located in the background is a cleanable application according to the output result of the first algorithm, the terminal may record the application A, B, C in the list of cleanable applications.
In step S102, after cleaning the recorded background application allowing cleaning, it is detected whether the cleaned application is used by the user within a preset first time range.
For example, after the determined cleanable application is cleaned from the background according to the output result of the first algorithm, the terminal may detect whether the application which is cleaned up is restarted by the user within a preset first time period. That is, the terminal can determine whether the cleaned application has become a foreground application due to use by the user.
For example, after the terminal has cleaned the applications A, B, C from the background according to the output of the first algorithm, the terminal may detect whether the user has used one or more of the applications A, B, C again within the next preset 5 minutes.
If it is detected that the application cleaned from the background before within the preset first time period is not used again by the user, it indicates that the result of the background cleanable application output by the first algorithm is accurate. In this case, the terminal may continue to perform other operations.
For example, after clearing the application A, B, C from the background, the terminal does not detect that the user is reusing any of the applications within 5 minutes, indicating that the results of the background cleanable applications output by the first algorithm are accurate.
If it is detected that the application cleaned from the background before within the preset first time period is used by the user, the process proceeds to step S103.
In step S103, if it is detected that the cleaned application is used by the user within the preset first time period, it is determined that an error exists in an output result of the first algorithm, and a second algorithm is obtained.
For example, after cleaning the application A, B, C from the background, the terminal detects that the user used one or more of the applications A, B, C within the next 5 minutes, indicating that the result of the cleanable background application output by the first algorithm was erroneous. In this case, the terminal may acquire the second algorithm.
In step S104, the second algorithm is used to replace the first algorithm for determining whether the background application is allowed to be cleaned.
For example, after acquiring the second algorithm, the terminal may use the second algorithm to replace the first algorithm, and then use the second algorithm to determine whether the background application is cleanable.
It can be understood that, in the embodiment of the application, when it is determined that the result of the cleanable background application output by the first algorithm is wrong, that is, it is determined that the first algorithm is not suitable for learning the behavior habit of the current user, and the cleanable background application is determined according to the learned behavior habit of the user, the second algorithm is used for replacing the first algorithm to learn the behavior habit of the user, and accordingly, whether the background application is cleanable is determined. Therefore, the matching degree between the learning algorithm and the actual situation of the user can be improved, and the accuracy of the terminal in judging whether the background can be cleaned up is further improved.
Referring to fig. 2, fig. 2 is another schematic flow chart of a method for replacing an algorithm according to an embodiment of the present application, where the flow chart may include:
in step S201, when determining whether the background application of the terminal is allowed to be cleaned by using the configured first algorithm, the terminal records the background application that is output by the first algorithm and allowed to be cleaned.
For example, when the first algorithm currently configured for the terminal is used to determine whether the background application of the terminal is a cleanable application, the terminal may record the cleanable application output by the first algorithm.
For example, if the terminal determines that the application A, B, C currently located in the background is a cleanable application according to the output result of the first algorithm, the terminal may generate a list of cleanable applications and record therein that the application A, B, C is the cleanable background application determined by the terminal using the first algorithm.
In step S202, the terminal obtains a first number of background applications that are allowed to be cleaned.
For example, after the cleanable background applications output by the first algorithm are recorded, the terminal may obtain the number of cleanable background applications output by the first algorithm this time, that is, the first number. For example, the number of cleanable background applications which are obtained by the terminal and output by the first algorithm this time is 3.
In step S203, after cleaning the recorded background application allowing cleaning, the terminal detects whether the cleaned application is used by the user within a preset first time range.
For example, after the determined cleanable application is cleaned from the background according to the output result of the first algorithm, the terminal may detect whether the application which is cleaned up is restarted by the user within a preset first time period. That is, the terminal can determine whether the cleaned application has become a foreground application due to use by the user.
For example, after the terminal has cleaned the applications A, B, C from the background according to the output of the first algorithm, the terminal may detect whether the user has used one or more of the applications A, B, C again within the next preset 5 minutes.
If it is detected that the application cleaned from the background before within the preset first time span is not used again by the user, it indicates that the result of the cleanable background application output by the first algorithm is accurate. In this case, the terminal may continue to perform other operations.
For example, after the application A, B, C is cleaned from the background, the terminal does not detect that the user uses any of the applications again within 5 minutes, indicating that the result of the cleanable background application output this time by the first algorithm is accurate.
If it is detected that the application previously cleaned from the background is used by the user within the preset first time period, the process proceeds to step S204.
In step S204, if it is detected that the cleaned application is used by the user within the preset first time period range, the terminal counts a second number of applications used by the user in the cleaned application.
In step S205, the terminal calculates the ratio of the second number to the first number.
In step S206, if it is detected that the ratio exceeds the preset ratio threshold, the terminal determines that an output result of the first algorithm is incorrect.
For example, steps S204, S205, and S206 may include:
after cleaning the applications A, B, C from the background, the terminal detects that the user used one or more of the applications A, B, C within the next 5 minutes, at which point the terminal may count the number of applications used by the user, i.e., the second number, in the cleaned applications A, B, C.
Then, the terminal may calculate a ratio of the second number to the first number, and detect whether the calculated ratio exceeds a preset ratio threshold.
If the calculated proportion does not exceed the preset proportion threshold, the cleanable background application result output by the first algorithm at this time can still be considered to be more accurate. At this point, the terminal may continue to perform other operations. For example, the terminal cleans up a total of 12 background applications from the background this time according to the result of the cleanable background applications output by the first algorithm. Within 5 minutes thereafter, only 1 of the 12 cleaned background applications is restarted by the user, i.e. the second number accounts for 8.3% of the first number and is lower than the preset percentage threshold value by 10%. In this case, the result of the cleanable background application output by the first algorithm may be considered relatively accurate. At this point, the terminal may continue to perform other operations.
If the calculated proportion exceeds the preset proportion threshold value, the result of the cleanable background application output this time by the first algorithm can be considered to have an error.
For example, after cleaning the application A, B, C from the background, the terminal detects that the user used application a and application B within the next 5 minutes, at which point the terminal may count that the second number of applications reused by the user in the cleaned background applications is 2. The terminal may then calculate that the second number 2 accounts for 66.7% of the first number 3. And the preset proportional threshold is, for example, 10%. In this case, the terminal may detect that the ratio of the second number to the first number exceeds a preset ratio threshold. Namely, the application in the background of the terminal is cleaned by mistake, and the background application is cleaned by mistake to a greater extent. At this time, the terminal may determine that there is an error in the cleanable background application output by the first algorithm.
In step S207, the terminal counts the number of times that the output result of the first algorithm has an error within a preset second duration range, where the preset second duration range is greater than the preset first duration range.
In step S208, if it is detected that the number of times reaches a preset value, the terminal acquires a second algorithm.
For example, steps S207 and S208 may include:
after determining that the result of the cleanable background application output by the first algorithm has errors, the terminal may count the number of times that the output result of the first algorithm has errors. If the number of times is detected to reach the preset value, the result error of the cleanable background application output by the first algorithm can be considered to be larger. In this case, the terminal may acquire the second algorithm.
For example, in this embodiment, after it is determined that the cleanable background application output by the first algorithm has an error, the terminal may count the number of times that the output result of the first algorithm has an error within a preset second duration range. The second duration range may be much longer than the preset first duration range. For example, the preset second duration range may be the last week.
After counting the number of times that the output result of the first algorithm has errors within the preset second duration range, the terminal may detect whether the number of times reaches a preset value.
If the terminal detects that the times do not reach the preset value, the cleanable background application result output by the first algorithm can still be considered to be accurate. For example, the number of times that the result of the cleanable background application output by the first algorithm has been erroneous during the last one week is only 2, while the preset value is 10. The result of the cleanable background application output by the first algorithm may still be considered accurate. At this point, the terminal may continue to perform other operations.
If the terminal detects that the number of times reaches a preset value, the result error of the cleanable background application output by the first algorithm can be considered to be larger. For example, the terminal counts that the number of times of errors in the result of the cleanable background application output by the first algorithm in the time range of the last week reaches 11 times and exceeds 10 times. Then the result of the cleanable background application output by the first algorithm may be deemed inaccurate. In this case, the terminal may acquire the second algorithm.
In step S209, the terminal replaces the first algorithm with the second algorithm for determining whether the background application is allowed to be cleaned.
For example, after acquiring the second algorithm, the terminal may use the second algorithm to replace the first algorithm, and then use the second algorithm to determine whether the background application is cleanable.
It can be understood that, in the embodiment of the application, when it is determined that the result of the cleanable background application output by the first algorithm is wrong, that is, it is determined that the first algorithm is not suitable for learning the behavior habit of the current user, and the cleanable background application is determined according to the learned behavior habit of the user, the second algorithm is used for replacing the first algorithm to learn the behavior habit of the user, and accordingly, whether the background application is cleanable is determined. Therefore, the matching degree between the learning algorithm and the actual situation of the user can be improved, and the accuracy of the terminal in judging whether the background can be cleaned up is further improved.
In an implementation, this embodiment may further include the following steps:
the terminal counts the flow consumption value of the application positioned in the terminal background in unit time;
according to the counted flow consumption value, the terminal calculates the average flow value of the application positioned in the terminal background in a preset period;
and if the average flow value is detected to exceed the preset flow threshold value, reducing the numerical value of the preset proportion threshold value.
For example, the terminal may count traffic consumption values of applications located in the background of the terminal every day. Then, the terminal can calculate an average flow value consumed by the application located in the background of the terminal within one week according to the flow consumption value of the background application counted every day, and detect whether the average flow value exceeds a preset flow threshold value.
If the average flow value is detected not to exceed the preset flow threshold, the application in the background of the terminal may be considered to consume less flow. In this case, the terminal may not adjust the value of the preset proportional threshold.
If the average flow value is detected to exceed the preset flow threshold, it can be considered that the flow consumed by the application in the background of the terminal is large. In this case, the result of the cleanable background application that needs the first algorithm output can be considered more accurate, thereby avoiding traffic being consumed without effect (by the cleanable background application that is not actually cleaned). At this time, the terminal may decrease the value of the preset proportion threshold used to determine whether there is an error in the output result of the first algorithm.
In another embodiment, the terminal may further determine whether the result of the cleanable background application output by the first algorithm at this time is accurate or not according to whether the cleaned application is used by the user within a preset first time length range after the first algorithm outputs the cleanable background application each time and cleans the corresponding application from the background, and record the accuracy or the error of the output result. Then, when it is determined that the output result of the first algorithm has an error, the terminal may determine whether the output result of the first algorithm has an error continuously for a preset number of times according to the previously recorded accurate or erroneous record of the output result of the first algorithm over the past time.
If so, the first algorithm is considered to be unsuitable for judging whether the background application of the terminal can be cleaned. In this case, the terminal may acquire the second algorithm and replace the first algorithm with the second algorithm.
If not, the terminal may continue to determine whether the first algorithm is suitable for determining whether the background application of the terminal is cleanable according to the steps in S201 to S209 in this embodiment.
For example, according to the time sequence, the first algorithm outputs results of the background applications which can be cleaned for six times, and the terminal performs corresponding background application cleaning according to the output results of the first algorithm. Wherein this time is the sixth time. The terminal counts that the first output result of the cleanable background application has no error, the second output result of the cleanable background application has an error, the third output result of the cleanable background application has an error, the fourth output result of the cleanable background application has an error, the fifth output result of the cleanable background application has an error, and the sixth output result of the cleanable background application has an error. When it is determined that the first algorithm has an error in the cleanable background application output for the sixth time, the terminal detects that the output result of the first algorithm has errors continuously for five times, and the preset times are reached for five times. In this case, the terminal may acquire the second algorithm and replace the first algorithm with the second algorithm.
In one embodiment, when the terminal judges whether the application cleaned from the background is used by the user within a preset first time range, the situation that the application appears in the foreground due to the fact that the user clicks the application icon by mistake and the terminal misunderstands that the clicked application is used by the user is avoided. The present application may also avoid the above problems in the following manner: when it is detected that the icon of the cleaned application is clicked by the user within the preset first time range, if it is detected that the clicked application is not further operated by the user but is immediately switched to the background (for example, within the preset 1 second), it can be considered that the application with the clicked icon belongs to the user error click, and therefore the terminal may not judge that the application with the clicked icon is used by the user.
For example, according to the output result of the first algorithm, the terminal detects that the icon of the application a is clicked by the user within 5 minutes after the application a is judged to be the cleanable background application and cleaned from the background, but the terminal does not detect that the application a is operated by the user next time, and the application a is switched to the background within 1 second, so that the application a is considered not to be used by the user but to be clicked by mistake, that is, the application a is considered not to be cleaned by mistake, and the output result of the first algorithm is not considered to have a mistake.
Referring to fig. 3 to 7, fig. 3 to 7 are schematic views illustrating a scenario of a method for replacing an algorithm according to an embodiment of the present application.
For example, as shown in FIG. 3, applications currently located in the background of the terminal include applications A, C, B, F and H. When the first algorithm configured for the terminal at present is used for judging whether the background application of the terminal is cleanable application, the terminal can record the cleanable application output by the first algorithm. For example, if the terminal determines that the application A, B, C currently located in the background is a cleanable application according to the output result of the first algorithm, the terminal may generate a list of cleanable applications and record therein that the application A, B, C is the cleanable background application determined by the terminal using the first algorithm.
Then, the terminal may obtain the number of cleanable background applications output this time by the first algorithm, that is, the first number. For example, the number of cleanable background applications which are obtained by the terminal and output by the first algorithm this time is 3.
The terminal may then clean up the application A, B, C from the background. The terminal may then detect whether the cleaned application A, B, C was used by the user in the next 5 minutes.
For example, after 1 minute, the terminal first detects that the user has clicked on the icon of application C, and uses application C, as shown in fig. 4. For example, the application C is a music playing application, as shown in fig. 5.
After 4 minutes, the terminal detects that the user has clicked on the icon of application a and uses application a, as shown in fig. 6. For example, application a is a browser application, as shown in fig. 7.
That is, within 5 minutes after application A, B, C is cleaned up from the background, the terminal detects that application a and application C are used by the user. In this case, the terminal may count the number of applications reused by the user among the cleaned applications A, B, C to 2 (i.e., the second number). The terminal may then calculate the proportion of the second number to the first number. For example, the second number 2 accounts for 66.7% of the first number 3.
After obtaining the ratio, the terminal may detect whether the ratio exceeds a preset ratio threshold. For example, the preset proportional threshold is 10%. Then the terminal can detect that the ratio 66.7% exceeds 10%. In this case, the terminal may determine that there is an error in the result of the cleanable background application of the output of the first algorithm this time.
After determining that the result of the cleanable background application output by the first algorithm has errors, the terminal may count the number of times that the output result of the first algorithm has errors in the last week. For example, the terminal counts that the number of errors in the result of the cleanable background application output by the first algorithm in the last week reaches 11 times and exceeds 10 times. Then the result of the cleanable background application output by the first algorithm may be deemed inaccurate. In this case, the terminal may acquire the second algorithm.
After the second algorithm is acquired, the terminal may use the second algorithm to replace the first algorithm, and then use the second algorithm to determine whether the background application is cleanable.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an apparatus for replacing an algorithm according to an embodiment of the present disclosure. The means 300 for replacing the algorithm may comprise: a recording module 301, a detection module 302, a first acquisition module 303, and a replacement module 304.
The recording module 301 is configured to record the background application which is output by the first algorithm and allowed to be cleaned when the configured first algorithm is used to determine whether the background application of the terminal is allowed to be cleaned.
For example, when determining whether the background application of the terminal is a cleanable application by using the first algorithm currently configured for the terminal, the recording module 301 may record the cleanable background application output by the first algorithm.
For example, if the terminal determines that the application A, B, C currently located in the background is a cleanable application according to the output result of the first algorithm, the recording module 301 may record the application A, B, C in a list of cleanable applications.
A detecting module 302, configured to detect whether the cleaned application is used by the user within a preset first time range after the recorded background application that is allowed to be cleaned is cleaned.
For example, after cleaning the determined cleanable application from the background according to the output result of the first algorithm, the detection module 302 may detect whether the application that was cleaned is restarted by the user within a preset first time period. That is, the terminal can determine whether the cleaned application has become a foreground application due to use by the user.
For example, after the terminal cleans the applications A, B, C from the background according to the output result of the first algorithm, the detection module 302 may detect whether the user uses one or more of the applications A, B, C again within a preset 5 minutes.
If it is detected that the application cleaned from the background before within the preset first time period is not used again by the user, it indicates that the result of the background cleanable application output by the first algorithm is accurate. In this case, the terminal may continue to perform other operations.
For example, after clearing the application A, B, C from the background, the detection module 302 does not detect that the user is reusing any of the applications within the next 5 minutes, indicating that the results of the background cleanable applications output by the first algorithm are accurate.
The first obtaining module 303 is configured to determine that an output result of the first algorithm has an error if it is detected that the cleaned application is used by a user within a preset first time range, and obtain a second algorithm.
For example, after cleaning applications A, B, C from the background, detection module 302 detects that the user used one or more of applications A, B, C within the next 5 minutes, indicating that there is an error in the results of the cleanable background applications output by the first algorithm. In this case, the first obtaining module 303 may obtain the second algorithm.
A replacing module 304, configured to replace the first algorithm with the second algorithm, and configured to determine whether the background application is allowed to be cleaned.
For example, after the first obtaining module 303 obtains the second algorithm, the replacing module 304 may replace the first algorithm with the second algorithm, and then determine whether the background application is cleanable using the second algorithm.
In one embodiment, the first obtaining module 303 may be configured to:
determining that the output result of the first algorithm has errors, and counting the times of the output result of the first algorithm having errors;
and if the times are detected to reach a preset value, acquiring a second algorithm.
For example, when it is detected that the cleaned application is used by a user within a preset first time period, the first obtaining module 303 may determine that an output result of the first algorithm is incorrect, and at this time, the first obtaining module 303 may further count the number of times that the output result of the first algorithm is incorrect, and detect whether the number of times reaches a preset value.
If it is detected that the number of times does not reach the preset value, it can be considered that the output result of the first algorithm has a smaller number of errors. That is, the output result of the first algorithm can be considered to be still more accurate. In this case, the terminal may continue to perform other operations.
If it is detected that the number of times reaches a preset value, it can be considered that the output result of the first algorithm has a higher number of errors. That is, the output result of the first algorithm may be considered to be insufficiently accurate. In this case, the first obtaining module 303 may obtain the second algorithm.
In one embodiment, the first obtaining module 303 may be configured to:
and counting the times of errors existing in the output result of the first algorithm in a preset second time length range, wherein the preset second time length range is larger than the preset first time length range.
For example, after determining that there is an error in the cleanable background application output by the first algorithm, the first obtaining module 303 may count the number of times that there is an error in the output result of the first algorithm within the preset second duration range. The second duration range may be much longer than the preset first duration range. For example, the preset second duration range may be the last week.
After counting the number of times that the output result of the first algorithm has errors within the preset second duration range, the terminal may detect whether the number of times reaches a preset value.
If the terminal detects that the number of times reaches a preset value, the result error of the cleanable background application output by the first algorithm can be considered to be poor. For example, the first obtaining module 303 counts that the number of times of errors in the result of the cleanable background application output by the first algorithm in the time range of the last week reaches 11 times, and exceeds 10 times. Then the result of the cleanable background application output by the first algorithm may be deemed inaccurate. In this case, the first obtaining module 303 may obtain the second algorithm.
Referring to fig. 9, fig. 9 is another schematic structural diagram of an apparatus for replacing an algorithm according to an embodiment of the present disclosure. In an embodiment, the apparatus 300 for replacing an algorithm may further include: a second acquisition module 305, and an adjustment module 306.
A second obtaining module 305, configured to obtain a first number of background applications that are allowed to be cleaned.
Then, the first obtaining module 303 may be configured to: if the cleaned application is detected to be used by the user within a preset first time range, counting a second number of applications used by the user in the cleaned application; calculating the proportion of the second number in the first number; and if the proportion is detected to exceed a preset proportion threshold value, determining that an error exists in the output result of the first algorithm.
For example, after the cleanable background applications output by the first algorithm are recorded, the second obtaining module 305 may obtain the number of cleanable background applications output by the first algorithm this time, that is, the first number. For example, the number of cleanable background applications that the second obtaining module 305 obtains the current output of the first algorithm is 3.
Then, after cleaning the applications A, B, C from the background, the terminal detects that the user uses one or more of the applications A, B, C within the next 5 minutes, and the first obtaining module 303 may count the number of applications used by the user, that is, the second number, in the cleaned applications A, B, C.
Then, the first obtaining module 303 may calculate a ratio of the second number to the first number, and detect whether the calculated ratio exceeds a preset ratio threshold.
If the calculated proportion does not exceed the preset proportion threshold, the cleanable background application result output by the first algorithm at this time can still be considered to be more accurate. At this point, the terminal may continue to perform other operations. For example, the terminal cleans up a total of 12 background applications from the background this time according to the result of the cleanable background applications output by the first algorithm. Within 5 minutes thereafter, only 1 of the 12 cleaned background applications is restarted by the user, i.e. the second number accounts for 8.3% of the first number and is lower than the preset percentage threshold value by 10%. In this case, the result of the cleanable background application output by the first algorithm may be considered relatively accurate. At this point, the terminal may continue to perform other operations.
If the calculated proportion exceeds the preset proportion threshold value, the result of the cleanable background application output this time by the first algorithm can be considered to have an error.
For example, after the application A, B, C is cleaned from the background, the terminal detects that the user uses the application a and the application B within the next 5 minutes, and the first obtaining module 303 may count that the second number of the applications reused by the user in the cleaned background applications is 2. Then, the first obtaining module 303 may calculate that the ratio of the second number 2 to the first number 3 is 66.7%. And the preset proportional threshold is, for example, 10%. In this case, the terminal may detect that the ratio of the second number to the first number exceeds a preset ratio threshold. Namely, the application in the background of the terminal is cleaned by mistake, and the background application is cleaned by mistake to a greater extent. At this time, the first obtaining module 303 may determine that there is an error in the cleanable background application output by the first algorithm.
The adjusting module 306 is configured to count a traffic consumption value of an application located in a terminal background in unit time; calculating the average flow value of the application positioned in the terminal background in a preset period according to the counted flow consumption value; and if the average flow value is detected to exceed a preset flow threshold value, reducing the numerical value of the preset proportion threshold value.
For example, the terminal may count traffic consumption values of applications located in the background of the terminal every day. Then, the terminal can calculate an average flow value consumed by the application located in the background of the terminal within one week according to the flow consumption value of the background application counted every day, and detect whether the average flow value exceeds a preset flow threshold value.
If the average flow value is detected not to exceed the preset flow threshold, the application in the background of the terminal may be considered to consume less flow. In this case, the terminal may not adjust the value of the preset proportional threshold.
If the average flow value is detected to exceed the preset flow threshold, it can be considered that the flow consumed by the application in the background of the terminal is large. In this case, the result of the cleanable background application that requires the output of the first algorithm may be considered more accurate, thereby avoiding traffic being consumed without effect (by applications that may be cleaned but are not actually cleaned). At this time, the terminal may trigger the adjusting module 306 to decrease the value of the preset proportion threshold for determining whether the output result of the first algorithm has an error.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed on a computer, causes the computer to execute the steps in the method for replacing an algorithm as provided in the present embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is used to execute the steps in the method for replacing the algorithm provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 10, fig. 10 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
The mobile terminal 400 may include a display unit 401, memory 402, a processor 403, and the like. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 7 is not intended to be limiting of mobile terminals and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The display unit 401 may be a display screen of a terminal or the like.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running an application program stored in the memory 402.
The processor 403 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the mobile terminal.
In this embodiment, the processor 403 in the mobile terminal loads the executable code corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, thereby implementing the steps:
when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned or not, recording the background application which is output by the first algorithm and allowed to be cleaned; after the recorded background application which is allowed to be cleaned is cleaned, detecting whether the cleaned application is used by a user within a preset first time range; if the cleaned application is detected to be used by a user within a preset first time range, determining that an output result of the first algorithm has an error, and acquiring a second algorithm; and replacing the first algorithm with the second algorithm for judging whether the background application is allowed to be cleaned.
Referring to fig. 11, the mobile terminal 500 may include a display unit 501, a memory 502, a processor 503, an input unit 504, an output unit 505, and the like.
The display unit 501 may be a display screen of a terminal or the like.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 503 executes various functional applications and data processing by running an application program stored in the memory 502.
The processor 503 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing an application program stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the mobile terminal.
The input unit 504 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 505 may be used to display information input by or provided to a user and various graphic user interfaces of the mobile terminal, which may be configured by graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
In this embodiment, the processor 503 in the mobile terminal loads the executable code corresponding to the process of one or more application programs into the memory 502 according to the following instructions, and the processor 503 runs the application programs stored in the memory 502, thereby implementing the steps:
when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned or not, recording the background application which is output by the first algorithm and allowed to be cleaned; after the recorded background application which is allowed to be cleaned is cleaned, detecting whether the cleaned application is used by a user within a preset first time range; if the cleaned application is detected to be used by a user within a preset first time range, determining that an output result of the first algorithm has an error, and acquiring a second algorithm; and replacing the first algorithm with the second algorithm for judging whether the background application is allowed to be cleaned.
In one embodiment, when the processor 503 executes the step of determining that the output result of the first algorithm has an error and acquiring the second algorithm, it may execute: determining that the output result of the first algorithm has errors, and counting the times of the output result of the first algorithm having errors; and if the times are detected to reach a preset value, acquiring a second algorithm.
In one embodiment, after the processor 503 performs the step of recording the cleaning-enabled background application output by the first algorithm, it may further perform: a first number of background applications that are allowed to be cleaned is obtained.
Then, the processor 503 may execute the step of determining that there is an error in the output result of the first algorithm if the cleaned application is detected to be used by the user within the preset first time period, and then: if the cleaned application is detected to be used by the user within a preset first time range, counting a second number of applications used by the user in the cleaned application; calculating the proportion of the second number in the first number; and if the proportion is detected to exceed a preset proportion threshold value, determining that an error exists in the output result of the first algorithm.
In one embodiment, the processor 503, when executing the step of counting the number of times that the output result of the first algorithm has errors, may execute: and counting the times of errors existing in the output result of the first algorithm in a preset second time length range, wherein the preset second time length range is larger than the preset first time length range.
In one embodiment, the processor 503 may further perform: counting the flow consumption value of the application positioned in the terminal background in unit time; calculating the average flow value of the application positioned in the terminal background in a preset period according to the counted flow consumption value; and if the average flow value is detected to exceed a preset flow threshold value, reducing the numerical value of the preset proportion threshold value.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the method for replacing the algorithm, and are not described herein again.
The algorithm replacing device provided in the embodiment of the present application and the algorithm replacing method in the above embodiments belong to the same concept, and any one of the methods provided in the algorithm replacing method embodiment may be run on the algorithm replacing device, and the specific implementation process thereof is described in detail in the algorithm replacing method embodiment, and is not described herein again.
It should be noted that, for the method for replacing an algorithm described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of the method for implementing the algorithm described in the embodiment of the present application can be implemented by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the method for replacing an algorithm can be included as described. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
For the algorithm replacing device in the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The method, the apparatus, the storage medium, and the electronic device for replacing an algorithm provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (5)

1. A method of replacing an algorithm, comprising:
when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned or not, recording the background application which is output by the first algorithm and allowed to be cleaned; acquiring a first number of background applications which are allowed to be cleaned;
after the recorded background application which is allowed to be cleaned is cleaned, detecting whether the cleaned application is used by a user within a preset first time range;
if the cleaned application is detected to be used by the user within a preset first time range, counting a second number of applications used by the user in the cleaned application; calculating the proportion of the second number in the first number; if the proportion is detected to exceed a preset proportion threshold value, determining that the output result of the first algorithm has errors, and counting the times that the output result of the first algorithm has errors; if the times are detected to reach a preset value, acquiring a second algorithm;
replacing the first algorithm with the second algorithm for determining whether the background application is allowed to be cleaned;
counting the flow consumption value of the application positioned in the terminal background in unit time; calculating the average flow value of the application positioned in the terminal background in a preset period according to the counted flow consumption value; and if the average flow value is detected to exceed a preset flow threshold value, reducing the numerical value of the preset proportion threshold value.
2. The method for replacing algorithm according to claim 1, wherein the counting the number of times that the output result of the first algorithm has errors comprises:
and counting the times of errors existing in the output result of the first algorithm in a preset second time length range, wherein the preset second time length range is larger than the preset first time length range.
3. An apparatus for replacing an algorithm, comprising:
the recording module is used for recording the background application which is output by the first algorithm and allowed to be cleaned when the configured first algorithm is used for judging whether the background application of the terminal is allowed to be cleaned; acquiring a first number of background applications which are allowed to be cleaned;
the detection module is used for detecting whether the cleaned application is used by a user within a preset first time range after the recorded background application which is allowed to be cleaned is cleaned;
the first obtaining module is used for counting a second number of applications used by a user in the cleaned applications if the cleaned applications are detected to be used by the user within a preset first time range; calculating the proportion of the second number in the first number; if the proportion is detected to exceed a preset proportion threshold value, determining that the output result of the first algorithm has errors, and counting the times that the output result of the first algorithm has errors; if the times are detected to reach a preset value, acquiring a second algorithm;
the replacing module is used for replacing the first algorithm by using the second algorithm and judging whether the background application is allowed to be cleaned; counting the flow consumption value of the application positioned in the terminal background in unit time; calculating the average flow value of the application positioned in the terminal background in a preset period according to the counted flow consumption value; and if the average flow value is detected to exceed a preset flow threshold value, reducing the numerical value of the preset proportion threshold value.
4. A storage medium having stored thereon a computer program, characterized in that the computer program, when executed on a computer, causes the computer to execute a method of changing an algorithm according to any one of claims 1 to 2.
5. An electronic device comprising a memory, a processor, wherein the processor is configured to perform the method of changing an algorithm of any of claims 1 to 2 by invoking a computer program stored in the memory.
CN201711124541.5A 2017-11-14 2017-11-14 Method and device for replacing algorithm, storage medium and electronic equipment Active CN107832155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711124541.5A CN107832155B (en) 2017-11-14 2017-11-14 Method and device for replacing algorithm, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711124541.5A CN107832155B (en) 2017-11-14 2017-11-14 Method and device for replacing algorithm, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN107832155A CN107832155A (en) 2018-03-23
CN107832155B true CN107832155B (en) 2020-01-14

Family

ID=61655500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711124541.5A Active CN107832155B (en) 2017-11-14 2017-11-14 Method and device for replacing algorithm, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN107832155B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2502768A (en) * 2012-04-12 2013-12-11 Qatar Foundation Correcting database errors
CN103838601B (en) * 2013-11-29 2017-04-19 北京奇虎科技有限公司 Junk data cleaning method and device
US9584619B2 (en) * 2014-08-21 2017-02-28 Sap Se Business web applications lifecycle management with multi-tasking ability
CN105183902B (en) * 2015-09-30 2019-03-15 北京金山安全软件有限公司 File cleaning method and device and terminal
CN106201595A (en) * 2016-06-30 2016-12-07 北京奇虎科技有限公司 The cleaning control method of a kind of application program and device
CN107133094B (en) * 2017-06-05 2021-11-02 努比亚技术有限公司 Application management method, mobile terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN107832155A (en) 2018-03-23

Similar Documents

Publication Publication Date Title
CN108304324B (en) Test case generation method, device, equipment and storage medium
CN107577522B (en) Application control method, device, storage medium and electronic equipment
CN108009692A (en) Maintenance of equipment information processing method, device, computer equipment and storage medium
CN105117062A (en) Screen luminance regulation method and mobile terminal
CN106685752B (en) A kind of information processing method and terminal
US10135779B2 (en) Levels of competency in an online community
CN109445884B (en) Function label display method and terminal equipment
WO2019085754A1 (en) Application cleaning method and apparatus, and storage medium and electronic device
CN107992361B (en) Background application cleaning method and device, storage medium and electronic equipment
CN107943571B (en) Background application control method and device, storage medium and electronic equipment
CN107943536B (en) Method and device for adjusting threshold, storage medium and electronic equipment
CN110602207A (en) Method, device, server and storage medium for predicting push information based on off-network
CN114707548A (en) Abnormal waveform capturing method and device, electronic equipment and storage medium
CN108604142B (en) Touch screen device operation method and touch screen device
CN107832155B (en) Method and device for replacing algorithm, storage medium and electronic equipment
CN111813307B (en) Application program display method and device and electronic equipment
JP2021089711A (en) Video jitter detection method and apparatus
CN106648916B (en) Method and device for reporting pedometer message
CN110275639B (en) Touch data processing method and device, terminal and storage medium
CN105468503A (en) Software test method and device
CN113590914B (en) Information processing method, apparatus, electronic device and storage medium
CN109922359B (en) User processing method, device, equipment and storage medium
CN108958929B (en) Method and device for applying algorithm library, storage medium and electronic equipment
CN114186123A (en) Processing method, device and equipment for hotspot event and storage medium
CN113900910A (en) Application program monitoring method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant