Movatterモバイル変換


[0]ホーム

URL:


CN106484507B - A kind of processing method and processing device using thread - Google Patents

A kind of processing method and processing device using thread
Download PDF

Info

Publication number
CN106484507B
CN106484507BCN201610830400.4ACN201610830400ACN106484507BCN 106484507 BCN106484507 BCN 106484507BCN 201610830400 ACN201610830400 ACN 201610830400ACN 106484507 BCN106484507 BCN 106484507B
Authority
CN
China
Prior art keywords
main thread
task
application
running time
thread
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.)
Expired - Fee Related
Application number
CN201610830400.4A
Other languages
Chinese (zh)
Other versions
CN106484507A (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.)
TVMining Beijing Media Technology Co Ltd
Original Assignee
TVMining Beijing Media Technology Co 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 TVMining Beijing Media Technology Co LtdfiledCriticalTVMining Beijing Media Technology Co Ltd
Priority to CN201610830400.4ApriorityCriticalpatent/CN106484507B/en
Publication of CN106484507ApublicationCriticalpatent/CN106484507A/en
Application grantedgrantedCritical
Publication of CN106484507BpublicationCriticalpatent/CN106484507B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of processing method and processing devices using thread, to solve the problems, such as using appearance without response.The described method includes: monitoring the operation duration of each task of the main thread during operation of the main thread of application;If the operation duration of task exceeds specified duration, the main thread is handled using default processing rule.

Description

