[go: up one dir, main page]

CN114115562B - Event monitoring method, device, medium and electronic device - Google Patents

Event monitoring method, device, medium and electronic device Download PDF

Info

Publication number
CN114115562B
CN114115562B CN202111435903.9A CN202111435903A CN114115562B CN 114115562 B CN114115562 B CN 114115562B CN 202111435903 A CN202111435903 A CN 202111435903A CN 114115562 B CN114115562 B CN 114115562B
Authority
CN
China
Prior art keywords
mouse
resource block
target
time period
target interface
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
CN202111435903.9A
Other languages
Chinese (zh)
Other versions
CN114115562A (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN202111435903.9A priority Critical patent/CN114115562B/en
Publication of CN114115562A publication Critical patent/CN114115562A/en
Application granted granted Critical
Publication of CN114115562B publication Critical patent/CN114115562B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03541Mouse/trackball convertible devices, in which the same ball is used to track the 2D relative movement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开涉及一种事件监听方法、装置、介质及电子设备,所述方法包括:间隔预设时长获取目标界面中当前时段对应的鼠标位置;根据当前时段和上一时段获得的鼠标位置,确定鼠标的移动方向和移动速度;根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述目标界面对应的目标资源块集合,所述目标资源块集合中的目标资源块为预测所述鼠标在下一时段内经过的资源块;在所述目标资源块集合为非空集合时,控制所述目标资源块的鼠标事件监听处于开启状态,所述目标界面中的各个资源块的鼠标事件监听初始为关闭状态。由此可以使得目标界面中的资源块的事件监听与用户操作相匹配。同时降低界面中事件监听对资源和性能的占用。

The present disclosure relates to an event monitoring method, device, medium and electronic device, the method comprising: obtaining the mouse position corresponding to the current time period in the target interface at intervals of a preset duration; determining the moving direction and moving speed of the mouse according to the mouse positions obtained in the current time period and the previous time period; determining the target resource block set corresponding to the target interface in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period, the target resource blocks in the target resource block set are the resource blocks predicted to pass by the mouse in the next time period; when the target resource block set is a non-empty set, controlling the mouse event monitoring of the target resource block to be in an on state, and the mouse event monitoring of each resource block in the target interface is initially in a off state. In this way, the event monitoring of the resource blocks in the target interface can be matched with the user operation. At the same time, the occupation of resources and performance by event monitoring in the interface is reduced.

Description

Event monitoring method, device, medium and electronic equipment
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to an event monitoring method, an event monitoring device, a medium and electronic equipment.
Background
At present, in the field of visualization, the use of a visual interface is increasingly frequent, and the requirement for manufacturing the visual interface is also improved. In the related art, in order to make a visual interface, tens or hundreds of freely dragged resource blocks are generally required to be used in the interface, and the interactive experience of the visual interface to a user is improved by setting the combination and response among different resource blocks.
In the process of editing the resource blocks, if the mouse moves in the editing area, each resource block in the editing interface needs to respond to the suspension time of the mouse, and the resource blocks can be configured with various attributes and monitor the mouse event. When more resource blocks exist in the editing interface, excessive event monitoring can occur, and the performance of the equipment is seriously affected.
Disclosure of Invention
The disclosure aims to provide a dynamic and accurate event monitoring method, device, medium and electronic equipment, so that event monitoring of resource blocks in a target interface is matched with user operation.
To achieve the above object, according to a first aspect of the present disclosure, there is provided an event listening method, the method including:
acquiring a mouse position corresponding to a current time period in a target interface at intervals of preset time length;
determining the moving direction and the moving speed of the mouse according to the mouse positions obtained in the current period and the previous period;
Determining a target resource block set corresponding to the target interface in a next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period, wherein a target resource block in the target resource block set is a resource block for predicting the mouse to pass in the next time period;
And when the target resource block set is a non-empty set, controlling the mouse event monitoring of the target resource block to be in an on state, wherein the mouse event monitoring of each resource block in the target interface is initially in an off state.
Optionally, the determining, according to the movement direction, the movement speed, and the mouse position obtained in the current period, a target resource block set corresponding to the target interface in a next period includes:
determining a predicted track of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period;
and determining a target resource block set corresponding to the target interface according to the predicted track.
Optionally, the determining, according to the predicted track, a target resource block set corresponding to the target interface includes:
determining the end point position corresponding to the predicted track;
if the end point position is outside the target interface, determining that the target resource block set is empty;
And if the end point position is in the target interface, adding the resource block which is overlapped with the predicted track existence position in the target interface into the target resource block set.
Optionally, the determining, according to the moving direction, the moving speed, and the mouse position obtained in the current period, a target resource block set corresponding to the target interface in a next period further includes:
determining the magnitude relation between the moving speed and a preset speed threshold value;
if the moving speed is smaller than the speed threshold, executing the step of determining the predicted track of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period;
And if the moving speed is not less than the speed threshold, determining that the target resource block set corresponding to the next time period is empty.
Optionally, the method further comprises:
determining the number of resource blocks in the target interface;
The interval preset time length obtaining the mouse position corresponding to the current time period in the target interface comprises the following steps:
And acquiring the mouse position corresponding to the current time period in the target interface at intervals of preset time length under the condition that the number of the resource blocks exceeds a preset number threshold.
Optionally, the method further comprises:
And when the target resource block set is empty, keeping the mouse event monitoring of each resource block in the target interface in a closed state.
Optionally, the method further comprises:
And when the target resource block set is a non-empty set, controlling the mouse event monitoring of the resource blocks except the target resource block in the target interface to be in a closed state.
According to a second aspect of the present disclosure, there is provided an event listening apparatus, the apparatus comprising:
The acquisition module is used for acquiring the mouse position corresponding to the current time period in the target interface at intervals of preset time length;
the first determining module is used for determining the moving direction and the moving speed of the mouse according to the mouse positions obtained in the current period and the previous period;
The second determining module is used for determining a target resource block set corresponding to the target interface in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period, wherein the target resource block in the target resource block set is a resource block for predicting the mouse to pass in the next time period;
And the first control module is used for controlling the mouse event monitoring of the target resource block to be in an on state when the target resource block set is a non-empty set, wherein the mouse event monitoring of each resource block in the target interface is initially in an off state.
According to a third aspect of the present disclosure there is provided a non-transitory computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method of any of the first aspects.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
A memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the first aspects.
In the above technical solution, when the mouse position corresponding to the current period in the target interface is obtained at intervals of a preset duration, the moving direction and the moving speed of the mouse can be determined according to the mouse position obtained in the current period and the previous period, and then the resource blocks passed by the mouse in the target interface in the next period can be predicted according to the moving direction, the moving speed and the mouse position obtained in the current period, so that the mouse event monitoring of the target resource blocks is controlled to be in an on state, and the mouse event monitoring of each resource block in the target interface is initially in an off state. Therefore, through the technical scheme, the resource blocks possibly passed by the mouse in the future period can be predicted by detecting the moving position of the mouse in real time, so that the mouse event monitoring of the part of the resource blocks can be controlled to be in an on state, the monitoring of the part of the resource blocks on the mouse event is realized, and the event monitoring of the resource blocks in the target interface is matched with the user operation. Meanwhile, monitoring of all resource blocks in the interface to the mouse events in the mouse moving process can be avoided, the number of invalid mouse monitoring events is reduced, occupation of the event monitoring in the interface to resources and performance is reduced, meanwhile, response of target resource blocks to the mouse events can be improved to a certain extent, and user experience is guaranteed.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart of an event listening method provided in accordance with one embodiment of the present disclosure;
FIG. 2 is a schematic construction diagram of a coordinate system of a target interface provided in accordance with one embodiment of the present disclosure;
FIG. 3 is a schematic illustration of a target interface provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a statistical schematic diagram of monitored data of mouse operation trajectories provided in accordance with one embodiment of the present disclosure;
Fig. 5 is a block diagram of an event listening device provided according to one embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
Fig. 1 is a flowchart illustrating an event listening method according to an embodiment of the present disclosure. As shown in fig. 1, the method may include:
In step 11, the mouse position corresponding to the current time period in the target interface is obtained at intervals of a preset time period.
The preset duration may be set according to an actual application scenario or user operation behavior, which is not limited in the present disclosure. For example, a coordinate system is built in advance for the target interface, as shown in fig. 2, a point at the lower left corner in the target interface U may be taken as an origin O to build a two-dimensional rectangular coordinate system, and after the interval time reaches the preset duration, a mouse position corresponding to the current period in the target interface is determined, where the mouse position corresponding to the current period may be a mouse position at a termination time corresponding to the current period, and the mouse position may be represented by two-dimensional coordinates, for example, (Xi, yi).
In step 12, the movement direction and movement speed of the mouse are determined according to the mouse positions obtained in the current period and the previous period.
In order to ensure real-time performance of the mouse position detection, the preset duration is usually set to be shorter, for example, 20ms may be set, as shown in fig. 2, the mouse position corresponding to the current period is P1 (X1, Y1), the mouse position corresponding to the previous period is P0 (X0, Y0), that is, the mouse position obtained in 0ms is P0 (X0, Y0), and the mouse position obtained in 20ms is P1 (X1, Y1).
In this embodiment, the direction in which the mouse position obtained in the previous period points to the mouse position obtained in the current period may be used as the moving direction, and the moving speed V may be a ratio of the distance to the preset period, that is, the moving speed V is L/T, according to the distance L between the current period and the mouse position obtained in the previous period and the preset period T.
In step 13, a target resource block set corresponding to a target interface in a next period is determined according to the moving direction, the moving speed and the mouse position obtained in the current period, wherein the target resource block in the target resource block set is a resource block for predicting the mouse to pass in the next period.
The resource blocks in the target interface may be graphic blocks for configuring various resources, where the resources may include pictures, icons, characters, dynamic charts, clocks, special effect components, frames, and the like, and the image blocks may be, for example, rectangular blocks, circular blocks, or user-defined graphic blocks, which are not described herein.
In step 14, when the target resource block set is a non-empty set, controlling the mouse event monitoring of the target resource block to be in an on state, wherein the mouse event monitoring of each resource block in the target interface is initially in an off state.
The mouse event monitoring of each resource block in the target interface is initially in a closed state, and when the target resource block set is a non-empty set, the mouse event monitoring of the target resource block in the target interface can be controlled to be in an open state so as to respond according to the movement of the mouse, namely, the mouse event monitoring is realized to be opened according to the actual movement of the mouse. As an example, the mouse event monitoring of the control target resource block is in an on state, i.e. the on state is maintained for the resource block in which the mouse event monitoring is in an on state, and the mouse event monitoring is controlled to be on for the resource block in which the mouse event monitoring is in an off state.
In the above technical solution, when the mouse position corresponding to the current period in the target interface is obtained at intervals of a preset duration, the moving direction and the moving speed of the mouse can be determined according to the mouse position obtained in the current period and the previous period, and then the resource blocks passed by the mouse in the target interface in the next period can be predicted according to the moving direction, the moving speed and the mouse position obtained in the current period, so that the mouse event monitoring of the target resource blocks is controlled to be in an on state, and the mouse event monitoring of each resource block in the target interface is initially in an off state. Therefore, through the technical scheme, the resource blocks possibly passed by the mouse in the future period can be predicted by detecting the moving position of the mouse in real time, so that the mouse event monitoring of the part of the resource blocks can be controlled to be in an on state, the monitoring of the part of the resource blocks on the mouse event is realized, and the event monitoring of the resource blocks in the target interface is matched with the user operation. Meanwhile, monitoring of all resource blocks in the interface to the mouse events in the mouse moving process can be avoided, the number of invalid mouse monitoring events is reduced, occupation of the event monitoring in the interface to resources and performance is reduced, meanwhile, response of target resource blocks to the mouse events can be improved to a certain extent, and user experience is guaranteed.
The method comprises the steps of controlling the monitoring of the mouse event to be closed when the time length of the monitoring of the mouse event in the on state of a resource block reaches the monitoring time length, and controlling the monitoring of the mouse event to be closed when the resource block is not currently determined as a target resource block so as to reduce the number of invalid mouse monitoring events.
In one possible embodiment, the method may further comprise:
And when the target resource block set is a non-empty set, controlling the mouse event monitoring of the resource blocks except the target resource block in the target interface to be in a closed state.
As described above, when the target resource block set is a non-empty set, the mouse event monitoring of the target resource block in the target resource block set can be controlled to be in an on state. In this embodiment, when the target resource block set is a non-empty set, the mouse event monitoring of the resource blocks except the target resource block in the target interface may be controlled to be in a closed state, i.e., for the resource block in the open state of the mouse event monitoring, the mouse event monitoring is controlled to be closed, and for the resource block in the closed state of the mouse event monitoring, the closed state may be maintained.
Therefore, through the technical scheme, when the target resource block in the next time period is determined, the mouse event monitoring of other resource blocks except the target resource block in the target interface is controlled to be in a closed state, so that the number of the resource blocks for performing the mouse event monitoring in the target interface is further reduced, the occupation of the mouse event monitoring on the equipment performance is reduced, and the equipment resources are saved.
In a possible embodiment, the determining an exemplary implementation manner of the target resource block set corresponding to the target interface in the next period according to the moving direction, the moving speed and the mouse position obtained in the current period may include:
And determining a predicted track of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period.
In this embodiment, in order to ensure real-time performance of the mouse position, the preset duration is usually set to be smaller, and the movement tracks of the mouse in adjacent periods are usually similar. Based on this, in the present disclosure, the movement direction determined in the current period may be taken as the movement direction of the mouse in the next period, and the movement speed determined in the current period may be taken as the movement speed of the mouse in the next period, so that a predicted track of the mouse may be determined, that is, a line obtained by taking the position of the mouse obtained in the current period as a starting point and moving for a preset period of time at the movement speed according to the movement direction is taken as the predicted track, as shown by a dashed line from P1 to M in fig. 2.
And determining a target resource block set corresponding to the target interface according to the predicted track.
After the coordinate system is built for the target interface, the corresponding position of each resource block in the target interface can determine the corresponding coordinate from the coordinate system, for example, the layout of each resource block can be obtained from the layout structure information of the target interface, and then coordinate determination is performed according to the layout of each resource block and the position relationship with the boundary of the target interface, for example, the coordinate of the boundary line of each resource block can be determined, so that the coordinate position of each resource block can be determined. The method of determining the position of the element in the interface may be implemented by using a position detection method commonly used in the art, which is not limited in this disclosure. As an example, the resource block in the target interface, which coincides with the existence position of the predicted track, may be directly used as a target resource block, and added to the target resource block set, and as shown in fig. 2, the resource blocks Z2 and Z3 may be determined as target resource blocks, and added to the target resource block set.
Therefore, through the technical scheme, the track of the mouse in the next period can be predicted to obtain the predicted track, so that the resource block which is overlapped with the existence position of the predicted track can be directly determined to be the resource block which the mouse passes, the determination efficiency and accuracy of the target resource block can be improved through position judgment, data support is provided for the state of monitoring the mouse event of the target resource block in subsequent control, the application scene requirement of mouse movement is attached, and the application range of the event monitoring method is improved.
As another example, an exemplary implementation manner of determining, according to the predicted trajectory, the target resource block set corresponding to the target interface is as follows, where the step may include:
And determining an end position corresponding to the predicted track, wherein the determined final position of the corresponding movement of the predicted track can be determined as the end position, such as M in fig. 2.
And if the end point position is outside the target interface, determining that the target resource block set is empty.
The target interface shown in fig. 3, where S1 is a mouse position obtained in a current period, and S2 is an end position corresponding to a predicted track in a next period. And comparing the coordinate of the end point position with the position range of the target interface to determine whether the end point position belongs to the position range of the target interface, if the coordinate of the end point position belongs to the position range of the target interface, determining that the end point position is positioned in the target interface, and if the coordinate of the end point position does not belong to the position range of the target interface, determining that the end point position is positioned outside the target interface.
In an actual application scenario, if a user actually operates a resource block in a target interface to move a mouse, the moving speed of the user is usually not too high, so that the user can prepare to select a corresponding resource block, the resource block is generally a certain distance from the edge of the target interface, and the position of the mouse is generally not beyond the range of the target interface. In the actual application scenario, when the user does not want to operate on the resource block, the user may operate the mouse to move, for example, the user may slide the mouse at will so as to quickly find the position of the target interface mouse, and in this case, the range of movement of the mouse by the user is larger; or the user quickly moves the mouse to an operation of a fixed button in the menu bar, such as a corresponding button of the minimize window, close window, etc., which is typically at an edge position in the target interface. Therefore, when the user performs the mouse operation, the situation that the end position of the predicted track is out of the target interface may occur when the track of the next period is predicted directly according to the moving speed corresponding to the current period.
If the end point is located outside the target interface, it indicates that the user operation is not a mouse operation on the resource blocks in the target interface, and the target resource block set may be directly determined to be empty to match with the actual operation of the user.
And if the end point position is in the target interface, adding the resource block which is overlapped with the predicted track existence position in the target interface into the target resource block set.
If the end point position is within the target interface, it indicates that the mouse operation of the user may be an operation for a resource block in the target interface, and at this time, a corresponding target resource block may be determined according to the predicted track, where a manner of determining a resource block in the target interface that coincides with the existence position of the predicted track is described in detail above, and will not be described herein.
Therefore, through the technical scheme, the real intention of the user for operating the mouse in the target interface can be analyzed by predicting the end position of the track, so that the resource block needing to be started for monitoring the mouse event in the target interface can be further determined by combining the intention of the user, the accuracy of monitoring and responding the mouse event in the target interface is ensured, meanwhile, the real mouse operation of the user can be matched, and the user experience is improved.
In a possible embodiment, an exemplary implementation manner of determining, according to the movement direction, the movement speed, and the mouse position obtained in the current period, the target resource block set corresponding to the target interface in the next period is as follows, where the step may further include:
And determining the magnitude relation between the moving speed and a preset speed threshold value.
The preset speed threshold may be set according to an actual application scenario. For example, when the user performs an editing operation on the target interface, data for monitoring the mouse operation tracks of a plurality of persons is shown in fig. 4, in which the horizontal axis represents the movement speed of the mouse and the vertical axis represents the duty ratio. Specifically, when the user performs an editing operation on a resource block in the target interface, the moving speed of the user to the mouse is generally within 1px/ms (pixel/ms), and generally not more than 5px/ms. When the moving speed of the mouse is higher than 10px/ms, the moving track of the mouse is basically slid to the outside, and generally corresponds to a specific operation such as minimizing a window, closing a browser, or dragging the browser to the edge of a target interface, etc. Therefore, the preset speed threshold can be set based on the determined monitoring data, and the speed threshold for other application scenes can be determined by performing scene monitoring, which is not described herein.
And if the moving speed is smaller than the speed threshold, executing the step of determining the predicted track of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period.
For example, if the movement speed is less than the speed threshold, it indicates that the mouse operation performed by the user in the target interface is performed on the resource block in the target interface, and at this time, the predicted track of the mouse in the next period may be determined according to the movement direction, the movement speed and the mouse position, so as to further determine the target resource block.
And if the moving speed is not less than the speed threshold, determining that the target resource block set corresponding to the next time period is empty.
If the moving speed is not less than the speed threshold, it indicates that the mouse operation performed by the user in the target interface is not the operation for the resource block in the target interface, and at this time, it may be directly determined that the target resource block set corresponding to the next period is empty. Therefore, the monitoring and response to the mouse operation in the target page can be matched with the actual operation of the user, and meanwhile, the occupation of equipment resources and performance can be saved.
In one possible embodiment, the method may further comprise:
And determining the number of resource blocks in the target interface. The determination may be performed by acquiring the layout information or the layout code of the target interface, which is not described herein.
An exemplary implementation manner of obtaining the mouse position corresponding to the current period in the target interface by the interval preset duration is as follows, and the steps may include:
And acquiring the mouse position corresponding to the current time period in the target interface at intervals of preset time length under the condition that the number of the resource blocks exceeds a preset number threshold.
The number threshold may be set according to the actual performance of the device, for example, the device performance may be better, the number threshold may be set larger, and the number threshold may be set smaller if the device performance is insufficient. Therefore, through the technical scheme, when the number of the resource blocks in the target interface is small, the influence of all the on-line mouse event monitoring on the performance of the equipment is small, at the moment, the target resource blocks can be determined without the need of determining the target resource blocks based on the motion trail of a mouse, more invalid mouse event monitoring is easy to generate when the number of the resource blocks in the target interface is large, occupation of equipment resources and performance can be improved due to the fact that the excessive resource blocks for carrying out mouse event monitoring in the target interface can also be improved, at the moment, the position of the mouse can be monitored to screen the resource blocks needing to carry out mouse event monitoring in the target interface, the method is fit with an actual application scene, and can be applied to equipment with lower resources and performance, the application range of the event monitoring method is widened, and the user experience is improved.
In one possible embodiment, the method may further comprise:
And when the target resource block set is empty, keeping the mouse event monitoring of each resource block in the target interface in a closed state.
As described above, if the determined set of target resource blocks is empty, it indicates that the current mouse operation of the user may be to slide the mouse at will so that the user may quickly find the position of the mouse in the target interface, or the operation for the fixed button in the menu bar, such as minimizing the window, closing the window, and the like, is not the related operation for the resource blocks in the target interface. Thus, in this embodiment, when the set of target resource blocks is empty, the mouse event monitor of each resource block in the target interface is kept in an off state. Therefore, when the user performs mouse operation irrelevant to the resource block in the target interface, the monitoring and response of the resource block corresponding to the mouse operation are avoided, equipment resources are saved, the influence of the mouse event monitoring and response of the resource block on the actual operation of the user is avoided, and the use requirement of the user is met.
The present disclosure also provides an event listening device, as shown in fig. 5, the device 10 includes:
the acquisition module 100 is used for acquiring the mouse position corresponding to the current time period in the target interface at intervals of a preset time period;
A first determining module 200, configured to determine a movement direction and a movement speed of the mouse according to the mouse positions obtained in the current period and the previous period;
A second determining module 300, configured to determine a target resource block set corresponding to the target interface in a next period according to the moving direction, the moving speed, and the mouse position obtained in the current period, where a target resource block in the target resource block set is a resource block predicted to pass by the mouse in the next period;
The first control module 400 is configured to control, when the target resource block set is a non-empty set, mouse event monitoring of the target resource block to be in an on state, where the mouse event monitoring of each resource block in the target interface is initially in an off state.
Optionally, the second determining module includes:
The first determining submodule is used for determining a predicted track of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period;
And the second determining submodule is used for determining a target resource block set corresponding to the target interface according to the predicted track.
Optionally, the determining, according to the predicted track, the target resource block set corresponding to the target interface includes:
The third determining submodule is used for determining the end position corresponding to the predicted track;
a fourth determining submodule, configured to determine that the target resource block set is empty if the end point position is outside the target interface;
And a fifth determining submodule, configured to add a resource block in the target interface, where the resource block coincides with the predicted track existence position, to the target resource block set if the end point position is within the target interface.
Optionally, the second determining module further includes:
a sixth determining submodule, configured to determine a magnitude relation between the moving speed and a preset speed threshold, and trigger the first determining submodule to determine a predicted track of the mouse in a next period according to the moving direction, the moving speed and a mouse position obtained in the current period when the moving speed is less than the speed threshold;
and a seventh determining submodule, configured to determine that the target resource block set corresponding to the next period is empty if the moving speed is not less than the speed threshold.
Optionally, the apparatus further comprises:
a third determining module, configured to determine a number of resource blocks in the target interface;
the acquisition module is used for:
And acquiring the mouse position corresponding to the current time period in the target interface at intervals of preset time length under the condition that the number of the resource blocks exceeds a preset number threshold.
Optionally, the apparatus further comprises:
And the second control module is used for keeping the monitoring of the mouse events of all the resource blocks in the target interface in a closed state when the target resource block set is empty.
Optionally, the apparatus further comprises:
and the third control module is used for controlling the monitoring of the mouse events of the resource blocks except the target resource block in the target interface to be in a closed state when the target resource block set is a non-empty set.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 6 is a block diagram of an electronic device 700, according to an example embodiment. As shown in fig. 6, the electronic device 700 may include: a processor 701, a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700 to perform all or part of the steps in the event listening method described above. The memory 702 is used to store various types of data to support operation on the electronic device 700, which may include, for example, instructions for any application or method operating on the electronic device 700, as well as application-related data, such as contact data, messages sent and received, pictures, audio, video, and so forth. The Memory 702 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia component 703 can include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 702 or transmitted through the communication component 705. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC) for short, 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination of more of them, is not limited herein. The corresponding communication component 705 may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application-specific integrated circuits (ASIC), digital signal Processor (DIGITAL SIGNAL Processor, DSP), digital signal processing device (DIGITAL SIGNAL Processing Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field Programmable GATE ARRAY, FPGA), controller, microcontroller, microprocessor, or other electronic component for performing the event listening method described above.
In another exemplary embodiment, a computer readable storage medium is also provided, comprising program instructions which, when executed by a processor, implement the steps of the event listening method described above. For example, the computer readable storage medium may be the memory 702 including program instructions described above, which are executable by the processor 701 of the electronic device 700 to perform the event listening method described above.
The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the embodiments described above, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the above embodiments may be combined in any suitable manner without contradiction. The various possible combinations are not described further in this disclosure in order to avoid unnecessary repetition.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.

