Synchronization method and device for roller event of synchronizer, equipment and medium

By listening and merging mouse wheel events in Windows synchronizer, the CPU burden and device lag caused by high-frequency wheel events are solved, and more efficient multi-window synchronization operation is achieved.

CN119917306APending Publication Date: 2025-05-02ZIXUN TECHNOLOGY (FUJIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411963010.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the multi-window synchronization scenario, the existing Windows synchronizer has a sharp increase in CPU usage due to the high frequency of mouse wheel events, causing device stuttering and stuck, and cannot be effectively handled when user equipment performance is insufficient.

Method used

By monitoring the mouse wheel event in the main control window, the CPU and memory usage is detected in real time. If it is within the set threshold, the wheel event will be executed; otherwise, the wheel event will be intercepted and recorded in the wheel queue. After setting the delay time, the wheel event will be merged in the same direction or the opposite direction to form a merge event and reduce the number of executions.

Benefits of technology

It effectively reduces the burden on the CPU of scrolling operations, avoids lag and stuck caused by high-frequency scrolling, improves the number of windows that users can synchronize, and improves the overall work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917306A_ABST
    Figure CN119917306A_ABST
Patent Text Reader

Abstract

The invention provides a synchronization method and device for a roller event of a synchronizer, equipment and a medium, a mouse roller event of a master control window is monitored, if the mouse roller event is executed currently, the CPU utilization rate and the memory utilization rate of the equipment are monitored, the mouse roller event is intercepted according to the utilization rate, and the mouse roller event is executed according to the intercepted mouse roller event. Recording the intercepted mouse wheel events into a wheel queue, and waiting for execution; setting a delay time, if the mouse wheel events acquired in the delay time are in the same direction, acquiring a wheel queue corresponding to the delay time, and combining the wheel queue into a mouse wheel combined event; if the reverse mouse wheel event exists in the delay time, combining the mouse wheel events in the wheel queue before the reverse mouse wheel event to obtain a mouse wheel combination event; the main control window executes the mouse wheel merging event; and each slave control window sequentially executes the same mouse wheel merging event as the master control window, so that normal operation of the equipment is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a synchronization method, device, equipment and medium for roller events of a synchronizer. Background Art

[0002] The mouse events of the existing Windows synchronizer are synchronized 1:1 from the master window to the slave window. Because the Windows mouse wheel event has the characteristics of many events and high frequency, and when using the touchpad, the mouse wheel event will instantly reach a frequency of 30 to 50 times. In the scenario of multi-window synchronization of the Windows synchronizer, the frequency of 30 to 50 times will be executed in each slave window, which amplifies the performance loss caused by high-frequency execution, causing the CPU usage rate to increase rapidly in a short period of time, and then causing the user device to freeze or freeze. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a synchronization method, device, equipment and medium for the scroll wheel events of the synchronizer, so as to reduce the burden on the CPU brought by the scrolling operation, thereby solving the problem of jamming and freezing caused by insufficient performance of the user device or high-frequency scrolling of a large number of slave control windows, and increasing the number of windows that can be synchronized by the user.

[0004] In a first aspect, the present invention provides a method for synchronizing a scroll wheel event of a synchronizer, which is used for a Windows synchronizer, wherein the Windows synchronizer is used for synchronizing a master window and a slave window; the method comprises the following steps:

[0005] Step 1, monitoring the mouse wheel event of the master control window, if there is currently an execution mouse wheel event, then obtaining the device CPU usage and memory usage in real time, if the CPU usage is less than a first set threshold, and the memory usage is less than a second set threshold, then the master control window and the slave control window execute the mouse wheel event; otherwise, proceed to step 2;

[0006] Step 2: intercept the mouse wheel event, and record the intercepted mouse wheel event into a wheel queue, waiting for execution;

[0007] Step 3, set a delay time, if the mouse wheel events obtained within the delay time are all in the same direction, then obtain the wheel queue corresponding to the delay time and merge them into a mouse wheel merge event; if there is a mouse wheel event in the opposite direction within the delay time, then combine the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction to obtain a mouse wheel merge event;

[0008] Step 4: The main control window executes the mouse wheel merge event;

[0009] Step 5: Each slave control window executes the same mouse wheel merge event as the master control window in turn.

[0010] In a second aspect, the present invention provides a synchronization device for a wheel event of a synchronizer, which is used for a Windows synchronizer, wherein the Windows synchronizer is used for synchronizing a master window and a slave window; the device comprises the following modules:

[0011] A monitoring module monitors the mouse wheel event of the master control window. If there is a mouse wheel event currently being executed, the CPU usage rate and memory usage rate of the device are obtained in real time. If the CPU usage rate is less than a first set threshold, and the memory usage rate is less than a second set threshold, the master control window and the slave control window execute the mouse wheel event; otherwise, the interception module is entered;

[0012] The interception module intercepts the mouse wheel event and records the intercepted mouse wheel event into a wheel queue, waiting for execution;

[0013] The merging module sets a delay time. If the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained and merged into a mouse wheel merge event. If there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merge event.

[0014] The main control execution module, the main control window executes the mouse wheel merging event;

[0015] The slave control execution module, each slave control window sequentially executes the same mouse wheel merging event as the master control window.

[0016] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.

[0017] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0018] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:

