CN108491122B - Click event response method, computer readable storage medium and terminal equipment - Google Patents

Click event response method, computer readable storage medium and terminal equipment Download PDF

Info

Publication number
CN108491122B
CN108491122B CN201810121665.6A CN201810121665A CN108491122B CN 108491122 B CN108491122 B CN 108491122B CN 201810121665 A CN201810121665 A CN 201810121665A CN 108491122 B CN108491122 B CN 108491122B
Authority
CN
China
Prior art keywords
utilization rate
click event
preset
cpu
current
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
CN201810121665.6A
Other languages
Chinese (zh)
Other versions
CN108491122A (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

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/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)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to the technical field of computers, and particularly relates to a click event response method, a computer-readable storage medium and terminal equipment. The method comprises the steps of firstly obtaining a first moment when a target terminal receives a first click event, obtaining a second moment when the target terminal receives a second click event, then calculating a time interval between the second moment and the first moment, responding to the second click event according to preset system response time if the time interval is larger than or equal to a preset interval threshold, calculating the current hardware resource utilization rate of the target terminal if the time interval is smaller than the interval threshold, inquiring target response time corresponding to the hardware resource utilization rate in a preset relation corresponding table, and responding to the second click event according to the target response time. By the invention, response disorder is avoided, the occurrence of card jamming is reduced, and the use experience of users is greatly improved.

Description