Claims (10)

1.一种事件监听方法,其特征在于,所述方法包括:1. An event monitoring method, characterized in that the method comprises: 间隔预设时长获取目标界面中当前时段对应的鼠标位置;Get the mouse position corresponding to the current time period in the target interface at preset intervals; 根据当前时段和上一时段获得的鼠标位置,确定鼠标的移动方向和移动速度;Determine the direction and speed of mouse movement based on the mouse positions obtained in the current period and the previous period; 根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述目标界面对应的目标资源块集合,其中,所述目标资源块集合中的目标资源块为预测所述鼠标在下一时段内经过的资源块;Determine a target resource block set corresponding to the target interface in a next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period, wherein the target resource blocks in the target resource block set are resource blocks predicted to be passed by the mouse in the next time period; 在所述目标资源块集合为非空集合时,控制所述目标资源块的鼠标事件监听处于开启状态,其中,所述目标界面中的各个资源块的鼠标事件监听初始为关闭状态。When the target resource block set is a non-empty set, the mouse event monitoring of the target resource block is controlled to be in an on state, wherein the mouse event monitoring of each resource block in the target interface is initially in a off state. 2.根据权利要求1所述的方法,其特征在于,所述根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述目标界面对应的目标资源块集合,包括:2. The method according to claim 1, characterized in that the step of determining a target resource block set corresponding to the target interface in a next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period comprises: 根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述鼠标的预测轨迹;Determining a predicted trajectory of the mouse in a next time period according to the moving direction, the moving speed, and the mouse position obtained in the current time period; 根据所述预测轨迹确定所述目标界面对应的目标资源块集合。A target resource block set corresponding to the target interface is determined according to the predicted trajectory. 3.根据权利要求2所述的方法,其特征在于,所述根据所述预测轨迹确定所述目标界面对应的目标资源块集合,包括:3. The method according to claim 2, characterized in that the step of determining the target resource block set corresponding to the target interface according to the predicted trajectory comprises: 确定所述预测轨迹对应的终点位置;Determining an endpoint position corresponding to the predicted trajectory; 若所述终点位置处于所述目标界面之外,则确定所述目标资源块集合为空;If the end point is outside the target interface, determining that the target resource block set is empty; 若所述终点位置处于所述目标界面之内,则将所述目标界面中与所述预测轨迹存在位置重合的资源块添加至所述目标资源块集合中。If the end point position is within the target interface, the resource blocks in the target interface that overlap with the predicted trajectory are added to the target resource block set. 4.根据权利要求2所述的方法,其特征在于,所述根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述目标界面对应的目标资源块集合,还包括:4. The method according to claim 2, characterized in that the step of determining a target resource block set corresponding to the target interface in a next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period further comprises: 确定所述移动速度与预设的速度阈值之间的大小关系;Determine the magnitude relationship between the moving speed and a preset speed threshold; 若所述移动速度小于所述速度阈值,则执行所述根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述鼠标的预测轨迹的步骤;If the moving speed is less than the speed threshold, the step of determining the predicted trajectory of the mouse in the next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period is performed; 若所述移动速度不小于所述速度阈值,确定所述下一时段对应的目标资源块集合为空。If the moving speed is not less than the speed threshold, it is determined that the target resource block set corresponding to the next time period is empty. 5.根据权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, characterized in that the method further comprises: 确定所述目标界面中的资源块的数量;Determining the number of resource blocks in the target interface; 所述间隔预设时长获取目标界面中当前时段对应的鼠标位置,包括:The preset time interval obtains the mouse position corresponding to the current time period in the target interface, including: 在所述资源块的数量超过预设的数量阈值的情况下,间隔预设时长获取目标界面中当前时段对应的鼠标位置。When the number of resource blocks exceeds a preset number threshold, the mouse position corresponding to the current time period in the target interface is obtained at preset time intervals. 6.根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:6. The method according to any one of claims 1 to 5, characterized in that the method further comprises: 在所述目标资源块集合为空时,保持所述目标界面中的各个资源块的鼠标事件监听为关闭状态。When the target resource block set is empty, the mouse event monitoring of each resource block in the target interface is kept in a closed state. 7.根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:7. The method according to any one of claims 1 to 5, characterized in that the method further comprises: 在所述目标资源块集合为非空集合时,控制所述目标界面中除所述目标资源块之外的资源块的鼠标事件监听处于关闭状态。When the target resource block set is a non-empty set, the mouse event monitoring of the resource blocks other than the target resource block in the target interface is controlled to be in a closed state. 8.一种事件监听装置,其特征在于,所述装置包括:8. An event monitoring device, characterized in that the device comprises: 获取模块,用于间隔预设时长获取目标界面中当前时段对应的鼠标位置;An acquisition module is used to obtain the mouse position corresponding to the current time period in the target interface at preset intervals; 第一确定模块,用于根据当前时段和上一时段获得的鼠标位置,确定鼠标的移动方向和移动速度;A first determination module, used to determine the moving direction and moving speed of the mouse according to the mouse positions obtained in the current period and the previous period; 第二确定模块,用于根据所述移动方向、所述移动速度和所述当前时段获得的鼠标位置,确定下一时段内所述目标界面对应的目标资源块集合,其中,所述目标资源块集合中的目标资源块为预测所述鼠标在下一时段内经过的资源块;A second determination module is used to determine a target resource block set corresponding to the target interface in a next time period according to the moving direction, the moving speed and the mouse position obtained in the current time period, wherein the target resource blocks in the target resource block set are resource blocks predicted to be passed by the mouse in the next time period; 第一控制模块,用于在所述目标资源块集合为非空集合时,控制所述目标资源块的鼠标事件监听处于开启状态,其中,所述目标界面中的各个资源块的鼠标事件监听初始为关闭状态。The first control module is used to control the mouse event monitoring of the target resource block to be in an on state when the target resource block set is a non-empty set, wherein the mouse event monitoring of each resource block in the target interface is initially in a off state. 9.一种非临时性计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-7中任一项所述方法的步骤。9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented. 10.一种电子设备,其特征在于,包括:10. An electronic device, comprising: 存储器,其上存储有计算机程序;a memory having a computer program stored thereon; 处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1-7中任一项所述方法的步骤。A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.
CN202111435903.9A 2021-11-29 2021-11-29 Event monitoring method, device, medium and electronic device Active CN114115562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111435903.9A CN114115562B (en) 2021-11-29 2021-11-29 Event monitoring method, device, medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111435903.9A CN114115562B (en) 2021-11-29 2021-11-29 Event monitoring method, device, medium and electronic device

