Methods for data binding and event handling of multi-level cascading components in controls
By introducing a path frequency storage area and a prefetch cache area into multi-level linked controls, the problem of sluggish interactive response of multi-level linked controls is solved, achieving efficient data binding and event handling, and improving response speed and data binding accuracy.
Patent Information
- Application Number
- CN202611319343.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-17
AI Technical Summary
Multi-level cascading controls require users to wait for data requests to be returned level by level after selecting the initial value, resulting in delayed interactive response. This is especially true as the number of control levels increases, leading to reduced responsiveness and the inability to reuse historical path data.
By introducing a path frequency storage area and a prefetch cache, a prefetch data request is initiated immediately after the primary value change event. The path frequency storage area and the prefetch cache are used to extract candidate predicted paths for data prefetching, reducing the waiting time at each level.
It improves the interactive responsiveness of multi-level linked controls, directly hits the cache for frequently repeated paths, reduces the cumulative latency of asynchronous waiting at each level, and ensures the efficiency and accuracy of the data binding process.
Smart Images

Figure CN123115485A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of front-end control technology, and specifically to a method for data binding and event handling of multi-level linked components in controls. Background Technology
[0002] In business systems, multi-level linked controls are widely used in scenarios such as province, city, and district address selection, and product category selection. When the value of the parent control changes, the system sends a data binding request to the current level's data source. After the data is returned, the current level's control is activated, and each level is processed sequentially.
[0003] In existing technologies, the data binding layer of multi-level linked controls does not save the user's historical path selection information, and each operation waits for asynchronous data to return level by level in a serial event processing manner.
[0004] The above method causes the cumulative waiting time to increase with the number of control levels. When the user repeatedly operates along the same path, the existing historical path data cannot be reused, which reduces the interactive responsiveness of multi-level linked controls. Summary of the Invention
[0005] This invention provides a method for data binding and event handling of multi-level linked components in controls, which solves the technical problem in related technologies that multi-level linked controls need to wait for data requests to be returned level by level after the user selects the first value, resulting in delayed interactive response.
[0006] This invention discloses a method for data binding and event handling of multi-level linked components in a control, comprising the following steps: Obtain the hierarchical configuration data of the multi-level linkage control, and allocate a persistent path frequency storage area for the control instance. The path frequency storage area is indexed by the path key value string, and each record contains a cumulative count field and a recent trigger timestamp field. When the user completes the full linkage selection operation, the selected values of each level of control are concatenated into a path key-value string in hierarchical order, the cumulative count field corresponding to the key-value is incremented and written, and the most recently triggered timestamp is updated. When the primary control receives a value change event, it retrieves historical path records from the path frequency storage area using the currently selected value of the primary control as a prefix, and sorts each matching record by its score. Sort, before extraction 10 records are used as candidate prediction paths, of which For the cumulative count field value, The difference between the current time and the most recently triggered timestamp. This is the decay rate parameter; Extract historical selected values from the candidate prediction path with the highest score level by level, send a prefetch data request to the corresponding level data binding source, and write the selected value of the upstream control above the returned option dataset into the prefetch cache of the corresponding level control with the cache key. When the data binding process is triggered, the current selected value of the upstream control is used as the key to retrieve the prefetch cache. If a match is found, the cached data is read directly to activate the control. If a miss occurs, clear the prefetch cache of that level and its downstream levels, initiate a real-time request according to the standard process, and re-execute the prefix retrieval, sorting, and prefetching operations with the actual selected value as the new prefix.
[0007] Furthermore, the step of initiating a prefetch data request to the corresponding level data binding source includes: extracting the second-level historical selected value from the candidate prediction path with the highest score, and initiating a prefetch data request to the second-level data binding source; determining the ranking score of the candidate path with the highest score. Does it exceed the preset threshold? If yes, continue along the path to extract the historical selected values of the third level and subsequent levels in sequence and initiate prefetch data requests level by level; otherwise, the prefetch request is only initiated up to the second level.
[0008] Furthermore, it also includes: periodically removing path records whose most recent trigger timestamp is earlier than a preset validity period threshold from the path frequency storage area; and performing a decay update on the cumulative count field of the remaining path records in the storage area, with the update formula being... ,in This is the cumulative count field value before decay. The preset counting attenuation coefficient and , This is the value of the count field written to the storage area after decay.
[0009] Furthermore, the periodic removal and decay updates are executed asynchronously in the background at fixed time intervals, without blocking the data binding event processing flow.
[0010] This invention discloses a data binding and event handling system for multi-level linked components in a control, comprising: The storage area management module is used to obtain the hierarchical configuration data of multi-level linked controls, allocate persistent path frequency storage areas for control instances, and concatenate the selected values at each level into a path key-value string when the user completes a complete linked selection operation, and perform cumulative count accumulation and timestamp update. The path prediction module is used to retrieve the path frequency storage area with the currently selected value of the primary control as a prefix when the primary control receives a value change event, based on... Calculate the ranking score for each matching record and extract the top-ranked records. Candidate prediction paths; The prefetching execution module is used to extract historical selected values from the candidate prediction path with the highest score level by level, send a prefetching data request to the corresponding data binding source, and write the upstream selected value of the returned option dataset as the cache key into the prefetching cache area of the corresponding level control. The cache scheduling module is used to retrieve the prefetch cache using the current selected value of the upstream control as the key when the data binding process is triggered. If a hit occurs, the cached data is read directly to activate the control. If a hit occurs, the cache of this level and downstream levels is cleared and a real-time request is initiated according to the standard process. At the same time, the path prediction module and the prefetch execution module are triggered to re-execute prediction and prefetching with the actual selected value as the new prefix. The storage area cleanup module is used to periodically remove expired path records whose most recently triggered timestamp is earlier than the expiration threshold, and to perform a decay coefficient multiplication on the cumulative count field of the remaining records before writing them.
[0011] Furthermore, the prefetching execution module is also used to determine the ranking score of the candidate path with the highest score. Does it exceed the preset threshold? If yes, continue along this path to initiate prefetch data requests to the third level and subsequent data binding sources; otherwise, prefetch requests are only initiated to the second level.
[0012] Furthermore, the storage area cleanup module performs cleanup and decay update operations asynchronously in the background at fixed time intervals, without blocking the data binding event processing flow.
[0013] The beneficial effects of this invention are as follows: This invention solves the technical problem of low interactive responsiveness caused by multi-level cumulative waiting in the serial event processing method by introducing a path frequency storage area and a prefetch cache into the data binding event handling process of multi-level linked controls. A prefetch data request is initiated immediately after the first-level value change event is triggered, allowing the prefetching process to run in parallel with the user's operation time in the upstream control. Data binding of high-frequency repetitive paths can directly hit the prefetch cache without waiting for real-time request returns, achieving the technical effect of reducing the cumulative delay of asynchronous waiting in multi-level linked operations. The time decay factor and periodic decay update maintain a high ranking weight for recent high-frequency paths, and the removal of expired path records no longer affects the accuracy of subsequent predictions, achieving the technical effect of dynamically updating the prefetch prediction results with usage time. Attached Figure Description
[0014] Figure 1 This is a flowchart of data binding and event handling for multi-level linked components in a control, provided by an embodiment of the present invention. Detailed Implementation
[0015] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0016] At least one embodiment of the present invention discloses a method for data binding and event handling of multi-level linked components in a control, see [link to relevant documentation]. Figure 1 This includes the following steps: Step 1: Obtain control hierarchy configuration data and establish a path frequency storage area.
[0017] Retrieve the hierarchical configuration data of the multi-level cascading control, including the number of control levels, the data binding source address of each level, and the level identifier sequence. Allocate a persistent path frequency storage area for the control instance. This storage area is indexed by the path key-value string, and each record contains a cumulative count field and a most recent trigger timestamp field.
[0018] When a user completes a full linked selection operation from the first level to the last level, the currently selected values of each level of control are concatenated into a path key-value string in hierarchical order. The cumulative count field corresponding to the key-value is incremented and written in the path frequency storage area, and the most recent trigger timestamp of the path record is updated to the current time.
[0019] Step 2: When the primary value change event is triggered, perform prefix retrieval and weight sorting to generate candidate prediction paths.
[0020] When the primary control receives a value change event, it retrieves all historical path records matching the current selected value in the path frequency storage area, using the current selected value as a prefix.
[0021] Calculate a ranking score for each path record in the search results. The ranking score combines the cumulative count field and the time decay factor, assuming the cumulative count of path records is [value missing]. The time difference between the current time and the most recently triggered timestamp is The attenuation coefficient is The sorting score is: ; in, This is the cumulative count field value recorded in the storage area for this path. The difference between the current time and the most recently triggered timestamp of the record for this path. The preset decay rate parameter, This represents an exponential function.
[0022] Press all matching records Sort the values from highest to lowest and extract the top-scoring values. 10 path records are used as candidate predicted paths, among which This is the preset upper limit for the number of candidate paths.
[0023] Step 3: Initiate prefetch data requests level by level along the candidate prediction path and write the datasets of each level of options into the prefetch cache.
[0024] Extract the historical selected value of the second level from the candidate prediction path with the highest score, and use this value as a parameter to initiate a prefetch data request to the second-level data binding source to obtain the second-level option dataset.
[0025] If the ranking score of the candidate path with the highest score is... Exceeding the preset threshold Continuing along this path, the historical selected values for the third level and subsequent levels are extracted sequentially, and prefetch data requests are initiated to the corresponding data binding source at each level. The obtained option datasets for each level are written into the prefetch cache associated with the control binding delegate of the corresponding level, with each cached record in the prefetch cache using the selected value of the upstream control as the cache key.
[0026] It should be noted that the above confidence thresholds Yes The lower bound parameter is used to distinguish between high-frequency stable paths and low-frequency intermittent paths. When the highest score candidate path... Value lower than At this time, the prefetch request is only initiated up to the second level and does not continue to extend to deeper levels, in order to avoid invalid prefetch requests generated by low-confidence paths.
[0027] Step 4: When the data binding process is triggered, the prefetch cache is hit first. If the cache is not hit, a real-time request and cache clearing are performed.
[0028] When a user action triggers the data binding process of a certain level of control, the currently selected value of the upstream control is used as the key, and the prefetch cache of the binding delegate of that level of control is retrieved.
[0029] If a matching option dataset exists in the prefetch cache, the dataset is read directly from the prefetch cache, and the data writing and control activation operations are performed, skipping the network data request.
[0030] If the prefetch cache does not contain a dataset that matches the currently selected value of the upstream control, clear the prefetch cache contents of this level and all downstream level controls, initiate a real-time request to the data source according to the standard data binding process, obtain the current level option dataset, and then perform data writing and control activation operations.
[0031] Step 5: If a cache miss occurs, re-execute prediction and prefetching with the actual selected value as the new prefix.
[0032] For data that has passed the cache miss processing in step 4, step 5 can be performed. Step 5 may specifically include: Using the current selected value generated by the user's actual operation as the new prefix, the prefix retrieval and sorting score calculation in step 2 are re-executed in the path frequency storage area. Based on the updated prefix matching results, the prediction paths for subsequent levels are re-determined. For each level of control involved in the new prediction path, a prefetch data request is initiated level by level, and the returned option dataset is written to the prefetch cache of the corresponding level control's bound proxy, with the selected value of the upstream control as the cache key.
[0033] Step 6: Periodically clean up the path frequency storage area and perform cumulative count decay update.
[0034] Periodically perform cleanup on the path frequency storage area. Mark path records whose most recent trigger timestamp is earlier than a preset validity period threshold as expired and remove them from the storage area.
[0035] Perform a decay update write on the cumulative count field of the remaining path records in the storage area, with a designed decay coefficient of . ( Then, the cumulative count field for each remaining record will be updated as follows: ; in, This is the cumulative count field value before decay. The preset counting attenuation coefficient, This is the count field value written to the storage area after decay. After decay update, the recently triggered path records are used in the subsequent prefix search sorting score calculation. Records with values higher than the same count but with trigger times further away.
[0036] In this embodiment of the application, in order to avoid the continuous expansion of the storage area size as the business operation affects the prefix retrieval performance, the cleanup and decay update operation in step 6 is executed asynchronously in the background at fixed time intervals, without blocking the data binding event processing flow triggered by user operation.
[0037] On the other hand, the present invention also proposes a data binding and event handling system for multi-level linked components in a control, comprising: The storage area management module is used to obtain the hierarchical configuration data of multi-level linked controls, allocate persistent path frequency storage areas for control instances, and concatenate the selected values at each level into a path key-value string when the user completes a complete linked selection operation, and perform cumulative count accumulation and timestamp update. The path prediction module is used to retrieve the path frequency storage area with the currently selected value of the primary control as a prefix when the primary control receives a value change event. It then calculates a sorting score based on the cumulative count and time decay factor, and extracts the previous path frequency. Candidate prediction paths; The prefetching execution module is used to extract historical selected values at all levels from the candidate prediction path with the highest score, initiate prefetching data requests to the corresponding data binding source level by level, and write the upstream selected values of the returned option dataset as cache keys into the prefetching cache area of the corresponding level control binding agent. The cache scheduling module is used to retrieve the prefetch cache using the current selected value of the upstream control as the key when the data binding process is triggered. If a hit occurs, the cached data is read directly to activate the control. If a hit occurs, the cache of this level and downstream levels is cleared and a real-time request is initiated according to the standard process. At the same time, the path prediction module and the prefetch execution module are triggered to re-execute prediction and prefetching with the actual selected value as the new prefix. The storage area cleanup module is used to periodically remove expired path records whose most recently triggered timestamp is earlier than the expiration threshold, and to perform a decay coefficient multiplication on the cumulative count field of the remaining records before writing them.
[0038] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.
[0039] This invention introduces a path frequency storage layer and a prefetch cache layer into the data binding event handling process of multi-level linked controls. After the first-level control value change event is triggered, prefix retrieval and ranking score calculation immediately extract candidate predicted paths, eliminating the need to wait for user operations on each level of control. Prefetch data requests and user operations on upstream controls are performed in parallel. Candidate predicted paths with high-frequency, repetitive operation paths have high ranking scores, and prefetch requests are prioritized along these paths. This ensures that when the user triggers data binding for downstream controls, the prefetch cache is directly hit, eliminating the accumulated delay of waiting for asynchronous data returns at each level in serial event handling. The cache clearing and re-prediction steps when a cache miss occurs ensure that controls can still complete accurate data binding based on real-time request data even on low-frequency or first-time operation paths. Time decay factors and periodic decay updates maintain high weight in the ranking scores for recently high-frequency paths, and the removal of expired path records prevents interference with the accuracy of subsequent prefetch predictions.
[0040] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A method for data binding and event handling of multi-level linked components in a control, characterized in that, Includes the following steps: Obtain the hierarchical configuration data of the multi-level linkage control, and allocate a persistent path frequency storage area for the control instance. The path frequency storage area is indexed by the path key value string, and each record contains a cumulative count field and a recent trigger timestamp field. When the user completes the full linkage selection operation, the selected values of each level of control are concatenated into a path key-value string in hierarchical order, the cumulative count field corresponding to the key-value is incremented and written, and the most recently triggered timestamp is updated. When the primary control receives a value change event, it retrieves historical path records from the path frequency storage area using the currently selected value of the primary control as a prefix, and sorts each matching record by its score. Sort, before extraction 10 records are used as candidate prediction paths, of which For the cumulative count field value, The difference between the current time and the most recently triggered timestamp. This is the decay rate parameter; Extract historical selected values from the candidate prediction path with the highest score level by level, send a prefetch data request to the corresponding level data binding source, and write the selected value of the upstream control above the returned option dataset into the prefetch cache of the corresponding level control with the cache key. When the data binding process is triggered, the current selected value of the upstream control is used as the key to retrieve the prefetch cache. If a match is found, the cached data is read directly to activate the control. If a match is not found, the prefetch cache of this level and downstream levels is cleared, a real-time request is initiated according to the standard process, and the prefix retrieval, sorting, and prefetching operations are re-executed with the actual selected value as the new prefix.
2. The method for data binding and event handling of multi-level linked components in a control according to claim 1, wherein, The step of initiating a prefetch data request to the corresponding level data binding source includes: Extract the second-level historical selected value from the candidate prediction path with the highest score, and send a prefetch data request to the second-level data binding source; The ranking score of the candidate path with the highest score is used to determine the ranking score. Does it exceed the preset threshold? If yes, continue along the path to extract the historical selected values of the third level and subsequent levels in sequence and initiate prefetch data requests level by level; otherwise, the prefetch request is only initiated up to the second level.
3. The method for data binding and event handling of multi-level linked components in a control according to claim 1 or 2, wherein, Also includes: Periodically remove path records whose most recent trigger timestamp is earlier than a preset validity period threshold from the path frequency storage area; Perform a decay update on the cumulative count field of the remaining path records in the storage area, using the following formula: ,in This is the cumulative count field value before decay. The preset counting attenuation coefficient and , This is the value of the count field written to the storage area after decay.
4. The method for data binding and event handling of multi-level linked components in a control according to claim 3, wherein, The periodic removal and decay updates are executed asynchronously in the background at fixed time intervals, without blocking the data binding event processing flow.
5. A data binding and event handling system for multi-level linked components in a control, characterized in that, include: The storage area management module is used to obtain the hierarchical configuration data of multi-level linked controls, allocate persistent path frequency storage areas for control instances, and concatenate the selected values at each level into a path key-value string when the user completes a complete linked selection operation, and perform cumulative count accumulation and timestamp update. The path prediction module is used to retrieve the path frequency storage area with the currently selected value of the primary control as a prefix when the primary control receives a value change event, based on... Calculate the ranking score for each matching record and extract the top-ranked records. Candidate prediction paths; The prefetching execution module is used to extract historical selected values from the candidate prediction path with the highest score level by level, send a prefetching data request to the corresponding data binding source, and write the upstream selected value of the returned option dataset as the cache key into the prefetching cache area of the corresponding level control. The cache scheduling module is used to retrieve the prefetch cache using the current selected value of the upstream control as the key when the data binding process is triggered. If a hit occurs, the cached data is read directly to activate the control. If a hit occurs, the cache of this level and downstream levels is cleared and a real-time request is initiated according to the standard process. At the same time, the path prediction module and the prefetch execution module are triggered to re-execute prediction and prefetching with the actual selected value as the new prefix. The storage area cleanup module is used to periodically remove expired path records whose most recently triggered timestamp is earlier than the expiration threshold, and to perform a decay coefficient multiplication on the cumulative count field of the remaining records before writing them.
6. The data binding and event handling system for multi-level linked components in a control according to claim 5, wherein, The prefetching module is also used to determine the ranking score of the candidate path with the highest score. Does it exceed the preset threshold? If yes, continue along this path to initiate prefetch data requests to the third level and subsequent data binding sources; otherwise, prefetch requests are only initiated to the second level.
7. The data binding and event handling system for multi-level linked components in a control according to claim 5 or 6, wherein, The storage area cleanup module performs cleanup and decay update operations asynchronously in the background at fixed time intervals, without blocking the data binding event processing flow.