[0019] The technical solution of the present invention detects the execution frequency of Windows mouse wheel events. When the execution frequency is too high, the wheel events in the same direction within a certain period of time are combined and sent, the scrolling distance is calculated, and they are merged into a new Windows mouse wheel event for execution, thereby reducing the burden of executing the scrolling operation on the CPU, thereby solving the problem of jamming and freezing caused by insufficient performance of user equipment or high-frequency scrolling of a large number of slave control windows, and increasing the number of windows that can be synchronized by users.

[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0022] Figure 1 is a flow chart of the method in Embodiment 1 of the present invention;

[0023] Figure 2 It is a schematic diagram of the structure of the device in the second embodiment of the present invention. DETAILED DESCRIPTION

[0024] The embodiments of the present application provide a synchronization method, apparatus, device and medium for scroll wheel events of a synchronizer to solve the problems of freezing and blocking caused by insufficient performance of user devices or high-frequency scrolling of a large number of slave control windows, thereby increasing the number of windows that can be synchronized by the user.

[0025] The technical solution in the embodiment of the present application specifically includes the following steps:

[0026] Step 1: When executing a Windows mouse wheel event, record the device CPU usage. If it exceeds the expected performance consumption, combine the events at the next Windows mouse wheel event.

[0027] Step 2: Use win32gui.SetWindowsHookEx to monitor the Windows mouse wheel event executed by the user, intercept it by returning 1, and record the wheel event in the queue, waiting for execution

[0028] Step 3: Set a delayer, combine all Windows mouse wheel events in the same direction waiting to be executed within 20 milliseconds and mark them as cover_use, calculate the cumulative scrolling distance wParam = win32api.MAKELONG (0, int (scroll_amount * 120)), and merge them into a new mouse wheel event. Send it to the execution end. If an event in the opposite direction is encountered, combine the previous round of events in advance, and then set a 20 millisecond delay to combine them, and so on.

[0029] Step 4: Execute the combined wheel event on the main control window, and use win32gui.SendMesage(win32con.WM_MOUSEWHEE L,wParam,lParam) to restore the intercepted Windows mouse wheel event executed by the user. This allows the user to perceive that all windows are executed synchronously.

[0030] Step 5: Execute the same events as the master window in the slave window, and perform a single long-distance scroll wheel event. Reduce the number of executions and reduce the CPU burden.

[0031] Step 6: After all window combined wheel events are executed once, the device CPU usage is detected to determine whether it is necessary to continue to execute the combined mouse wheel event. If the device performance is as expected, this function is turned off.

[0032] Embodiment 1

[0033] like Figure 1 As shown, this embodiment provides a synchronization method for a wheel event of a synchronizer, which is used for a Windows synchronizer, and the Windows synchronizer is used for synchronizing a master window and a slave window; the method comprises the following steps:

[0034] Step 1, monitoring the mouse wheel event of the master control window, if there is currently an execution mouse wheel event, then obtaining the device CPU usage and memory usage in real time, if the CPU usage is less than a first set threshold, and the memory usage is less than a second set threshold, then the master control window and the slave control window execute the mouse wheel event; otherwise, proceed to step 2;

[0035] Step 2: intercept the mouse wheel event, and record the intercepted mouse wheel event into a wheel queue, waiting for execution;

