A data linkage control method and related device
By managing global operation version numbers and three-dimensional version number sets, loops can be monitored and interrupted in real time, solving the problems of duplicate calculations and infinite loops in large-scale data linkage, achieving data consistency and system performance improvement in high-concurrency environments, and optimizing sub-form processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FAN RUAN SOFTWARE CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies suffer from problems such as repeated triggering, invalid calculations, logical infinite loops, and data inconsistency when handling large-scale data linkage tasks. In particular, they are difficult to guarantee data consistency and system performance in multi-layered nested dependencies and high-concurrency scenarios.
By determining the global operation version number, a global set of affected fields is generated using the linkage trigger relationship graph. A three-dimensional version number set (target state version number, trigger state version number, and data retrieval state version number) is used to prevent duplicate calculations, dependency waiting calculations, and expiration calculations. Loops are monitored and interrupted in real time. Sub-form processing is optimized by combining the row and column version status of sub-fields, and concurrent requests are scheduled.
It effectively reduces redundant calculations in complex forms, prevents logical loops, ensures data consistency in high-concurrency environments, improves system performance and resource utilization, and optimizes resource scheduling and data consistency in multi-row sub-form scenarios.
Smart Images

Figure CN122347124A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data linkage control method and related apparatus. Background Technology
[0002] As enterprises deepen their digital transformation, form systems, as the core carrier of business process management, are bearing the growing demand for complex data processing. To improve user interaction and business workflow efficiency, modern office systems have generally introduced automated logic processing mechanisms, enabling rapid data flow and synchronization across different dimensions and levels through preset rules. This poses a greater challenge to the efficiency and accuracy of supporting the underlying business logic.
[0003] Data linkage technology, as a key component of the form system, is primarily responsible for handling dynamic dependencies between fields. It automatically triggers the recalculation, reassignment, or state switching of related fields by detecting changes in a single piece of data. In business scenarios involving multi-level sub-forms, master-child table relationships, and complex formula calculations, this technology must ensure the orderly execution of logical links between fields to maintain the logical consistency of the form's global state.
[0004] However, existing technologies have significant limitations when handling large-scale interconnected tasks. Traditional conditional control or simple event-driven solutions lack global state tracking of the interconnected chain, leading to repeated triggering and invalid calculations under multi-level nested dependencies, causing system lag and severe performance bottlenecks. Simultaneously, conventional topology sorting methods struggle to handle logical loops that may arise in business configurations, causing the system to fail to automatically break infinite loops when faced with circular dependencies, potentially leading to crashes. Furthermore, in asynchronous concurrency or scenarios with frequent changes in multiple rows of data, the system struggles to guarantee the execution order of interconnected calculations, resulting in inconsistent final data states and a high likelihood of logical conflicts.
[0005] In summary, existing technologies suffer from poor consistency in data linkage. Summary of the Invention
[0006] In view of the above problems, this application provides a data linkage control method and related apparatus to improve the consistency of data linkage control. The specific solution is as follows:
[0007] The first aspect of this application provides a data linkage control method, including:
[0008] In response to user data modification operations on the current form, determine the global operation version number of the current form;
[0009] The global impact field set of the global operation version number is determined based on the pre-constructed linkage trigger relationship diagram;
[0010] The system determines the preset dimension version number set for the target field in each asynchronous linkage path within the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set. Based on this preset dimension version number set, it performs anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field. The preset dimension version number set includes at least the target state version number, trigger state version number, and data retrieval state version number corresponding to the target field. The target state version number is the highest operation version number that the target field is planned to update to, representing the latest operation sequence of the user on the current form. The trigger state version number is a timestamp identifier that stores the actual execution logic of the target field entering the linkage calculation engine under a specific operation version number, used to identify the current execution progress of the target field in a specific operation flow. The data retrieval state version number is the ready state version number fed back to the current node after all preceding dependent nodes of the target field have completed their calculations. The target field can be any field from the initial field or the global impact field.
[0011] If the current triggering link of the target field is detected to cause the trigger status version number of the target field to be set repeatedly, and it is determined that the triggering relationship of the target field in the current triggering link belongs to the preset loop set, the current triggering link is cut off.
[0012] One possible implementation also includes:
[0013] When the target field is a subfield in a subform, the current field state of the subfield is determined based on the subfield's unique row identifier, row version status, and column version status. The row version status is used to characterize the local linkage state caused by internal field changes in a specific row of the subfield. The column version status is used to characterize the state triggered by changes in the main form field that involve all rows of subfields in the subform.
[0014] In one possible implementation, the current field state of a subfield is determined based on its unique row identifier, row version state, and column version state, including:
[0015] The set of row version numbers corresponding to the row version status and the set of column version numbers corresponding to the column version status are determined based on the unique row identifier.
[0016] The current field status of a subfield is determined based on the row version number with the largest value in the row version number set and the column version number with the largest value in the column version number set.
[0017] In one possible implementation, anti-duplicate calculation, dependency wait calculation, and anti-expiration calculation are performed on the target field based on a preset dimension version number set, including:
[0018] To prevent duplicate calculations, obtain the trigger status version number of the target field;
[0019] Determine if the trigger status version number exists in the current operation chain. If it exists, interrupt the generation of the trigger request corresponding to the trigger status version number.
[0020] Before executing the calculation formula of the target field, traverse all the preceding dependent nodes of the target field in the linkage trigger relationship graph and compare the data retrieval status version number of all preceding nodes with the target status version number of the target field.
[0021] The calculation formula is allowed to be executed when the data retrieval version number of all preceding nodes is greater than or equal to the target version number of the target field.
[0022] If any of the data retrieval status version numbers of all preceding nodes is less than the target status version number of the target field, the target field is set to a waiting state until the data retrieval status version numbers of all preceding nodes are greater than or equal to the target status version number of the target field, then the calculation formula is executed.
[0023] For anti-expiration calculations, when a target field is triggered by multiple operations to generate multiple sub-target status version numbers, the values of the multiple sub-target status version numbers are compared, and the sub-target status version number with the largest value is taken as the latest target status version number of the target field.
[0024] In one possible implementation, the global impact field of the global operation version number is determined based on a pre-built linkage trigger relationship graph, including:
[0025] Traverse the pre-built linkage trigger relationship graph with the initial field as the root node to obtain the downstream node set;
[0026] The downstream node set is the global impact field.
[0027] One possible implementation also includes:
[0028] When the number of linked requests for the current form reaches the preset concurrent linked request threshold, the linked requests exceeding the preset concurrent linked request threshold will be sent to the first-in-first-out waiting queue.
[0029] When a new linkage request is detected to enter the first-in-first-out (FIFO) waiting queue, the FIFO waiting queue is deduplicated.
[0030] A second aspect of this application provides a data linkage control device, comprising:
[0031] The first determining unit is used to determine the global operation version number of the current form in response to the user's data modification operation on the current form;
[0032] The second determining unit is used to determine the global impact field set of the global operation version number based on the pre-constructed linkage trigger relationship diagram;
[0033] The calculation unit is used to determine the preset dimension version number set of the target field in each asynchronous linkage path in the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set. It then performs anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field according to the preset dimension version number set. The preset dimension version number set includes at least the target state version number, trigger state version number, and data retrieval state version number corresponding to the target field. The target state version number is the highest operation version number that the target field is planned to update to, representing the latest operation sequence of the user on the current form. The trigger state version number is a timestamp identifier that stores the actual execution logic of the target field entering the linkage calculation engine under a specific operation version number, used to identify the current execution progress of the target field in a specific operation flow. The data retrieval state version number is the ready state version number fed back to the current node after all the preceding dependent nodes that the target field depends on have completed their calculations. The target field can be any field from the initial field or the global impact field.
[0034] The loop interruption unit is used to cut off the current triggering link when it is detected that the current triggering link of the target field will cause the triggering status version number of the target field to be repeatedly set, and it is determined that the triggering relationship of the target field in the current triggering link belongs to a preset loop set.
[0035] A third aspect of this application provides a data linkage control device, including at least one processor and a memory connected to the processor, wherein:
[0036] Memory is used to store computer programs;
[0037] The processor is used to execute computer programs so that the data linkage control device can implement the data linkage control method of the first aspect or any implementation thereof.
[0038] The fourth aspect of this application provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement the data linkage control method described in the first aspect or any implementation thereof.
[0039] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the data linkage control method described in the first aspect or any implementation thereof.
[0040] By employing the above technical solutions, the data linkage control method and related apparatus provided in this application, in response to a user's data modification operation on the current form, determine the global operation version number of the current form, and then determine the global impact field of the global operation version number according to the linkage trigger relationship diagram; using a preset dimensional version number set including the target state version number, trigger state version number, and data retrieval state version number, perform anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation of the target field in each asynchronous linkage path determined by the initial field and global impact field corresponding to the data modification operation; and monitor the trigger version in real time to identify and interrupt the linkage loop. Through multi-dimensional version number management and state machine evolution, this application can effectively reduce redundant calculations in complex forms, prevent logical infinite loops, ensure data consistency in high-concurrency environments, and significantly improve system performance and resource utilization. Attached Figure Description
[0041] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0042] Figure 1 A flowchart illustrating the data linkage control method provided in this application;
[0043] Figure 2 A schematic diagram of the structure of a data linkage control device provided in this application;
[0044] Figure 3 This is a schematic diagram of the data linkage control device in the embodiments of this application. Detailed Implementation
[0045] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0046] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0047] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0048] To address the problem of poor data consistency in existing form systems, this application provides a data linkage control method and related apparatus.
[0049] See Figure 1 This application provides a schematic flowchart of a data linkage control method.
[0050] like Figure 1 As shown, this data linkage control method includes the following steps:
[0051] Step 101: In response to the user's data modification operation on the current form, determine the global operation version number of the current form.
[0052] It should be noted that data modification operations can be interactive operations, update operations, etc. The global operation version number of the current form is a globally incrementing version number, specifically using a monotonically increasing predetermined numerical sequence to ensure that each user interaction or system-triggered change has a unique and sortable timestamp semantic.
[0053] Specifically, when any data node of a form instance (such as a text input box, numeric field, dropdown selector, etc.) receives a user interaction command or an update command pushed by the system backend, the form controller will capture the change event. The system will then call the global version manager to generate an operation version number that monotonically increases within the current form's lifecycle, denoted as the global operation version number.
[0054] The global operation version number can be a 64-bit integer value to ensure that the sequence remains consistent and unique even under extremely high frequency of interactions.
[0055] Step 102: Determine the global impact field set of the global operation version number based on the pre-constructed linkage trigger relationship diagram.
[0056] It should be noted that the linkage trigger relationship graph is a directed graph structure built by parsing configuration metadata during the form initialization phase. It uses all fields extracted by the system containing calculation formulas, data filling rules, and visibility control logic as nodes, and establishes directional edges based on the variable dependencies in the formulas. The process of building this linkage trigger relationship graph is as follows:
[0057] During the form initialization phase, the system deeply parses the form configuration metadata, extracting all fields containing calculation formulas, data source filling rules, and show / hide conditions as nodes. For each field containing an expression, a lexical analyzer is used to decompose all the variable identifiers it depends on. These variable identifiers include sibling form fields, cross-subform fields, system global variables, and external data source references. Then, directed edges are established based on the dependency relationships between variable identifiers and field nodes. These directed edges are divided into strong associations representing formula calculations and weak associations representing visibility control logic.
[0058] In addition, for scenarios with multi-level nested formulas, a recursive descent analysis method is used to decompose deep-level implicit dependencies, and all the parsed dependency paths are mapped to the linkage trigger relationship graph to ensure that the trigger paths between nodes reflect the data flow of the form business logic.
[0059] Optionally, the initial field corresponding to the data modification operation is determined as the root node, and then the pre-built linkage trigger relationship graph is traversed to obtain the downstream node set, which is the global impact field.
[0060] For example, if the calculation formula of field B depends on the value of field A, a directed edge from A to B is established in the graph. The system uses the field that caused the initial change as the root node and employs a breadth-first search algorithm to search for all reachable downstream nodes in the linkage trigger relationship graph. These nodes constitute the global scope of influence for this operation. The system writes the generated first operation version number into the field version storage location associated with each of these downstream nodes. This pre-marking operation is completed before the asynchronous linkage calculation officially starts, establishing a logical "version barrier" for the entire form. This allows each subsequent node's calculation to determine whether it is in the latest update chain through version comparison, thus obtaining the global influence field set composed of each downstream node.
[0061] In summary, this step ensures that the entire system is aware of the expected final impact of the operation before the actual execution, providing a benchmark for subsequent dependency checks.
[0062] Step 103: Determine the preset dimension version number set of the target field in each asynchronous linkage path in the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set, and perform anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field according to the preset dimension version number set.
[0063] Next, starting from the initial field corresponding to the data modification operation, the linkage calculation is asynchronously advanced according to the linkage trigger relationship diagram. The calculation behavior of each field in the asynchronous linkage path is controlled by a preset dimension version number set. The specific calculation behavior of each field in the asynchronous linkage path can be controlled by a three-dimensional version state machine. The three-dimensional version state machine includes the field version that records the target state, the trigger version that records the triggered state, and the data retrieval version that records the dependent ready state. Correspondingly, the preset dimension version number set includes the target state version number, the trigger state version number, and the data retrieval state version number.
[0064] Among them, the target status version number is the highest operation version number that the target field is planned to be updated to, which represents the latest operation sequence of the user on the current form; the trigger status version number is the timestamp identifier that stores the target field's actual entry into the linkage calculation engine execution logic under a specific operation version number, which is used to identify the current execution progress of the target field in a specific operation flow; the data retrieval status version number is the ready status version number fed back to the current node after all the preceding dependent nodes that the target field depends on have completed their calculations.
[0065] It should be noted that the target field can be either the initial field or any of the globally affected fields.
[0066] Starting from the initial field, the linkage calculation is asynchronously advanced according to the linkage trigger relationship diagram. The calculation behavior of each field is controlled by a three-dimensional version state machine. The three-dimensional version state machine includes the field version that records the target state, the trigger version that records the triggered state, and the data retrieval version that records the dependency ready state. By comparing the above three-dimensional version numbers, anti-duplication calculation, dependency waiting, and anti-expiration calculation are performed.
[0067] Optionally, the calculation process to prevent duplicate calculations is as follows:
[0068] Obtain the trigger status version number of the target field, and determine whether the trigger status version number exists in the current operation chain. If it exists, interrupt the generation of the trigger request corresponding to the trigger status version number.
[0069] Specifically, when the linkage engine transmits the calculation instruction to the target field B according to the trigger relationship graph, the system first extracts the current trigger state version number from B's local state pool. If the extracted trigger state version number is equal to the first operation version number that is currently active, it is determined that field B has already been calculated in this linkage flow or is waiting in the calculation queue. At this time, the system will immediately discard the current trigger instruction and interrupt the generation of the trigger request corresponding to the trigger state version number. This mechanism effectively solves the problem of redundant calculation caused by a field being triggered simultaneously by multiple superior branches in a complex mesh dependency structure.
[0070] Optionally, the computation process that depends on waiting for computation is as follows:
[0071] Before calculating the formula for the target field, traverse all the preceding dependent nodes of the target field in the linkage trigger relationship graph and compare the data retrieval status version number of all preceding nodes with the target status version number of the target field: when the data retrieval status version number of all preceding nodes is greater than or equal to the target status version number of the target field, execute the calculation formula.
[0072] If any of the data retrieval status version numbers of all preceding nodes is less than the target status version number of the target field, the target field is set to a waiting state until the data retrieval status version numbers of all preceding nodes are greater than or equal to the target status version number of the target field, at which point the calculation formula is executed.
[0073] Specifically, the dependency waiting logic for this computation is implemented through "barrier synchronization" of version numbers. Before target field B is ready to read input parameters and execute formula calculations, the linkage engine queries all preceding dependency nodes (such as A1 and A2) pointing to B in the linkage trigger relationship graph. The system checks the data retrieval version of A1 and A2 one by one. Only when the data retrieval version numbers of A1 and A2 are both greater than or equal to the target state version number of B is it determined that the data input source has reached a final consistency state, allowing B to start logic processing and perform formula calculations. If there is a data retrieval version number of A1 and A2 that is less than the target state version number of B, target field B will be placed in a suspended queue until all dependencies complete version evolution, that is, until the data retrieval version numbers of A1 and A2 are both greater than or equal to the target state version number of B.
[0074] Optionally, the calculation process for preventing expiration is as follows:
[0075] When a target field is triggered by multiple operations to generate multiple sub-target state version numbers, the values of the multiple sub-target state version numbers are compared, and the sub-target state version number with the largest value is taken as the latest target state version number of the target field.
[0076] Specifically, in scenarios involving concurrent editing by multiple users or continuous, rapid user operations, the system may generate a second version of the operation before the first version's linkage is completed. In this case, the target field's version will be updated to the larger second version number. When the delayed first version trigger signal reaches that field, the system compares the first operation's version number and finds it to be smaller than the current field version, thus determining that the calculation has expired. The system will directly ignore this expired request and attempt to forcibly terminate the ongoing first-version calculation task, prioritizing system resources for the latest second-version task.
[0077] For example, when a user rapidly and continuously modifies field A, generating versions V1 and V2, if the linked branch triggered by V1 lags behind V2 in reaching field B due to network latency or computational complexity, the system compares the current field version of B (which has now been updated to V2) with the incoming instruction version (V1). Since V1 is less than V2, the system determines that V1 is an outdated operation and directly terminates the corresponding computation task. If the task is already in progress, the scheduler issues a forced interrupt signal to release the occupied CPU and memory resources, ensuring that system resources always serve the computational needs of the highest version.
[0078] In summary, this step mainly involves the coordinated execution and state machine evolution, forming the core process for achieving precise scheduling and consistency assurance. It primarily utilizes a three-dimensional version state machine to provide fine-grained control over the lifecycle of each field.
[0079] Step 104: If it is detected that the current triggering link of the target field will cause the triggering status version number of the target field to be set repeatedly, and it is determined that the triggering relationship of the target field in the current triggering link belongs to the preset loop set, the current triggering link is cut off.
[0080] During the aforementioned linkage propagation process, the trigger status version number of the target field is monitored in real time to see if it is set repeatedly. If a specific field is detected to be triggered again under the same operation version number and the trigger relationship exists in the preset loop set, it is determined that a linkage loop has occurred and the corresponding trigger link is immediately interrupted.
[0081] When the first operation version number attempts to re-enter the same field node, and that node is in the triggering state of the first version, the system performs a secondary confirmation based on a predefined loop risk list. If it is confirmed that the path belongs to a logical closed loop in the business configuration, the system will execute a circuit breaker operation to stop the subsequent propagation of that branch. This dynamic detection mechanism does not rely on complex static graph analysis and can effectively handle loop risks introduced by users dynamically adjusting linkage relationships at runtime.
[0082] Specifically, the system maintains an active node stack based on the current operation version within the linkage execution engine. When a linkage signal attempts to propagate from node C back to node A, the system checks the trigger state version number of node A under the current first operation version number. If it finds that A's trigger state version number has been marked as the first operation version number, and A has not yet completed its calculation and exited the stack space, the system will further compare whether the trigger relationship hits a preset loop feature library. If a logical loop is confirmed, the system will execute circuit breaker protection, cutting off the signal feedback loop from C to A. This dynamic detection mechanism allows for reasonable transient loops in the business logic, intervening only when a substantial loop trigger occurs at runtime, balancing business flexibility and system stability.
[0083] In summary, this step avoids the risk of infinite recursion by dynamically tracking the linkage propagation path.
[0084] In another specific embodiment of this application, the design of sub-forms is also included to solve the storage and calculation problems under multiple rows of data.
[0085] For subfields in subforms, a unique row identifier is assigned and column and row versions are maintained synchronously. When reading the subfield status, the maximum value of the column and row versions is taken to decouple the logic of triggering full column linkage and row linkage of the main field.
[0086] Optionally, when the target field is a subfield in a subform, the current field state of the subfield is determined based on the unique row identifier of the subfield, the row version state of the subfield, and the column version state of the subfield. The row version state is used to characterize the local linkage state caused by the internal field change of a specific row of the subfield. The column version state is used to characterize the state that is triggered by the change of the main form field and involves all rows of subfields in the subform.
[0087] Specifically, a set of row version numbers corresponding to the row version status and a set of column version numbers corresponding to the column version status are determined based on the unique row identifier. The current field status of the subfield is determined based on the largest row version number in the row version number set and the largest column version number in the column version number set. The current field status can be represented by the largest row version number plus the largest column version number.
[0088] The row version number is used to record local changes to fields within a specific row record, such as modifying the unit price in a specific row to trigger the amount calculation for that row; the column version records global changes to columns across the entire subform, such as modifying the discount rate in the main form to trigger the recalculation of the amount in all rows of the subform.
[0089] The current field status can be set when the system needs to determine the final valid version status of a field in a subform. The determination process is as follows:
[0090] The system concurrently reads the row version number and column version number corresponding to the field in the subform. By taking the maximum of the two, the system determines that the valid state of the field should reflect the change in the corresponding version number. This design reduces the complexity of state storage from a product of the number of rows and columns to an addition of the number of rows and columns, greatly optimizing memory usage and retrieval efficiency.
[0091] The optimized design of subforms is applied to multi-row processing scenarios, with dual optimizations at the storage and algorithm levels for the linkage of large-scale structured data. The system assigns a globally unique row identifier to each physical row in the subform. For field nodes within the subform, the system no longer maintains an independent full-version state machine for each row; instead, it employs a composite indexing mechanism of "column version + row version." The column version records full updates triggered by main form fields (such as the global discount rate) that affect all rows of the subform; the row version records local linkages caused only by changes to fields within that row (such as the unit price per row).
[0092] The system reduces the space complexity of the status data that needs to be maintained in real time from the number of rows multiplied by the number of columns to a linear space complexity of the number of rows plus the number of columns. A field can only participate in subsequent linked calculations when the valid version read matches the version of the currently being processed global operation. This decoupled design ensures that memory usage remains within a controllable range when processing complex documents containing thousands of rows of data, and that batch linkage triggered by the main field can achieve synchronization of the status of all rows with a single column version update.
[0093] In another specific embodiment of this application, concurrent request scheduling and control are also included, specifically as follows:
[0094] When the number of linked requests for the current form reaches the preset concurrent threshold, the linked requests exceeding the preset concurrent threshold are sent to the first-in-first-out (FIFO) waiting queue. When a new linked request is detected entering the FIFO waiting queue, the FIFO waiting queue is deduplicated, and the old task for the same field is overwritten by the new task to save computing resources.
[0095] Specifically, the concurrent scheduler integrated into the form instance dynamically adjusts the preset concurrent threshold of the restricted execution thread pool based on the client's hardware performance indicators. When the total number of instantaneously generated concurrent requests exceeds the preset concurrent threshold, subsequent requests enter the first-in-first-out (FIFO) waiting queue in the order of their timestamps. The concurrent scheduler scans the task list in the FIFO waiting queue. If it finds that a newly entered second-version task targets the same target field and the same row identifier as the first-version task already in the queue, and the second-version number is greater than the first-version number, the first-version task is removed from the queue. The concurrent scheduler also supports a priority-based scheduling strategy. For field requests involving core financial or key inventory tags, they are preferentially extracted to the execution pool for execution after deduplication.
[0096] In summary, this application significantly improves the performance of linked operations in ultra-large-scale forms. By introducing a three-dimensional version state machine, this invention enforces a strategy from the underlying logic that each field is calculated only a predetermined number of times in a single operation. In complex forms with multi-level and cross-dependencies, this mechanism directly reduces the exponential or multiplicative computational load that may occur in traditional event-driven solutions to a linear level. In scenarios with large-scale linked nodes, system response latency is significantly reduced, effectively eliminating the stuttering phenomenon in the data entry process of complex forms.
[0097] This application enhances the system's robustness and automated fault tolerance. The OMG version number in this application utilizes the incrementing and propagation characteristics to achieve native real-time detection and interruption of linked loops. Compared to traditional static dependency graph detection methods, this application's dynamic monitoring mechanism can more flexibly handle dynamically triggered loop logic in different business scenarios, automatically preventing the system from falling into infinite loops without complex preprocessing procedures. This not only protects server resources from the risk of crashes caused by infinite recursion but also significantly reduces the mental burden on business personnel when configuring complex logic.
[0098] This application ensures eventual data consistency under high concurrency and asynchronous environments. By maintaining multi-dimensional states such as field version, trigger version, and data retrieval version, this invention constructs a rigorous logical synchronization mechanism. During high-concurrency editing or rapid continuous operations, the system can intelligently identify and discard outdated intermediate calculation tasks, ensuring that the finally stored data is always the result calculated based on the latest operation sequence. The dependency waiting mechanism ensures that all calculations are based on ready upstream data, effectively avoiding the generation of dirty data and providing reliable data support for complex business decisions.
[0099] This application optimizes resource scheduling in multi-row subform scenarios. The row and column version merging strategy designed for subforms significantly reduces state maintenance overhead while achieving extremely high-performance master-child linkage processing. This design enables the system to easily handle subforms containing a large amount of row data, while maintaining stable memory usage and processing speed during update operations. Combined with concurrent request scheduling and queue deduplication mechanisms, this invention maximizes system throughput and resource utilization while ensuring a smooth user experience.
[0100] In summary, the data linkage control method provided in this application responds to a user's data modification operation on the current form, determines the global operation version number of the current form, and then determines the global impact field of this global operation version number based on the linkage trigger relationship diagram. It utilizes a preset set of dimensional version numbers, including the target state version number, trigger state version number, and data retrieval state version number, to perform anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation for the target field in each asynchronous linkage path determined by the initial field and global impact field corresponding to the data modification operation. It also monitors the trigger version in real time to identify and interrupt linkage loops. Through multi-dimensional version number management and state machine evolution, this application can effectively reduce redundant calculations in complex forms, prevent logical infinite loops, ensure data consistency in high-concurrency environments, and significantly improve system performance and resource utilization.
[0101] The above describes a data linkage control method provided by the embodiments of this application. The following will describe the apparatus for performing the above data linkage control method.
[0102] Please see Figure 2 , Figure 2 This is a schematic diagram of a data linkage control device provided in this application. Figure 2 As shown, the device includes:
[0103] The system comprises a first determining unit 10, a second determining unit 20, a calculation unit 30, and a loop interruption unit 40; wherein:
[0104] The first determining unit 10 is used to determine the global operation version number of the current form in response to the user's data modification operation on the current form;
[0105] The second determining unit 20 is used to determine the global impact field set of the global operation version number based on the pre-constructed linkage trigger relationship diagram;
[0106] The calculation unit 30 is used to determine the preset dimension version number set of the target field in each asynchronous linkage path of the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set. It then performs anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field according to the preset dimension version number set. The preset dimension version number set includes at least the target state version number, trigger state version number, and data retrieval state version number corresponding to the target field. The target state version number is the highest operation version number that the target field is planned to update to, representing the latest operation sequence of the user on the current form. The trigger state version number is a timestamp identifier that stores the actual execution logic of the target field entering the linkage calculation engine under a specific operation version number, used to identify the current execution progress of the target field in a specific operation flow. The data retrieval state version number is the ready state version number fed back to the current node after all the preceding dependent nodes that the target field depends on have completed their calculations. The target field can be any field from the initial field or the global impact field.
[0107] The loop interruption unit 40 is used to cut off the current triggering link when it is detected that the current triggering link of the target field will cause the triggering status version number of the target field to be repeatedly set, and it is determined that the triggering relationship of the target field in the current triggering link belongs to a preset loop set.
[0108] In one embodiment, the data linkage control device further includes a third determining unit;
[0109] The third determining unit is specifically used for:
[0110] When the target field is a subfield in a subform, the current field state of the subfield is determined based on the subfield's unique row identifier, row version status, and column version status. The row version status is used to characterize the local linkage state caused by internal field changes in a specific row of the subfield. The column version status is used to characterize the state triggered by changes in the main form field that involve all rows of subfields in the subform.
[0111] In one embodiment, the third determining unit is specifically used for:
[0112] The set of row version numbers corresponding to the row version status and the set of column version numbers corresponding to the column version status are determined based on the unique row identifier.
[0113] The current field status of a subfield is determined based on the row version number with the largest value in the row version number set and the column version number with the largest value in the column version number set.
[0114] In one embodiment, the calculation unit 30 is specifically used for:
[0115] To prevent duplicate calculations, obtain the trigger status version number of the target field;
[0116] Determine if the trigger status version number exists in the current operation chain. If it exists, interrupt the generation of the trigger request corresponding to the trigger status version number.
[0117] Before executing the calculation formula of the target field, traverse all the preceding dependent nodes of the target field in the linkage trigger relationship graph and compare the data retrieval status version number of all preceding nodes with the target status version number of the target field.
[0118] The calculation formula is allowed to be executed when the data retrieval version number of all preceding nodes is greater than or equal to the target version number of the target field.
[0119] If any of the data retrieval status version numbers of all preceding nodes is less than the target status version number of the target field, the target field is set to a waiting state until the data retrieval status version numbers of all preceding nodes are greater than or equal to the target status version number of the target field, then the calculation formula is executed.
[0120] For anti-expiration calculations, when a target field is triggered by multiple operations to generate multiple sub-target status version numbers, the values of the multiple sub-target status version numbers are compared, and the sub-target status version number with the largest value is taken as the latest target status version number of the target field.
[0121] In one embodiment, the second determining unit 20 is specifically used for:
[0122] Traverse the pre-built linkage trigger relationship graph with the initial field as the root node to obtain the downstream node set;
[0123] The downstream node set is the global impact field.
[0124] In one embodiment, the data linkage control device further includes a concurrent request scheduling and deduplication unit;
[0125] This concurrent request scheduling and deduplication unit is specifically used for:
[0126] When the number of linked requests for the current form reaches the preset concurrent linked request threshold, the linked requests exceeding the preset concurrent linked request threshold will be sent to the first-in-first-out waiting queue.
[0127] When a new linkage request is detected to enter the first-in-first-out (FIFO) waiting queue, the FIFO waiting queue is deduplicated.
[0128] This application also provides a data linkage control device in its embodiments. (See reference...) Figure 3The diagram illustrates a structural schematic suitable for implementing the data linkage control device in the embodiments of this application. The data linkage control device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The data linkage control device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0129] like Figure 3 As shown, the data linkage control device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the data linkage control device is powered on, the RAM 603 also stores various programs and data required for the operation of the data linkage control device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0130] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows the data linkage control device to exchange data wirelessly or via wired communication with other devices. Although Figure 3 A data linkage control device with various devices is shown; however, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or included alternatively.
[0131] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the data linkage control methods provided in this application.
[0132] This application also provides a computer storage medium that carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any of the data linkage control methods provided in this application.
[0133] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0135] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.
[0136] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. 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 from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, 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 store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A data-linked control method, characterized in that, include: In response to a user's data modification operation on the current form, determine the global operation version number of the current form; The global impact field set of the global operation version number is determined based on the pre-constructed linkage trigger relationship diagram; Determine the preset dimension version number set of the target field in each asynchronous linkage path in the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set, and perform anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field based on the preset dimension version number set; The preset dimension version number set includes at least the target state version number, trigger state version number, and data retrieval state version number corresponding to the target field; The target status version number is the highest operation version number that the target field is planned to be updated to, representing the latest sequence of user operations on the current form; The trigger state version number is a timestamp identifier that stores the target field's actual entry into the linked calculation engine's execution logic under a specific operation version number, used to identify the target field's current execution progress in a specific operation flow; the data retrieval state version number is the ready state version number fed back to the current node after all the preceding dependent nodes that the target field depends on have completed their calculations; the target field is any field among the initial field and the global influence field; If it is detected that the current triggering link of the target field will cause the triggering status version number of the target field to be repeatedly set, and it is determined that the triggering relationship of the target field in the current triggering link belongs to a preset loop set, the current triggering link is cut off.
2. The data linkage control method according to claim 1, characterized in that, Also includes: When the target field is a subfield in a subform, the current field state of the subfield is determined based on the unique row identifier of the subfield, the row version state of the subfield, and the column version state of the subfield. The row version state is used to characterize the local linkage state caused by the internal field change of a specific row of the subfield. The column version state is used to characterize the state triggered by the main form field change that involves all rows and subfields of the subform.
3. The data linkage control method according to claim 2, characterized in that, Determining the current field state of a subfield based on its unique row identifier, row version state, and column version state includes: Based on the unique row identifier, determine the set of row version numbers corresponding to the row version status, and the set of column version numbers corresponding to the column version status; The current field status of the subfield is determined based on the row version number with the largest value in the row version number set and the column version number with the largest value in the column version number set.
4. The data linkage control method according to claim 1, characterized in that, The step of performing anti-duplicate calculation, dependency waiting calculation, and anti-expiration calculation on the target field based on the preset dimension version number set includes: For the anti-duplication calculation, obtain the trigger status version number of the target field; Determine whether the trigger status version number exists in the current operation chain. If it exists, interrupt the generation of the trigger request corresponding to the trigger status version number. Before executing the calculation formula of the target field, traverse all the preceding dependent nodes of the target field in the linkage trigger relationship graph, and compare the data retrieval status version number of all the preceding nodes with the target status version number of the target field. The calculation formula is allowed to be executed when the data retrieval status version number of all the preceding nodes is greater than or equal to the target status version number of the target field. When there is a data retrieval status version number among all the data retrieval status version numbers of the preceding nodes that is less than the target status version number of the target field, the target field is set to a waiting state until the data retrieval status version numbers of all the preceding nodes are greater than or equal to the target status version number of the target field, and then the calculation formula is executed. For the anti-expiration calculation, when the target field is triggered by multiple operations to generate multiple sub-target status version numbers, the values of the multiple sub-target status version numbers are compared, and the sub-target status version number with the largest value is taken as the latest target status version number of the target field.
5. The data linkage control method according to claim 1, characterized in that, The global impact field for determining the global operation version number based on a pre-constructed linkage trigger relationship diagram includes: Using the initial field as the root node, traverse the pre-constructed linkage trigger relationship graph to obtain the downstream node set; The downstream node set is the global impact field.
6. The data linkage control method according to claim 1, characterized in that, Also includes: When the number of linkage requests for the current form reaches the preset linkage request concurrency threshold, the linkage requests exceeding the preset linkage request concurrency threshold will be sent to the first-in-first-out waiting queue. When a new linkage request is detected to enter the first-in-first-out (FIFO) waiting queue, the FIFO waiting queue is deduplicated.
7. A data linkage control device, characterized in that, include: The first determining unit is used to determine the global operation version number of the current form in response to the user's data modification operation on the current form; The second determining unit is used to determine the global impact field set of the global operation version number based on a pre-constructed linkage trigger relationship diagram; The calculation unit is used to determine the preset dimension version number set of the target field in each asynchronous linkage path in the asynchronous linkage path set generated based on the pre-constructed linkage trigger relationship diagram, the initial field corresponding to the data modification operation, and the global impact field set, and to perform anti-duplication calculation, dependency waiting calculation, and anti-expiration calculation on the target field based on the preset dimension version number set. The preset dimension version number set includes at least the target state version number, trigger state version number, and data retrieval state version number corresponding to the target field; The target status version number is the highest operation version number that the target field is planned to be updated to, representing the latest sequence of user operations on the current form; The trigger state version number is a timestamp identifier that stores the target field's actual entry into the linked calculation engine's execution logic under a specific operation version number, used to identify the target field's current execution progress in a specific operation flow; the data retrieval state version number is the ready state version number fed back to the current node after all the preceding dependent nodes that the target field depends on have completed their calculations; the target field is any field among the initial field and the global influence field; The loop interruption unit is used to cut off the current triggering link when it is detected that the current triggering link of the target field will cause the triggering status version number of the target field to be repeatedly set, and it is determined that the triggering relationship of the target field in the current triggering link belongs to a preset loop set.
8. A data linkage control device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the data linkage control device can implement the data linkage control method as described in any one of claims 1 to 6.
9. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the data linkage control method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the data linkage control method as described in any one of claims 1 to 6.