Interface lag optimization method, device and equipment of swing system and readable storage medium
By detecting time-consuming code blocks in the Swing system and executing them asynchronously, combined with the SecondaryLoop interface to manage the EDT event loop, the UI lag issue was resolved, ensuring logical correctness without requiring large-scale modifications to user code.
CN122331894APending Publication Date: 2026-07-03FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by
Patent Information
- Application Number
- CN202610279696.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-09
- Publication Date
- 2026-07-03
AI Technical Summary
Technical Problem
Existing technologies for handling UI lag issues in Swing systems cannot guarantee logical correctness and require large-scale modifications to user code, especially when the time-consuming code block is not at the end of the user code.
Method used
The time-consuming code block is detected by EDT and encapsulated into a time-consuming task, which is then submitted to the asynchronous task executor for execution in a background thread. At the same time, the SecondaryLoop interface is used to start and exit the secondary EDT event loop to ensure the correct order of interface response.
Benefits of technology
While resolving the UI lag issue, the original logic remains correct, eliminating the need for large-scale modifications and refactoring of user code.
✦ Generated by Eureka AI based on patent content.
Smart Images

Figure CN122331894A_ABST
Abstract
This application provides a method, apparatus, device, and readable storage medium for optimizing UI lag in a Swing system. The method includes: an Event Deployment Thread (EDT) detecting whether each code block in the target user code is a time-consuming code block, wherein the target user code is bound to the UI event currently being responded to by the EDT; the EDT encapsulating the time-consuming code block into a time-consuming task and submitting it to an asynchronous task executor, which allocates a background thread independent of the EDT for execution; after submitting the time-consuming task, the EDT calls the `enter` method of the `SecondaryLoop` interface to start a secondary EDT event loop, blocking the execution of subsequent code blocks in the target user code while responding normally to new UI events; after receiving feedback that the time-consuming task has completed execution, the EDT calls the `exit` method of the `SecondaryLoop` interface to exit the secondary EDT event loop, resuming the execution of subsequent code blocks in the target user code. This application can solve the lag problem while ensuring the correctness of the original logic, without requiring large-scale modification and refactoring of the user code.
Need to check novelty before this filing date? Find Prior Art