[0036] Step 3: Set a delay time. If the mouse wheel events obtained within the delay time are all in the same direction, obtain the wheel queue corresponding to the delay time and merge them into a mouse wheel merge event. If there is a mouse wheel event in the opposite direction within the delay time, combine the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction to obtain a mouse wheel merge event. The delay time is set to 20 milliseconds to ensure that the user does not feel it.

[0037] Step 4: The main control window executes the mouse wheel merge event;

[0038] Step 5: Each slave control window executes the same mouse wheel merge event as the master control window in turn.

[0039] In this embodiment, preferably, the step 2 is specifically: the mouse wheel event is mounted and monitored using win32gui.SetWindowsHookEx, the callback returns 1 to intercept, and the intercepted mouse wheel events are recorded in the wheel queue, waiting for execution.

[0040] In this embodiment, preferably, the step 3 is specifically: setting a delay time, if the mouse wheel events obtained within the delay time are all in the same direction, obtaining the wheel queue corresponding to the delay time, calculating the cumulative scrolling distance wParam=win32api.MAKELONG(0,int(scroll_amount*120)) of all the mouse wheel events in the wheel queue, and merging them into a mouse wheel merged event; if there is a mouse wheel event in the opposite direction within the delay time, combining the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction to obtain a mouse wheel merged event.

[0041] In this embodiment, preferably, step 4 is specifically: the main control window executes the mouse wheel merge event, and restores the mouse wheel merge event using win32gui.SendMesage(win32con.WM_MOU SEWHEEL,wParam,lParam).

[0042] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.

[0043] Embodiment 2

[0044] like Figure 2 As shown, in this embodiment, a synchronization device for a wheel event of a synchronizer is provided, which is used for a Windows synchronizer, and the Windows synchronizer is used for synchronizing a master control window and a slave control window; and includes the following modules:

[0045] A monitoring module monitors the mouse wheel event of the master control window. If there is a mouse wheel event currently being executed, the CPU usage rate and memory usage rate of the device are obtained in real time. If the CPU usage rate is less than a first set threshold, and the memory usage rate is less than a second set threshold, the master control window and the slave control window execute the mouse wheel event; otherwise, the interception module is entered;

[0046] The interception module intercepts the mouse wheel event and records the intercepted mouse wheel event into a wheel queue, waiting for execution;

[0047] The merging module sets a delay time. If the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained and merged into a mouse wheel merge event. If there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merge event.

[0048] The main control execution module, the main control window executes the mouse wheel merging event;

[0049] The slave control execution module, each slave control window sequentially executes the same mouse wheel merging event as the master control window.

[0050] In this embodiment, preferably, the interception module is specifically: the mouse wheel event is mounted and monitored using win32gui.SetWindowsHookEx, the callback returns 1 to intercept, and the intercepted mouse wheel events are recorded in the wheel queue, waiting for execution.

[0051] In this embodiment, preferably, the merging module is specifically as follows: a delay time is set, and if the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained, and the cumulative scrolling distance wParam=win32api.MAKELONG(0,int(scroll_amount*120)) of all the mouse wheel events in the wheel queue is calculated, and merged into a mouse wheel merged event; if there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merged event.

[0052] In this embodiment, preferably, the main control execution module is specifically: the main control window executes the mouse wheel merging event, and restores the mouse wheel merging event using win32gui.SendMesage(win32con.WM_MOUSEWHEEL,wParam,lParam).

[0053] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.

[0054] Based on the same inventive concept, the present application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.

[0055] Embodiment 3

[0056] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first embodiment can be implemented.

[0057] Since the electronic device introduced in this embodiment is a device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the device used by the method in the embodiment of the present application, it belongs to the scope of protection of the present application.

[0058] Based on the same inventive concept, the present application provides a storage medium corresponding to the first embodiment, see the fourth embodiment for details.

[0059] Embodiment 4

[0060] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any implementation method in the first embodiment can be implemented.

[0061] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:

[0062] This embodiment monitors the trigger frequency of mouse wheel events in real time. When an abnormally high frequency is detected, the wheel events in the same direction within a certain period of time are automatically integrated. Specifically, the cumulative scrolling distance of these events is calculated and merged into a single mouse wheel event for execution. This optimization measure can effectively reduce the consumption of CPU resources by scrolling operations, thereby alleviating system freezes and freezes caused by device performance limitations or a large number of parallel window operations. Ultimately, this technical solution can significantly improve the user experience when using multi-window synchronous operations, increase the number of synchronizable windows, and improve overall work efficiency.