Click event response method, computer readable storage medium and terminal equipment
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a click event response method, a computer-readable storage medium and terminal equipment.
Background
When a user operates various intelligent terminal devices, the system can give a response when a click event of the user is received, but due to the influence of the performance of hardware devices, some devices with lower configuration ends can react too slowly to the input event of the user. Sometimes, a user can continuously click a certain view in order to obtain a response, which results in that a system software interface is not yet updated urgently, but the user already performs multiple click actions on the same view, which causes disorder of system response, and at this time, a common card jamming phenomenon occurs, so that the use experience of the user is greatly influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a click event response method, a computer-readable storage medium, and a terminal device, so as to solve the problem that a card jamming phenomenon is likely to occur when a user makes a continuous click event.
A first aspect of an embodiment of the present invention provides a click event response method, which may include:
acquiring a first moment when a target terminal receives a first click event;
acquiring a second moment when the target terminal receives a second click event, wherein the second click event is a first click event after the first click event;
calculating a time interval between the second time and the first time;
if the time interval is greater than or equal to a preset interval threshold, responding to the second click event according to preset system response time;
if the time interval is smaller than the interval threshold, calculating the current hardware resource utilization rate of the target terminal;
inquiring target response time corresponding to the utilization rate of the hardware resources in a preset relation corresponding table, wherein the target response time is positively correlated with the utilization rate of the hardware resources;
and responding to the second click event according to the target response time.
A second aspect of embodiments of the present invention provides a computer-readable storage medium storing computer-readable instructions, which when executed by a processor implement the steps of:
acquiring a first moment when a target terminal receives a first click event;
acquiring a second moment when the target terminal receives a second click event, wherein the second click event is a first click event after the first click event;
calculating a time interval between the second time and the first time;
if the time interval is greater than or equal to a preset interval threshold, responding to the second click event according to preset system response time;
if the time interval is smaller than the interval threshold, calculating the current hardware resource utilization rate of the target terminal;
inquiring target response time corresponding to the utilization rate of the hardware resources in a preset relation corresponding table, wherein the target response time is positively correlated with the utilization rate of the hardware resources;
and responding to the second click event according to the target response time.
A third aspect of an embodiment of the present invention provides a click event response terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, where the processor implements the following steps when executing the computer-readable instructions:
acquiring a first moment when a target terminal receives a first click event;
acquiring a second moment when the target terminal receives a second click event, wherein the second click event is a first click event after the first click event;
calculating a time interval between the second time and the first time;
if the time interval is greater than or equal to a preset interval threshold, responding to the second click event according to preset system response time;
if the time interval is smaller than the interval threshold, calculating the current hardware resource utilization rate of the target terminal;
inquiring target response time corresponding to the utilization rate of the hardware resources in a preset relation corresponding table, wherein the target response time is positively correlated with the utilization rate of the hardware resources;
and responding to the second click event according to the target response time.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the method comprises the steps of firstly obtaining a first moment when a target terminal receives a first click event, obtaining a second moment when the target terminal receives a second click event, then calculating a time interval between the second moment and the first moment, responding to the second click event according to preset system response time if the time interval is larger than or equal to a preset interval threshold, calculating the current hardware resource utilization rate of the target terminal if the time interval is smaller than the interval threshold, inquiring target response time corresponding to the hardware resource utilization rate in a preset relation corresponding table, and responding to the second click event according to the target response time. When the user normally clicks, the click event is responded according to the normal system response time, when the user makes a continuous click event, the response time is determined according to the current hardware resource utilization rate, the hardware resource utilization rate is higher, the response time is longer, enough time is reserved for responding to the continuous click event, the disorder of system response is avoided, the occurrence of the phenomenon of card jamming is reduced, and the use experience of the user is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an embodiment of a click event response method according to the present invention;
FIG. 2 is a schematic flow chart of a preset process of the relationship correspondence table;
FIG. 3 is a block diagram of an embodiment of a click event response device in accordance with the present invention;
fig. 4 is a schematic block diagram of a click event response terminal device in an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of a click event response method according to an embodiment of the present invention may include:
step S101, acquiring a first time when the target terminal receives the first click event.
And step S102, acquiring a second moment when the target terminal receives a second click event.
The second click event is a first click event after the first click event, that is, in this embodiment, the first click event and the second click event are two click events that occur successively, a time when the target terminal receives the first click event is denoted as lastClickTime, that is, the first time, and a time when the target terminal receives the second click event is denoted as currentTime, that is, the second time.
And step S103, calculating the time interval between the second moment and the first moment.
And step S104, judging whether the time interval is smaller than a preset interval threshold value.
The interval threshold may be denoted as MIN _ clock _ DELAY _ TIME, and the specific value may be set according to the actual situation, for example, MIN _ clock _ DELAY _ TIME may be set for 500 ms.
If the time interval is greater than or equal to the interval threshold, then:
if currentTime-lastClickTime ≧ MIN _ CLICK _ DELAY _ TIME, step S105 is executed.
If the time interval is less than the interval threshold, then:
currentTime-lastClickTime < MIN _ client _ DELAY _ TIME, then step S106 and its subsequent steps are performed.
And S105, responding to the second click event according to preset system response time.
When the time interval is larger than or equal to the preset interval threshold, the time interval between two continuous click events is large enough, and the phenomenon of jamming cannot be caused when the response is carried out according to the default response time of the system.
And step S106, calculating the current hardware resource utilization rate of the target terminal.
Firstly, the current CPU utilization rate of the target terminal is obtained.
Specifically, at a preset first sampling time, obtaining a file which is preset in the target terminal and records the CPU information, and extracting CPU running state data at the first sampling time from the file which records the CPU information; acquiring the file for recording the CPU information at a preset second sampling moment, wherein the second sampling moment is separated from the first sampling moment by a preset time length, and extracting CPU running state data at the second sampling moment from the file for recording the CPU information; and calculating the CPU utilization rate according to the CPU running state data at the first sampling moment and the CPU running state data at the second sampling moment.
For example, the CPU information recorded in the/proc/cpuinfo file of the target terminal may be acquired, and the following CPU running state data may be extracted:
user: the running time in the user state does not contain a process with a negative nice value;
nice: the nice value is the CPU time occupied by the negative process, the nice value is a numerical value representing the static priority in the system, each process has the own static priority, and the process with high priority can be preferentially operated;
system: run time in kernel mode;
idle: other latencies than IO latency;
iowait: IO latency;
irq: service interruption time;
softirq: soft interrupt time;
steelstolen: time spent on other operating systems while the virtual environment is running;
guest: time spent by the operating system virtual CPU;
guest _ nice: the operating system virtual CPU spends time on the nice process.
Successively sampling CPU running state data of two sufficiently short time intervals, which are respectively marked as t1 and t2, wherein the structures of t1 and t2 are 10 tuples (user, nice, system, idle, iowait, irq, softirq, steelsulen, gut and gut _ nice); summing all the 10-tuple data for the first time to obtain totalCPUTime 1; summing all the 10-tuple data of the second time to obtain totalc CPUTime 2; obtaining first-time idle data, which is marked as idle 1; obtaining a second-time idle data, denoted idle 2; then the current CPU utilization rate lambda of the target terminalCPUCan be calculated by the following formula:
Figure BDA0001572292830000061
and then, acquiring the current memory utilization rate of the target terminal.
Specifically, a file preset in the target terminal and used for recording memory information is obtained; extracting the total amount of the memory space and the available allowance of the memory space from the file for recording the memory information; and calculating the memory utilization rate according to the total amount of the memory space and the available allowance of the memory space.
For example, the memory information recorded in the/proc/meminfo file of the target terminal may be obtained, where the file contains much information, and if the memory usage rate is to be calculated, only two variable values of the file are needed, that is, MemTotal amount of memory space and MemFree representing the available remaining amount of memory space, and the current memory usage rate λ of the target terminalMemoryCan be calculated by the following formula:
Figure BDA0001572292830000062
and finally, calculating the current hardware resource utilization rate of the target terminal according to the following formula:
η=(sinλmax)2max+(cosλmax)2min
wherein λ ismax=max(λCPUMemory),λmin=min(λCPUMemory),λCPUIs the current CPU utilization rate, lambda, of the target terminalMemoryη is the current memory usage rate of the target terminal, and is the current hardware resource usage rate of the target terminal.
And S107, inquiring target response time corresponding to the hardware resource utilization rate in a preset relation corresponding table.
The target response time is positively correlated with the hardware resource usage. That is, the higher the hardware resource utilization, the longer the corresponding target response time.
The preset process of the relationship correspondence table may specifically include the steps shown in fig. 2:
step S1071, dividing the value range of the hardware resource utilization rate into sub-intervals with preset number.
For example, the value range of the hardware resource usage may be divided into ten subintervals of (0, 10%, (10%, 20%, (20%, 30%,) … …, (90%, 100%,).
And S1072, randomly selecting one subinterval from the subintervals as the current testing subinterval.
And step S1073, running a preset task.
The preset tasks are preset in the target terminal, the preset tasks are used for consuming hardware resources, and the current hardware resource utilization rate can be adjusted by adjusting the number of the tasks which run simultaneously. It is easily understood that the higher the number of tasks running simultaneously, the higher the current hardware resource usage.
And step S1074, calculating the current utilization rate of the hardware resources.
For a specific calculation process of the hardware resource usage rate, reference may be made to the content in step S106, and details of this embodiment are not described herein again.
Step S1075, judge whether the difference between said hardware resource utilization rate and target utilization rate is in the predetermined error range;
and the target utilization rate is the upper limit value of the current testing subinterval. If the difference between the hardware resource utilization rate and the target utilization rate is not within a preset error range, executing step S1076, and if the difference between the hardware resource utilization rate and the target utilization rate is within the error range, executing step S1077 and the subsequent steps.
And step S1076, adjusting the running number of the preset tasks.
Specifically, if the difference between the hardware resource utilization rate and the target utilization rate is greater than 0, the running number of tasks is reduced, and if the difference between the hardware resource utilization rate and the target utilization rate is less than 0, the running number of tasks is increased.
After step S1076, execution of step S1074 and its subsequent steps is returned to.
Step S1077, triggering a preset automatic click event and recording the response time of the automatic click event.
The automatic click event is a click event automatically executed by the system, and can be regarded as a simulation of the click event implemented by the user, and the process of the automatic click event does not need the participation of the user.
Taking an android system as an example, an auxiliary function service, that is, an accessibility service, is provided in the system to implement the automatic click event, specifically, an abstract method that the accessibility service is required to inherit an accessibility service class and implement the abstract method can be implemented first, and a service class is customized to inherit the accessibility service of the system and overwrite an accessibility event and an onruintercept method. After the service class is written, the service is registered in a system configuration file android manifest. And completing the registration and configuration of the basic auxiliary function service, wherein the specific function realization needs to be completed in the onaccestibiteEvent, and the automatic click event can be realized by combining an interface related to simulated click provided by the service class according to the accessibiUvent object transmitted by the onaccessibiteEvent callback method.
Step S1078, storing the corresponding relation between the current testing subinterval and the response time into the relation corresponding table.
Step S1079, determine whether each subinterval has been selected.
If there are sub-sections that have not been selected, the process returns to step S1072, and if all the sub-sections have been selected, step S10710 is performed.
And step S10710, storing the relation corresponding table.
In an initial state, the utilization rate of hardware resources is generally low, at the moment, the running number of tasks is continuously increased until the utilization rate of the hardware resources reaches a first target utilization rate (for example, 10%), a click event is automatically run, the starting moment of the click event is recorded, after a response is received, the current moment is recorded again, and the response time corresponding to a first subinterval can be calculated by subtracting the starting moment of the click event; continuing to increase the running number of the tasks until the utilization rate of the hardware resources reaches a second target utilization rate (for example, 20%), automatically running a click event, and calculating the response time corresponding to the second subinterval according to the method; and continuing the process until the response time corresponding to each subinterval is calculated.
The above test process is only one time, and in order to improve the accuracy, the above process can be repeated for multiple times, the response time obtained by each calculation is averaged, and the finally obtained relationship correspondence table is more accurate and reliable.
And S108, responding to the second click event according to the target response time.
In summary, in the embodiments of the present invention, a first time when a target terminal receives a first click event is first obtained, a second time when the target terminal receives a second click event is obtained, then a time interval between the second time and the first time is calculated, if the time interval is greater than or equal to a preset interval threshold, the second click event is responded according to a preset system response time, if the time interval is smaller than the interval threshold, a current hardware resource usage rate of the target terminal is calculated, a target response time corresponding to the hardware resource usage rate is queried in a preset relationship correspondence table, and the second click event is responded according to the target response time. When the user normally clicks, the click event is responded according to the normal system response time, when the user makes a continuous click event, the response time is determined according to the current hardware resource utilization rate, the hardware resource utilization rate is higher, the response time is longer, enough time is reserved for responding to the continuous click event, the disorder of system response is avoided, the occurrence of the phenomenon of card jamming is reduced, and the use experience of the user is greatly improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 3 is a structural diagram of an embodiment of a click event response device according to an embodiment of the present invention, which corresponds to the click event response method according to the above embodiments.
In this embodiment, a click event response apparatus may include:
a first time obtaining module 301, configured to obtain a first time when the target terminal receives the first click event;
a second time obtaining module 302, configured to obtain a second time when the target terminal receives a second click event, where the second click event is a first click event after the first click event;
a time interval calculating module 303, configured to calculate a time interval between the second time and the first time;
a first response module 304, configured to respond to the second click event according to a preset system response time if the time interval is greater than or equal to a preset interval threshold;
a hardware resource usage rate calculation module 305, configured to calculate a current hardware resource usage rate of the target terminal if the time interval is smaller than the interval threshold;
a target response time query module 306, configured to query, in a preset relationship correspondence table, a target response time corresponding to the hardware resource usage rate, where the target response time is positively correlated to the hardware resource usage rate;
a second response module 307, configured to respond to the second click event according to the target response time.
Further, the hardware resource usage calculation module may include:
a CPU utilization rate obtaining unit, configured to obtain a current CPU utilization rate of the target terminal;
a memory usage rate obtaining unit, configured to obtain a current memory usage rate of the target terminal;
a hardware resource utilization rate calculating unit, configured to calculate a current hardware resource utilization rate of the target terminal according to the following formula:
η=(sinλmax)2max+(cosλmax)2min
wherein λ ismax=max(λCPUMemory),λmin=min(λCPUMemory),λCPUIs the current CPU utilization rate, lambda, of the target terminalMemoryη is the current memory usage rate of the target terminal, and is the current hardware resource usage rate of the target terminal.
Further, the CPU usage acquisition unit may include:
the first CPU information file acquisition subunit is used for acquiring a file which is preset in the target terminal and used for recording the CPU information at a preset first sampling moment;
a first CPU running state data extracting subunit, configured to extract CPU running state data at the first sampling time from the file in which the CPU information is recorded;
a second CPU information file obtaining subunit, configured to obtain, at a preset second sampling time, the file for recording the CPU information, where the second sampling time is separated from the first sampling time by a preset duration;
a second CPU running state data extracting subunit, configured to extract the CPU running state data at the second sampling time from the file in which the CPU information is recorded;
and the CPU utilization rate calculating subunit is used for calculating the CPU utilization rate according to the CPU running state data at the first sampling moment and the CPU running state data at the second sampling moment.
Further, the memory usage obtaining unit may include:
a memory information file obtaining subunit, configured to obtain a file that records memory information and is preset in the target terminal;
the memory information extracting subunit is used for extracting the total amount of the memory space and the available allowance of the memory space from the file for recording the memory information;
and the memory utilization rate calculating subunit is used for calculating the memory utilization rate according to the total amount of the memory space and the available allowance of the memory space.
Further, the click event response device may further include:
the subinterval division module is used for dividing the value range of the hardware resource utilization rate into subintervals with preset number;
the current test subinterval selecting module is used for selecting one subinterval from the subintervals as the current test subinterval;
the task running module is used for running a preset task;
the hardware resource utilization rate calculation module is used for calculating the current hardware resource utilization rate;
the task quantity adjusting module is used for adjusting the running quantity of the preset tasks if the difference between the hardware resource utilization rate and the target utilization rate is not within a preset error range, wherein the target utilization rate is an upper limit value of the current testing subinterval;
the response time recording module is used for triggering a preset automatic click event and recording the response time of the automatic click event if the difference between the hardware resource utilization rate and the target utilization rate is within the error range;
and the relation corresponding table storage module is used for storing the corresponding relation between the current testing subinterval and the response time into the relation corresponding table.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, modules, units and sub-units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 4 is a schematic block diagram of a click event response terminal device according to an embodiment of the present invention, and only a part related to the embodiment of the present invention is shown for convenience of description.
In this embodiment, the click event response terminal device 4 may be a computing device such as a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palm computer, and a cloud server. The click event response terminal device 4 may include: a processor 40, a memory 41, and computer readable instructions 42 stored in the memory 41 and executable on the processor 40, such as computer readable instructions to perform the click event response method described above. The processor 40, when executing the computer readable instructions 42, implements the steps in the various click event response method embodiments described above, such as steps S101-S108 shown in fig. 1. Alternatively, the processor 40, when executing the computer readable instructions 42, implements the functions of the modules/units in the above device embodiments, such as the functions of the modules 301 to 307 shown in fig. 3.
Illustratively, the computer readable instructions 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer-readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer-readable instructions 42 in the click event response terminal device 4.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the click event response terminal device 4, such as a hard disk or a memory of the click event response terminal device 4. The memory 41 may also be an external storage device of the click event response terminal device 4, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the click event response terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the click event response terminal device 4. The memory 41 is used to store the computer readable instructions and other instructions and data required by the click event response terminal device 4. The memory 41 may also be used to temporarily store data that has been output or is to be output.
Each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of computer readable instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, which can store computer readable instructions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A click event response method, comprising:
acquiring a first moment when a target terminal receives a first click event;
acquiring a second moment when the target terminal receives a second click event, wherein the second click event is a first click event after the first click event;
calculating a time interval between the second time and the first time;
if the time interval is greater than or equal to a preset interval threshold, responding to the second click event according to preset system response time;
if the time interval is smaller than the interval threshold, calculating the current hardware resource utilization rate of the target terminal;
inquiring target response time corresponding to the utilization rate of the hardware resources in a preset relation corresponding table, wherein the target response time is positively correlated with the utilization rate of the hardware resources;
responding to the second click event according to the target response time;
the calculating the current hardware resource utilization rate of the target terminal comprises the following steps:
acquiring the current CPU utilization rate of the target terminal;
acquiring the current memory utilization rate of the target terminal;
calculating the current hardware resource utilization rate of the target terminal according to the following formula:
η=(sinλmax)2max+(cosλmax)2min
wherein λ ismax=max(λCPUMemory),λmin=min(λCPUMemory),λCPUIs the current CPU utilization rate, lambda, of the target terminalMemoryη is the current memory usage rate of the target terminal, and is the current hardware resource usage rate of the target terminal.
2. The click event response method according to claim 1, wherein the acquiring the current CPU utilization of the target terminal comprises:
acquiring a file for recording CPU information preset in the target terminal at a preset first sampling moment;
extracting CPU running state data at the first sampling moment from the file for recording the CPU information;
acquiring the file for recording the CPU information at a preset second sampling time, wherein the second sampling time is separated from the first sampling time by a preset time length;
extracting CPU running state data at the second sampling moment from the file for recording the CPU information;
and calculating the CPU utilization rate according to the CPU running state data at the first sampling moment and the CPU running state data at the second sampling moment.
3. The click event response method according to claim 1, wherein the obtaining of the current memory usage rate of the target terminal comprises:
acquiring a file for recording memory information preset in the target terminal;
extracting the total amount of the memory space and the available allowance of the memory space from the file for recording the memory information;
and calculating the memory utilization rate according to the total amount of the memory space and the available allowance of the memory space.
4. The click event response method according to any one of claims 1 to 3, wherein the preset process of the relationship correspondence table includes:
dividing the value range of the hardware resource utilization rate into sub-intervals with preset number;
randomly selecting one subinterval from the subintervals as a current test subinterval;
running a preset task;
calculating the current utilization rate of hardware resources;
if the difference between the hardware resource utilization rate and the target utilization rate is not within a preset error range, adjusting the running quantity of the preset tasks, and returning to the step of calculating the current hardware resource utilization rate, wherein the target utilization rate is an upper limit value of the current test subinterval;
if the difference between the hardware resource utilization rate and the target utilization rate is within the error range, triggering a preset automatic click event, and recording the response time of the automatic click event;
and storing the corresponding relation between the current testing subinterval and the response time into the relation corresponding table, and then returning to execute the step of randomly selecting one subinterval from the subintervals as the current testing subinterval until all subintervals are selected.
5. A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the steps of the click event response method of any one of claims 1 to 4.
6. A click event response terminal device comprising a memory, a processor and computer readable instructions stored in said memory and executable on said processor, wherein said processor when executing said computer readable instructions performs the steps of:
acquiring a first moment when a target terminal receives a first click event;
acquiring a second moment when the target terminal receives a second click event, wherein the second click event is a first click event after the first click event;
calculating a time interval between the second time and the first time;
if the time interval is greater than or equal to a preset interval threshold, responding to the second click event according to preset system response time;
if the time interval is smaller than the interval threshold, calculating the current hardware resource utilization rate of the target terminal;
inquiring target response time corresponding to the utilization rate of the hardware resources in a preset relation corresponding table, wherein the target response time is positively correlated with the utilization rate of the hardware resources;
responding to the second click event according to the target response time;
the calculating the current hardware resource utilization rate of the target terminal comprises the following steps:
acquiring the current CPU utilization rate of the target terminal;
acquiring the current memory utilization rate of the target terminal;
calculating the current hardware resource utilization rate of the target terminal according to the following formula:
η=(sinλmax)2max+(cosλmax)2min
wherein λ ismax=max(λCPUMemory),λmin=min(λCPUMemory),λCPUIs the current CPU utilization rate, lambda, of the target terminalMemoryη is the current memory usage rate of the target terminal, and is the current hardware resource usage rate of the target terminal.
7. The click event response terminal device according to claim 6, wherein the obtaining of the current CPU usage of the target terminal comprises:
acquiring a file for recording CPU information preset in the target terminal at a preset first sampling moment;
extracting CPU running state data at the first sampling moment from the file for recording the CPU information;
acquiring the file for recording the CPU information at a preset second sampling time, wherein the second sampling time is separated from the first sampling time by a preset time length;
extracting CPU running state data at the second sampling moment from the file for recording the CPU information;
and calculating the CPU utilization rate according to the CPU running state data at the first sampling moment and the CPU running state data at the second sampling moment.
8. The click event response terminal device according to any one of claims 6 to 7, wherein the preset process of the relationship correspondence table includes:
dividing the value range of the hardware resource utilization rate into sub-intervals with preset number;
randomly selecting one subinterval from the subintervals as a current test subinterval;
running a preset task;
calculating the current utilization rate of hardware resources;
if the difference between the hardware resource utilization rate and the target utilization rate is not within a preset error range, adjusting the running quantity of the preset tasks, and returning to the step of calculating the current hardware resource utilization rate, wherein the target utilization rate is an upper limit value of the current test subinterval;
if the difference between the hardware resource utilization rate and the target utilization rate is within the error range, triggering a preset automatic click event, and recording the response time of the automatic click event;
and storing the corresponding relation between the current testing subinterval and the response time into the relation corresponding table, and then returning to execute the step of randomly selecting one subinterval from the subintervals as the current testing subinterval until all subintervals are 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 CN108491122A (en) 2018-09-04
CN108491122B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542594B (en) * 2018-11-27 2024-05-17 努比亚技术有限公司 Event response method and device, mobile terminal and computer readable storage medium
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
CN111159038B (en) * 2019-12-30 2023-07-14 北京声智科技有限公司 Method for simulating CPU load and electronic equipment
CN112698594B (en) * 2020-12-14 2022-09-02 北京小米移动软件有限公司 Equipment control method and device
CN113163483B (en) * 2021-04-19 2022-08-23 北京字节跳动网络技术有限公司 Timestamp updating method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* 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

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN108491122A (en) 2018-09-04
WO2019153502A1 (en) 2019-08-15

Similar Documents

Publication Publication Date Title
CN108491122B (en) Click event response method, computer readable storage medium and terminal equipment
CN106407190B (en) Event record query method and device
CN108446176B (en) Task allocation method, computer readable storage medium and terminal device
CN107066365B (en) System abnormity monitoring method and device
CN108683720B (en) Container cluster service configuration method and device
CN108388509B (en) Software testing method, computer readable storage medium and terminal equipment
CN108363788B (en) Post intelligent ranking method and device and computer readable storage medium
CN110209502B (en) Information storage method and device, electronic equipment and storage medium
CN115150471B (en) Data processing method, apparatus, device, storage medium, and program product
WO2018149085A1 (en) Method and system for optimizing database system, electronic device, and storage medium
CN111427628A (en) Software function module configuration method, device, software product and storage medium
WO2024113932A1 (en) Model optimization method and apparatus, and device and storage medium
CN109213965B (en) System capacity prediction method, computer readable storage medium and terminal device
US20160253591A1 (en) Method and apparatus for managing performance of database
CN111159038A (en) Method for simulating CPU load and electronic equipment
CN110865877B (en) Task request response method and device
CN110750498A (en) Object access method, device and storage medium
CN112669091B (en) Data processing method, device and storage medium
US11507485B2 (en) Universal profiling device and method for simulating performance monitoring unit
CN114201696A (en) Message pushing method and device, storage medium and computer equipment
CN111176966A (en) Method, device and equipment for determining CPU utilization rate and storage medium
CN109582863B (en) Recommendation method and server
CN113794906A (en) Video recommendation method and device and cloud video server
CN113038242A (en) Method, device and equipment for determining display position of live broadcast card and storage medium
CN111767137B (en) System deployment method and device, electronic equipment and storage medium

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