Publications (2)

Publication Number Publication Date
CN114115562A CN114115562A (en) 2022-03-01
CN114115562B true CN114115562B (en) 2024-11-22

Family

ID=80367751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111435903.9A Active CN114115562B (en) 2021-11-29 2021-11-29 Event monitoring method, device, medium and electronic device

Country Status (1)

Country Link
CN (1) CN114115562B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377634A (en) * 2021-05-25 2021-09-10 北京猿力教育科技有限公司 Monitoring method for backtracking user operation, user operation backtracking method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8949719B2 (en) * 2008-05-23 2015-02-03 Viasat, Inc. Methods and systems for user interface event snooping and prefetching
CN102012805B (en) * 2009-09-04 2013-10-23 腾讯科技(深圳)有限公司 Custom cursor realization method and device
CN104077115A (en) * 2013-03-27 2014-10-01 苏州精易会信息技术有限公司 Classification-navigation pull-down menu design implementation method
US20170178012A1 (en) * 2015-12-17 2017-06-22 Microsoft Technology Licensing, Llc Precaching via input method trajectory prediction
CN106708591B (en) * 2017-01-25 2020-06-02 东软集团股份有限公司 Character detection method and device for operating system
CN107958092A (en) * 2017-12-29 2018-04-24 北京奇虎科技有限公司 The method and device that roller browses is carried out to browsing device net page
CN109521894A (en) * 2018-10-19 2019-03-26 北京金山云网络技术有限公司 Business executes method, apparatus and electronic equipment
CN110619102B (en) * 2019-07-08 2022-12-30 苏宁云计算有限公司 Method and device for monitoring page elements

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377634A (en) * 2021-05-25 2021-09-10 北京猿力教育科技有限公司 Monitoring method for backtracking user operation, user operation backtracking method and device