Application thread processing method and device
Technical Field
The invention relates to the technical field of internet application, in particular to a method and a device for processing an application thread.
Background
With the popularization of mobile terminal devices such as smart phones and tablet computers, people are gradually accustomed to a mode of surfing the internet by using APP (Application) clients, and all domestic large electronic businesses at present have own APP clients.
In practical applications, there may be situations where the application is not responsive, for example, an input box is displayed, but there is no focus in the input box; or, there is focus in the input box, but the virtual keyboard is not popped up, and so on, there is a need to solve this problem.
Disclosure of Invention
The invention provides a processing method and a processing device of an application thread, which are used for solving the problem of no response of an application.
The invention provides a processing method of an application thread, which comprises the following steps:
monitoring the running time of each task of a main thread in the running process of the main thread of an application;
and if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule.
In an embodiment of the present invention, monitoring the running time of each task of the main thread includes:
starting a timer when each task is executed in the main thread;
and timing each task by utilizing the timer so as to monitor the running time of each task of the main thread.
In an embodiment of the present invention, processing the main thread by using a preset processing rule includes:
killing the main thread; or,
and generating prompt information for prompting the user not to perform other operations aiming at the application.
In an embodiment of the present invention, the method further includes:
and shielding the hardware button operation aiming at the application.
In an embodiment of the present invention, before monitoring the running time of each task of the main thread, the method further includes:
judging whether the number of tasks of the main thread exceeds a number threshold;
and if so, monitoring the running time of each task of the main thread.
The invention also provides a processing device of the application thread, which comprises:
the monitoring module is used for monitoring the running time of each task of the main thread in the running process of the main thread of the application;
and the processing module is used for processing the main thread by adopting a preset processing rule if the running time of the task exceeds the specified time.
In an embodiment of the present invention, the monitoring module is further configured to:
starting a timer when each task is executed in the main thread;
and timing each task by utilizing the timer so as to monitor the running time of each task of the main thread.
In an embodiment of the present invention, the processing module is further configured to:
killing the main thread; or,
and generating prompt information for prompting the user not to perform other operations aiming at the application.
In an embodiment of the present invention, the processing module is further configured to:
and shielding the hardware button operation aiming at the application.
In an embodiment of the present invention, the apparatus further includes:
the judging module is used for judging whether the number of the tasks of the main thread exceeds a number threshold value; and if so, monitoring the running time of each task of the main thread.
In the embodiment of the invention, in the process of running a main thread of an application, the running time of each task of the main thread is monitored; and if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule. Therefore, the embodiment of the invention can solve the problem of no response of the application.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart illustrating a method for processing application threads according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for processing application threads according to another embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a structure of a processing device applying threads according to an embodiment of the present invention; and
FIG. 4 is a schematic structural diagram of a processing device using threads according to another embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Fig. 1 is a flowchart illustrating a processing method for application threads, which may be applied to a terminal such as a smart phone or a smart tv set, according to an embodiment of the present invention, and the method may include the following steps S11-S12.
Step S11, during the process of the main thread running of the application, the running time of each task of the main thread is monitored.
And step S12, if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule.
In the embodiment of the invention, in the process of running a main thread of an application, the running time of each task of the main thread is monitored; and if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule. Therefore, the embodiment of the invention can solve the problem of no response of the application.
In the above step S11, the running time of each task of the main thread is monitored, and an alternative solution is provided in the embodiment of the present invention, which includes the following steps a1-a 2.
Step A1, a timer is started when each task is executed in the main thread.
And step A2, timing each task by using a timer to monitor the running time of each task of the main thread.
The embodiment of the invention adds the timing management of the operation of the main thread to monitor the operation time of each task of the main thread, and further processes the main thread by adopting the preset processing rule when the operation time of the task exceeds the specified time.
In the step S12, the main thread is processed by using the preset processing rule, the embodiment of the present invention provides an optional scheme, where the scheme may be to kill the main thread; or, generating a prompt message for prompting the user not to perform other operations with respect to the application, and so on, which is not limited by the present invention.
In an optional embodiment of the present invention, if the running time of the task exceeds a specified time, the hardware button operation for the application may be further masked.
In an alternative embodiment of the present invention, before monitoring the running time of each task of the main thread in step S11 above, it may be determined whether the number of tasks of the main thread exceeds a number threshold; and if so, monitoring the running time of each task of the main thread. Otherwise, the monitoring operation may not be performed.
In an alternative embodiment of the invention, it may also be monitored whether the main thread in the application is in star state. If so, it indicates that the main thread is a time consuming thread and needs to be killed. The main thread is typically the thread used for the interface display and can therefore be killed. In one application, each interface has a unique main thread, so when the current interface is displayed, the main thread of the current interface cannot be killed, otherwise, the current interface is destroyed. Thus, it is possible to monitor whether a time-consuming task or operation is in the main thread of the current interface to affect the display of the interface.
The following describes in detail the implementation process of the application thread processing method according to the present invention by using a specific embodiment. Fig. 2 is a flowchart illustrating a processing method for application threads in another embodiment of the present invention, where the method may be applied to a terminal such as a smart phone or a smart tv, and the method may include the following steps S21-S23.
Step S21, in the process of the main thread running, judging whether the number of tasks of the main thread exceeds the number threshold, if yes, continuing to execute step S22; otherwise, if not, the determination operation of step S21 is continued.
And step S22, starting a timer, and timing each task by using the timer so as to monitor the running time of each task of the main thread.
And step S23, if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule.
In this step, the main thread may be killed; or, generating a prompt message for prompting the user not to perform other operations with respect to the application, and so on, which is not limited by the present invention. In addition, hardware button operations for the application may also be masked.
It should be noted that, in practical applications, all the above-mentioned optional embodiments may be combined in a combined manner at will to form an optional embodiment of the present invention, and details are not described here any more.
Corresponding to the processing method of the application thread in the above embodiment, the present invention also provides a processing apparatus of the application thread. Fig. 3 is a schematic structural diagram of a processing apparatus for applying threads according to an embodiment of the present invention, including:
the monitoring module 31 is configured to monitor an operation duration of each task of a main thread during an operation process of the main thread of an application;
and the processing module 32 is configured to process the main thread by using a preset processing rule if the running time of the task exceeds a specified time.
In an embodiment of the present invention, the monitoring module 31 is further configured to:
starting a timer when each task is executed in the main thread;
and timing each task by utilizing the timer so as to monitor the running time of each task of the main thread.
In an embodiment of the present invention, the processing module 32 is further configured to:
killing the main thread; or,
and generating prompt information for prompting the user not to perform other operations aiming at the application.
In an embodiment of the present invention, the processing module 32 is further configured to:
and shielding the hardware button operation aiming at the application.
In an embodiment of the present invention, as shown in fig. 4, the apparatus shown in fig. 3 above may further include:
a judging module 41, configured to judge whether the number of tasks of the main thread exceeds a number threshold; and if so, monitoring the running time of each task of the main thread.
The above device of the embodiment of the present invention: monitoring the running time of each task of a main thread in the running process of the main thread of an application; and if the running time of the task exceeds the specified time, processing the main thread by adopting a preset processing rule. Therefore, the embodiment of the invention can solve the problem of no response of the application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

