A smart contract-based data management and circulation control system for data flow
By constructing an authorization rule state sequence and a rule applicability index determination, the inconsistency problem caused by frequent changes in authorization rules in the data circulation system is solved, and the stability and predictability control of data circulation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI KEDADUO CHUANGZHIXIN TECH CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-05-26
AI Technical Summary
In data circulation systems, frequent changes to authorization rules lead to inconsistencies in the execution of historical data transfer requests, affecting the continuity, stability, and predictability of data circulation.
By constructing an authorization rule state sequence, obtaining the rule applicability index, determining the target authorization rule state, and comprehensively considering time, stability, and on-chain confirmation depth, the accurate processing of data flow requests is ensured.
It improves the continuity, stability, and predictability of the data flow control process, and avoids historical authorization failures and permission conflicts.
Smart Images

Figure CN122093145A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data management technology, and more specifically to a smart contract data management and circulation control system for data flow. Background Technology
[0002] With the development of the data element market and the digital economy system, data has gradually become a crucial production factor in enterprise operation and management, industrial collaboration, and social governance. Various business systems continuously generate large amounts of structured and unstructured data during operation. This data is typically stored across different platforms or systems and circulates and is used by multiple entities through data interfaces, sharing platforms, and business collaboration mechanisms. The flow of data across entities and platforms often involves management needs such as data ownership confirmation, authorization, scope of use control, and accountability. Therefore, how to achieve orderly flow and controllable sharing of data while ensuring data security and compliant use has become a key technical focus in the fields of data governance and data circulation.
[0003] In existing technologies, data management and flow control systems based on blockchain and smart contracts have been widely applied. These systems typically deploy smart contracts within a blockchain network to register information such as data identifiers, authorizing entities, and the scope of authorization. When a data flow request is initiated, the smart contract is invoked to verify the relevant authorization information, thereby automating the control of data access and usage. Leveraging the immutability of the blockchain ledger, these systems can uniformly maintain data authorization status and flow records, enhancing the credibility and transparency of the data circulation process.
[0004] In existing data flow management mechanisms, corresponding data authorization rules are typically configured for data objects, and these rules serve as the basis for subsequent data flow control after generation. During data flow, the system generally uses the currently valid authorization rules as a judgment benchmark to verify flow requests, thereby determining whether to allow the target data to be transmitted or accessed between relevant entities. This approach is widely used in practice, and its basic idea is to maintain consistency in data flow control logic through centralized management of authorization rules, facilitating unified maintenance of authorization relationships by the system.
[0005] However, the above-mentioned technologies have at least the following technical problems: In the actual operation environment of a data circulation system, data authorization rules are often not static but are updated or revised multiple times as business strategies change, compliance requirements evolve, or risk control needs emerge. When authorization rules change multiple times during their lifecycle, multiple authorization rule states generated at different times may exist simultaneously in the system. Some historical data transfer requests, often initiated based on older authorization rules, are still in the execution or waiting state. In this situation, if all data transfer requests are processed uniformly based solely on the latest authorization rules, it can easily lead to problems such as the invalidation of historical authorizations, inconsistent execution results of transfer requests, and conflicts in data usage permissions, thereby affecting the continuity, stability, and predictability of the data circulation control process. Summary of the Invention
[0006] In order to overcome the above-mentioned defects of the prior art, the present invention provides a smart contract data management and circulation control system for data circulation, so as to solve the problems existing in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A smart contract data management and circulation control system for data circulation includes: a data access and management module for acquiring data to be circulated, performing unified format processing and structured encapsulation on the data to be circulated to form data management objects, and assigning corresponding data identifiers to the data management objects, the data management objects including attribute information and user information; an authorization rule generation and management module for constructing data authorization rules based on the data management objects and their data identifiers, and managing the data authorization rules to form authorization rule information to be written; a smart contract execution module for deploying and running smart contracts related to data circulation, and writing the authorization rule status into the blockchain network to form authorization rule status; and an authorization rule change determination module for obtaining the authorization rule status sequence corresponding to the target data identifier when a data circulation request is received, and determining whether the data circulation request is within its lifecycle based on the authorization rule status sequence. The system checks whether at least one authorization rule change has occurred. The rule applicability determination module, if it determines that at least one authorization rule change has occurred within the data flow request lifecycle, determines a candidate authorization rule state set based on the authorization rule state sequence. It then obtains the rule applicability parameters corresponding to each authorization rule state in the candidate authorization rule state set. These parameters include the authorization effective start time stamp, authorization effective end time stamp, historical authorization rule state sequence, and on-chain location information. Based on the rule applicability parameters, it evaluates and obtains a rule applicability index. Finally, it determines the target authorization rule state corresponding to this data flow request based on the rule applicability index of each authorization rule state in the candidate authorization rule state set. The flow control module controls the data flow request based on the target authorization rule state to obtain the flow result state. The flow state management module maintains the flow result state and establishes the association between the flow result state and the corresponding data identifier.
[0008] Preferably, the step of constructing data authorization rules based on data management objects and their data identifiers is as follows: obtaining the corresponding data identifier from the data management object and establishing an association between the data identifier and the data management object; determining the data authorization scope corresponding to the data management object based on the attribute information of the data management object and the data identifier; determining the data access subjects involved in the data authorization rules based on the user information in the data management object; constructing the conditional content of the data authorization rules based on the data identifier, the data authorization scope, and the data access subjects; and generating complete data authorization rules based on the conditional content.
[0009] Preferably, the step of determining whether at least one authorization rule change has occurred within the data flow request lifecycle based on the authorization rule state sequence is as follows: sequentially obtain the state parameters corresponding to adjacent authorization rule states in the authorization rule state sequence, and compare the state parameters of adjacent authorization rule states item by item; when at least one state parameter is detected to have changed between adjacent authorization rule states, it is determined that at least one authorization rule change has occurred within the data flow request lifecycle; if no change in state parameters is detected in the authorization rule state sequence, it is determined that no authorization rule change has occurred within the data flow request lifecycle.
[0010] Preferably, the steps for obtaining the candidate authorization rule status set are as follows: arranging the authorization rule status sequence in chronological order according to the effective time information corresponding to each authorization rule status in the authorization rule status sequence; filtering out authorization rule statuses that match the request time range from the authorization rule status sequence based on the request time information of the data flow request to form a candidate authorization rule status set; and when the candidate authorization rule status set is empty, selecting the authorization rule status that most recently took effect before the data flow request time from the authorization rule status sequence and adding it to the candidate authorization rule status set.
[0011] Preferably, the steps for obtaining the rule applicability index are as follows: After receiving a data transfer request, obtain the request timestamp of the data transfer request and the authorization effective start timestamp and authorization effective end timestamp of the authorization rule status; calculate the time adaptation coefficient based on the request timestamp, authorization effective start timestamp, and authorization effective end timestamp; obtain the historical authorization rule status sequence corresponding to the authorization rule status, arranged in chronological order, and calculate the rule stability coefficient based on the historical authorization rule status sequence; obtain the on-chain location information of the authorization rule status in the blockchain network, and calculate the on-chain maturity coefficient based on the on-chain location information; normalize the time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient, and calculate the rule applicability index based on the normalized time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient.
[0012] Preferably, the steps for obtaining the time adaptation coefficient are as follows: After receiving a data transfer request, obtain the request time information corresponding to the data transfer request, and record it as the request timestamp. At the same time, obtain the authorization start timetamp and authorization end timetamp corresponding to the authorization rule status from the authorization rule status corresponding to the target data identifier; subtract the authorization start timetamp from the authorization end timetamp to obtain the authorization effect time window length; calculate the average of the authorization end timetamp and the authorization start timetamp to obtain the center timetamp of the authorization effect time window; calculate the absolute difference between the request timestamp and the center timetamp of the authorization effect time window to obtain the request time deviation; normalize the request time deviation under the authorization effect time window scale to obtain the normalized deviation; when the request timestamp is greater than or equal to the authorization start timetamp and less than or equal to the authorization end timetamp, subtract the normalized deviation from 1 to obtain the time adaptation coefficient; when the request timestamp is less than the authorization start timetamp or greater than the authorization end timetamp, record the time adaptation coefficient as 0.
[0013] Preferably, the step of obtaining the rule stability coefficient is as follows: For any authorization rule state in the candidate authorization rule state set, obtain the historical authorization rule state sequence corresponding to that authorization rule state, arranged in chronological order; extract a set of state parameters to characterize the stability of the authorization rule state from each authorization rule state in the authorization rule state sequence; compare two adjacent authorization rule states in the authorization rule state sequence, if the two adjacent authorization rule states are not equal, then the adjacent state change identifier is recorded as 1; if the two adjacent authorization rule states are equal, then the adjacent state change identifier is recorded as 0; obtain the sequence length of the authorization rule state sequence, and when the sequence length is 1, record the change frequency stable component as 1; when the sequence length is greater than 1, count the number of changes of the adjacent state change identifier, and calculate the change frequency stable component based on the number of changes and the sequence length; identify the continuous stable segment in the authorization rule state sequence based on the adjacent state change identifier, obtain the maximum number of continuous stable states corresponding to the continuous stable segment, and divide the maximum number of continuous stable states by the sequence length to obtain the continuous stable segment stable component; multiply the change frequency stable component and the continuous stable segment stable component to obtain the rule stability coefficient.
[0014] Preferably, the steps for obtaining the on-chain maturity coefficient are as follows: For any authorization rule state in the candidate authorization rule state set, obtain the on-chain location information of the authorization rule state in the blockchain network. The on-chain location information includes: the transaction identifier carrying the authorization rule state and the block height where the transaction was written; when a data transfer request is received, obtain the block height of the latest block from the blockchain network, subtract the block height where the transaction was written from the block height of the latest block, and add 1 to obtain the on-chain confirmation depth; obtain the finality status identifier of the transaction identifier from the blockchain network. When the transaction corresponding to the transaction identifier has been confirmed by the blockchain network and is not in a rollback or reorganization state, the finality status identifier is recorded as 1; otherwise, the finality status identifier is recorded as 0; divide the on-chain confirmation depth by the block height of the latest block and multiply it by the finality status identifier to obtain the on-chain maturity coefficient.
[0015] Preferably, the step of determining the target authorization rule state corresponding to the current data flow request based on the rule applicability index of each authorization rule state in the candidate authorization rule state set is as follows: obtain the rule applicability index of all authorization rule states, compare the rule applicability index values, and determine the authorization rule state corresponding to the largest rule applicability index as the target authorization rule state corresponding to the current data flow request; when there are multiple authorization rule states with the same rule applicability index and the largest value, select the authorization rule state whose effective time information is closest to the data flow request time as the target authorization rule state.
[0016] The technical effects and advantages of this invention are as follows: Upon receiving a data transfer request, an authorization rule status sequence is obtained. Based on this sequence, it is determined whether at least one authorization rule change has occurred within the data transfer request lifecycle. If such a change is confirmed, a candidate authorization rule status set is determined based on the authorization rule status sequence. The applicable rules for each authorization rule status in the candidate set are then obtained, and the rule applicability index is evaluated. Finally, the target authorization rule status for this data transfer request is determined, effectively improving the continuity, stability, and predictability of the data flow control process. Attached Figure Description
[0017] Figure 1 This is a structural diagram of a smart contract data management and circulation control system for data flow, provided as an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. The smart contract data management and circulation control system for data flow involved in the present invention is not limited to the structures described in the following embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] This invention provides a smart contract data management and flow control system for data circulation, such as... Figure 1 As shown, the system includes: The data access and management module is used to acquire data to be circulated, process and encapsulate the data in a unified format to form a data management object that can be used for subsequent authorization and circulation control, and assign a corresponding data identifier to the data management object. The data management object includes attribute information and user information. The authorization rule generation and management module is used to construct data authorization rules based on data management objects and their data identifiers, and to manage the data authorization rules to form authorization rule information to be written. In this embodiment, it should be specifically explained that the steps for constructing data authorization rules based on data management objects and their data identifiers are as follows: Obtain the corresponding data identifier from the data management object and establish the association between the data identifier and the data management object to achieve unified identification and referencing of the data management object; Based on the attribute information and data identifier of the data management object, determine the data authorization scope corresponding to the data management object. The data authorization scope shall at least include the data access type, data usage restrictions and authorization time range. It should be noted that determining the data authorization scope corresponding to the data management object based on the attribute information and data identifier of the data management object is an existing technology, and this embodiment will not describe its specific steps in detail.
[0020] Based on the user information in the data management object, determine the data access subject involved in the data authorization rules. The data access subject includes at least the data requester identifier and the authorized party identifier. It should be noted that determining the data access subject involved in the data authorization rules based on user information in the data management object is an existing technology, and this embodiment will not describe its specific steps in detail.
[0021] Based on the data identifier, data authorization scope, and data access subject, construct the conditions for the data authorization rules, including data access permissions, access constraints, and access time limits. Complete data authorization rules are generated based on the conditions, and the authorization rule information corresponding to the generated authorization rules is stored in the blockchain network for subsequent data flow control and query verification.
[0022] The smart contract execution module is used to deploy and run smart contracts related to data circulation, and write the authorization rule state into the blockchain network to form the authorization rule state, which serves as the sole source of rule state in the data circulation control process. It should be noted that smart contracts related to data circulation refer to automatically executable programs deployed on a blockchain network, used to process data authorization information and data transfer requests according to preset rules. Upon receiving an external call request, a smart contract can automatically complete operations such as registering authorization rules, updating rule status, and querying rule status, with the execution results synchronously written to the on-chain ledger. This type of smart contract is a fundamental technology widely used in the blockchain field; in this application, it is only used as a rule execution carrier, and its specific details are not described in detail.
[0023] It should be noted that a blockchain network is a distributed ledger system jointly maintained by multiple nodes. It provides a runtime environment for smart contracts and uniformly stores and maintains the authorized rule states generated by contract execution. Blockchain networks possess the capabilities of data immutability and state consistency maintenance; their specific network structure, consensus mechanism, and implementation methods can all be implemented using existing blockchain technologies.
[0024] The authorization rule change determination module is used to obtain the authorization rule status sequence corresponding to the target data identifier when a data flow request is received, and to determine whether at least one authorization rule change has occurred within the life cycle of the data flow request based on the authorization rule status sequence. It should be noted that the target data identifier refers to the data identifier pointed to in the data transfer request, which is used to uniquely identify the data to be transferred in this data transfer request.
[0025] In this embodiment, it should be specifically explained that the step of determining whether at least one authorization rule change has occurred within the lifecycle of the data flow request based on the authorization rule state sequence is as follows: Sequentially obtain the status parameters corresponding to adjacent authorization rule states in the authorization rule status sequence, and compare the status parameters of adjacent authorization rule states item by item; When a change in at least one status parameter is detected between adjacent authorization rule states, it is determined that at least one authorization rule change has occurred within the lifecycle of the data flow request. If no change in the status parameter is detected in the authorization rule status sequence, it is determined that no change in the authorization rule has occurred during the data flow request lifecycle.
[0026] If the rule application determination module determines that at least one authorization rule change has occurred within the lifecycle of the data flow request, it determines a set of candidate authorization rule states based on the authorization rule state sequence, and obtains the rule application parameters corresponding to each authorization rule state in the candidate authorization rule state set. The rule application parameters include the authorization effective start time stamp, the authorization effective end time stamp, the historical authorization rule state sequence, and the on-chain positioning information. The rule applicability index is obtained by evaluating the rule applicability parameters. The target authorization rule status corresponding to this data flow request is determined based on the rule applicability index of each authorization rule status in the candidate authorization rule status set. In this embodiment, it should be specifically explained that the steps for obtaining the candidate authorization rule status set are as follows: Arrange the authorization rule status sequence in chronological order according to the effective time information corresponding to each authorization rule status in the authorization rule status sequence; Based on the request time information of the data flow request, the authorization rule status that matches the request time range is selected from the authorization rule status sequence to form a candidate authorization rule status set; It should be noted that matching request time ranges means that the request time of the data flow request is within the authorization effective time range recorded in the authorization rule status.
[0027] Furthermore, when the candidate authorization rule status set is empty, the authorization rule status that most recently took effect before the data flow request time is selected from the authorization rule status sequence and added to the candidate authorization rule status set.
[0028] In this embodiment, it should be specifically explained that the steps for obtaining the rule applicability index are as follows: After receiving a data transfer request, obtain the request timestamp of the data transfer request and the authorization effective start timestamp and authorization effective end timestamp of the authorization rule status. Calculate the time adaptation coefficient based on the request timestamp, authorization effective start timestamp, and authorization effective end timestamp. Obtain the historical authorization rule status sequence corresponding to the authorization rule status, arranged in chronological order, and calculate the rule stability coefficient based on the historical authorization rule status sequence; Obtain the on-chain location information of the authorization rule status in the blockchain network, and calculate the on-chain maturity coefficient based on the on-chain location information; The time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient are normalized. Specifically, in this embodiment, vector normalization can be used to normalize these coefficients. Specifically, the time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient are combined to form a three-dimensional vector. The norm value is obtained by calculating the square root of the sum of squares of each component of this three-dimensional vector. Each influence coefficient is then divided by this norm value to achieve normalization on a uniform scale. This normalization method avoids bias in the subsequent calculation of the rule applicability index caused by differences in the value range or variation of different influence coefficients, thereby improving the stability and consistency of the rule applicability determination results. Since the vector normalization method is existing technology, its specific calculation process will not be described in detail in this embodiment. The rule applicability index is calculated based on the normalized time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient. The specific steps for obtaining the rule applicability index are as follows: ; In the formula, Represented as the rule applicability index, Represented as the normalized time fit coefficient, the higher the degree of matching between the authorization rule status and the data flow request in the time dimension, the higher its comprehensive applicability evaluation in rule application determination. When the data flow request time is closer to the center of the authorization rule's effective time interval or falls within the authorization effective time range, the time fit coefficient increases, thereby driving a corresponding increase in the rule applicability index. This gives authorization rules with higher time fit a higher priority in the rule selection process. This represents the normalized rule stability coefficient. The higher the stability of the authorization rule state throughout its lifecycle, the higher its priority for selection and application in the current data flow request scenario. When the authorization rule changes less frequently and maintains continuous stability for a longer period during its historical evolution, the corresponding rule stability coefficient increases. This positively impacts the rule applicability index in rule application determination, making the system more inclined to select authorization rule states with stronger stability and higher predictability as the applicable rules for this data flow request. Represented as the normalized on-chain maturity coefficient, the higher the sufficiency of confirmation and the stability of consensus of the authorization rule state in the blockchain network, the higher its priority in being adopted in the current data flow request scenario. When the authorization rule state has undergone a deeper confirmation layer on the chain and has reached a stable consensus state, the corresponding on-chain maturity coefficient value increases, thus positively boosting the rule applicability index in the rule application determination. This makes authorization rule states with more mature and reliable on-chain states more likely to be selected as the applicable rules for this data flow request. , , These represent the weighting coefficients of the normalized time adaptation coefficient, the normalized rule stability coefficient, and the normalized on-chain maturity coefficient. , , , The weighting coefficients, reflecting the relative importance of each indicator, are obtained through the Analytic Hierarchy Process (AHP). AHP is a method that decomposes complex decision-making problems into multiple layers, including the objective layer, criterion layer, and indicator layer. It calculates these weights by constructing pairwise comparison matrices between elements at each layer. The basic idea is to transform qualitative judgments into calculable weighted results for comprehensive evaluation of multiple indicators. Since AHP is existing technology, its specific calculation process will not be described in detail in this embodiment.
[0029] In this embodiment, it should be specifically explained that the steps for obtaining the time adaptation coefficient are as follows: Upon receiving a data transfer request, the request time information corresponding to the data transfer request is obtained and recorded as the request timestamp. At the same time, the authorization start timetamp and authorization end timetamp corresponding to the authorization rule status corresponding to the target data identifier are obtained from the authorization rule status. Subtracting the authorization start time stamp from the authorization end time stamp yields the authorization effective time window length, which is used to characterize the duration of the authorization rule status in the time dimension. Calculate the average of the authorization effective termination timestamp and the authorization effective start timestamp to obtain the center timestamp of the authorization effective time window, which is used to characterize the time center position of the authorization effective time window; Calculate the absolute difference between the request timestamp and the center timestamp of the authorization effective time window to obtain the request time deviation, which characterizes the degree of offset of the request time relative to the center of the authorization window; The request time deviation is normalized within the authorization effective time window scale to obtain the normalized deviation. The specific steps for obtaining this deviation are as follows: ; In the formula, Expressed as normalized deviation, This is expressed as the request time deviation. This represents the length of the authorization effective time window; When the request timestamp is greater than or equal to the authorization start timestamp and less than or equal to the authorization end timestamp, subtract the normalized deviation from 1 to obtain the time adaptation coefficient. When the request timestamp is less than the authorization start timestamp or greater than the authorization end timestamp, the time adaptation coefficient is recorded as 0. The time adaptation coefficient is used to characterize the time adaptation degree of the authorization rule status in this data flow request scenario.
[0030] By comprehensively considering the relative positional relationship between the request time of data flow requests and the effective time range of authorization rules, the applicability of authorization rules within the effective time window is continuously characterized, rather than being judged discretely solely based on whether they are within their validity period. This method can distinguish the applicability differences of authorization rules in the central and boundary areas of the time window. Therefore, even when authorization rules have undergone multiple changes or coexisted, it more accurately reflects the time adaptability level of different authorization rules to the current data flow request, helping to improve the stability and rationality of rule applicability determination results and avoiding rule selection bias caused by simply basing it on whether it is effective or not.
[0031] In this embodiment, it should be specifically explained that the steps for obtaining the rule stability coefficient are as follows: For any authorization rule state in the candidate authorization rule state set, obtain the historical authorization rule state sequence corresponding to that authorization rule state, arranged in chronological order. The historical authorization rule state sequence is a sequence consisting of multiple authorization rule states formed by the same authorization rule at different points in time. Extract a set of state parameters from each authorization rule state in the authorization rule state sequence to characterize the stability of the authorization rule state. The set of state parameters is a set of fields stored in the system for the authorization rule state, which is used to support the comparison of parameter consistency between adjacent authorization rule states. Compare two adjacent authorization rule states in the authorization rule state sequence. If the two adjacent authorization rule states are not equal, the adjacent state change flag is recorded as 1; if the two adjacent authorization rule states are equal, the adjacent state change flag is recorded as 0. To obtain the sequence length of the authorization rule state sequence, it should be noted that, in this embodiment, the sequence length refers to the number of authorization rule states contained in the authorization rule state sequence. This number can be obtained by counting the state entries in the authorization rule state sequence. When the sequence length is 1, the change frequency stable component is recorded as 1; when the sequence length is greater than 1, the number of changes of adjacent state change identifiers is counted, and the change frequency stable component is calculated based on the number of changes and the sequence length. The specific steps are as follows: ; In the formula, Represented as a stable component with varying frequency. Represented as the number of changes, Represented as sequence length; It should be noted that since each authorization rule corresponds to at least one initial authorization rule state when it is generated, the authorization rule state sequence contains at least one authorization rule state, and the sequence length is always greater than or equal to 1. There is no case where the sequence length is less than 1.
[0032] Based on the adjacent state change identifier, identify the continuous stable segment in the state sequence of the authorization rule, obtain the maximum number of continuous stable states corresponding to the continuous stable segment, and divide the maximum number of continuous stable states by the sequence length to obtain the stable component of the continuous stable segment. It should be noted that, based on the adjacent state change identifier, the authorization rule state sequence is divided into several consecutive authorization rule state segments corresponding to adjacent state change identifiers of 0, and each consecutive authorization rule state segment constitutes a continuous stable segment.
[0033] It should be noted that the maximum number of continuous stable states is the number of states in the segment containing the most authorized rule states among all continuous stable segments.
[0034] The stability coefficient of a rule is obtained by multiplying the stable component of the frequency of change with the stable component of the continuous stable segment. The larger the stability coefficient of a rule is, the higher the stability of the authorized rule state in the authorized rule state sequence, and thus the stronger its stability contribution in the evaluation of the rule applicability index.
[0035] The rule stability coefficient characterizes the degree to which the state of an authorization rule remains consistent throughout its lifecycle. By comprehensively reflecting the frequency of changes in the state of the authorization rule over time and its continuous stability, it distinguishes the stability characteristics of rules in scenarios of frequent adjustments and long-term invariance. This approach avoids judging stability solely based on a single state change or the current state, but rather characterizes the stability level of authorization rules from the perspective of overall historical evolution. Therefore, in application scenarios where authorization rules change multiple times but historical authorizations still need to be valid, it provides a more objective and reliable stability basis for determining rule applicability, helping to improve the rationality of rule selection results and the continuity of system operation.
[0036] In this embodiment, it should be specifically explained that the steps for obtaining the on-chain maturity coefficient are as follows: For any authorization rule state in the candidate authorization rule state set, obtain the on-chain location information of the authorization rule state in the blockchain network. The on-chain location information includes at least: the transaction identifier carrying the authorization rule state and the block height where the transaction was written, where the block height is the sequential number of the block in the blockchain network. When a data transfer request is received, the block height of the latest block is obtained from the blockchain network. The block height of the latest block is subtracted from the block height of the transaction written and then 1 is added to obtain the on-chain confirmation depth, which is used to characterize the cumulative depth of the authorization rule status since it was written to the block and has been confirmed by subsequent blocks. It should be noted that the on-chain confirmation depth is calculated in this embodiment using a counting method that includes the block itself. Since a transaction corresponding to an authorization rule state receives at least one layer of on-chain confirmation (the block being written) once it is packaged and written into a block, the on-chain confirmation depth should be 1, not 0, when the current block height is equal to the block height being written. By adding 1 to the difference in block heights, the on-chain confirmation depth is always positive, which better aligns with the conventional definition of confirmation layers in blockchain scenarios.
[0037] Obtain the finality status identifier of the transaction identifier from the blockchain network, where the finality status identifier is a binary identifier; when the transaction corresponding to the transaction identifier has been confirmed by the blockchain network and is not in a state affected by rollback or reorganization, the finality status identifier is recorded as 1, otherwise the finality status identifier is recorded as 0; It should be noted that the finality state identifier is used to characterize whether the on-chain transaction corresponding to the transaction identifier has reached a stable and irreversible confirmation state. Specifically, when the transaction has been confirmed by the blockchain network and is in a stable consensus state, and has not been affected by abnormal consensus events such as on-chain rollback or chain reorganization, the authorization rule state corresponding to the transaction can be considered to have on-chain finality, and the finality state identifier is recorded as 1; conversely, when the transaction has not yet been confirmed or is likely to be affected by rollback or reorganization, the finality state identifier is recorded as 0. By introducing the finality state identifier, the authorization rule state in an unstable consensus stage can be avoided from being used for subsequent rule application determination, thereby improving the consistency and reliability of on-chain state references.
[0038] The on-chain maturity coefficient is calculated by multiplying the on-chain confirmation depth by the block height of the latest block and then by the finality status identifier. The larger the on-chain maturity coefficient, the higher the confirmation maturity of the authorized rule status in the blockchain network, and thus the stronger its contribution to on-chain availability and consistency in the rule applicability index evaluation.
[0039] The on-chain maturity coefficient characterizes the reliability of the confirmation of the authorization rule state in the blockchain network. By comprehensively reflecting the on-chain confirmation depth experienced by the authorization rule state since it was written into a block and whether it has reached a final state of stable consensus, it distinguishes the credibility of the authorization rule state when it is in the initial confirmation stage and the fully confirmed stage on the chain. This approach avoids simply judging based on whether the authorization rule state has been recorded on the chain, but instead characterizes its maturity level from two dimensions: on-chain confirmation sufficiency and consensus stability. Therefore, in scenarios where multiple authorization rule states coexist, it provides a more reliable on-chain state basis for determining the applicability of rules, which helps to improve the consistency and security of the data flow control process.
[0040] In this embodiment, it should be specifically explained that the step of determining the target authorization rule status corresponding to this data flow request based on the rule applicability index of each authorization rule status in the candidate authorization rule status set is as follows: Obtain the rule applicability index of all authorized rule statuses, compare the rule applicability indices, and determine the authorized rule status corresponding to the highest rule applicability index as the target authorized rule status for this data flow request. When multiple authorization rule states have the same rule applicability index and the maximum value, the authorization rule state whose effective time information is closest to the data flow request time is selected as the target authorization rule state.
[0041] The data flow control module is used to control and process data flow requests based on the target authorization rule status, and obtain the flow result status. Data transfer requests are verified and processed according to authorization rules to determine whether access or transmission of the corresponding data between relevant entities is permitted. This process generally includes comparing information such as the requesting entity, data identifier, and authorization scope, and outputting the corresponding transfer processing result based on the comparison result. The above-described method of controlling and processing data transfer requests based on authorization rules is a common and widely used technique in the field of data access control, and its specific steps will not be described in detail in this embodiment.
[0042] The workflow status management module is used to maintain the status of workflow results and establish the association between workflow result status and corresponding data identifiers.
[0043] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0044] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A smart contract data management and circulation control system for data flow, characterized in that, The system includes: The data access and management module is used to acquire data to be circulated, process and encapsulate the data in a unified format to form a data management object, and assign a corresponding data identifier to the data management object. The data management object includes attribute information and user information. The authorization rule generation and management module is used to construct data authorization rules based on data management objects and their data identifiers, and to manage the data authorization rules to form authorization rule information to be written. The smart contract execution module is used to deploy and run smart contracts related to data circulation, and write the authorization rule state into the blockchain network to form the authorization rule state; The authorization rule change determination module is used to obtain the authorization rule status sequence corresponding to the target data identifier when a data flow request is received, and to determine whether at least one authorization rule change has occurred within the life cycle of the data flow request based on the authorization rule status sequence. If the rule application determination module determines that at least one authorization rule change has occurred within the lifecycle of the data flow request, it determines a set of candidate authorization rule states based on the authorization rule state sequence, and obtains the rule application parameters corresponding to each authorization rule state in the candidate authorization rule state set. The rule application parameters include the authorization effective start time stamp, the authorization effective end time stamp, the historical authorization rule state sequence, and the on-chain positioning information. The rule applicability index is obtained by evaluating the rule applicability parameters. The target authorization rule status corresponding to this data flow request is determined based on the rule applicability index of each authorization rule status in the candidate authorization rule status set. The data flow control module is used to control and process data flow requests based on the target authorization rule status, and obtain the flow result status. The workflow status management module is used to maintain the status of workflow results and establish the association between workflow result status and corresponding data identifiers.
2. The smart contract data management and circulation control system for data circulation according to claim 1, characterized in that: The steps for constructing data authorization rules based on data management objects and their data identifiers are as follows: Obtain the corresponding data identifier from the data management object and establish the association between the data identifier and the data management object; Based on the attribute information and data identifier of the data management object, determine the data authorization scope corresponding to the data management object; Based on the user information in the data management object, determine the data access subjects involved in the data authorization rules; Based on the data identifier, data authorization scope, and data access subject, construct the conditions and content of the data authorization rules; Generate complete data authorization rules based on conditional content.
3. The smart contract data management and circulation control system for data flow according to claim 1, characterized in that, The step of determining whether at least one authorization rule change has occurred during the lifecycle of a data flow request based on the authorization rule state sequence is as follows: Sequentially obtain the status parameters corresponding to adjacent authorization rule states in the authorization rule status sequence, and compare the status parameters of adjacent authorization rule states item by item; When a change in at least one status parameter is detected between adjacent authorization rule states, it is determined that at least one authorization rule change has occurred within the lifecycle of the data flow request. If no change in the status parameter is detected in the authorization rule status sequence, it is determined that no change in the authorization rule has occurred during the data flow request lifecycle.
4. A smart contract data management and circulation control system for data flow according to claim 1, characterized in that, The steps for obtaining the candidate authorization rule status set are as follows: Arrange the authorization rule status sequence in chronological order according to the effective time information corresponding to each authorization rule status in the authorization rule status sequence; Based on the request time information of the data flow request, the authorization rule status that matches the request time range is selected from the authorization rule status sequence to form a candidate authorization rule status set; Furthermore, when the candidate authorization rule status set is empty, the authorization rule status that most recently took effect before the data flow request time is selected from the authorization rule status sequence and added to the candidate authorization rule status set.
5. A smart contract data management and circulation control system for data flow according to claim 1, characterized in that: The steps for obtaining the applicable index for the rule are as follows: After receiving a data transfer request, obtain the request timestamp of the data transfer request and the authorization effective start timestamp and authorization effective end timestamp of the authorization rule status. Calculate the time adaptation coefficient based on the request timestamp, authorization effective start timestamp, and authorization effective end timestamp. Obtain the historical authorization rule status sequence corresponding to the authorization rule status, arranged in chronological order, and calculate the rule stability coefficient based on the historical authorization rule status sequence; Obtain the on-chain location information of the authorization rule status in the blockchain network, and calculate the on-chain maturity coefficient based on the on-chain location information; The time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient are normalized, and the rule applicability index is calculated based on the normalized time adaptation coefficient, rule stability coefficient, and on-chain maturity coefficient.
6. A smart contract data management and circulation control system for data flow according to claim 5, characterized in that: The steps for obtaining the time adaptation coefficient are as follows: Upon receiving a data transfer request, the request time information corresponding to the data transfer request is obtained and recorded as the request timestamp. At the same time, the authorization start timetamp and authorization end timetamp corresponding to the authorization rule status corresponding to the target data identifier are obtained from the authorization rule status. Subtract the authorization start time stamp from the authorization end time stamp to obtain the authorization effective time window length; Calculate the average of the authorization effective and termination timestamps and the authorization effective start timestamps to obtain the center timestamp of the authorization effective time window; Calculate the absolute difference between the request timestamp and the center timestamp of the authorization effective time window to obtain the request time deviation. The request time deviation is normalized under the authorization effective time window scale to obtain the normalized deviation. When the request timestamp is greater than or equal to the authorization start timestamp and less than or equal to the authorization end timestamp, subtract the normalized deviation from 1 to obtain the time adaptation coefficient. When the request timestamp is less than the authorization start timestamp or greater than the authorization end timestamp, the time adaptation coefficient is recorded as 0.
7. A smart contract data management and circulation control system for data flow according to claim 5, characterized in that: The steps for obtaining the rule stability coefficient are as follows: For any authorization rule state in the candidate authorization rule state set, obtain the historical authorization rule state sequence corresponding to that authorization rule state, arranged in chronological order; Extract a set of state parameters to characterize the stability of the authorization rule state from each authorization rule state in the authorization rule state sequence; Compare two adjacent authorization rule states in the authorization rule state sequence. If the two adjacent authorization rule states are not equal, the adjacent state change flag is recorded as 1; if the two adjacent authorization rule states are equal, the adjacent state change flag is recorded as 0. Obtain the sequence length of the authorization rule state sequence. When the sequence length is 1, record the change frequency stable component as 1. When the sequence length is greater than 1, count the number of changes of adjacent state change identifiers, and calculate the change frequency stable component based on the number of changes and the sequence length. Based on the adjacent state change identifier, identify the continuous stable segment in the state sequence of the authorization rule, obtain the maximum number of continuous stable states corresponding to the continuous stable segment, and divide the maximum number of continuous stable states by the sequence length to obtain the stable component of the continuous stable segment. The regular stability coefficient is obtained by multiplying the stable component with the variable frequency with the stable component of the continuous stable segment.
8. A smart contract data management and circulation control system for data flow according to claim 5, characterized in that: The steps for obtaining the on-chain maturity coefficient are as follows: For any authorization rule state in the candidate authorization rule state set, obtain the on-chain location information of the authorization rule state in the blockchain network. The on-chain location information includes: the transaction identifier carrying the authorization rule state and the block height where the transaction was written. When a data transfer request is received, the block height of the latest block is obtained from the blockchain network. The block height of the latest block is then subtracted from the block height of the transaction written, and then 1 is added to obtain the on-chain confirmation depth. Obtain the finality status identifier of the transaction identifier from the blockchain network. When the transaction corresponding to the transaction identifier has been confirmed by the blockchain network and is not in a state affected by rollback or reorganization, the finality status identifier is recorded as 1; otherwise, the finality status identifier is recorded as 0. The on-chain maturity coefficient is calculated by dividing the on-chain confirmation depth by the block height of the latest block and then multiplying it by the finality status flag.
9. A smart contract data management and circulation control system for data flow according to claim 1, characterized in that: The step of determining the target authorization rule status corresponding to this data transfer request based on the rule applicability index of each authorization rule status in the candidate authorization rule status set is as follows: Obtain the rule applicability index of all authorized rule statuses, compare the rule applicability indices, and determine the authorized rule status corresponding to the highest rule applicability index as the target authorized rule status for this data flow request. When multiple authorization rule states have the same rule applicability index and the maximum value, the authorization rule state whose effective time information is closest to the data flow request time is selected as the target authorization rule state.