[0063] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0064] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0065] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0066] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0067] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A synchronization method for a wheel event of a synchronizer, used for a Windows synchronizer, wherein the Windows synchronizer is used for synchronizing a master control window and a slave control window; characterized in that: The steps include: Step 1, monitoring the mouse wheel event of the master control window, if there is currently an execution mouse wheel event, obtaining the device CPU usage and memory usage in real time, if the CPU usage is less than a first set threshold, and the memory usage is less than a second set threshold, the master control window and the slave control window execute the mouse wheel event; If not, proceed to step 2; Step 2: intercept the mouse wheel event, and record the intercepted mouse wheel event into a wheel queue, waiting for execution; Step 3, set a delay time, if the mouse wheel events obtained within the delay time are all in the same direction, then obtain the wheel queue corresponding to the delay time and merge them into a mouse wheel merge event; if there is a mouse wheel event in the opposite direction within the delay time, then combine the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction to obtain a mouse wheel merge event; Step 4: The main control window executes the mouse wheel merge event; Step 5: Each slave control window executes the same mouse wheel merge event as the master control window in turn.

2. A method for synchronizing a roller event of a synchronizer according to claim 1, characterized in that: The step 2 is specifically as follows: the mouse wheel event is mounted and monitored using win32gui.SetWind owsHookEx, the callback returns 1 to intercept, and the intercepted mouse wheel events are recorded in the wheel queue, waiting for execution.

3. A method for synchronizing a roller event of a synchronizer according to claim 1, characterized in that: The step 3 is specifically as follows: a delay time is set; if the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained; the cumulative scrolling distance of all the mouse wheel events in the wheel queue is calculated wParam=win32api.MAKELONG(0,int(scroll_amount*120)), and they are merged into a mouse wheel merge event; if there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merge event.

4. A method for synchronizing a roller event of a synchronizer according to claim 3, characterized in that: The step 4 is specifically as follows: the main control window executes the mouse wheel merge event, and restores the mouse wheel merge event using win32gui.SendMesage(win32con.WM_MOUSEWHEEL, wParam, lParam).

5. A synchronization device for a wheel event of a synchronizer, used for a Windows synchronizer, wherein the Windows synchronizer is used for synchronizing a master control window and a slave control window; characterized in that: Includes the following modules: A monitoring module monitors the mouse wheel event of the master control window. If there is a mouse wheel event currently being executed, the CPU usage rate and memory usage rate of the device are obtained in real time. If the CPU usage rate is less than a first set threshold and the memory usage rate is less than a second set threshold, the master control window and the slave control window execute the mouse wheel event. If not, enter the interception module; The interception module intercepts the mouse wheel event and records the intercepted mouse wheel event into a wheel queue, waiting for execution; The merging module sets a delay time. If the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained and merged into a mouse wheel merge event. If there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merge event. The main control execution module, the main control window executes the mouse wheel merging event; The slave control execution module, each slave control window sequentially executes the same mouse wheel merging event as the master control window.

6. A synchronization device for roller events of a synchronizer according to claim 5, characterized in that: The interception module specifically includes: using win32gui.SetWi ndowsHookEx to mount and monitor the mouse wheel event, the callback returns 1 to intercept, and the intercepted mouse wheel events are recorded in the wheel queue, waiting for execution.

7. A synchronization device for roller events of a synchronizer according to claim 5, characterized in that: The merging module is specifically as follows: a delay time is set, and if the mouse wheel events obtained within the delay time are all in the same direction, the wheel queue corresponding to the delay time is obtained, and the cumulative scrolling distance of all the mouse wheel events in the wheel queue is calculated wParam=win32api.MAKELONG(0,int(scroll_amount*120)), and merged into a mouse wheel merged event; if there is a mouse wheel event in the opposite direction within the delay time, the mouse wheel events in the wheel queue before the mouse wheel event in the opposite direction are combined to obtain a mouse wheel merged event.

8. A synchronization device for roller events of a synchronizer according to claim 7, characterized in that: The main control execution module is specifically: the main control window executes the mouse wheel merging event, and restores the mouse wheel merging event using win32gui.SendMesage(win32con.WM_MOUSEWHEEL,wParam,lParam).

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.