A method, apparatus, storage medium, and electronic device for atomic processing of cross-domain data states.
By generating and asynchronously reporting cross-domain events carrying shared transaction identifiers in a distributed system, and performing consistency determination at a trusted coordinating node, the problem of reliable association and consistency of cross-domain data states in asynchronous network environments is solved, and the atomicity and consistency of cross-domain data state changes are improved.
Patent Information
- Application Number
- CN202611296565.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-17
AI Technical Summary
In cross-domain interaction scenarios of distributed systems, existing technologies struggle to reliably correlate and consistently determine cross-domain data state changes between different nodes in asynchronous and uncertain network environments. This leads to partial effectiveness or erroneous release of temporary states in cross-domain transactions, making it difficult to guarantee the atomicity and consistency of cross-domain data states.
By executing the first event in the effective state on the first node and establishing the second event in the temporary state on the second node, the shared transaction identifier is asynchronously reported to the trusted coordination node for cross-domain transaction association and consistency determination. The second node is only triggered to release the temporary state when the consistency determination is successful; otherwise, the temporary state is maintained and not released.
It reduces the risk of partial effectiveness and incorrect state release in cross-domain transactions under asynchronous network environments, and improves the reliability and consistency of cross-domain data state collaborative processing.
Smart Images

Figure CN123114632A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed data processing technology, and more specifically, to a method and apparatus for atomic processing of cross-domain data states, a storage medium, and an electronic device. Background Technology
[0002] In cross-domain interaction scenarios of distributed systems, different business nodes are typically managed by independent systems, with each node maintaining its local data state. When different nodes need to perform resource swapping, rights sharing, or other cross-domain data state coordination, data interaction between nodes is required to achieve coordinated changes in the relevant states, ensuring that the data states maintained by different nodes for the same cross-domain transaction remain consistent.
[0003] Existing technologies typically employ centralized reconciliation mechanisms or synchronous interface calls to achieve cross-domain data status coordination. Centralized reconciliation mechanisms usually involve each participating node periodically summarizing its own system's status changes and operation records and sending them to a centralized system for data comparison and discrepancy processing. This approach suffers from significant time lag and struggles to promptly detect status differences arising during cross-domain status changes. Synchronous interface calls, on the other hand, rely on real-time communication between different nodes. In cases of network jitter, communication delays, or interruptions, situations can arise where one node has completed its status change while another has not, leaving cross-domain transactions partially effective or suspended. For these abnormal states, existing technologies typically require manual reconciliation or anomaly repair, which fails to meet the demands for real-time and reliable cross-domain data status coordination and processing.
[0004] Therefore, in situations where different nodes operate independently and the network environment is asynchronous and uncertain, how to reliably associate the state changes of different nodes belonging to the same cross-domain transaction, and to make consistency judgments on the associated state changes, so that the state of one node has already taken effect while the state of the other node is temporarily stored only takes effect after the consistency is confirmed, and the temporary state is prevented from being released incorrectly when the consistency is not confirmed, thereby improving the atomicity and consistency of cross-domain data state changes, has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and electronic device for atomic processing of cross-domain data states. It can solve the technical problem that when different nodes operate independently and the network environment is asynchronous and uncertain, it is difficult to reliably associate and determine the state changes of different nodes belonging to the same cross-domain transaction, which leads to the partial effectiveness or erroneous release of temporary states in cross-domain transactions, thus making it difficult to guarantee the atomicity and consistency of cross-domain data state changes.
[0006] According to a first aspect of this application, an atomic processing method for cross-domain data state is provided. The method includes: in response to a cross-domain state change request, a first node performs a first data state change and generates a first event containing an effective state; a second node establishes a temporary state corresponding to a second data state change and generates a second event based on the temporary state; both the first event and the second event carry a shared transaction identifier; the first event and the second event are asynchronously reported to a trusted coordination node; the trusted coordination node performs a cross-domain transaction association on the first event and the second event based on the shared transaction identifier; the trusted coordination node performs a consistency determination on the successfully associated first event and second event; in response to the consistency determination passing, the second node is triggered to release the temporary state as an effective state; in response to the consistency determination failing, the temporary state of the second node is not released.
[0007] According to a second aspect of this application, an atomic processing apparatus for cross-domain data state is provided. The apparatus includes: a state change and event generation module configured to, in response to a cross-domain state change request, a first node executes a first data state change and generates a first event containing an effective state, a second node establishes a temporary state corresponding to a second data state change, and generates a second event based on the temporary state, wherein both the first event and the second event carry a shared transaction identifier; an asynchronous reporting module configured to asynchronously report the first event and the second event to a trusted coordinating node; a transaction association module configured to, based on the shared transaction identifier, perform cross-domain transaction association between the first event and the second event; a consistency determination module configured to, based on the successfully associated first event and second event, perform a consistency determination by the trusted coordinating node; and a state release control module configured to, in response to the consistency determination passing, trigger the second node to release the temporary state into an effective state; and in response to the consistency determination failing, prevent the temporary state of the second node from being released.
[0008] According to a third aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the above-described atomic processing method for cross-domain data states.
[0009] According to a fourth aspect of this application, an electronic device is provided, including a processor; and a memory for storing one or more programs, which, when executed by the processor, cause the processor to implement the above-described atomic processing method for cross-domain data states.
[0010] Compared with the prior art, this application sets the states of different nodes involved in the cross-domain transaction to two different states: an effective state and a temporary state. This avoids the second node directly making the corresponding state effective before the cross-domain transaction has been confirmed to be consistent, and reduces the risk of partial effectiveness when the state of one end has been changed but the state of the other end has not been synchronized.
[0011] Furthermore, this application asynchronously reports the first event and the second event to the trusted coordinating node, and associates the first event and the second event across domains based on the shared transaction identifier, so that state changes scattered across different nodes can correspond to the same cross-domain transaction, thereby reducing the risk of transaction mismatch caused by differences in the arrival time of events in an asynchronous network environment.
[0012] Furthermore, this application performs a consistency determination on the first and second events of successful association, and only triggers the second node to release the temporary state into an effective state when the consistency determination passes. If the consistency determination fails, the temporary state of the second node is maintained and not released, so that the final effectiveness of cross-domain state change is controlled by the consistency determination result, thereby avoiding the erroneous release of the temporary state when the states of the two ends are inconsistent, and improving the atomicity and consistency of cross-domain data state change.
[0013] Therefore, this application can improve the reliability of cross-domain data state collaborative processing by reducing the risk of partial effectiveness and incorrect state release of cross-domain transactions through dual-end state separation, cross-domain event association, and conditional state release after consistency determination, when different nodes run independently and the network environment is asynchronous and uncertain.
[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings: Figure 1 A flowchart illustrating an atomic processing method for cross-domain data states provided in this application; Figure 2A flowchart illustrating the specific implementation of the atomic processing method for cross-domain data state provided in this application, which involves the first node generating the first event and the second node generating the second event. Figure 3 A flowchart illustrating the process of verifying the legality of digital signatures and determining the success of cross-domain transaction association in the atomicity processing method for cross-domain data state provided in this application; Figure 4 The flowchart illustrates the process of obtaining the public key, reconstructing the original byte sequence, and performing signature verification operations to determine the validity of the digital signature in the atomic processing method for cross-domain data state provided in this application. Figure 5 The flowchart shows the process of determining the consistency judgment result based on the time difference and triggering the exception handling flow by listening for missing events in the atomicity processing method of cross-domain data state provided in this application. Figure 6 The flowchart illustrates the atomicity processing method for cross-domain data state provided in this application, which maintains the temporary state without releasing it and generates an exception record to be written into the distributed ledger. Figure 7 The flowchart shows the process of calculating the relative error based on a preset resource conversion rate and determining the quantity consistency verification in the atomicity processing method for cross-domain data status provided in this application. Figure 8 The atomicity processing method for cross-domain data state provided in this application includes a flowchart of writing the verification result and abnormal records into a distributed ledger and providing a query interface to obtain the full-process verification record; Figure 9 A structural block diagram of an atomicity processing device for cross-domain data state provided in this application; Figure 10 This is a schematic diagram of the modules of an electronic device according to an exemplary embodiment of this application. Detailed Implementation
[0016] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of the embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this application.
[0017] Furthermore, the accompanying drawings are merely illustrative of this application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0018] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances. Furthermore, all the terms "first" and "second" used below are for distinction purposes only and should not be construed as limiting the scope of this application.
[0019] Figure 1 A flowchart illustrating an exemplary embodiment of the atomic processing method for cross-domain data states is shown. (Reference) Figure 1 The atomic processing method for cross-domain data state can include the following steps: Step S110: In response to the cross-domain state change request, the first node performs the first data state change and generates a first event containing the effective state. The second node establishes a temporary state corresponding to the second data state change and generates a second event based on the temporary state. Both the first event and the second event carry a shared transaction identifier.
[0020] Specifically, a cross-domain state change request refers to a request that triggers collaborative updates of data state between two or more independent management domains, such as resource swapping, rights exchange, or data synchronization. Unlike processing methods that require multiple nodes to complete state changes synchronously, this embodiment adopts an asymmetric state transition method, so that different nodes participating in the same cross-domain transaction are in different state stages.
[0021] Specifically, the first node, acting as the initiator of a cross-domain state change or the party changing the first data state, executes the first data state change upon receiving a cross-domain state change request, confirms the first data state change as effective, and generates a first event to characterize the first data state change. This first event records the fact that the first node has completed the state change, so that subsequent trusted coordination nodes can determine the corresponding state change status of the first node based on the first event.
[0022] Unlike the first node, the second node, as the party modifying the second data state, does not directly declare the second data state change as effective upon receiving a cross-domain state change request. Instead, it establishes a temporary state corresponding to the second data state change. The temporary state indicates that the second data state change has been reserved or pre-processed, but has not yet undergone consistency confirmation through cross-domain transactions. Therefore, the temporary state is not directly provided externally as the final effective state. The second node generates a second event based on the temporary state. This second event records the pending confirmation status information corresponding to the second data state change.
[0023] Both the first and second events carry a shared transaction identifier. This shared transaction identifier uniquely identifies the cross-domain transaction to which the first and second data state changes belong, enabling events originating from the first and second nodes respectively to be recognized as events corresponding to the same cross-domain transaction during subsequent processing. The shared transaction identifier can be generated by the initiating node and transmitted to other nodes participating in the cross-domain transaction during the processing of the cross-domain state change request, or it can be jointly determined by the participating nodes according to a preset transaction identifier generation rule. This embodiment does not limit this approach.
[0024] In this way, the first data state change of the first node can enter the effective state first, while the second data state change of the second node remains in the temporary state. This separates the state change process of different nodes in the cross-domain transaction at the state level, so that the second node does not need to make the second data state change effective before the cross-domain transaction association and consistency confirmation are completed. This provides a state basis for the subsequent cross-domain transaction association and consistency determination of the first event and the second event, and reduces the risk of the cross-domain transaction partially taking effect due to the asynchronous state changes of the two ends.
[0025] In yet another alternative embodiment, such as Figure 2 As shown, this application also provides a specific implementation process for the first node to generate the first event and the second node to generate the second event. The method includes: Step S210: The first node and the second node each listen for local state change events.
[0026] The first and second nodes each deploy a data acquisition agent module to detect data status changes within their respective management domains in real time.
[0027] Local state change events are used to characterize data state changes occurring within the first or second node, including operations such as adding, deleting, modifying, or transitioning data states. Local state change events can be triggered by database state changes, state change notifications generated by applications, or other events that reflect changes in local data state.
[0028] As one implementation method, the data acquisition proxy module can obtain locally occurring data state changes by listening to database change logs, receiving state change messages, or calling the event notification interface provided by the application. When a local state change corresponding to a cross-domain state change request is detected, the data acquisition proxy module captures the corresponding local state change event and uses it as the raw data for subsequent event construction.
[0029] In this way, state changes scattered in the local systems of the first and second nodes can be converted into event data that can be further processed, providing a data foundation for the subsequent generation of standardized events corresponding to the first and second nodes respectively.
[0030] Step S230: Extract the transaction identifier, user identifier, operation type, and resource change information from the local state change event.
[0031] After obtaining the local state change event, the data acquisition agent module extracts the data fields related to the cross-domain state change from the local state change event according to the preset field mapping rules.
[0032] Among them, the transaction identifier is used to identify the cross-domain transaction to which this cross-domain state change belongs, so that state change events generated by different nodes can be associated through the same transaction identifier; the user identifier is used to identify the user or other data subject corresponding to the data state change; the operation type is used to characterize the type of this data state change, such as data state increase or data state decrease; and the resource change information is used to characterize the type of resource that has undergone a state change and the corresponding change value.
[0033] When different nodes use different data structures or field naming methods, the data fields in local state change events can be converted into unified standard fields according to the preset field mapping relationship, thereby reducing the impact of data structure differences between different nodes on subsequent event association and consistency determination.
[0034] In this process, user information can be anonymized during the extraction or construction of events to avoid using users' original identity information directly for cross-domain event transmission.
[0035] Step S250: Construct a standardized event structure based on the extracted information, and generate a digital signature for the standardized event structure using the private key of the corresponding node to obtain the first event or the second event.
[0036] Based on the transaction identifier, user identifier, operation type, and resource change information extracted in step S230, a standardized event structure is constructed according to the preset unified event data model.
[0037] A standardized event structure can include at least the following fields: transaction identifier, user identifier, source node identifier, operation type, resource type, change value, and timestamp. This ensures that the events generated by the first and second nodes have a unified data organization form, which facilitates the trusted coordination node to parse, associate, and process events from different nodes for consistency.
[0038] As an alternative implementation, after the standardized event structure is constructed, the first node and the second node can generate digital signatures for the standardized event structure using their respective private keys.
[0039] Specifically, according to a preset field arrangement rule, the data fields in the standardized event structure, excluding the signature field, are serialized to form data to be signed. Then, the private key of the corresponding node is used to perform a signature operation on the data to be signed, generating a digital signature. Subsequently, the digital signature is written into the signature field corresponding to the standardized event structure, thus obtaining either the first event or the second event.
[0040] In the above manner, the first node and the second node can convert local data state changes into first events and second events with a unified data structure, respectively. Furthermore, they can attach source authentication and content integrity verification information to the events through digital signatures, enabling subsequent trusted coordination nodes to judge the credibility of the events based on the corresponding verification information.
[0041] It should be noted that the digital signature mechanism is an optional implementation method for trusted event transmission and verification, and does not affect the basic processing flow of cross-domain transaction association between the first and second events based on the shared transaction identifier.
[0042] Through the aforementioned monitoring, information extraction, event standardization construction, and optional signature processing, the automatic conversion from node local data state changes to cross-domain event data can be achieved, ensuring consistency between the first and second events in data organization, and providing standardized event data for subsequent cross-domain transaction association and consistency determination based on shared transaction identifiers.
[0043] In one optional implementation, the first and second events employ a unified event data model. This unified event data model serves as the foundational architecture for the cross-domain data state atomicity processing method, defining a standardized protocol for information exchange during cross-system interactions. This model is not merely a data container, but a set of structured data specifications with strict semantic constraints and type conventions, aiming to eliminate data format differences between heterogeneous systems. As the sole data carrier for interaction between the first node, the second node, and the trusted coordinating node, its internal field definitions directly serve the execution of core logic such as cross-domain transaction association, consistency determination, and state release.
[0044] The first and second nodes construct reporting events based on change records in their local databases and preset mapping rules, thereby generating a unified event data model. After a node completes a local data status change operation, it extracts key business data from its local business database, including order numbers, user identity information, and resource changes, and populates the corresponding fields in the unified event data model according to preset field mapping logic. This process achieves standardized encapsulation of cross-domain data before transmission, laying the data foundation for subsequent automated processing.
[0045] Specifically, the event data model includes at least the following fields: a transaction identifier field to store the shared transaction identifier; a user identifier field to store the user identifier after anonymization; a source node identifier field to store the source node identifier that generated the event; an operation type field to indicate the increase or decrease of the data state; a resource type field to indicate the changed resource type; a change value field to record the actual number of changes in the data state; a timestamp field to record the millisecond-level timestamp of the event generation; and a signature field to store the digital signature.
[0046] The transaction identifier field serves as the core index field of this data model. Its value is a globally unique shared transaction identifier generated by the initiating node at the initial stage of the business process. This field persists throughout the entire lifecycle of the cross-domain transaction and is the sole retrieval basis for trusted coordinating nodes to associate cross-domain transactions, ensuring that first and second events scattered across different domains can be accurately matched to the same business context.
[0047] The user identifier field stores the user's identity after it has been anonymized, such as user identity information processed using a hash algorithm or masking rules. This design supports the tracking and auditing of abnormal behavior based on the user dimension, while ensuring privacy compliance.
[0048] The source node identifier field identifies the node that generated the event, distinguishing it from the first or second node. During cross-domain transaction association, this field prevents self-closing matching of events from the same node, ensuring that paired events originate from different business domains.
[0049] The operation type field is an enumeration type, explicitly indicating the direction of data state change corresponding to the current event, with specific values including increase or decrease. This field directly serves the logical verification of numerical changes in subsequent consistency checks.
[0050] The resource type field defines the specific category of the data resource that has changed, such as points, membership days, or virtual currency. By clearly defining the resource category, it ensures that changes to different resource types can be correctly identified and distinguished, avoiding validation errors caused by confusion of resource types.
[0051] The variable value field uses a high-precision numeric type to record the actual number of changes in data status. This field is a key data basis for determining whether the quantity of cross-domain rights exchange is compliant, and it directly participates in the calculation of numerical proportions and error verification.
[0052] The timestamp field records the precise moment an event was generated, with millisecond-level accuracy. This timestamp is not only used to record the time when a business event occurs, but also in consistency checks to calculate the time difference between the arrival of the first and second events, in order to identify any abnormal time deviations or delay attacks.
[0053] The signature field stores a digital signature, which is generated by the source node using its private key to operate on all fields in the event except the signature field. By verifying this signature, the integrity of the event data and the authenticity of its source can be guaranteed, preventing data from being tampered with or forged during transmission.
[0054] By applying this unified event data model, unstructured or semi-structured business data generated by heterogeneous systems can be transformed into standard events with unified semantics. This structured data encapsulation method eliminates data parsing errors caused by ambiguous field naming, incompatible data formats, or differences in precision definitions. This allows trusted coordination nodes to directly execute automated consistency verification logic based on standard fields without the need for complex adaptation and conversion for different participants, thereby significantly improving the efficiency and accuracy of cross-domain data processing.
[0055] Step S130: Asynchronously report the first event and the second event to the trusted coordination node.
[0056] After generating their respective first and second events, the first and second nodes asynchronously report these events to the trusted coordinating node via their locally deployed data acquisition agent modules. This asynchronous reporting mechanism eliminates the need for the first and second nodes to wait for the other to complete its operation or for an immediate response from the trusted coordinating node, thus preventing their business processes from being blocked due to network latency or overhead on the other end. During the reporting process, the first and second events carry their respective transaction identifiers and digital signatures. The trusted coordinating node, acting as an arbitrator independent of the first and second nodes, receives and caches the first and second events, triggering the subsequent consistency verification process once both events have arrived.
[0057] Step S150: The trusted coordinating node performs cross-domain transaction association for the first event and the second event based on the shared transaction identifier.
[0058] After receiving a reported event, the trusted coordinating node parses the shared transaction identifier carried in the event. Due to the asynchronous nature of network transmission, the arrival times of the first and second events at the trusted coordinating node are uncertain. The trusted coordinating node uses the shared transaction identifier to search the event buffer pool or database, matching the first and second events with the same shared transaction identifier to establish a logical association. This cross-domain transaction association process is a prerequisite for subsequent consistency verification, ensuring that the judgment operation is performed on the same cross-domain business transaction in two different domains, avoiding misjudgments due to event confusion.
[0059] Furthermore, such as Figure 3 As shown, the embodiments of this application provide a detailed explanation of specific cross-domain transaction associations, including: Step S310: Obtain the digital signature carried in the first event and the second event, and verify the legality of the digital signature.
[0060] After receiving the first event and the second event reported by the first node and the second node respectively, the trusted coordination node obtains the digital signatures carried in the first event and the second event, and verifies the legality of the digital signatures respectively.
[0061] Specifically, for the first event, the trusted coordinating node obtains the public key corresponding to the source node of the first event and reconstructs the data to be verified based on the data fields in the first event, excluding the signature field. Subsequently, it uses the public key to perform a signature verification operation on the digital signature in the first event and the data to be verified. If the signature verification operation passes, the digital signature in the first event is determined to be valid, and it is thus confirmed that the first event was generated by the corresponding source node and that the event content has not been tampered with.
[0062] For the second event, the same method as for the first event is used to obtain the public key corresponding to the source node of the second event, and the digital signature in the second event is verified. When the digital signatures of both the first and second events pass verification, it is determined that the first event and the second event respectively meet the verification requirements of source authenticity and content integrity.
[0063] In one implementation, the first node and the second node can respectively form data to be signed from multiple data fields in the event (excluding the signature field) according to a preset field arrangement order, and generate a digital signature using their respective private keys; the trusted coordination node then verifies the digital signature using the public key of the corresponding node. The specific signature algorithm used can be configured according to actual application requirements, and this application does not impose specific limitations on it.
[0064] Step S330: Verify whether the shared transaction identifiers in the first event and the second event are consistent, and whether the source nodes of the first event and the second event are different.
[0065] After the digital signature verification of the first and second events is successful, the trusted coordinating node further extracts the shared transaction identifier from the first and second events and performs a consistency check on the two shared transaction identifiers.
[0066] The shared transaction identifier is used to identify the same cross-domain transaction to which the first data state change and the second data state change belong. The trusted coordinating node compares the shared transaction identifier in the first event with the shared transaction identifier in the second event. When the two shared transaction identifiers match, it is determined that the first event and the second event belong to the same cross-domain transaction in terms of transaction identifier dimension.
[0067] Simultaneously, the trusted coordinating node obtains the source node identifiers corresponding to the first and second events and verifies whether the two source node identifiers are different. When the two source node identifiers are different, it is determined that the first event and the second event originate from different participating nodes, thereby avoiding the erroneous association of multiple events generated by the same node as two events in a cross-domain transaction.
[0068] By simultaneously verifying the shared transaction identifier and the source node, dual constraints can be imposed on the events to be associated in both the transaction identifier and source dimensions. This enables the trusted coordinating node to filter out events from multiple asynchronously reported events that originate from different nodes and belong to the same cross-domain transaction.
[0069] Step S350: In response to the validity of the digital signature, the consistency of the shared transaction identifier, and the different source nodes, the cross-domain transaction association is determined to be successful.
[0070] When the digital signatures of the first event and the second event are both verified to be valid, the shared transaction identifiers in the two events are consistent, and the source nodes of the two events are different, the trusted coordinating node determines that the cross-domain transaction association between the first event and the second event is successful.
[0071] After the association is successful, the trusted coordinating node can bind the first event and the second event to the transaction processing context of the same cross-domain transaction, and continue to perform subsequent consistency determination based on the associated first event and second event.
[0072] In this way, the trusted coordinating node first uses digital signatures to verify the authenticity of the event's source and the integrity of its content, then uses shared transaction identifiers to determine whether two events belong to the same cross-domain transaction, and uses source node information to confirm that the two events come from different participating nodes, thus forming a multi-condition association mechanism consisting of "event trustworthiness verification - transaction identifier association - source node constraint".
[0073] This reduces the risk of cross-domain transaction errors caused by event tampering, incorrect matching, or repeated event generation by the same node, providing reliable event input for subsequent consistency determinations based on the consistency of execution time and quantity of associated events.
[0074] Furthermore, the embodiments of this application provide a detailed description of verifying the legality of digital signatures, referencing... Figure 4 ,include: Step S410: For any target event in the first event and the second event, obtain the public key of the source node that generated the target event.
[0075] When verifying the legitimacy of a digital signature in a target event, the trusted coordinating node first determines the source node that generated the target event and obtains the public key corresponding to the source node.
[0076] Specifically, the target event can carry a source node identifier. The trusted coordinating node retrieves the public key corresponding to the source node from a pre-configured public key storage location based on the source node identifier. The public key corresponds to the private key used by the source node when generating the target event and is used to verify the digital signature generated by the source node.
[0077] By configuring corresponding public keys for nodes from different sources, trusted coordinating nodes can select appropriate verification parameters based on the actual source of the target event, thus providing a foundation for subsequent digital signature verification.
[0078] Step S430: The digital signature in the target event is generated by the source node using the corresponding private key to perform a signature operation on the original byte sequence obtained by concatenating multiple data fields in the target event, excluding the field where the signature is located, in a preset order.
[0079] When generating a target event, the source node determines the data fields to be digitally signed from the event data to be sent, and organizes multiple data fields, excluding the field containing the signature, in a preset order.
[0080] Multiple data fields may include at least some of the following: transaction identifier, user identifier, source node identifier, operation type, resource type, changed value, and timestamp. The specific composition of each data field can be configured according to actual application requirements.
[0081] The source node serializes and concatenates multiple data fields into byte sequences according to a preset order to obtain the original byte sequence. It then performs a signature operation on the original byte sequence using the corresponding private key to generate a digital signature. Finally, the digital signature is written to the signature field corresponding to the target event.
[0082] The preset arrangement order is used to determine the position of multiple data fields participating in the digital signature operation within the original byte sequence. This order is jointly determined by the first node, the second node, and the trusted coordinating node based on a pre-agreed unified event data model. Specifically, when determining the unified event data model, each data field is configured with a corresponding field identifier and field sequence number, and the arrangement order of the multiple data fields is determined according to the field sequence number. When generating an event, the first and second nodes extract the corresponding fields sequentially according to the field sequence number and perform byte serialization and concatenation. When performing signature verification, the trusted coordinating node reconstructs the original byte sequence based on the same field sequence number and field serialization rules. The preset arrangement order can be predetermined and synchronized to all participating nodes during system initialization, node registration, or event data model configuration, ensuring that the signature generation and signature verification ends use consistent data organization rules.
[0083] By associating a digital signature with data fields other than the signature field, when the content of any field in the data field changes, the original byte sequence reconstructed based on the changed data field will change, thus making it impossible to re-verify the signature on the changed data.
[0084] Step S450: The trusted coordinating node extracts multiple data fields from the target event, excluding the field containing the signature, according to a preset arrangement order, and reconstructs the original byte sequence.
[0085] After receiving the target event, the trusted coordinating node first determines multiple data fields from the target event, excluding the field containing the signature, and extracts these multiple data fields in the same preset order as when the source node generated the digital signature.
[0086] Subsequently, the trusted coordinating node performs data organization and serialization processing on the extracted data fields according to a preset order, corresponding to the source node, in order to reconstruct the original byte sequence used for signature verification.
[0087] In one implementation, to avoid different nodes using different data representations for the same field, the source node and trusted coordinating node can pre-agree on the encoding method, field arrangement method, and data serialization rules of the data field, so that the same data field can form a consistent byte sequence after processing.
[0088] Therefore, the trusted coordinating node can reproduce the original data corresponding to the digital signature generated by the source node locally based on the received target event, thereby providing data to be verified for subsequent signature verification.
[0089] Step S470: Perform signature verification operations on the digital signature and the reconstructed original byte sequence using the public key.
[0090] After obtaining the public key corresponding to the source node, the digital signature in the target event, and the reconstructed original byte sequence, the trusted coordinating node performs digital signature verification operations.
[0091] Specifically, the trusted coordinating node uses the public key, digital signature, and the reconstructed original byte sequence as inputs to the signature verification operation, and determines whether the digital signature matches the source node and the original byte sequence according to the preset signature verification rules.
[0092] When the signature verification operation shows that the digital signature can be verified by the public key against the reconstructed original byte sequence, it is determined that the digital signature corresponds to the data content of the current target event; when the signature verification operation fails, it is determined that the digital signature is invalid.
[0093] The specific digital signature algorithm can be configured according to actual application requirements, and this application does not impose any specific limitations on it.
[0094] Step S490: In response to the successful signature verification operation, the digital signature of the target event is determined to be valid, so as to confirm that the source of the target event is genuine and the content has not been tampered with.
[0095] When the signature verification operation passes, the trusted coordinating node determines that the digital signature in the target event is valid.
[0096] Since the digital signature is generated by the source node of the target event using the corresponding private key and verified by the trusted coordinating node using the public key corresponding to the private key, if the signature verification is successful, it can be confirmed that the target event has a valid signature corresponding to the source node.
[0097] Meanwhile, since the original byte sequence used in the signature verification process is reconstructed from the data fields in the target event other than the signature field, when the data fields involved in the signature in the target event change during transmission, the reconstructed original byte sequence will also change, making the original digital signature unable to pass verification for the changed data.
[0098] Therefore, the above signature verification process can simultaneously verify the authenticity of the source of the target event and the integrity of the data covered by the signature.
[0099] Through steps S410 to S490, the trusted coordinating node can verify the digital signature in the target event based on the public key corresponding to the source node, and reconstruct the signature verification data in a consistent manner through a preset field arrangement order, thereby establishing a trusted association between the target event and its source node, and reducing the risk that the event data will be forged or tampered with during transmission and then enter the subsequent cross-domain transaction association and consistency determination process.
[0100] Step S170: The trusted coordinating node performs a consistency determination on the first and second events of successful association.
[0101] After completing the cross-domain transaction association, the trusted coordinating node performs a consistency check on the matched first and second events. This check aims to verify whether the data state changes described by the two events are logically and numerically compatible and conform to preset business rules. As a core step in ensuring the atomicity of cross-domain data state, the consistency check ensures that the deduction operation executed by the first node and the addition operation to be executed by the second node are consistent in terms of quantity, time, and identity, preventing data tampering, duplicate redemption, or accounting imbalance. Only when the check result is passed does it indicate that the cross-domain state change meets the atomicity requirements agreed upon in the business agreement.
[0102] In one alternative embodiment, such as Figure 5 As shown, this application also provides an implementation method for fault-tolerant processing of cross-domain events based on time consistency verification and retry observation period. This method is used to determine the timeliness of cross-domain transactions and provide a waiting and retry mechanism when a single-end event is temporarily missing. If the missing event is not received after a preset retry observation period, an exception handling process is triggered. The method includes: Step S510: In response to the fact that both the first event and the second event have arrived and the time difference between them exceeds the preset time window, the consistency determination is determined to be unsuccessful.
[0103] When the trusted coordinating node receives a first event and a second event carrying the same shared transaction identifier, it retrieves the timestamp fields from the first and second events respectively and calculates the absolute time difference between the two timestamps. The timestamps are used to characterize the generation time of the corresponding event or the time when the corresponding local state change occurred.
[0104] The calculated absolute time difference is compared with a preset time window. When the absolute time difference exceeds the preset time window, it indicates that the deviation of the state changes of the first node and the second node in the time dimension exceeds the preset allowable range. At this time, the consistency determination is determined to have failed, and subsequent consistency determinations based on this event are stopped.
[0105] The preset time window can be configured based on the real-time requirements of cross-domain services, node processing latency, and network communication environment. For example, a smaller time window can be set for services with high real-time requirements; a larger time window can be set for services that cross geographical boundaries or have significant network latency. By setting a time window, events that clearly exceed the normal service timeline can be identified, preventing expired events from participating in subsequent state release decisions.
[0106] Step S530: In response to the fact that both the first event and the second event have arrived and the time difference between them does not exceed the preset time window, the time consistency check is confirmed to be successful.
[0107] When both the first and second events have reached the trusted coordination node, and the calculated absolute time difference between the two events does not exceed the preset time window, the time consistency check is considered successful.
[0108] The time consistency check indicates that the state changes corresponding to the first and second events occurred within a preset allowed time range, satisfying the timeliness condition for participating in subsequent consistency determinations. At this point, the trusted coordinating node retains the first and second events and continues to execute subsequent consistency determinations to further assess the consistency of the two events in terms of data state and business rules.
[0109] By incorporating time-dimensional verification into the consistency determination, the temporal relationship of events can be constrained before cross-domain events enter the subsequent state release process, thereby reducing erroneous state releases caused by long-term lags or abnormal delays in events.
[0110] Step S550: In response to receiving only one-end event from the first event or the second event, continuously listen for the missing other-end event during the preset retry observation period.
[0111] In actual cross-domain asynchronous communication, due to network jitter, communication delays, or temporary node unavailability, the trusted coordinating node may receive only one of the first or second events within a certain period of time. In this case, the trusted coordinating node establishes a matching transaction context based on the shared transaction identifier in the received single-end event and determines the missing other-end event.
[0112] During the pre-defined retry observation period, the trusted coordinating node continuously monitors the event receiving channel and searches for a corresponding event on the other end based on the shared transaction identifier. When an event on the other end carrying the same shared transaction identifier is received during the retry observation period, the event on the other end is paired with the already received single-end event.
[0113] The preset retry observation period is used to provide a buffer time for network retransmission, delayed event arrival, and short-term node failure recovery. Its specific duration can be configured according to network communication latency, event retransmission cycle, and the maximum waiting time allowed by the service, and is not limited to a specific time length.
[0114] By setting a retry observation period, trusted coordinating nodes can distinguish between temporary event transmission delays and persistent cross-domain transaction anomalies, avoiding the direct judgment of normal transactions as failures due to brief communication jitter.
[0115] Step S570: In response to receiving an event from the other end within the preset retry observation period, re-execute the cross-domain transaction association and consistency determination.
[0116] When the trusted coordinating node receives a missing event from the other end within the preset retry observation period, it associates the missing event with the previously received single-end event based on the shared transaction identifier carried by the other end event, and re-executes the cross-domain transaction association.
[0117] After a cross-domain transaction association is successfully established, the trusted coordinating node performs a consistency check on the re-associated first and second events. The consistency check may include time consistency verification and other preset consistency checks, and determines whether the second node is allowed to release the corresponding temporary state based on the result of the re-execution.
[0118] By re-executing the association and consistency determination after a missing event arrives, cross-domain transactions can be avoided from being terminated directly due to the temporary absence of a single-end event, allowing events that arrive late but are still within the scope of valid processing to re-enter the atomic processing flow.
[0119] Step S590: In response to the failure to receive an event from the other end after the preset retry observation period, the exception handling process is triggered.
[0120] If the trusted coordinating node still has not received the missing event from the other end after the preset retry observation period has expired, it is determined that the cross-domain transaction has not formed a complete pair of events within the preset waiting range, and the exception handling process is triggered.
[0121] Specifically, this application also provides a concrete implementation method for the exception handling process, such as... Figure 6 As shown, the method includes: Step S610: Maintain the temporary state of the second node and do not release it.
[0122] If the missing event from the other end is not received by the end of the preset retry observation period, or if the consistency determination fails, the trusted coordinating node sends a state maintenance instruction to the second node, so that the second node maintains the temporary state corresponding to the shared transaction identifier and does not perform the release operation from the temporary state to the effective state.
[0123] The temporary state is used to indicate that the corresponding second data state change on the second node side has not yet been confirmed by cross-domain transactions. By maintaining the temporary state in abnormal situations, unconfirmed state changes can be prevented from entering the effective state of the second node, thereby avoiding further expansion of state differences before a valid consistency determination has been formed between the first and second nodes, and preserving the corresponding transaction state for subsequent abnormal handling.
[0124] Step S630: Prohibit transactions related to the corresponding shared transaction identifier from generating new state changes.
[0125] While maintaining the temporary state of the second node, the trusted coordinating node further marks the shared transaction identifier that has an anomaly as an abnormal state and sends a state change restriction instruction to the relevant nodes, so that the first node and / or the second node prohibits the transaction corresponding to the shared transaction identifier from continuing to generate new state changes.
[0126] Specifically, after receiving the state change restriction instruction, the relevant node adds the shared transaction identifier to the local abnormal transaction set; when it receives a state change request carrying the shared transaction identifier again, it intercepts or rejects the state change request until the abnormal state corresponding to the shared transaction identifier is lifted.
[0127] By restricting abnormal transactions from generating new state changes, we can prevent abnormal transactions from continuing to transition to a new state before they have been processed, thus preventing the abnormal state from spreading to subsequent business operations and reducing the risk of further inconsistencies in the state caused by repeated commits or processing.
[0128] Step S650: Generate an exception record containing the reason for the failure and write the exception record to the distributed ledger to provide tamper-proof audit evidence.
[0129] After the exception handling process is triggered, the trusted coordinating node generates an exception record corresponding to the shared transaction identifier. The exception record includes at least the shared transaction identifier, the identifier of the node involved in the exception, and the reason for the consistency determination failure.
[0130] The reasons for failure can be determined based on the actual reasons that trigger the exception handling process, including events from both ends not arriving simultaneously within the preset retry observation period, the time difference between the first event and the second event exceeding the preset time window, failure of quantity consistency verification, or failure of other consistency verifications.
[0131] The trusted coordinating node writes the generated anomaly records into the distributed ledger, making these records an immutable historical record. Subsequent queries or anomaly investigations of cross-domain transactions corresponding to shared transaction identifiers can retrieve the corresponding anomaly records from the distributed ledger to trace the cause and handling process of the anomaly.
[0132] Through the above steps, when an anomaly occurs in a cross-domain transaction, the temporary state of the second node is maintained and not released. Then, the abnormal transaction is prevented from generating new state changes, and the cause of the anomaly and related processing information are written into the distributed ledger. This forms an anomaly handling mechanism consisting of state isolation, transaction blocking, and anomaly logging. This mechanism can prevent the abnormal state from spreading to subsequent business operations and provides verifiable data for subsequent anomaly localization and transaction auditing.
[0133] This application's embodiments utilize a preset time window to perform time consistency verification on arrived dual-end events, and a preset retry observation period to continuously monitor and supplement the reception of temporarily missing single-end events. When an event arrives on time, the cross-domain transaction association and consistency determination are re-executed; when an event is missing for an extended period, a temporary state is maintained and an exception handling process is triggered. Therefore, while ensuring the atomicity of cross-domain state changes, the system's fault tolerance to network latency, delayed event arrival, and short-term communication anomalies is improved, while preventing abnormal transactions from continuing and causing cross-domain state inconsistencies.
[0134] Furthermore, consistency determination also includes quantity consistency verification, such as... Figure 7 As shown, the quantity consistency check includes: Step S710: Obtain the preset resource conversion rate, and calculate the theoretical increase based on the preset resource conversion rate and the actual reduction in the first event.
[0135] The preset resource conversion rate is used to characterize the quantitative correspondence when resources or rights are converted across domains between the first node and the second node, and to establish the conversion relationship between the reduction of resources on the first node side and the increase of resources on the second node side. For example, in the business scenario of redeeming membership services with points, the preset resource conversion rate can be expressed as 100 points redeem 1 day of membership service.
[0136] The preset resource conversion rate can be determined during the cross-domain business rule configuration phase, based on the resource exchange rules pre-defined by the parties involved in cross-domain collaboration. Specifically, the corresponding quantitative relationships between different resource types can be determined based on cross-domain business agreements, resource exchange rules, or pre-configured business parameters, and the determined resource conversion rates can be configured and stored according to the corresponding resource type, business type, or exchange scenario. When the resource exchange rules under the same business scenario change, the corresponding preset resource conversion rate can be redefined and updated based on the updated business rules.
[0137] After obtaining the preset resource conversion rate, the trusted coordination node obtains the actual reduction from the first event, and calculates the theoretical increase in resources on the second node side based on the actual reduction and the preset resource conversion rate.
[0138] For example, if the actual reduction in the first event is 500 points, and the preset resource conversion rate is 100 points for 1 day of membership service, then the theoretical increase is 5 days. Through the above conversion, the resource status changes expressed in different units of measurement in the first and second nodes are converted into corresponding quantities, providing a theoretical benchmark for subsequent quantity consistency verification.
[0139] Step S730: Obtain the actual increase in the second event, and calculate the relative error based on the theoretical increase and the actual increase.
[0140] The trusted coordinating node obtains the actual increase from the change value field of the second event. The actual increase is used to characterize the amount of resources added corresponding to the temporary state established by the second node for the current cross-domain transaction.
[0141] After obtaining the actual increase, the actual increase is compared with the theoretical increase obtained in step S710 to determine the degree of deviation between the actual increase in resources on the second node side and the theoretical increase, and the relative error is determined based on the difference between the theoretical increase and the actual increase.
[0142] The relative error is used to normalize and characterize the actual deviations at different resource orders of magnitude, so that trusted coordination nodes can use a unified judgment standard to make quantitative consistency judgments on cross-domain resource changes of different scales.
[0143] Step S750: In response to the relative error exceeding the preset error threshold, it is determined that the quantity consistency verification has failed.
[0144] The trusted coordination node compares the calculated relative error with a preset error threshold. The preset error threshold limits the maximum allowable deviation between the actual increase and the theoretical increase.
[0145] The preset error threshold can be determined based on the specific business requirements for resource exchange accuracy. Specifically, it can be set according to the allowed range of resource quantity deviations, resource measurement accuracy, and quantity deviations in historical normal transaction data, as stipulated in cross-domain business rules. For businesses that require strict adherence to resource exchange ratios, a smaller preset error threshold can be set; for businesses that allow for some deviations due to resource rounding or differences in measurement accuracy, an appropriate preset error threshold can be set according to the corresponding business rules.
[0146] When the relative error exceeds the preset error threshold, it indicates that the deviation between the actual increase and the theoretical increase in the second node exceeds the allowable range. At this time, it is determined that the quantity consistency verification has failed, and the result of the quantity consistency verification failure is used as the basis for the consistency judgment failure, thereby preventing the temporary state of the second node from being released to the effective state.
[0147] Step S770: In response to the fact that the relative error does not exceed the preset error threshold, the quantity consistency verification is determined to be successful.
[0148] When the relative error does not exceed the preset error threshold, it indicates that the deviation between the actual increase and the theoretical increase in the second node is within the preset allowable range, and the quantity consistency verification is passed.
[0149] The quantity consistency check result serves as one dimension for the trusted coordinating node to perform consistency determination, and is used together with other consistency check results to determine whether the current cross-domain transaction meets the state release conditions. Only when the quantity consistency check passes and all other necessary consistency checks pass, is it permissible to trigger the second node to release the temporary state into an effective state based on the consistency determination result.
[0150] Through the above steps, a quantitative mapping relationship is established between the actual resource reduction of the first node and the theoretical resource increase of the second node based on a preset resource conversion rate. Furthermore, the actual increase of the second node is quantitatively verified through relative error, thereby extending the consistency judgment of cross-domain data status to the resource quantity dimension, realizing the quantitative verification of cross-domain status change results, and reducing the risk of inconsistency in cross-domain resource quantity caused by incorrect resource exchange ratio configuration, abnormal status change, or data anomalies.
[0151] Step S190: In response to the consensus determination being passed, the second node is triggered to release the temporary state into the effective state; in response to the consensus determination failing, the temporary state of the second node is not released.
[0152] When the consistency determination result of the trusted coordinating node is passed, it indicates that the cross-domain state changes corresponding to the first and second events meet the preset consistency conditions. At this time, the trusted coordinating node sends a state release command to the second node. In response to the state release command, the second node changes the previously established temporary state from the pending confirmation state to the effective state, making the corresponding data state change officially effective, and allowing the corresponding resources or rights to be used on the second node side in a normal business state.
[0153] The temporary state is used to carry data state changes on the second node side that have not yet been confirmed for cross-domain consistency. Before the consistency determination is passed, the temporary state is isolated from the data state that has already taken effect on the second node side and does not have a formal effect on users or related business systems; after the consistency determination is passed, the temporary state is transformed into the effective state through the state release operation, thus forming a state control process of "temporary storage first, confirmation later, and then effectiveness".
[0154] When the consistency check of the trusted coordinating node fails, the trusted coordinating node does not trigger a state release operation. The second node continues to maintain a temporary state without converting it to an effective state, ensuring that data state changes that fail the consistency check will not further affect the formal effective state of the second node. For abnormal transactions caused by the consistency check failure, they can be further isolated and processed according to the preset exception handling procedure.
[0155] Through the aforementioned state release control, data state changes on the second node side do not take effect immediately upon receiving a cross-domain state change request. Instead, after the first and second events complete cross-domain association and consistency determination, the decision on whether to complete the final state transition is based on the determination result. Therefore, by utilizing a differentiated state handling mechanism where the first node takes effect immediately and the second node temporarily stores the changes pending confirmation, the final effectiveness control of cross-domain state changes is centralized on the consistency determination result. This achieves unified control over the timing of the second node's state effectiveness in an asynchronous cross-domain interaction environment, thereby reducing the risk of data state anomalies caused by inconsistencies in the state change results between the two ends.
[0156] In yet another alternative embodiment, such as Figure 8 As shown, this application also provides a specific implementation method for writing event data, verification results, and exception information during cross-domain transaction processing into a distributed ledger, and obtaining the full-process verification record through a query interface. This method includes: Step S810: The trusted coordinating node writes the first event, the second event, the consistency determination verification result, and the exception record into the distributed ledger.
[0157] The trusted coordinating node, acting as the data storage and execution entity in the cross-domain transaction processing, associates the first event reported by the first node, the second event reported by the second node, and the verification results generated during the consistency determination process, and writes the aforementioned data into the distributed ledger. Specifically, the first and second events record the state change information of their respective nodes, and at least include a shared transaction identifier and the business data corresponding to the state change; the verification results of the consistency determination are used to characterize whether the current cross-domain transaction meets the preset consistency conditions; and the exception log records situations where the consistency determination fails, the event times out, or other abnormal handling scenarios.
[0158] Specifically, after determining that the first event and the second event belong to the same cross-domain transaction, the trusted coordinating node will organize the first event, the second event, and the consistency determination result corresponding to the cross-domain transaction into evidence data according to a preset data organization method, and submit it to the distributed ledger for recording. When an anomaly occurs during the consistency determination process, the corresponding anomaly record will also be written into the distributed ledger, so that the key processes of the cross-domain transaction from event generation, event association, consistency verification to the final processing result will form associated evidence records.
[0159] By writing the aforementioned data into a distributed ledger, the processing data, originally scattered across different nodes and within the trusted coordinating node during cross-domain transaction processing, is unified into a historical record. In the event of subsequent business disputes, data anomalies, or the need for process auditing, the processing of the corresponding cross-domain transaction can be reconstructed based on the data recorded in the distributed ledger, thereby improving the traceability and reliability of cross-domain transaction processing results.
[0160] Step S830: Provide a query interface. The query interface is used to respond to query requests from external systems and obtain full-process verification records from the distributed ledger. The full-process verification records include the original text of events reported by both ends, the complete verification path and decision basis, and the alarm list within a specific time period.
[0161] The trusted coordination node provides a standardized query interface to receive query requests from external systems for cross-domain transaction processing records and retrieves the corresponding full-process verification records from the distributed ledger based on the query conditions in the query request.
[0162] Specifically, external systems can initiate query requests based on shared transaction identifiers, time ranges, or other preset query conditions. The trusted coordination node responds to the query request, locates the evidence data corresponding to the query conditions from the distributed ledger, and associates and organizes the evidence data to form a full-process verification record.
[0163] The full-process verification log includes the original text of events reported by both ends, the complete verification path and decision basis, and an alarm list for a specific time period. The original text of events reported by both ends is used to reconstruct the event content reported by the first and second nodes for the same shared transaction identifier; the complete verification path and decision basis reflect the processing and results of the trusted coordination node in performing event correlation, time consistency verification, quantity consistency verification, and eventual consistency determination for the first and second events; the alarm list reflects abnormal transactions generated within a specified time range and corresponding abnormal handling records.
[0164] External systems can obtain the entire verification process records through a query interface without needing to access the local business databases of the first and second nodes separately. This links cross-domain transaction business state change data with the verification and processing results of the trusted coordination node, and continuously retains this data through a distributed ledger, providing complete data support for subsequent business auditing, anomaly tracking, and dispute resolution.
[0165] Through the above steps, the two-end events, verification results and abnormal records generated during cross-domain transaction processing are associated and stored as evidence. The unified acquisition of the verification records throughout the entire process is achieved through the query interface. This enables the atomic processing of cross-domain data status to not only complete status control at the business processing level, but also to form traceable data records at the processing result level, thereby improving the credibility and auditability of the cross-domain data status processing process.
[0166] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0167] Furthermore, this example embodiment also provides an atomic processing apparatus for cross-domain data states.
[0168] Figure 9 A block diagram illustrating an atomic processing apparatus for cross-domain data states according to an exemplary embodiment of this application is shown schematically. (Reference) Figure 9 The atomicity processing apparatus 900 for cross-domain data state according to an exemplary embodiment of this application may include: a state change and event generation module 910, an asynchronous reporting module 930, a transaction association module 950, a consistency determination module 970, and a state release control module 990.
[0169] Specifically, the state change and event generation module 910 is configured to respond to a cross-domain state change request, whereby the first node performs a first data state change and generates a first event containing the effective state, and the second node establishes a temporary state corresponding to the second data state change and generates a second event based on the temporary state. Both the first and second events carry a shared transaction identifier. The asynchronous reporting module 930 is configured to asynchronously report the first and second events to the trusted coordinating node. The transaction association module 950 is configured for the trusted coordinating node to perform cross-domain transaction association on the first and second events based on the shared transaction identifier. The consistency determination module 970 is configured for the trusted coordinating node to perform consistency determination on the successfully associated first and second events. The state release control module 990 is configured to trigger the second node to release the temporary state to the effective state in response to a successful consistency determination; and to prevent the temporary state of the second node from being released in response to a failed consistency determination.
[0170] Since the functional modules of the cross-domain data state atomicity processing apparatus in this application are the same as those in the above method embodiments, they will not be described again here.
[0171] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.
[0172] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0173] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0174] In an exemplary embodiment of this application, an electronic device capable of implementing the above-described method is also provided.
[0175] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as circuits, modules, or systems.
[0176] The following reference Figure 10 To describe an electronic device 1000 according to this embodiment of the present invention. Figure 10 The electronic device 1000 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0177] like Figure 10As shown, the electronic device 1000 is manifested in the form of a general-purpose computing device. The components of the electronic device 1000 may include, but are not limited to: at least one processing unit 1010, at least one storage unit 1020, a bus 1030 connecting different system components (including storage unit 1020 and processing unit 1010), and a display unit 1040.
[0178] The storage unit 1020 stores program code that can be executed by the processing unit 1010, causing the processing unit 1010 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1010 can perform the method steps shown in the figure.
[0179] Storage unit 1020 may include readable media in the form of volatile storage units, such as random access memory (RAM) 10201 and / or cache memory 10202, and may further include read-only memory (ROM) 10203.
[0180] Storage unit 1020 may also include a program / utility 10204 having a set (at least one) program module 10205, such program module 10205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0181] Bus 1030 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0182] Electronic device 1000 can also communicate with one or more external devices 1070 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1000, and / or any device that enables electronic device 1000 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1050. Furthermore, electronic device 1000 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1060. As shown, network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0183] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.
[0184] In exemplary embodiments of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0185] The program product for implementing the above-described method according to embodiments of the present invention can employ a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0186] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0187] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0188] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0189] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0190] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0191] Other embodiments of this application will readily conceive of by those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0192] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for atomic processing of cross-domain data states, characterized in that, The method includes: In response to a cross-domain state change request, the first node performs a first data state change and generates a first event containing the effective state. The second node establishes a temporary state corresponding to the second data state change and generates a second event based on the temporary state. Both the first event and the second event carry a shared transaction identifier. The first event and the second event are reported asynchronously to the trusted coordination node; The trusted coordination node associates the first event and the second event across domain transactions based on the shared transaction identifier; The trusted coordination node performs a consistency determination on the first event and the second event that have been successfully associated; In response to the consensus determination being passed, the second node is triggered to release the temporary state into an effective state; in response to the consensus determination failing, the temporary state of the second node is not released.
2. The method according to claim 1, characterized in that, The cross-domain transaction associations include: Obtain the digital signatures carried in the first event and the second event, and verify the legality of the digital signatures; Verify whether the shared transaction identifiers in the first event and the second event are consistent, and whether the source nodes of the first event and the second event are different; In response to the validity of the digital signature, the consistency of the shared transaction identifier, and the different source nodes, the cross-domain transaction association is determined to be successful.
3. The method according to claim 2, characterized in that, The verification of the legality of the digital signature in the first event and the second event includes: For any target event in the first event and the second event, obtain the public key of the source node that generated the target event; The digital signature in the target event is generated by the source node using the corresponding private key to perform a signature operation on the original byte sequence obtained by concatenating multiple data fields in the target event, excluding the field where the signature is located, in a preset arrangement order; The trusted coordination node extracts the multiple data fields from the target event, excluding the field containing the signature, according to the preset arrangement order, and reconstructs the original byte sequence; The public key is used to perform signature verification operations on the digital signature and the reconstructed original byte sequence; In response to the successful signature verification operation, the digital signature of the target event is determined to be valid, thereby confirming that the source of the target event is authentic and its content has not been tampered with.
4. The method according to claim 1, characterized in that, The method further includes: If both the first event and the second event have arrived and the time difference between them exceeds a preset time window, the consistency determination is determined to have failed. In response to the fact that both the first event and the second event have arrived and the time difference between them does not exceed the preset time window, the time consistency check is determined to be successful. In response to receiving only one-end event from the first event or the second event, continuously monitor the missing other-end event for a preset retry observation period; In response to receiving the other end event within the preset retry observation period, the cross-domain transaction association and consistency determination are re-executed; If the other end event is not received after the preset retry observation period, the exception handling process is triggered.
5. The method according to claim 4, characterized in that, The exception handling process includes: The temporary state of the second node is maintained and not released; The transactions associated with the shared transaction identifier are prohibited from generating new state changes. An exception record containing the reason for the failure is generated and written into the distributed ledger to provide tamper-proof audit evidence.
6. The method according to claim 2, characterized in that, The first event and the second event adopt a unified event data model, which includes at least the following fields: The transaction identifier field is used to store the shared transaction identifier; The user identifier field is used to store the user identifier after it has been anonymized. The source node identifier field is used to store the source node identifier of the generated event; The operation type field is used to indicate whether the data status is increased or decreased; The resource type field indicates the type of resource that has changed. The variable value field is used to record the actual number of changes in the data status; The timestamp field is used to record the millisecond-level timestamp of the event's generation. The signature field is used to store the digital signature.
7. The method according to claim 1, characterized in that, The consistency determination also includes quantity consistency verification, which includes: Obtain a preset resource conversion rate, and calculate the theoretical increase based on the preset resource conversion rate and the actual reduction in the first event; Obtain the actual increase in the second event, and calculate the relative error based on the theoretical increase and the actual increase; In response to the relative error exceeding a preset error threshold, it is determined that the quantity consistency check has failed; In response to the fact that the relative error does not exceed the preset error threshold, the quantity consistency verification is determined to be successful.
8. The method according to claim 5, characterized in that, The method further includes: The trusted coordinating node writes the first event, the second event, the consistency determination result, and the exception record into the distributed ledger; A query interface is provided, which is used to respond to query requests from external systems and obtain full-process verification records from the distributed ledger. The full-process verification records include the original text of the events reported by both ends, the complete verification path and decision basis, and the alarm list within a specific time period.
9. The method according to any one of claims 1 to 8, characterized in that, The first node performs a first data state change and generates a first event containing the effective state. The second node establishes a temporary state corresponding to the second data state change and generates a second event based on the temporary state, including: The first node and the second node each listen for local state change events; Extract the transaction identifier, user identifier, operation type, and resource change information from the local state change event; Based on the extracted information, a standardized event structure is constructed, and a digital signature is generated on the standardized event structure using the private key of the corresponding node to obtain the first event or the second event.
10. An atomic processing device for cross-domain data states, characterized in that, The device includes: The state change and event generation module is configured to respond to a cross-domain state change request, wherein a first node performs a first data state change and generates a first event containing the effective state, and a second node establishes a temporary state corresponding to the second data state change and generates a second event based on the temporary state. Both the first event and the second event carry a shared transaction identifier. The asynchronous reporting module is configured to asynchronously report the first event and the second event to the trusted coordination node; The transaction association module is configured so that the trusted coordination node performs cross-domain transaction association between the first event and the second event based on the shared transaction identifier; The consistency determination module is configured to enable the trusted coordination node to determine the consistency of the first event and the second event that have been successfully associated. The state release control module is configured to trigger the second node to release the temporary state into an effective state in response to the consensus determination passing; and to prevent the temporary state of the second node from being released in response to the consensus determination failing.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the atomic processing method for cross-domain data states as described in any one of claims 1 to 9.
12. An electronic device, characterized in that, include: processor; A memory for storing one or more programs that, when executed by the processor, cause the processor to implement the atomic processing method for cross-domain data states as described in any one of claims 1 to 9.