Also Published As

Publication number Publication date
CN114115562A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN109240576B (en) Image processing method and device in game, electronic device and storage medium
CN108595230B (en) Application preloading method, device, storage medium and terminal
US9961251B2 (en) Methods for adjusting control parameters on an image capture device
US10572017B2 (en) Systems and methods for providing dynamic haptic playback for an augmented or virtual reality environments
CN108829314B (en) Screenshot selecting interface selection method, device, equipment and storage medium
CN106358069A (en) Video data processing method and mobile terminal
US11889135B2 (en) Video stream playing control method and apparatus, and storage medium
CN113434065B (en) Information processing method and terminal
EP3671627B1 (en) Image processing method and device
US20250044922A1 (en) Element display method and apparatus for information input interface, device, and medium
CN107861681A (en) Screenshotss processing method, device, computer equipment and storage medium
CN112256563A (en) Android application stability testing method and device, electronic equipment and storage medium
CN115220885A (en) Agent control method, device, storage medium, electronic device and server
CN112530205A (en) Airport parking apron airplane state detection method and device
CN106708508B (en) A kind of interface data processing method and device
CN113485605B (en) Display device, terminal device and screen projection method
CN112073301B (en) Method, device and computer readable medium for deleting chat group members
CN114115562B (en) Event monitoring method, device, medium and electronic device
CN111757161A (en) High-definition video playing content switching method, device, equipment and storage medium
CN115906205A (en) Constructs an environment view from optionally determined environment images
US10187610B2 (en) Controlling display based on an object position in an imaging space
CN111797933A (en) Template matching method and device, electronic equipment and storage medium
CN114666647B (en) Method, device and related assembly for realizing picture-in-picture between different information sources
CN115215170B (en) Elevator control method, device, storage medium and electronic equipment
CN115866211A (en) Equipment position tracking method and device, electronic equipment and 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