CN201610830400.4A2016-09-182016-09-18A kind of processing method and processing device using threadExpired - Fee RelatedCN106484507B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610830400.4ACN106484507B (en)2016-09-182016-09-18A kind of processing method and processing device using thread

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610830400.4ACN106484507B (en)2016-09-182016-09-18A kind of processing method and processing device using thread

Publications (2)

Publication NumberPublication Date
CN106484507A CN106484507A (en)2017-03-08
CN106484507Btrue CN106484507B (en)2019-11-29

Family

ID=58267434

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610830400.4AExpired - Fee RelatedCN106484507B (en)2016-09-182016-09-18A kind of processing method and processing device using thread

Country Status (1)

CountryLink
CN (1)CN106484507B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101911056A (en)*2008-01-152010-12-08微软公司Content isolation by processes in an application
CN102929500A (en)*2012-09-272013-02-13东莞宇龙通信科技有限公司Mobile terminal and method for closing application program
CN103810053A (en)*2014-02-142014-05-21福建天晴数码有限公司Method for processing endless loop of game server
CN104615497A (en)*2015-02-132015-05-13广州华多网络科技有限公司Thread hanging processing method and device
CN105389258A (en)*2015-12-102016-03-09腾讯科技(深圳)有限公司Program detection method and apparatus
CN105446806A (en)*2014-09-282016-03-30广州市动景计算机科技有限公司Processing method and apparatus for application not responding

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7987462B2 (en)*2006-11-162011-07-26International Business Machines CorporationMethod for automatic throttling of work producers

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101911056A (en)*2008-01-152010-12-08微软公司Content isolation by processes in an application
CN102929500A (en)*2012-09-272013-02-13东莞宇龙通信科技有限公司Mobile terminal and method for closing application program
CN103810053A (en)*2014-02-142014-05-21福建天晴数码有限公司Method for processing endless loop of game server
CN105446806A (en)*2014-09-282016-03-30广州市动景计算机科技有限公司Processing method and apparatus for application not responding
CN104615497A (en)*2015-02-132015-05-13广州华多网络科技有限公司Thread hanging processing method and device
CN105389258A (en)*2015-12-102016-03-09腾讯科技(深圳)有限公司Program detection method and apparatus

Also Published As

Publication numberPublication date
CN106484507A (en)2017-03-08

Similar Documents

PublicationPublication DateTitle
US9880157B2 (en)Apparatus and methods for suppressing user-alerting actions
CN107678782B (en)Process protection method, device, equipment and computer readable storage medium
WO2015100933A1 (en)Data processing method for realizing multiple operating systems and terminal device
CN105843681B (en)Mobile terminal and operating system switching method thereof
CN110750284B (en)Application quick starting method, terminal and computer readable storage medium
CN103761036A (en)Method and device for running application
CN105302455A (en)Interface operation method and terminal
CN110737562A (en)method and system for monitoring process and electronic equipment
CN104077151B (en)The method and electronic equipment of fast start network application
CN105677533B (en)Application process monitoring method and application process monitoring device
CN109086077A (en)A kind of operation method and device of application program
CN113805962A (en) Application page display method, device and electronic device
WO2018103217A1 (en)Method for upgrading application, and server and user equipment
CN111294377A (en)Network request sending method of dependency relationship, terminal device and storage medium
CN107526584B (en)Data access method and device
CN111880912A (en)Method and device for controlling electronic equipment and electronic equipment
CN107209732B (en)Method, medium, and first device for responding to connection of external device to computer
US20200081597A1 (en)Application program management method and apparatus
CN106022117A (en)Method and device for preventing system environment variable from being modified and electronic equipment
CN106484507B (en)A kind of processing method and processing device using thread
WO2017096826A1 (en)Method and device for controlling mobile terminal
CN110704247B (en)Processing method and device for application memory exception, electronic equipment and device
CN112016080B (en) Application permission management method, device and electronic device
CN106814835A (en)A kind of over-current protection method, device and electronic equipment
CN105653364A (en)Application process management method and application process management device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
PE01Entry into force of the registration of the contract for pledge of patent right
PE01Entry into force of the registration of the contract for pledge of patent right

Denomination of invention:An application thread processing method and device

Effective date of registration:20210104

Granted publication date:20191129

Pledgee:Inner Mongolia Huipu Energy Co.,Ltd.

Pledgor:TVMINING (BEIJING) MEDIA TECHNOLOGY Co.,Ltd.

Registration number:Y2020990001527

CF01Termination of patent right due to non-payment of annual fee
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20191129

Termination date:20210918


[8]ページ先頭

©2009-2025 Movatter.jp