CN108491122A - A kind of click event response method, computer readable storage medium and terminal device - Google Patents

A kind of click event response method, computer readable storage medium and terminal device Download PDF

Info

Publication number
CN108491122A
CN108491122A CN201810121665.6A CN201810121665A CN108491122A CN 108491122 A CN108491122 A CN 108491122A CN 201810121665 A CN201810121665 A CN 201810121665A CN 108491122 A CN108491122 A CN 108491122A
Authority
CN
China
Prior art keywords
utilization rate
click event
preset
cpu
target terminal
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.)
Granted
Application number
CN201810121665.6A
Other languages
Chinese (zh)
Other versions
CN108491122B (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810121665.6A priority Critical patent/CN108491122B/en
Priority to PCT/CN2018/083284 priority patent/WO2019153502A1/en
Publication of CN108491122A publication Critical patent/CN108491122A/en
Application granted granted Critical
Publication of CN108491122B publication Critical patent/CN108491122B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04812Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • 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/5016Allocation 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 the resource being the memory
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to a kind of field of computer technology more particularly to click event response method, computer readable storage medium and terminal devices.The method obtains the first moment when target terminal receives the first click event first, and obtain the second moment when the target terminal receives the second click event, then the time interval between second moment and first moment is calculated, if the time interval is greater than or equal to preset interval threshold, then the second click event is responded according to preset system response time, if the time interval is less than the interval threshold, then calculate the current hardware resource utilization rate of the target terminal, target response time corresponding with the hardware resource utilization rate is inquired in preset relationship corresponds to table, and the second click event is responded according to the target response time.Through the invention, it is disorderly to avoid response, reduces the generation of card machine phenomenon, greatly improves the usage experience of user.

Description

A kind of click event response method, computer readable storage medium and terminal device
Technical field
The invention belongs to field of computer technology more particularly to a kind of click event response method, computer-readable storages Medium and terminal device.
Background technology
When operating various intelligent terminals, system can be given in the click event for receiving user and respond user, But due to the influence of hardware device performance, some configurations compare low side equipment the incoming event of user can be made it is slow Reaction.Sometimes user is in order to be responded, some view of meeting adopting consecutive click chemical reaction, this results in system software interface to come not yet Anxious update, but user has done multiple click action on the same view, and the disorder for causing system to respond will go out at this time Our existing common card machine phenomenons, very big the usage experience for influencing user.
Invention content
In view of this, an embodiment of the present invention provides a kind of click event response method, computer readable storage medium and Terminal device, to solve the problems, such as that card machine phenomenon easily occurs when user makes adopting consecutive click chemical reaction event.
The first aspect of the embodiment of the present invention provides a kind of click event response method, may include:
Obtain the first moment when target terminal receives the first click event;
The second moment when the target terminal receives the second click event is obtained, described second clicks event as in institute State first click event after the first click event;
Calculate the time interval between second moment and first moment;
If the time interval is greater than or equal to preset interval threshold, according to preset system response time to described Second click event is responded;
If the time interval is less than the interval threshold, calculates the current hardware resource of the target terminal and use Rate;
Target response time corresponding with the hardware resource utilization rate, the mesh are inquired in preset relationship corresponds to table Mark response time and the hardware resource utilization rate positive correlation;
The second click event is responded according to the target response time.
The second aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer-readable instruction, the computer-readable instruction to realize following steps when being executed by processor:
Obtain the first moment when target terminal receives the first click event;
The second moment when the target terminal receives the second click event is obtained, described second clicks event as in institute State first click event after the first click event;
Calculate the time interval between second moment and first moment;
If the time interval is greater than or equal to preset interval threshold, according to preset system response time to described Second click event is responded;
If the time interval is less than the interval threshold, calculates the current hardware resource of the target terminal and use Rate;
Target response time corresponding with the hardware resource utilization rate, the mesh are inquired in preset relationship corresponds to table Mark response time and the hardware resource utilization rate positive correlation;
The second click event is responded according to the target response time.
The third aspect of the embodiment of the present invention provides a kind of click event response terminal device, including memory, processing Device and it is stored in the computer-readable instruction that can be run in the memory and on the processor, the processor executes Following steps are realized when the computer-readable instruction:
Obtain the first moment when target terminal receives the first click event;
The second moment when the target terminal receives the second click event is obtained, described second clicks event as in institute State first click event after the first click event;
Calculate the time interval between second moment and first moment;
If the time interval is greater than or equal to preset interval threshold, according to preset system response time to described Second click event is responded;
If the time interval is less than the interval threshold, calculates the current hardware resource of the target terminal and use Rate;
Target response time corresponding with the hardware resource utilization rate, the mesh are inquired in preset relationship corresponds to table Mark response time and the hardware resource utilization rate positive correlation;
The second click event is responded according to the target response time.
Existing advantageous effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention obtains target end first The first moment when termination receives the first click event, and obtain when the target terminal receives the second click event second Then moment calculates the time interval between second moment and first moment, if the time interval is more than or waits In preset interval threshold, then the second click event is responded according to preset system response time, if when described Between interval be less than the interval threshold, then the current hardware resource utilization rate of the target terminal is calculated, in preset relationship pair It answers and inquires target response time corresponding with the hardware resource utilization rate in table, and according to the target response time to described Second click event is responded.I.e. when user normally clicks, carried out according to normal system response time to clicking event Response, when user makes adopting consecutive click chemical reaction event, determines the response time, and the two is just according to current hardware resource utilization rate Relevant relationship, hardware resource utilization rate is higher, and the response time is longer, leaves time enough in this way and comes to adopting consecutive click chemical reaction thing Part is responded, and is avoided the disorder of system response, is reduced the generation of card machine phenomenon, and greatly improve user uses body It tests.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of one embodiment flow chart for clicking event response method in the embodiment of the present invention;
Fig. 2 is the schematic flow diagram for the default process that relationship corresponds to table;
Fig. 3 is a kind of one embodiment structure chart for clicking event response device in the embodiment of the present invention;
Fig. 4 is a kind of schematic block diagram for clicking event response terminal device in the embodiment of the present invention.
Specific implementation mode
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field All other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention Range.
Referring to Fig. 1, in the embodiment of the present invention it is a kind of click event response method one embodiment may include:
Step S101, the first moment when target terminal receives the first click event is obtained.
Step S102, the second moment when the target terminal receives the second click event is obtained.
Described second clicks event for first click event after the first click event, i.e., in the present embodiment In, the first click event and the second click event are the click event twice occurred in succession successively, by target terminal It is denoted as lastClickTime namely first moment at the time of when receiving the first click event, target terminal is received It is denoted as currentTime namely second moment at the time of when the second click event.
Step S103, the time interval between second moment and first moment is calculated.
Step S104, judge whether the time interval is less than preset interval threshold.
The interval threshold can be denoted as MIN_CLICK_DELAY_TIME, specific value can according to actual conditions into Row setting, for example, MIN_CLICK_DELAY_TIME=500ms can be arranged.
If the time interval is greater than or equal to the interval threshold, namely:
CurrentTime-lastClickTime >=MIN_CLICK_DELAY_TIME thens follow the steps S105.
If the time interval is less than the interval threshold, namely:
currentTime-lastClickTime<MIN_CLICK_DELAY_TIME thens follow the steps S106 and its follow-up Step.
Step S105, the second click event is responded according to preset system response time.
When the time interval is greater than or equal to preset interval threshold, illustrate between two adopting consecutive click chemical reaction events when Between be spaced it is sufficiently large, according to the response time of system default carry out response will not generate card machine phenomenon.
Step S106, the current hardware resource utilization rate of the target terminal is calculated.
First, the current CPU usage of the target terminal is obtained.
Specifically, in preset first sampling instant, the text of preset record CPU information in the target terminal is obtained Part, CPU running state data of the extraction in first sampling instant from the file of the record CPU information;Preset Second sampling instant obtains the file of the record CPU information, second sampling instant and first sampling instant interval Preset duration, CPU running state data of the extraction in second sampling instant from the file of the record CPU information; According to the CPU running state datas in first sampling instant and the CPU running state datas in second sampling instant Calculate the CPU usage.
For example, can obtain target terminal /proc/cpuinfo files in the CPU information that records, extract following CPU Running state data:
User:Run time in User space does not include the process that nice values are negative;
nice:Nice values are the process occupied CPU time born, and nice values are that the number of static priority is indicated in system Value, each process have the static priority of oneself, the high process of priority preferentially to be run;
system:Run time in kernel mode;
idle:Other stand-by period in addition to I/O latency;
iowait:I/O latency;
Irq:Out of service time;
softirq:The traps time;
stealstolen:The time of other operating systems is spent in when virtual environment is run;
guest:The time that operating system virtual cpu is spent;
guest_nice:Operating system virtual cpu spends in the time in nice processes.
The CPU running state datas of two time intervals short enough of first post-sampling, are denoted as t1, t2, wherein t1, t2 respectively Structure be (user, nice, system, idle, iowait, irq, softirq, stealstolen, guest, guest_ Nice 10 tuples);All 10 tuple datas of first time are summed, totalCPUTime1 is obtained;Secondary all 10 Tuple data is summed, and totalCPUTime2 is obtained;The idle data for obtaining first time, are denoted as idle1;It obtains secondary Idle data, are denoted as idle2;The then current CPU usage λ of the target terminalCPUIt can be calculate by the following formula:
Then, the current memory usage of the target terminal is obtained.
Specifically, the file of preset record memory information in the target terminal is obtained;From the record memory information File in extract surplus workable for memory headroom total amount and memory headroom;According to the memory headroom total amount and institute It states surplus workable for memory headroom and calculates the memory usage.
For example, can obtain target terminal /proc/meminfo files in the memory information that records, contain in this document Many information, to calculate the utilization rate of memory, it is only necessary to which two variate-values therein represent memory headroom total amount MemTotal and the MemFree for representing surplus workable for memory headroom, the current memory usage λ of the target terminalMemory It can be calculate by the following formula:
Finally, the current hardware resource utilization rate of the target terminal is calculated according to the following formula:
η=(sin λmax)2max+(cosλmax)2min
Wherein, λmax=max (λCPUMemory), λmin=min (λCPUMemory), λCPUCurrent for the target terminal CPU usage, λMemoryFor the current memory usage of the target terminal, η, which is the current hardware resource of the target terminal, to be made With rate.
Step S107, when inquiring target response corresponding with the hardware resource utilization rate during preset relationship corresponds to table Between.
The target response time and the hardware resource utilization rate positive correlation.That is hardware resource utilization rate is higher, then right The target response time answered is also longer.
Wherein, the relationship corresponds to the default process of table and can specifically include step as shown in Figure 2:
Step S1071, the value range of the hardware resource utilization rate is divided into the subinterval of preset number.
For example, the value range of the hardware resource utilization rate can be divided into (0,10%], (10%, 20%], (20%, 30%] ..., (90%, 100%] this ten subintervals.
Step S1072, a subinterval is arbitrarily chosen from the subinterval as current test subinterval.
Step S1073, preset task is run.
The preset task is set in advance in the target terminal, its object is to consume hardware resource, by adjusting The quantity of the task of operation simultaneously, can be adjusted current hardware resource utilization rate.Ground is readily appreciated that, if running simultaneously Task quantity it is more, then current hardware resource utilization rate is higher.
Step S1074, current hardware resource utilization rate is calculated.
The specific calculating process of hardware resource utilization rate may refer to the content in step S106, and the present embodiment is herein no longer It repeats.
Step S1075, judge the difference of the hardware resource utilization rate and target utilization rate whether in preset error range It is interior;
The target utilization rate is the upper limit value in the current test subinterval.If the hardware resource utilization rate with it is described The difference of target utilization rate in preset error range, does not then follow the steps S1076, if the hardware resource utilization rate with it is described The difference of target utilization rate thens follow the steps S1077 and its subsequent step in the error range.
Step S1076, the operation quantity of the preset task is adjusted.
Specifically, if the difference of the hardware resource utilization rate and the target utilization rate is more than 0, the operation of task is reduced Quantity increases the operation quantity of task if the difference of the hardware resource utilization rate and the target utilization rate is less than 0.
After step S1076, S1074 and its subsequent step are returned to step.
Step S1077, preset automatically clicking event is triggered, and records the response time of the automatically clicking event.
The automatically clicking event is the click event executed automatically by system, can be seen as implementing user A kind of simulation of click event, process are not necessarily to the participation of user.
Miscellaneous function service is provided by taking Android system as an example, in system namely AccessibilityService comes It realizes the automatically clicking event, specifically, can realize that a miscellaneous function service request is inherited first AccessibilityService classes and the abstract method for realizing it, self-defined service Similar integral system AccessibilityService simultaneously overrides onAccessibilityEvent and onInterrupt methods.Write service class Later, the registration service in system configuration file AndroidManifest.xml.The step of front two is completed just to complete substantially The registration and configuration of miscellaneous function service, specific function, which is realized, to be needed to complete in onAccessibilityEvent, according to The AccessibilityEvent objects that onAccessibilityEvent callback methods pass over, in conjunction with the service class sheet The simulation that body provides clicks relevant interface and the automatically clicking event can be realized.
Step S1078, the current test subinterval and the correspondence between the response time are stored into described Relationship corresponds in table.
Step S1079, judge whether each subinterval was selected.
If there are the subinterval of unselected mistake, S1072 is returned to step, if each subinterval was selected, Then follow the steps S10710.
Step S10710, it preserves the relationship and corresponds to table.
In the initial state, hardware resource utilization rate is generally relatively low, at this point, being continuously increased the operation quantity of task, hardware Until resource utilization reaches first aim utilization rate (such as 10%), automatic running clicks event, records click event Initial time records current time again upon receiving the response, and can be calculated by subtracting click event start time by first The subinterval corresponding response time;The operation quantity of task is continued growing, until hardware resource utilization rate reaches second target Until utilization rate (such as 20%), automatic running clicks event, and it is corresponding to calculate second subinterval according to the method described above Response time;Continue above procedure, until calculating each subinterval corresponding response time.
Above procedure can be repeated several times to improve accuracy by being only a test process above, and each time is calculated The obtained response time averages, and it is more accurate and reliable that finally obtained relationship corresponds to table.
Step S108, the second click event is responded according to the target response time.
In conclusion the embodiment of the present invention obtains the first moment when target terminal receives the first click event first, And the second moment when the target terminal receives the second click event is obtained, then calculate second moment and described the Time interval between one moment, if the time interval is greater than or equal to preset interval threshold, according to preset system Response time responds the second click event, if the time interval be less than the interval threshold, calculate described in The current hardware resource utilization rate of target terminal is inquired corresponding with the hardware resource utilization rate in preset relationship corresponds to table Target response time, and the second click event is responded according to the target response time.It is i.e. normal in user When click, click event is responded according to normal system response time, when user makes adopting consecutive click chemical reaction event, according to Current hardware resource utilization rate determines the response time, and the two is positively related relationship, and hardware resource utilization rate is higher, response Time is longer, leaves time enough in this way to be responded to adopting consecutive click chemical reaction event, avoids the disorder of system response, subtracts The generation for having lacked card machine phenomenon greatly improves the usage experience of user.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to a kind of click event response method described in foregoing embodiments, Fig. 3 shows that the embodiment of the present invention provides A kind of click event response device one embodiment structure chart.
In the present embodiment, a kind of click event response device may include:
First moment acquisition module 301, for obtaining the first moment when target terminal receives the first click event;
Second moment acquisition module 302, when for obtaining second when the target terminal receives the second click event It carves, described second clicks event as first click event after the first click event;
Time interval computing module 303, for calculating the time interval between second moment and first moment;
First respond module 304, if being greater than or equal to preset interval threshold for the time interval, according to default System response time the second click event is responded;
Hardware resource utilization rate computing module 305 calculates institute if being less than the interval threshold for the time interval State the current hardware resource utilization rate of target terminal;
Target response time enquiry module 306 makes for inquiry in corresponding to table in preset relationship with the hardware resource With the corresponding target response time of rate, the target response time and the hardware resource utilization rate positive correlation;
Second respond module 307, for being responded to the second click event according to the target response time.
Further, the hardware resource utilization rate computing module may include:
CPU usage acquiring unit, the CPU usage current for obtaining the target terminal;
Memory usage acquiring unit, the memory usage current for obtaining the target terminal;
Hardware resource utilization rate computing unit is used for calculating the current hardware resource of the target terminal according to the following formula Rate:
η=(sin λmax)2max+(cosλmax)2min
Wherein, λmax=max (λCPUMemory), λmin=min (λCPUMemory), λCPUCurrent for the target terminal CPU usage, λMemoryFor the current memory usage of the target terminal, η, which is the current hardware resource of the target terminal, to be made With rate.
Further, the CPU usage acquiring unit may include:
First CPU information file acquisition subelement, in preset first sampling instant, obtaining in the target terminal The file of preset record CPU information;
First CPU running state datas extract subelement, for being extracted described from the file of the record CPU information The CPU running state datas of first sampling instant;
Second CPU information file acquisition subelement, in preset second sampling instant, obtaining the record CPU letters The file of breath, second sampling instant and the preset duration in first sampling instant interval;
2nd CPU running state datas extract subelement, for being extracted described from the file of the record CPU information The CPU running state datas of second sampling instant;
CPU usage computation subunit, for according in the CPU running state datas of first sampling instant and in institute The CPU running state datas for stating the second sampling instant calculate the CPU usage.
Further, the memory usage acquiring unit may include:
Memory information file acquisition subelement, the text for obtaining preset record memory information in the target terminal Part;
Memory information extract subelement, for from it is described record memory information file in extract memory headroom total amount with And surplus workable for memory headroom;
Memory usage computation subunit, for according to workable for the memory headroom total amount and the memory headroom Surplus calculates the memory usage.
Further, the click event response device can also include:
Subinterval division module, the sub-district for the value range of the hardware resource utilization rate to be divided into preset number Between;
Module is chosen in current test subinterval, is surveyed as current for arbitrarily choosing a subinterval from the subinterval Swab section;
Task run module, for running preset task;
Hardware resource utilization rate computing module, for calculating current hardware resource utilization rate;
Task quantity adjusts module, if for the difference of the hardware resource utilization rate and target utilization rate not in preset mistake In poor range, then the operation quantity of the preset task is adjusted, the target utilization rate is the current test subinterval Upper limit value;
Response time logging modle, if for the difference of the hardware resource utilization rate and target utilization rate in the error model In enclosing, then preset automatically clicking event is triggered, and record the response time of the automatically clicking event;
Relationship corresponds to table memory module, is used for the current test subinterval and the corresponding pass between the response time System is stored into the relationship and corresponds in table.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description, The specific work process of module, unit and subelement, can refer to corresponding processes in the foregoing method embodiment, herein no longer It repeats.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Fig. 4 shows a kind of schematic block diagram for clicking event response terminal device provided in an embodiment of the present invention, in order to just In explanation, illustrate only and the relevant part of the embodiment of the present invention.
In the present embodiment, the click event response terminal device 4 can be mobile phone, tablet computer, desktop calculating The computing devices such as machine, notebook, palm PC and cloud server.The click event response terminal device 4 may include:Processor 40, memory 41 and it is stored in the computer-readable instruction that can be run in the memory 41 and on the processor 40 42, such as execute the computer-readable instruction of above-mentioned click event response method.The processor 40 executes the computer Above-mentioned each step clicked in event response method embodiment, such as step S101 shown in FIG. 1 are realized when readable instruction 42 To S108.Alternatively, the processor 40 realizes each mould in above-mentioned each device embodiment when executing the computer-readable instruction 42 The function of block/unit, for example, module 301 to 307 shown in Fig. 3 function.
Illustratively, the computer-readable instruction 42 can be divided into one or more module/units, one Or multiple module/units are stored in the memory 41, and executed by the processor 40, to complete the present invention.Institute It can be the series of computation machine readable instruction section that can complete specific function, the instruction segment to state one or more module/units For describing implementation procedure of the computer-readable instruction 42 in the click event response terminal device 4.
The processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
The memory 41 can be the internal storage unit of the click event response terminal device 4, such as click thing Part responds the hard disk or memory of terminal device 4.The memory 41 can also be the outer of the click event response terminal device 4 The plug-in type hard disk being equipped in portion's storage device, such as the click event response terminal device 4, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, The memory 41 can also be both including the internal storage unit for clicking event response terminal device 4 or including external storage Equipment.The memory 41 is for storing needed for the computer-readable instruction and the click event response terminal device 4 Other instruction and datas.The memory 41 can be also used for temporarily storing the data that has exported or will export.
Each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also be each Unit physically exists alone, can also be during two or more units are integrated in one unit.Above-mentioned integrated unit both may be used It realizes, can also be realized in the form of SFU software functional unit in the form of using hardware.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words Embody, which is stored in a storage medium, including several computer-readable instructions use so that One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the present invention State all or part of step of method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read- Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with Store the medium of computer-readable instruction.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed Or it replaces, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution.

Claims (10)

1. a kind of click event response method, which is characterized in that including:
Obtain the first moment when target terminal receives the first click event;
Obtain the second moment when the target terminal receives the second click event, described second to click event be described the First click event after one click event;
Calculate the time interval between second moment and first moment;
If the time interval is greater than or equal to preset interval threshold, according to preset system response time to described second Click event is responded;
If the time interval is less than the interval threshold, the current hardware resource utilization rate of the target terminal is calculated;
Target response time corresponding with the hardware resource utilization rate is inquired in preset relationship corresponds to table, the target is rung Between seasonable with the hardware resource utilization rate positive correlation;
The second click event is responded according to the target response time.
2. click event response method according to claim 1, which is characterized in that the calculating target terminal is current Hardware resource utilization rate include:
Obtain the current CPU usage of the target terminal;
Obtain the current memory usage of the target terminal;
The current hardware resource utilization rate of the target terminal is calculated according to the following formula:
η=(sin λmax)2max+(cosλmax)2min
Wherein, λmax=max (λCPUMemory), λmin=min (λCPUMemory), λCPUMake for the current CPU of the target terminal With rate, λMemoryFor the current memory usage of the target terminal, η is the current hardware resource utilization rate of the target terminal.
3. click event response method according to claim 2, which is characterized in that the acquisition target terminal is current CPU usage include:
In preset first sampling instant, the file of preset record CPU information in the target terminal is obtained;
CPU running state data of the extraction in first sampling instant from the file of the record CPU information;
In preset second sampling instant, the file of the record CPU information, second sampling instant and described first are obtained The preset duration in sampling instant interval;
CPU running state data of the extraction in second sampling instant from the file of the record CPU information;
According to the CPU running state datas in first sampling instant and the CPU operating statuses in second sampling instant Data calculate the CPU usage.
4. click event response method according to claim 2, which is characterized in that the acquisition target terminal is current Memory usage include:
Obtain the file of preset record memory information in the target terminal;
Surplus workable for memory headroom total amount and memory headroom is extracted from the file of the record memory information;
The memory usage is calculated according to surplus workable for the memory headroom total amount and the memory headroom.
5. click event response method according to any one of claim 1 to 4, which is characterized in that the relationship corresponds to The default process of table includes:
The value range of the hardware resource utilization rate is divided into the subinterval of preset number;
A subinterval is arbitrarily chosen from the subinterval as current test subinterval;
Run preset task;
Calculate current hardware resource utilization rate;
If the difference of the hardware resource utilization rate and target utilization rate adjusts described preset not in preset error range The operation quantity of task, and return and execute described the step of calculating current hardware resource utilization rate, the target utilization rate is The upper limit value in the current test subinterval;
If the difference of the hardware resource utilization rate and target utilization rate in the error range, triggers preset automatically clicking Event, and record the response time of the automatically clicking event;
The current test subinterval and the correspondence between the response time are stored into the corresponding table of the relationship, so It returns afterwards and arbitrarily chooses a step of subinterval is as current test subinterval described in executing from the subinterval, until each Until a subinterval was selected.
6. a kind of computer readable storage medium, the computer-readable recording medium storage has computer-readable instruction, special Sign is, the click thing as described in any one of claim 1 to 5 is realized when the computer-readable instruction is executed by processor The step of part response method.
7. a kind of click event response terminal device, including memory, processor and it is stored in the memory and can be The computer-readable instruction run on the processor, which is characterized in that the processor executes the computer-readable instruction Shi Shixian following steps:
Obtain the first moment when target terminal receives the first click event;
Obtain the second moment when the target terminal receives the second click event, described second to click event be described the First click event after one click event;
Calculate the time interval between second moment and first moment;
If the time interval is greater than or equal to preset interval threshold, according to preset system response time to described second Click event is responded;
If the time interval is less than the interval threshold, the current hardware resource utilization rate of the target terminal is calculated;
Target response time corresponding with the hardware resource utilization rate is inquired in preset relationship corresponds to table, the target is rung Between seasonable with the hardware resource utilization rate positive correlation;
The second click event is responded according to the target response time.
8. click event response terminal device according to claim 7, which is characterized in that described to calculate the target terminal Current hardware resource utilization rate includes:
Obtain the current CPU usage of the target terminal;
Obtain the current memory usage of the target terminal;
The current hardware resource utilization rate of the target terminal is calculated according to the following formula:
η=(sin λmax)2max+(cosλmax)2min
Wherein, λmax=max (λCPUMemory), λmin=min (λCPUMemory), λCPUMake for the current CPU of the target terminal With rate, λMemoryFor the current memory usage of the target terminal, η is the current hardware resource utilization rate of the target terminal.
9. click event response terminal device according to claim 8, which is characterized in that described to obtain the target terminal Current CPU usage includes:
In preset first sampling instant, the file of preset record CPU information in the target terminal is obtained;
CPU running state data of the extraction in first sampling instant from the file of the record CPU information;
In preset second sampling instant, the file of the record CPU information, second sampling instant and described first are obtained The preset duration in sampling instant interval;
CPU running state data of the extraction in second sampling instant from the file of the record CPU information;
According to the CPU running state datas in first sampling instant and the CPU operating statuses in second sampling instant Data calculate the CPU usage.
10. the click event response terminal device according to any one of claim 7 to 9, which is characterized in that the relationship The default process of corresponding table includes:
The value range of the hardware resource utilization rate is divided into the subinterval of preset number;
A subinterval is arbitrarily chosen from the subinterval as current test subinterval;
Run preset task;
Calculate current hardware resource utilization rate;
If the difference of the hardware resource utilization rate and target utilization rate adjusts described preset not in preset error range The operation quantity of task, and return and execute described the step of calculating current hardware resource utilization rate, the target utilization rate is The upper limit value in the current test subinterval;
If the difference of the hardware resource utilization rate and target utilization rate in the error range, triggers preset automatically clicking Event, and record the response time of the automatically clicking event;
The current test subinterval and the correspondence between the response time are stored into the corresponding table of the relationship, so It returns afterwards and arbitrarily chooses a step of subinterval is as current test subinterval described in executing from the subinterval, until each Until a subinterval was selected.
CN201810121665.6A 2018-02-07 2018-02-07 Click event response method, computer readable storage medium and terminal equipment Active CN108491122B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810121665.6A CN108491122B (en) 2018-02-07 2018-02-07 Click event response method, computer readable storage medium and terminal equipment
PCT/CN2018/083284 WO2019153502A1 (en) 2018-02-07 2018-04-17 Method for responding to click event, readable storage medium, terminal device, and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810121665.6A CN108491122B (en) 2018-02-07 2018-02-07 Click event response method, computer readable storage medium and terminal equipment

Publications (2)

Publication Number Publication Date
CN108491122A true CN108491122A (en) 2018-09-04
CN108491122B CN108491122B (en) 2020-02-18

Family

ID=63344654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810121665.6A Active CN108491122B (en) 2018-02-07 2018-02-07 Click event response method, computer readable storage medium and terminal equipment

Country Status (2)

Country Link
CN (1) CN108491122B (en)
WO (1) WO2019153502A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542594A (en) * 2018-11-27 2019-03-29 努比亚技术有限公司 Event response method and device, mobile terminal and computer readable storage medium
CN111025010A (en) * 2019-11-25 2020-04-17 科华恒盛股份有限公司 Method and device for measuring active response time of equipment and terminal equipment
CN111176966A (en) * 2019-12-26 2020-05-19 京信通信系统(中国)有限公司 Method, device and equipment for determining CPU utilization rate and storage medium
CN112698594A (en) * 2020-12-14 2021-04-23 北京小米移动软件有限公司 Equipment control method and device
CN113163483A (en) * 2021-04-19 2021-07-23 北京字节跳动网络技术有限公司 Timestamp updating method and device and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159038B (en) * 2019-12-30 2023-07-14 北京声智科技有限公司 Method for simulating CPU load and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040237087A1 (en) * 2003-05-08 2004-11-25 Nong Ye Job scheduling techniques to reduce the variance of waiting time
EP2280345A1 (en) * 2009-07-20 2011-02-02 Nxp B.V. A device for and a method of managing computer tasks
CN102306095A (en) * 2011-07-21 2012-01-04 宇龙计算机通信科技(深圳)有限公司 Application management method and terminal
CN104765557A (en) * 2015-03-18 2015-07-08 北京畅游天下网络技术有限公司 Method and device for reducing mis-operation of touch screen
CN105094826A (en) * 2015-07-23 2015-11-25 上海斐讯数据通信技术有限公司 Response method and device thereof for interactive interface views in client terminal system
CN106125984A (en) * 2016-06-28 2016-11-16 维沃移动通信有限公司 The touch-control processing method of a kind of mobile terminal and mobile terminal
CN107168757A (en) * 2017-03-31 2017-09-15 武汉斗鱼网络科技有限公司 A kind of Android ends prevent View controls from clicking on the method and device of shake

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040237087A1 (en) * 2003-05-08 2004-11-25 Nong Ye Job scheduling techniques to reduce the variance of waiting time
EP2280345A1 (en) * 2009-07-20 2011-02-02 Nxp B.V. A device for and a method of managing computer tasks
CN102306095A (en) * 2011-07-21 2012-01-04 宇龙计算机通信科技(深圳)有限公司 Application management method and terminal
CN104765557A (en) * 2015-03-18 2015-07-08 北京畅游天下网络技术有限公司 Method and device for reducing mis-operation of touch screen
CN105094826A (en) * 2015-07-23 2015-11-25 上海斐讯数据通信技术有限公司 Response method and device thereof for interactive interface views in client terminal system
CN106125984A (en) * 2016-06-28 2016-11-16 维沃移动通信有限公司 The touch-control processing method of a kind of mobile terminal and mobile terminal
CN107168757A (en) * 2017-03-31 2017-09-15 武汉斗鱼网络科技有限公司 A kind of Android ends prevent View controls from clicking on the method and device of shake

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542594A (en) * 2018-11-27 2019-03-29 努比亚技术有限公司 Event response method and device, mobile terminal and computer readable storage medium
CN109542594B (en) * 2018-11-27 2024-05-17 努比亚技术有限公司 Event response method and device, mobile terminal and computer readable storage medium
CN111025010A (en) * 2019-11-25 2020-04-17 科华恒盛股份有限公司 Method and device for measuring active response time of equipment and terminal equipment
CN111025010B (en) * 2019-11-25 2022-03-11 科华恒盛股份有限公司 Method and device for measuring active response time of equipment and terminal equipment
CN111176966A (en) * 2019-12-26 2020-05-19 京信通信系统(中国)有限公司 Method, device and equipment for determining CPU utilization rate and storage medium
CN112698594A (en) * 2020-12-14 2021-04-23 北京小米移动软件有限公司 Equipment control method and device
CN113163483A (en) * 2021-04-19 2021-07-23 北京字节跳动网络技术有限公司 Timestamp updating method and device and electronic equipment

Also Published As

Publication number Publication date
WO2019153502A1 (en) 2019-08-15
CN108491122B (en) 2020-02-18

Similar Documents

Publication Publication Date Title
CN108491122A (en) A kind of click event response method, computer readable storage medium and terminal device
CN106407190B (en) Event record query method and device
CN108536761A (en) Report data querying method and server
CN109067841B (en) Service current limiting method, system, server and storage medium based on ZooKeeper
CN109299164A (en) A kind of data query method, computer readable storage medium and terminal device
CN110781372B (en) Method and device for optimizing website, computer equipment and storage medium
CN108874535A (en) A kind of task adjusting method, computer readable storage medium and terminal device
CN107291603A (en) Power consumption daily record analytic method, device, mobile terminal and readable storage medium storing program for executing
CN108573348B (en) Financial index distributed computing method and system
CN116544999A (en) Method, device, equipment and medium for determining installed capacity of energy storage system
CN108133005B (en) Environment model simulation method based on memory database, terminal equipment and storage medium
CN110865877B (en) Task request response method and device
CN110020196A (en) A kind of customer analysis method and apparatus and calculating equipment based on different data sources
CN111131393B (en) User activity data statistical method, electronic device and storage medium
EP4209933A1 (en) Data processing method and apparatus, and electronic device and storage medium
CN115098232A (en) Task scheduling method, device and equipment
WO2019134084A1 (en) Code execution method and apparatus, terminal device, and computer-readable storage medium
CN110955547B (en) Management method, system, equipment and readable storage medium for interface abnormal information
CN109800148A (en) A kind of page adjustment method, device, readable storage medium storing program for executing and terminal device
CN111258676A (en) Module preloading method, device, equipment and readable storage medium
CN112531629B (en) Method and device for automatically setting protection setting value of power distribution network and terminal equipment
CN111026458A (en) Method and device for setting exit time of application program
CN112148470A (en) Parameter synchronization method, computer device and readable storage medium
CN115600567B (en) Report export method and device
Richter IML-inscribed nets for modeling text processing and data (base) management systems

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
GR01 Patent grant
GR01 Patent grant