List component state synchronization method, system, medium, device, and program product
By listening to the scrolling operations of the graphics rendering pipeline in the virtual list, obtaining the offset in advance and registering the component controller, and combining the driver pointer to perform the scrolling operation, the data alignment and event loop problems of the virtual list under high-speed scrolling and large data volume are solved, improving the smoothness and stability of list scrolling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FOUNDER SECURITIES CO LTD
- Filing Date
- 2026-06-12
- Publication Date
- 2026-07-10
Smart Images

Figure CN122363804A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal application technology, and in particular to a method, system, medium, device and program product for synchronizing the status of a list component. Background Technology
[0002] The core mechanism of virtual lists lies in component reuse. When a user scrolls quickly, component instances are recycled and rebound with new data, but layout rendering calculations often lag behind data binding. If only standard lifecycle synchronization is relied upon, the scrolling container may not have completed its geometric layout, causing scroll positioning to fail or reset. In practice, this manifests as some rows and columns becoming misaligned with others after scrolling stops, almost always occurring when the scrolling speed exceeds a certain threshold.
[0003] In scenarios with large amounts of data (such as more than 5,000 market data entries), the full binding method maintains thousands of object references. The broadcast computation for each scroll is large, and low-end devices are prone to frame drops. The processing time for a single scroll event may exceed sixteen milliseconds, affecting smoothness.
[0004] In two-way interactive scenarios (such as table headers and list items controlling each other), event loops can easily form, where A triggers B, and B in turn triggers A, causing UI jitter or cyclic calls. Although this can be avoided using flag variables, it is cumbersome and error-prone.
[0005] Therefore, how to achieve real-time alignment and scrolling of data in large-scale data scenarios is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this application is to provide a method, system, computer-readable storage medium, electronic device, and computer program product for synchronizing the state of a list component, which can solve the problem of real-time data alignment in a list under high-speed scrolling and reuse.
[0007] To address the aforementioned technical problems, this application provides a method for synchronizing the state of a list component, the specific technical solution of which is as follows: When a scrolling operation of the graphics rendering pipeline is detected, before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, the offset corresponding to the scrolling operation is obtained from the global state manager; the component controller corresponding to the sub-item component is registered, and the component controller corresponding to the sub-item component is added to the dynamic linkage pool, and a broadcast notification is received. When an operation instruction broadcast is received, the global state manager is invoked to add a current driver pointer to the sub-item component; the current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; Perform a scrolling operation based on the offset and the current driver pointer.
[0008] Optionally, before listening to scrolling operations in the graphics rendering pipeline, the following also applies: Construct a controller collection container to store component controllers that are to be responded to and linked; the maximum number of objects in the controller collection container is the maximum number of rows displayed on a single screen.
[0009] Optional, also includes: The global state manager is created by calling the state container object. The global state manager is used to maintain the lateral offset and the current driver pointer.
[0010] Optionally, monitoring scrolling operations in the graphics rendering pipeline includes: When the physical pixels of a sub-item component enter the visible area of the screen and are visible, it is determined to be in a geometrically ready state; in the geometrically ready state, the geometric attributes of the visible object are cached; wherein, the scrolling operation can be performed when the sub-item component is in the geometrically ready state; When the sub-item component moves out of the visible area of the screen, the corresponding component controller is removed from the dynamic linkage pool.
[0011] Optionally, performing the scrolling operation based on the offset and the current driver pointer includes: Iterate through the component controllers in the dynamic linkage pool and compare the memory address references of the components to which each component controller belongs; If the memory address reference of a component is the same as the reference address corresponding to the current driver pointer, skip the component; If the memory address reference of a component is different from the reference address corresponding to the current driver pointer, a scroll instruction is broadcast to the component to which the component controller belongs; the scroll instruction is used to guide the synchronous scrolling operation between components.
[0012] Optionally, before adding the component controller corresponding to the sub-item component to the dynamic linkage pool, the method further includes: Perform a scroll position correction operation to obtain position correction data; the position correction data is used to eliminate residual data from component reuse.
[0013] This application also provides a list component state synchronization system, including: The state monitoring module is used to monitor the scrolling operation of the graphics rendering pipeline. Before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, it obtains the offset corresponding to the scrolling operation from the global state manager; registers the component controller corresponding to the sub-item component; adds the component controller corresponding to the sub-item component to the dynamic linkage pool; and receives broadcast notifications. The operation recording module is used to call the global state manager to add a current driver pointer to the sub-item component when an operation instruction broadcast is received; the current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; The state synchronization module is used to perform a scrolling operation based on the offset and the current driver pointer.
[0014] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0015] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when it invokes the computer program in the memory.
[0016] This application also provides a computer program product, including a computer program that, when executed, implements the steps of the method described above.
[0017] This application provides a method for synchronizing the state of a list component, comprising: when a scrolling operation of the graphics rendering pipeline is detected, before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, obtaining the offset corresponding to the scrolling operation from the global state manager; registering the component controller corresponding to the sub-item component, adding the component controller corresponding to the sub-item component to the dynamic linkage pool, and receiving a broadcast notification; when an operation instruction broadcast is received, calling the global state manager to add a current driver pointer to the sub-item component; the current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; and performing the scrolling operation according to the offset and the current driver pointer.
[0018] The list component state synchronization method provided in this application, upon detecting scrolling operations in the graphics rendering pipeline, prioritizes obtaining the scroll offset from the global state manager before the corresponding sub-item component is marked as visible and added to the dynamic linkage pool. Then, it registers the component controller and includes it in the dynamic linkage pool to receive broadcast notifications. This avoids the problem of inconsistent rendering timing and data binding timing during high-speed scrolling reuse of traditional virtual lists. It ensures that all sub-items in a multi-column list complete data binding and page rendering based on a globally unified offset at the same moment, effectively eliminating column misalignment caused by timing differences and ensuring real-time visual alignment of list data. Furthermore, this application only registers controllers for visible sub-item components and adds them to the dynamic linkage pool to participate in broadcast responses and linkage calculations. It abandons the traditional approach of involving all data items in the linkage, optimizing the linkage calculation from a linear correlation with the total data volume to a constant level related only to the number of visible rows on the screen. This significantly reduces computational overhead in large-scale data scenarios, effectively overcomes performance bottlenecks, and significantly improves the smoothness of list scrolling. Furthermore, upon receiving an operation instruction broadcast, this application adds a current driver pointer to the child component through a global state manager, accurately marking the component instance that actively triggers the scrolling operation. Subsequently, the scrolling operation is executed by combining the offset and the driver pointer. The event source is identified and filtered by the driver pointer. Without setting an additional state lock, the event loop and cyclic triggering problem in multi-directional linkage scenarios can be blocked, simplifying the state management logic, avoiding deadlock risks, ensuring the stability and reliability of the multi-component linkage interaction process, and comprehensively optimizing the user experience of the virtual list in complex business scenarios such as high-speed scrolling, massive data, and multi-directional linkage.
[0019] This application also provides a list component state synchronization system, a computer-readable storage medium, an electronic device, and a computer program product, which have the above-mentioned beneficial effects, and will not be elaborated here. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0021] Figure 1 A flowchart illustrating a list component state synchronization method provided in this application embodiment; Figure 2 A global flowchart provided for embodiments of this application; Figure 3 This is a schematic diagram of a list component state synchronization system provided in an embodiment of this application; Figure 4This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] See Figure 1 , Figure 1 A flowchart of a list component state synchronization method provided in this application embodiment, the method including: S101: When a scrolling operation of the graphics rendering pipeline is detected, before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, obtain the offset corresponding to the scrolling operation from the global state manager; register the component controller corresponding to the sub-item component, add the component controller corresponding to the sub-item component to the dynamic linkage pool, and receive a broadcast notification. S102: When an operation instruction broadcast is received, the global state manager is invoked to add a current driver pointer to the sub-item component; the current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; S103: Perform a scrolling operation based on the offset and the current driver pointer.
[0024] In step S101, the trigger condition for this step is real-time monitoring of scrolling operations in the graphics rendering pipeline. In the graphics rendering pipeline, scrolling operations are not pixel sliding on the user interface, but rather refer to instructions for offsetting texture coordinates or horizontal displacement of scene layers in the graphics rendering process.
[0025] This monitoring can be achieved by injecting a scroll event listener, which intercepts the scroll displacement signals transmitted by the rendering pipeline as it processes each frame. Alternatively, the rendering engine callback interface can be used to capture the horizontal translation parameters related to the viewport transformation matrix during the command buffer parsing phase at the graphics driver level. Furthermore, the monitoring process can also map user interaction events from the touchpad, mouse wheel, or stylus into scroll commands within the rendering pipeline.
[0026] In one feasible implementation, a geometrically ready state is determined when the physical pixels of a child component enter the visible area of the screen and are visible. In this geometrically ready state, the geometric attributes of the visible object are cached. It is important to note that at this point, the layout calculation of the child component has been completed, and its coordinates, width, height, and other geometric attributes have been determined, allowing for safe execution of scroll positioning operations. Therefore, scrolling operations can only be performed when the child component is in the geometrically ready state.
[0027] After receiving the scroll operation signal, before the corresponding child component is marked as visible and added to the dynamic interaction pool, the horizontal offset bound to the scroll operation is actively read from the global state manager. The visible state mark indicates that the child component needs to be in the visible interface to be displayed to the user.
[0028] The dynamic linkage pool stores the component controllers within the currently visible screen area that need to participate in linkage. It is a data collection used to manage components with linkage scrolling relationships. It can be a linear list, hash set, or indexed array, and internally maintains references or identifiers of component controllers whose scrolling states need to be synchronized. In one feasible implementation, a controller collection container can be pre-built to store the component controllers to be linked, and the maximum number of objects in the controller collection container is the maximum number of rows displayed on a single screen. A collection data structure (such as an array or hash table) is created for dynamically storing and removing controller instances. The number of objects in the dynamic linkage pool usually does not exceed the number of rows that can be displayed on a single screen (usually less than 20), regardless of the total amount of data.
[0029] Furthermore, the global state manager can be created by calling a state container object. The global state manager is used to maintain the lateral offset and the current driver pointer. In the specific application scenario of this application, the global state manager can be a centralized key-value storage structure, using the scroll context identifier or scene node path as the key and the lateral offset as the value. The source of the value can be the residual scroll momentum of the previous scroll operation or the target displacement of the active operation.
[0030] In step S101, it is also necessary to obtain the horizontal offset from the global state manager, which occurs in the pre-stage before the child component is finally marked and added to the dynamic linkage pool.
[0031] Subsequently, the registration operation of the component controller corresponding to the sub-component is performed, and it is added to the dynamic linkage pool. The component controller is an independent module used to encapsulate the coordinate system transformation logic and boundary constraints of the sub-component itself. The registration process means establishing a two-way communication channel between the component controller and the global state manager or dynamic linkage pool. The registration process can dynamically create controller instances and write their unique identifiers into the registry of the dynamic linkage pool. When adding the component controller to the dynamic linkage pool, reference counting can be used to ensure that the controller is not added repeatedly in the pool. At the same time, the component controller begins to receive broadcast notifications, which refer to signals from the driving source component when it initiates a scroll operation. The broadcast reception method can be bound to a callback function in the listener pattern to ensure that the component controller can detect the event trigger in a timely manner.
[0032] In one feasible implementation, a scroll position correction operation can be performed before adding the component controller to the dynamic linkage pool to obtain position correction data. This position correction data is used to eliminate residual data from component reuse, enabling geometrically forced alignment and ensuring that list items enter the visible area of the screen in the correct position. The scroll position correction operation occurs before the user can clearly see the list items, typically at the instant the list items enter the edge of the screen.
[0033] This step strictly limits the order of reading the horizontal offset and constructing the dynamic linkage pool. When a scrolling operation occurs, the offset is determined in a timely manner, and all other component controllers in the dynamic linkage pool participate in the calculation based on this stable offset benchmark. This avoids cascading position errors caused by the offset being tampered with midway due to concurrent operations. In addition, by registering component controllers and adding them to the dynamic linkage pool, once a broadcast is issued, the component controllers can respond immediately, reducing the first-frame response delay caused by dynamic creation or delayed binding. This significantly improves the immediacy and smoothness of linked scrolling, enabling a large number of sub-item components in the graphics rendering pipeline to scroll synchronously. Each component controller independently manages its corresponding list items, achieving synchronous coordination through unified offsets and event broadcasts.
[0034] It is easy to understand that when a child component moves out of the visible area of the screen, the corresponding component controller is removed from the dynamic linkage pool. This ensures that the number of objects in the dynamic linkage pool remains at a relatively stable constant level.
[0035] It should be noted that in this application, the graphics rendering pipeline is an internal monitoring system that is not visible to the user, while the sub-item components contain user-visible data. Each component controller corresponds to a row or column of data in the list, and the offset during scrolling is mostly a horizontal offset.
[0036] Step S102 builds upon the completion of component controller registration and broadcast listening in step S101. This step is triggered when a component controller in the dynamic linkage pool receives an operation command broadcast. The publisher of the operation command broadcast can be any component instance with scrolling capabilities, and its publication can be accomplished through event bus, global message queue, etc. The broadcast content is not limited here; it can include a scrolling operation type identifier, and may also carry data such as the device information of the driving source, gesture speed, and scrolling direction.
[0037] It's important to note that a component instance can represent a child component that doesn't yet contain data. VirtualList is a common list optimization technique that renders only data items within the visible screen area. As scrolling occurs, it dynamically recycles off-screen components, reusing or creating new ones, significantly reducing memory usage and initial screen rendering time. This process involves component reuse; list item components are not destroyed after being moved off-screen but are recycled into a pool. When new data arrives, the recycled component instance is directly applied and rebound, avoiding frequent creation and destruction of list item components.
[0038] Upon receiving a broadcast, the global state manager is invoked to add a current driver pointer to the child component. Internally, the global state manager maintains a thread-safe mapping table recording the current driver source followed by each child component. The current driver pointer is used to reference the component instance; it can be a raw pointer, a smart pointer, or a unique identifier. When multiple components initiate scrolling operations simultaneously or sequentially, it clearly indicates which driver source's offset the child component should currently respond to.
[0039] The current driver pointer marking mechanism enables the interaction behavior of child components to have context awareness. Unlike the indiscriminate application of a globally unique horizontal offset, each child component can independently follow a different driving source through its own driver pointer. This means that multiple scrolling groups can exist simultaneously in the same graphical interface, each driven by a different active component, without interfering with each other. This design greatly enhances the graphics rendering pipeline's ability to handle complex interactive scenarios. For example, in multi-view layouts or nested scrolling areas, child components in different areas can correctly follow horizontal scrolling without interfering with each other.
[0040] In step S103, after obtaining the lateral offset in step S101 and determining the driver pointer in step S102, the final scrolling operation is performed.
[0041] Before executing a scrolling operation, a validation of the current driver pointer can be performed. The component controller of the child component checks whether the current driver pointer, stored internally or obtained through the global state manager, is valid. For example, it checks whether the pointer is not null, whether the component instance it points to has not been destroyed, and whether the component instance is still in an active scrolling-driven state. If the validation fails, the component controller can adopt a safe rollback strategy, such as maintaining the component's current position, slowly decaying to the default position, or issuing an error report without performing any position update, to ensure the stability of the list interface display.
[0042] Offsets can be applied directly. For example, for horizontal offsets, they can be directly assigned. That is, the component controller will directly assign the horizontal offset obtained from the global state manager to the horizontal position property of the child component, which will ultimately be reflected in the model transformation matrix or the unified variable of the vertex shader in the graphics rendering pipeline.
[0043] During execution, the offset can also be clamped in conjunction with the boundary constraints of the child components. The controller can read the component's configuration metadata to obtain its minimum or maximum allowable displacement value. The offset is processed by a clamping function before application to ensure that the child components do not scroll out of the preset visible area.
[0044] The scrolling operation is applied based on the current driver pointer. In the implementation, the component controller queries the real-time state of the driving source component through the driver pointer, such as whether the scrolling direction of the driving source is locked to horizontal only, and whether the current animation speed of the driving source is zero. The final execution of the scrolling operation requires writing the calculated position value into the graphics rendering pipeline.
[0045] In the specific application scenario of this application, this step can be performed in the following manner: The first step is to traverse the component controllers in the dynamic linkage pool and compare the memory address references of the components to which each component controller belongs; The second step is to skip the component if the memory address reference of the component is the same as the reference address corresponding to the current driver pointer. Third, if the memory address reference of a component is different from the reference address corresponding to the current driver pointer, a scroll instruction is broadcast to the component to which the component controller belongs; the scroll instruction is used to guide the synchronous scrolling operation between components.
[0046] When any component (header or list item) begins scrolling, a pointer to the current driver is added to the corresponding child component. When a scroll offset update is triggered, the component controllers in the dynamic cascading pool are traversed, and the memory address references of the components to which each component controller belongs are compared.
[0047] If the target object matches the reference of the driving source, the notification is skipped (i.e., no instruction is sent to itself), and only other subordinate components are driven. This approach leverages the uniqueness of object references for identification, eliminating the need to maintain additional flag variables or ID mapping tables, and achieving constant-time loop blocking.
[0048] This step aims to achieve high-fidelity, high-performance interactive scrolling. Based on a clear mapping between offsets and the driver pointer, and by ensuring all linked sub-components move in a coordinated manner with consistent direction, speed, and smoothness, real-time scrolling synchronization of the list is achieved.
[0049] The list component state synchronization method provided in this application, upon detecting scrolling operations in the graphics rendering pipeline, prioritizes obtaining the scroll offset from the global state manager before the corresponding sub-item component is marked as visible and added to the dynamic linkage pool. Then, it registers the component controller and includes it in the dynamic linkage pool to receive broadcast notifications. This avoids the problem of inconsistent rendering timing and data binding timing during high-speed scrolling reuse of traditional virtual lists. It ensures that all sub-items in a multi-column list complete data binding and page rendering based on a globally unified offset at the same moment, effectively eliminating column misalignment caused by timing differences and ensuring real-time visual alignment of list data. Furthermore, this application only registers controllers for visible sub-item components and adds them to the dynamic linkage pool to participate in broadcast responses and linkage calculations. It abandons the traditional approach of involving all data items in the linkage, optimizing the linkage calculation from a linear correlation with the total data volume to a constant level related only to the number of visible rows on the screen. This significantly reduces computational overhead in large-scale data scenarios, effectively overcomes performance bottlenecks, and significantly improves the smoothness of list scrolling. Furthermore, upon receiving an operation instruction broadcast, this application adds a current driver pointer to the child component through a global state manager, accurately marking the component instance that actively triggers the scrolling operation. Subsequently, the scrolling operation is executed by combining the offset and the driver pointer. The event source is identified and filtered by the driver pointer. Without setting an additional state lock, the event loop and cyclic triggering problem in multi-directional linkage scenarios can be blocked, simplifying the state management logic, avoiding deadlock risks, ensuring the stability and reliability of the multi-component linkage interaction process, and comprehensively optimizing the user experience of the virtual list in complex business scenarios such as high-speed scrolling, massive data, and multi-directional linkage.
[0050] See Figure 2 , Figure 2 The global flowchart provided in this application embodiment shows that when the user scrolls the list and a new row is about to appear, the first component enters the viewport; the child component triggers the visibility change callback (visible), obtains the current global offset from the global state manager, returns the current offset value, and then performs a scroll positioning operation. Before joining the dynamic linkage pool, it is forcibly aligned, and then its own controller instance is registered, and the registration is successful.
[0051] When entering the second stage of the linkage broadcast, the user slides their finger horizontally across a row. The reused sub-component marks itself as the current driver, updates the offset in the global state manager, and traverses all registered controllers in the dynamic linkage pool. For each selected component controller, if it is the driver itself, a scroll positioning instruction is sent; if it is another component controller that can handle events, it is skipped to prevent infinite loops.
[0052] The following describes the list component state synchronization method provided in this application using an exemplary application scenario: Initialization Phase: The application starts and loads the initial screen data. An empty set of controllers and a global horizontal offset record (initially 0) are created globally. The component instances corresponding to the first 10 rows of data are created and rendered on the screen. Each component registers its own scroll controller to the dynamic interaction pool when it enters the visible area.
[0053] Scrolling interaction phase: The user presses and holds their finger on the header and slides it to the left. The header's scrolling event is triggered, adding a current driver pointer to the header component to mark it as the current driver. The horizontal offset changes generated by the header are updated in real-time to the global horizontal offset record in the global state manager. The system traverses the controller set in the dynamic linkage pool, finding several visible list items on the screen, and drives these list items to scroll synchronously to the left with the header. Since the header itself is marked as the driver, it is skipped during broadcasting to avoid duplicate triggering.
[0054] Virtual reuse and correction phase: The user begins to scroll down the list quickly, and the data in row 11 (which was originally invisible) is about to enter the bottom of the screen. At this time, the component instance of row 1 is recycled and bound to the data of row 11. At the same time, the scroll container inside the component instance retains the state of row 1.
[0055] When the pixels of the component in row 11 actually appear at the edge of the viewport, the rendering visibility callback is triggered, and the component becomes visible. The component immediately reads the current global horizontal offset record (let's say 50px) and immediately performs a scroll positioning operation to 50px. This operation occurs before the component is clearly visible to the user, and the time window is typically within a few milliseconds. After the offset correction is complete, the component adds its own component controller to the dynamic cascading pool and begins responding to subsequent cascading broadcasts.
[0056] Cleanup Phase: The previously visible first-row components are completely moved off the top of the screen. A rendering visibility callback is triggered, and the status becomes invisible. The system removes the component controller of the first-row components from the dynamic link pool and stops sending synchronization commands to it, saving resources. The component instance of the first-row components is recycled back to the pool, awaiting reuse.
[0057] See Figure 3 , Figure 3This application provides a schematic diagram of a list component state synchronization system architecture, which includes: The state monitoring module is used to monitor the scrolling operation of the graphics rendering pipeline. Before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, it obtains the offset corresponding to the scrolling operation from the global state manager; registers the component controller corresponding to the sub-item component; adds the component controller corresponding to the sub-item component to the dynamic linkage pool; and receives broadcast notifications. The operation recording module is used to call the global state manager to add a current driver pointer to the sub-item component when an operation instruction broadcast is received; the current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; The state synchronization module is used to perform a scrolling operation based on the offset and the current driver pointer.
[0058] Based on the above embodiments, as a preferred embodiment, it further includes: The linkage pool creation module is used to construct a controller collection container to store component controllers that are to be linked. The maximum number of objects in the controller collection container is the maximum number of rows displayed on a single screen.
[0059] Based on the above embodiments, as a preferred embodiment, it further includes: The Global Manager module is used to call the State Container object to create the Global State Manager, which is used to maintain the horizontal offset and the current driver pointer.
[0060] Based on the above embodiments, as a preferred embodiment, it further includes: A scrolling correction unit is used to perform a scrolling position correction operation to obtain position correction data; the position correction data is used to eliminate residual data from component reuse.
[0061] This application also provides an embodiment of a computer-readable storage medium and a computer program product. Both the computer-readable storage medium and the computer program product may store a computer program that, when executed by a processor, implements the steps of the method described in the above method embodiments.
[0062] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] The computer-readable storage medium provided in this embodiment includes the method mentioned above, and has the same effect.
[0064] This application also provides an electronic device, see [link to document]. Figure 4 The present application provides a structural diagram of an electronic device, such as... Figure 4 As shown, it may include a processor 1410 and a memory 1420.
[0065] The processor 1410 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 1410 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 1410 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0066] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 1420 is used to store at least the following computer program 1421, which, after being loaded and executed by the processor 1410, is capable of implementing the relevant steps in the methods executed by the electronic device side as disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. The operating system 1422 may include Windows, Linux, Android, etc.
[0067] In some embodiments, the electronic device may further include a display screen 1430, an input / output interface 1440, a communication interface 1450, a sensor 1460, a power supply 1470, and a communication bus 1480.
[0068] certainly, Figure 4 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of this application. In practical applications, the electronic device may include more than [other components]. Figure 4 More or fewer components as shown, or combinations of certain components.
[0069] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. As the system provided in the embodiments corresponds to the method provided in the embodiments, the description is relatively simple; relevant parts can be found in the method section.
[0070] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
[0071] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for synchronizing the state of a list component, characterized in that, include: When a scrolling operation of the graphics rendering pipeline is detected, before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, the offset corresponding to the scrolling operation is obtained from the global state manager; the component controller corresponding to the sub-item component is registered, and the component controller corresponding to the sub-item component is added to the dynamic linkage pool, and a broadcast notification is received. Upon receiving an operation instruction broadcast, the global state manager is invoked to add a current driver pointer to the sub-item component; The current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; Perform a scrolling operation based on the offset and the current driver pointer.
2. The method according to claim 1, characterized in that, Before monitoring scrolling operations in the graphics rendering pipeline, the following is also included: Construct a controller collection container to store component controllers that are to be responded to and linked; the maximum number of objects in the controller collection container is the maximum number of rows displayed on a single screen.
3. The method according to claim 1, characterized in that, Also includes: The global state manager is created by calling the state container object. The global state manager is used to maintain the lateral offset and the current driver pointer.
4. The method according to claim 1, characterized in that, Monitoring scrolling operations in the graphics rendering pipeline includes: When the physical pixels of a sub-item component enter the visible area of the screen and are visible, it is determined to be in a geometrically ready state; in the geometrically ready state, the geometric attributes of the visible object are cached; wherein, the scrolling operation can be performed when the sub-item component is in the geometrically ready state; When the sub-item component moves out of the visible area of the screen, the corresponding component controller is removed from the dynamic linkage pool.
5. The method according to claim 1, characterized in that, The scrolling operation based on the offset and the current driver pointer includes: Iterate through the component controllers in the dynamic linkage pool and compare the memory address references of the components to which each component controller belongs; If the memory address reference of a component is the same as the reference address corresponding to the current driver pointer, skip the component; If the memory address reference of a component is different from the reference address corresponding to the current driver pointer, a scroll instruction is broadcast to the component to which the component controller belongs; the scroll instruction is used to guide the synchronous scrolling operation between components.
6. The method according to claim 1, characterized in that, Before adding the component controller corresponding to the sub-item component to the dynamic linkage pool, the process also includes: Perform a scroll position correction operation to obtain position correction data; the position correction data is used to eliminate residual data from component reuse.
7. A list component state synchronization system, characterized in that, include: The state monitoring module is used to monitor the scrolling operation of the graphics rendering pipeline. Before the sub-item component corresponding to the scrolling operation is marked as visible and added to the dynamic linkage pool, it obtains the offset corresponding to the scrolling operation from the global state manager; registers the component controller corresponding to the sub-item component; adds the component controller corresponding to the sub-item component to the dynamic linkage pool; and receives broadcast notifications. The operation log module is used to call the global state manager to add a current driver pointer to the sub-item component when an operation instruction broadcast is received; The current driver pointer is used to mark the component instance that currently actively triggers the scrolling operation; The state synchronization module is used to perform a scrolling operation based on the offset and the current driver pointer.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the steps of the method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program, which, when executed, implements the steps of the method as described in any one of claims 1 to 6.