Mouse action response method of embedded graphic system
By optimizing mouse event processing, the problem of poor compatibility of domestic embedded graphics systems for high-speed mice is solved, and the mouse movement in the graphical interface is achieved without lag, improving the user experience.
Patent Information
- Application Number
- CN202510021429.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-06
AI Technical Summary
The domestic embedded graphics system has poor compatibility with high-speed mice, resulting in the lag of mouse movement in the graphical interface, which cannot meet actual needs and has a poor user experience.
By obtaining the mouse event and the mouse data transmission frequency, if the data transmission frequency is greater than the graphics system response frequency, some events will be deleted from the same continuous mouse events until the remaining mouse events require a processing frequency not greater than the graphics system response frequency, and the graphics system displays the mouse event.
It has successfully avoided the problem of stuttering of the graphics display system when the embedded hardware platform is adapted to multiple mouse devices, ensuring that users can access the embedded graphics system without any sense when using high-speed mice, and operate smoothly and stably for a long time.
Smart Images

Figure CN119938198A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of embedded graphics systems, and more specifically, relates to a mouse action response method of an embedded graphics system. Background Art
[0002] With the development of domestic embedded graphics systems, the demand for adapting to various high-performance input and output devices is also increasing. However, due to the limited main frequency of domestic embedded hardware and insufficient concurrent processing capabilities, the compatibility with many peripherals is not very good, especially in the Loongson multi-core embedded system. The data response processing of high-speed mouse devices is not timely enough, which can easily cause the movement of the mouse in the graphical interface to be stuck, which cannot meet actual needs and leads to poor user experience. Summary of the invention
[0003] In view of the defects of the prior art, the purpose of this application is to propose a mouse action response method for an embedded graphics system, aiming to solve the problem that the existing domestic embedded graphics system is not compatible with high-speed mice.
[0004] To achieve the above objectives, in a first aspect, the present application provides a mouse action response method for an embedded graphics system, the mouse action response method comprising the following steps: Get mouse events and the frequency of sending mouse data; If the data transmission frequency is greater than the graphics system response frequency, some events are deleted from the consecutive identical mouse events until the processing frequency required for the remaining mouse events is no greater than the graphics system response frequency; The graphics system displays the mouse events.
[0005] Preferably, deleting some events from the consecutive identical mouse events until the processing frequency required for the remaining mouse events is no greater than the response frequency of the graphics system specifically includes the following steps: (11) Put consecutive identical mouse events into the event queue in chronological order; (12) every N mouse events, delete one event from the event queue; (13) Determine whether the processing frequency required for the remaining mouse events is not greater than the response frequency of the graphics system. If so, the optimization is completed; otherwise, return to step (11).
[0006] Preferably, the remaining mouse events are processed as often as needed for:
[0007] in, is the number of remaining mouse events; The sending time of consecutive identical mouse events; and must meet the following requirements: , For the remaining set of mouse events, A collection of consecutive identical mouse events.
[0008] Preferably, events that meet the following conditions are considered consecutive identical mouse events:
[0009] in, Indicates the mouse button value, The subscript indicates the timing of obtaining the mouse key value.
[0010] Preferably, the graphic system reads the data transmission frequency of the connected mouse from the USB interface via a USB driver.
[0011] Preferably, the graphics system response frequency is positively correlated with the CPU main frequency.
[0012] Preferably, when the graphics system displays a mouse event, it obtains the movement increment of the current mouse event, then adds the movement increment to the coordinates of the previous mouse event to obtain the coordinates of the current mouse event, and then updates the coordinates of the current mouse event based on the limitation of the screen range. The graphics system displays the current mouse event at the updated coordinates.
[0013] In a second aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in any possible implementation of the first aspect.
[0014] In a third aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in any possible implementation of the first aspect.
[0015] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in any possible implementation manner of the first aspect.
[0016] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0017] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art: (1) This application provides a method for responding to mouse actions in an embedded graphics system, which obtains the hardware rate information of the mouse and then optimizes the continuous identical mouse events based on the hardware rate information before displaying them. This method successfully avoids the problem of graphics display system freezes when a national embedded hardware platform is adapted to multiple types of mouse devices.
[0018] (2) This application uses a USB driver layer to read the mouse hardware information, and the graphics driver layer fully utilizes the computing power of the CPU main frequency to optimize the mouse data, ensuring that users can seamlessly access the embedded graphics system when using various types of high-speed mice, and can run smoothly and stably for a long time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is one of the flow charts of a mouse action response method of an embedded graphics system provided in an embodiment of the present application.
[0020] Figure 2 This is the second flow chart of a mouse action response method of an embedded graphics system provided in an embodiment of the present application.
[0021] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] Embodiment 1: Embodiment 1 is an implementation scheme of the technical solution of the present application, such as Figure 1 As shown, this embodiment includes the following steps: S1. Get mouse events and the frequency of sending mouse data; The data transmission frequency of the connected mouse is read from the USB interface through the USB driver layer.
[0024] S2: If the data transmission frequency is greater than the graphics system response frequency, some events are deleted from the consecutive identical mouse events until the processing frequency required for the remaining mouse events is no greater than the graphics system response frequency. This includes the following sub-steps: (11) Put consecutive identical mouse events into the event queue in chronological order; (12) Every N mouse events, delete one event from the queue of consecutive identical mouse events; among them, an event that meets the following conditions is considered a consecutive identical mouse event:
[0025] in, Indicates the mouse button value, The subscript indicates the timing of obtaining the mouse key value.
[0026] (13) Determine whether the processing frequency required for the remaining mouse events is not greater than the response frequency of the graphics system. If so, the optimization is completed; otherwise, return to step (11).
[0027] Among them, the remaining mouse event processing frequency Specifically:
[0028] is the number of remaining mouse events; The sending time of consecutive identical mouse events; and must meet the following requirements: , For the remaining set of mouse events, A collection of consecutive identical mouse response events.
[0029] Among them, the graphics system response frequency is positively correlated with the CPU main frequency.
[0030] When the graphics system displays a mouse event, it obtains the movement increment of this mouse event, and then adds the movement increment to the coordinate information of the previous mouse event to obtain the coordinate information of this mouse event. Then, the coordinate information of this mouse event is updated based on the limitation of the screen range, and the graphics system displays this mouse event on the updated coordinate information.
[0031] Embodiment 2: Embodiment 2 provides another implementation method of the technical solution of the present application, such as Figure 2 As shown, the specific steps include: (1) The USB mouse hardware and embedded device are connected through the USB interface.
[0032] (2) The USB driver layer scans the mouse hardware information and obtains the mouse data transmission frequency.
[0033] (3) When the mouse is operated, such as moving, clicking, etc., mouse event data will be generated. The USB driver layer will report the mouse events and the mouse data transmission frequency to the graphics driver layer through the custom mouse data interface.
[0034] (4) The graphics driver layer determines whether to optimize based on the mouse data transmission frequency and mouse events and then sends them to the graphics system for display. Specifically: (41) Determine whether the data transmission frequency of the mouse is greater than the response frequency of the graphics system. If so, the connected mouse is deemed to be a high-speed mouse, and the process proceeds to step (42) to continue determining whether the display needs to be optimized. Otherwise, it indicates that the graphics system can process the received mouse events, and the process proceeds to step (44), where the graphics system directly displays the mouse events.
[0035] The maximum value of the response frequency of the graphics system can be set to the main core frequency of the CPU in the embedded device.
[0036] (42) Determine whether it is a continuous identical mouse event. If so, it means that the display can be optimized and will not affect the display effect of the graphics system. The mouse needs to be slowed down and the process goes to step (43). Otherwise, it is determined to be a critical mouse event and the display cannot be optimized. The process goes to step (44) and the graphics system directly displays the mouse event.
[0037] In this application, mouse events are represented by mouse key values, which are: left button 1; right button 2; scroll wheel 3; release button: 0; move: continuous same mouse key value.
[0038] 0-1-0 means clicking the left button; 0-0-0-0 means moving without pressing any button; 1-1-1-1-1 means moving with pressing the left button.
[0039] Consecutive identical mouse events appear as consecutive identical mouse button values.
[0040] (43) The specific speed reduction process is as follows: (431) Arrange consecutive identical mouse events in time sequence; (432) Every 10 mouse events, delete one event from the queue of consecutive identical mouse events; (433) Determine whether the processing frequency required for the remaining mouse events is not greater than the response frequency of the graphics system. If so, the optimization is completed and the process goes to step (44); otherwise, the process returns to step (431).
[0041] In this step, it can also be determined whether the average time interval between the remaining mouse events is not less than the minimum response time of the graphics system; if so, the optimization is completed and the process proceeds to step (44); otherwise, the process returns to step (431).
[0042] (44) The graphics driver layer sends each mouse event to the graphics system for display.
[0043] The graphics driver layer obtains the movement increment of this mouse event, and then adds the movement increment to the coordinate information of the previous mouse event to obtain the coordinate information of this mouse event, and then updates the coordinate information of this mouse event based on the screen range limit. Finally, the graphics system displays this mouse event on the updated coordinate information.
[0044] Based on the method in the above embodiment, the embodiment of the present application provides an electronic device, such as Figure 3 As shown, the electronic device may include: a processor (Processor) 310, a communication interface (Communications Interface) 320, a memory (Memory) 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the method in the above embodiment.
[0045] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0046] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0047] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0048] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0049] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0050] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0051] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0052] The terms “first”, “second” and the like in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects.
[0053] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0054] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more than two.
[0055] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A mouse action response method for an embedded graphics system, characterized in that: The mouse action response method comprises the following steps: Get mouse events and the frequency of sending mouse data; If the data transmission frequency is greater than the graphics system response frequency, some events are deleted from the consecutive identical mouse events until the processing frequency required for the remaining mouse events is no greater than the graphics system response frequency; The graphics system displays the mouse events.
2. The mouse action response method according to claim 1, characterized in that: Deleting some consecutive identical mouse events until the processing frequency required for the remaining mouse events is no greater than the response frequency of the graphics system includes the following steps: (11) Put consecutive identical mouse events into the event queue in chronological order; (12) every N mouse events, delete one event from the event queue; (13) Determine whether the processing frequency required for the remaining mouse events is not greater than the response frequency of the graphics system. If so, the optimization is completed; otherwise, return to step (11).
3. The mouse action response method according to claim 1 or 2, characterized in that: The remaining mouse events require processing frequency for: in, is the number of remaining mouse events; The sending time of consecutive identical mouse events; and must meet the following requirements: , For the remaining set of mouse events, A collection of consecutive identical mouse events.
4. The mouse action response method according to claim 1, characterized in that: Events that meet the following conditions are considered consecutive identical mouse events: in, Indicates the mouse button value, The subscript indicates the timing of obtaining the mouse key value.
5. The mouse action response method according to claim 1, characterized in that: The graphic system reads the data transmission frequency of the connected mouse from the USB interface through the USB driver.
6. The mouse action response method according to claim 1, characterized in that: The response frequency of the graphics system is positively correlated with the main frequency of the CPU.
7. The mouse action response method according to claim 1, characterized in that: When the graphics system displays a mouse event, it obtains the movement increment of this mouse event, and then adds the movement increment to the coordinates of the previous mouse event to obtain the coordinates of this mouse event. Then, the coordinates of this mouse event are updated based on the screen range limit, and the graphics system displays this mouse event at the updated coordinates.
8. An electronic device, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.