Nuclear power production management system transaction consistency processing method oriented to localized environment

By integrating Seata AT mode with Spring Cloud Alibaba and DM database, and combining it with Nacos registry center, the distributed transaction consistency problem of nuclear power production management system under domestic environment is solved, realizing efficient and stable data consistency management, which is suitable for microservice architecture of nuclear power production management system.

CN122019054APending Publication Date: 2026-05-12NAT NUCLEAR INFORMATION TECH CO LTD +4
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing distributed transaction solutions suffer from low performance, high complexity, and poor compatibility in domestically developed nuclear power production management systems, making it difficult to meet the requirements of high reliability and high concurrency. In particular, data consistency across services is difficult to guarantee under a microservice architecture.

Method used

By adopting the Seata AT mode, combined with Spring Cloud Alibaba and the domestic DM database, and through the high availability integration of the transaction coordinator TC cluster with the Nacos registry center, automatic compensation and rollback of global transactions are achieved to ensure data consistency.

Benefits of technology

It achieves efficient and stable transaction management of microservice architecture in a domestic environment, improves data consistency and system reliability of nuclear power production management system, and meets the high availability requirements of nuclear power industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019054A_ABST
    Figure CN122019054A_ABST
Patent Text Reader

Abstract

The invention discloses a localized environment-oriented nuclear power production management system transaction consistency processing method, which is realized based on Seaa and is applied to an environment of a micro-service architecture and a DM database constructed by adopting Spring Cloud Alibab, and comprises the following steps of: a transaction initiation step: starting a global transaction through declarative annotation by a TM (Transaction Management) of the Seaa according to a service request, initiating a creation request to the TC cluster to obtain a global transaction identifier; a first-stage execution step: each RM participating in the global transaction intercepts a data operation request for the DM database, and generates a data rollback log while executing business data updating; in the transaction coordination step, the TC cluster waits for all RMs to report branch transaction results, execution is successful, all the RMs are notified to submit transactions, and corresponding data rollback logs are cleaned; and when execution of any branch transaction fails or is overtime, notifying each RM to perform data rollback based on the data rollback log.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of distributed transaction processing technology under microservice architecture, and particularly relates to a transaction consistency processing method for nuclear power production management system oriented towards domestic production environments. Background Technology

[0002] As nuclear power production management systems migrate to a fully domestically produced microservice architecture, the system is broken down into multiple independent service units, each managing its own data and business logic. While microservice architecture improves system flexibility and scalability, traditional monolithic transaction management solutions (such as local transactions and XA transactions) are difficult to apply to data consistency across multiple microservices. In core business processes of nuclear power production management, such as "work orders entering the preparation process and synchronously updating equipment status," collaborative data updates across multiple independent microservices (such as work order services and equipment services) are often required. These operations must be atomic: either all succeed or all rollback; any intermediate state could lead to production scheduling chaos or equipment management errors, which is unacceptable in the nuclear power field, where safety and reliability requirements are extremely high.

[0003] To ensure data consistency in such cross-service operations, distributed transaction technology becomes crucial. Currently, typical industry solutions mainly include the following types of distributed transaction solutions: • XA transactions (two-phase commit): strong consistency, but lower performance, making it difficult to meet the high concurrency requirements of microservices.

[0004] • TCC (Try-Confirm-Cancel) transactions: suitable for scenarios where business operations can be compensated, but have a high implementation complexity.

[0005] • Saga Transaction (Long Transaction Compensation): Suitable for long-running business processes, but requires manual writing of compensation logic.

[0006] In summary, existing mainstream distributed transaction solutions generally have significant limitations in terms of performance, complexity, compatibility, or development cost when applied to the microservice architecture of domestically produced, highly reliable, and complex nuclear power production management systems.

[0007] In recent years, under the domestically developed environment (DM database), traditional XA transactions have been difficult to promote due to performance and database support issues, while the TCC / Saga model has high implementation costs. Therefore, a distributed transaction solution based on the Seata AT model has become the best choice.

[0008] Seata (Simple Extensible Autonomous Transaction Architecture) is an open-source framework designed specifically for distributed transaction management. Its AT mode relies on local database rollback capabilities, making it suitable for high-concurrency transaction scenarios that do not require business compensation. The AT mode ensures transaction consistency and reduces business development complexity through a one-phase commit snapshot and a two-phase automatic rollback mechanism, making it highly suitable for the business needs of nuclear power production management systems. However, successfully applying the Seata AT mode to the specific domestic technology stack of Spring Cloud Alibaba + DM Database, and ensuring its stable and highly available operation in the critical domain of nuclear power production management systems, still faces a series of specific challenges: It is necessary to resolve the deep compatibility issues between Seata and DM database to ensure the reliability of the Undo Log mechanism and rollback function.

[0009] A highly available Transaction Coordinator (TC) deployment scheme needs to be designed to avoid single points of failure and meet the requirements of 24 / 7 uninterrupted operation of nuclear power systems.

[0010] It is necessary to achieve seamless integration between Seata and Nacos registry / configuration center within the Spring Cloud Alibaba microservice ecosystem to ensure transparent transmission of transaction context and efficient cluster governance.

[0011] Therefore, there is an urgent need for an integrated and highly available distributed transaction processing solution that is tailored to the specific needs of the domestic production environment and industry, in order to ensure strong data consistency and high service reliability of the nuclear power production management system under a microservice architecture. Summary of the Invention

[0012] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a transaction consistency processing method for nuclear power production management systems oriented towards domestic production environments.

[0013] In view of this, this invention proposes a transaction consistency processing method for a nuclear power production management system oriented towards a domestically produced environment. It is implemented based on the distributed transaction framework Seata and applied to an environment using a microservice architecture built with Spring Cloud Alibaba and the domestic DM database. The method includes: Transaction initiation steps: Seata's Transaction Manager™ starts a global transaction based on the business request using declarative annotations, and sends a creation request to Seata's Transaction Coordinator TC cluster to obtain the global transaction identifier XID; Phase 1 execution steps: Each Resource Manager (RM) of Seata participating in the global transaction intercepts data operation requests to the DM database, and generates data rollback logs while performing business data updates in the DM database; Transaction coordination steps: The transaction coordinator (TC) cluster waits for all resource managers (RMs) to report the results of branch transactions. When all branch transactions are executed successfully, it notifies each resource manager RM to commit the transaction and clean up the corresponding data rollback log. When any branch transaction fails or times out, it notifies each resource manager RM to roll back the data based on the data rollback log.

[0014] As an improvement to the above method, the declarative annotation is the @GlobalTransactional annotation in the Spring Cloud Alibaba microservice architecture.

[0015] As an improvement to the above method, the transaction coordinator TC cluster performs service registration and discovery through the domestic Nacos registry center to achieve high availability.

[0016] As an improvement to the above method, the interaction configuration information between the transaction coordinator TC cluster and the domestic Nacos registry is centrally stored in the Nacos configuration. The interaction configuration information includes transaction group mapping relationships, TC cluster node address list, and DM database connection parameters.

[0017] As an improvement to the above method, the transaction coordinator TC cluster has high availability, specifically including: When the primary node in the transaction coordinator TC cluster fails, the domestic Nacos registry automatically switches to the backup node to ensure uninterrupted transaction coordination.

[0018] As an improvement to the above method, the global transaction identifier XID is automatically passed between microservices via a remote call chain, specifically including: The Transaction Manager™ binds the acquired XID to the current thread context, ensuring that all operations within the same thread carry that XID.

[0019] As an improvement to the above method, the business request is specifically a request for synchronizing the work order status and equipment status triggered in the nuclear power production management system; the processing of the transaction manager TM also includes: a first data operation to update the target work order status from "to be prepared" to "in preparation", and a second data operation to update the associated equipment status from "idle" to "to be maintained".

[0020] As an improvement to the above method, the specific way in which the Resource Manager (RM) intercepts data operation requests includes: intercepting the specified data operation statement through bytecode enhancement technology, obtaining the front image of the data before execution, obtaining the back image of the data after execution, and encapsulating the front image, back image, SQL type, table name, global transaction identifier XID, and branch transaction ID together into a data rollback log record.

[0021] As an improvement to the above method, the data rollback based on the data rollback log includes: restoring data through the previous image recorded in the data rollback log to achieve automatic compensation.

[0022] Compared with the prior art, the advantages of the present invention are: 1. Adapts to the Seata AT transaction mode of the domestic DM database, solving the problem of distributed transaction management in domestic databases.

[0023] 2. Microservice registration and configuration management are based on Nacos to ensure the high availability of the transaction coordinator (TC) in a distributed environment.

[0024] 3. Adopting the Spring Cloud Alibaba architecture, it is seamlessly integrated with Seata to achieve automatic rollback at the transaction level, thereby improving the stability of the nuclear power production management system. Attached Figure Description

[0025] Figure 1 It is a global transaction execution sequence diagram of "work order preparation process + equipment status synchronization"; Figure 2 This is a diagram of the Seata transaction coordination architecture for nuclear power production management systems. Figure 3 This is a schematic diagram of the transaction execution process in Seata AT mode; Figure 4 This is a schematic diagram of Seata's application in the Spring Cloud Alibaba + DM database architecture. Detailed Implementation

[0026] This invention proposes a transaction consistency processing method for a nuclear power production management system oriented towards a domestically produced environment. It is implemented based on the distributed transaction framework Seata and applied to an environment using a microservice architecture built with Spring Cloud Alibaba and the domestic DM database. The method includes: Transaction initiation steps: Seata's Transaction Manager™ starts a global transaction based on the business request using declarative annotations, and sends a creation request to Seata's Transaction Coordinator TC cluster to obtain the global transaction identifier XID; Phase 1 execution steps: Each Resource Manager (RM) of Seata participating in the global transaction intercepts data operation requests to the DM database, and generates data rollback logs while performing business data updates in the DM database; Transaction coordination steps: The transaction coordinator (TC) cluster waits for all resource managers (RMs) to report the results of branch transactions. When all branch transactions are executed successfully, it notifies each resource manager RM to commit the transaction and clean up the corresponding data rollback log. When any branch transaction fails or times out, it notifies each resource manager RM to roll back the data based on the data rollback log.

[0027] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0028] Example 1 This invention focuses on the core business scenario of "synchronously modifying equipment status after a work order enters the preparation process node" in a nuclear power production management system, and specifically describes the implementation of this invention. This business is a core process of nuclear power equipment operation and maintenance, and it is necessary to ensure the atomicity of work order status updates and equipment status modifications—if the work order status update succeeds but the equipment status modification fails, or vice versa, it will lead to inconsistencies in system data and affect the accuracy of operation and maintenance scheduling.

[0029] This scenario involves two core microservices: pm-service (work order service): Responsible for managing the entire lifecycle of work orders. Its core operation is to update the status of the target work order from "pending preparation" to "preparing". The data is stored in the relevant business tables of the work process management module in the database. equ-service (device service): Responsible for maintaining the operational status of devices. Its core operation is updating the corresponding device status from "idle" to "pending maintenance." Data is stored in the relevant business tables of the database device module. For example... Figure 1 The diagram shown is a global transaction execution sequence diagram for "Work Order Preparation Process + Equipment Status Synchronization". 1. System Architecture This invention is built on Spring Cloud Alibaba + Seata + Nacos. Spring Cloud Alibaba is a microservice suite that Alibaba has open-sourced and continuously maintains. Seata is an open-source distributed transaction solution, whose full name is Simple Extensible Autonomous Transaction Architecture.

[0030] This invention is based on the distributed transaction framework Seata, specifically employing its AT (Auto Transaction) mechanism. The Automatic Transaction mode, through the collaborative working mechanism of its Transaction Coordinator (TC), Transaction Manager (TM), and Resource Manager (RM), enables one-click initiation, automatic compensation rollback, and eventual consistency guarantee for cross-microservice transactions in the Spring Cloud Alibaba microservice architecture and DM database environment.

[0031] The system mainly includes: 1) Transaction Coordinator (TC): Responsible for managing the global transaction state and ensuring transaction consistency. For example... Figure 2 The diagram shown is a transaction coordination architecture diagram of the Seata nuclear power production management system. 2) Transaction Manager (TM): Controls the start, commit, and rollback of global transactions.

[0032] 3) Resource Manager (RM): Responsible for transaction management of specific database resources and ensuring rollback capability in AT mode through the Undo Log mechanism.

[0033] 4) DM Database: Supports Seata AT mode to enable automatic transaction rollback.

[0034] 2. Core code implementation and configuration 1) Start global transaction (TM side: pm-service) In this embodiment, the `@GlobalTransactional` annotation from the Spring Cloud Alibaba microservice architecture is used to enable a global transaction, bringing work order status updates and device status modifications into the same transaction context. A specific example is shown in Table 1 below: Table 1

[0035] 2) Device status modification implementation (RM side: equ-service) Device services do not require additional transaction annotations; they automatically integrate with global transactions through Seata RM to enable state modification and rollback capabilities, as shown in Table 2 below: Table 2

[0036] 3) Microservice Seata integration configuration with database (application.yml) Examples are shown in Table 3 below: Table 3

[0037] 4) Seata TC Cluster Nacos Configuration (nacos-config.txt) The interaction configuration information between the Transaction Coordinator (TC) cluster and the domestic Nacos registry is centrally stored in the Nacos configuration. This interaction configuration information includes transaction group mapping relationships, a list of TC cluster node addresses, and DM database connection parameters. An example is shown in Table 4 below: Table 4

[0038] 5) Global Transaction ID (XID) Transmission Mechanism • When the @GlobalTransactional annotation is triggered, Seata™ initiates a global transaction creation request to the TC cluster. The TC generates a unique XID (global transaction identifier) ​​and returns it to the TM. • TM binds the XID to the current thread context (ThreadLocal), ensuring that all operations within the same thread carry that XID; • When microservices make calls via Feign, Seata automatically passes the XID through the seata-xid request header. The receiving service's RM extracts the XID from the request header and binds it to its own thread context, so that device state modification operations are included in the same global transaction.

[0039] 6) RM interception of SQL and Undo Log generation mechanism • Seata RM intercepts DML operations (UPDATE / INSERT / DELETE) in microservices through bytecode enhancement (AOP), reading the original state of the data (pre-image) before SQL execution; After the SQL is executed, the modified state of the data (post-image) is read, and information such as "previous image, post-image, SQL type, table name, XID, branch ID" is encapsulated into an Undo Log; • The Undo Log is written to the undo_log table in the DM database as the basis for data rollback. For example, when updating the status of a work order, the Undo Log will record "Work Order ID=1001, Status before modification= TO_BE_PREPARED, Status after modification= PREPARING".

[0040] 7) TC's global decision-making mechanism •TC, as the core of transaction coordination, maintains the global transaction status (initializing / committing / rolling back) and the status of all branch transactions (success / failure / timeout) in real time. • Commit decision: When all branch transactions report "success", the TC determines that the global transaction can be committed and sends a "commit command" to all RMs. After receiving the command, the RM deletes the Undo Log (no rollback is required, resources are released). • Rollback decision: If any branch transaction reports "failure" or times out without response, the TC determines that the global transaction needs to be rolled back and sends a "rollback instruction" to all RMs. The RMs restore the data through the previous image in the Undo Log, achieving automatic compensation. • High availability guarantee: TC is deployed through a Nacos cluster. When the primary TC node fails, Nacos automatically switches to the backup TC node to ensure uninterrupted transaction coordination.

[0041] like Figure 3 The diagram shown is a schematic of the transaction execution process in Seata AT mode. Figure 4 This is a schematic diagram of Seata's application in the Spring CloudAlibaba + DM database architecture.

[0042] This invention ensures the consistency of microservice transactions in a nuclear power production management system within a domestically developed environment (DM database) using the Seata AT transaction mode, effectively improving system reliability and data consistency. Through the Nacos + Seata + Spring Cloud Alibaba framework, it achieves an efficient and low-cost transaction management solution suitable for domestically developed distributed system applications in the nuclear power industry.

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A transaction consistency processing method for a nuclear power production management system oriented towards a domestically produced environment, implemented based on the distributed transaction framework Seata, and applied to an environment using a microservice architecture built with Spring Cloud Alibaba and the domestic DM database, the method comprising: Transaction initiation steps: Seata's Transaction Manager™ starts a global transaction based on the business request using declarative annotations, and sends a creation request to Seata's Transaction Coordinator TC cluster to obtain the global transaction identifier XID; Phase 1 execution steps: Each Resource Manager (RM) of Seata participating in the global transaction intercepts data operation requests to the DM database, and generates data rollback logs while performing business data updates in the DM database; Transaction coordination steps: The transaction coordinator (TC) cluster waits for all resource managers (RMs) to report the results of branch transactions. When all branch transactions are executed successfully, it notifies each resource manager RM to commit the transaction and clean up the corresponding data rollback log. When any branch transaction fails or times out, it notifies each resource manager RM to roll back the data based on the data rollback log.

2. The transaction consistency processing method for nuclear power production management system oriented towards domestic production environment according to claim 1, characterized in that, The declarative annotation is the @GlobalTransactional annotation in the Spring Cloud Alibaba microservice architecture.

3. The transaction consistency processing method for nuclear power production management system oriented towards domestic production environment according to claim 1, characterized in that, The transaction coordinator TC cluster performs service registration and discovery through the domestic Nacos registry center to achieve high availability.

4. The transaction consistency processing method for nuclear power production management system oriented towards domestic production environment as described in claim 3, characterized in that, The interaction configuration information between the transaction coordinator TC cluster and the domestic Nacos registry is centrally stored in the Nacos configuration. The interaction configuration information includes transaction group mapping relationships, TC cluster node address list, and DM database connection parameters.

5. The transaction consistency processing method for nuclear power production management system oriented towards domestic production environment according to claim 3, characterized in that, The transaction coordinator (TC) cluster has high availability, specifically including: When the primary node in the transaction coordinator TC cluster fails, the domestic Nacos registry automatically switches to the backup node to ensure uninterrupted transaction coordination.

6. The transaction consistency processing method for a nuclear power production management system oriented towards a domestic environment according to claim 1, characterized in that, The global transaction identifier XID is automatically passed between microservices via a remote call chain, specifically including: The Transaction Manager™ binds the acquired XID to the current thread context, ensuring that all operations within the same thread carry that XID.

7. The transaction consistency processing method for nuclear power production management system oriented towards domestic production environment according to claim 1, characterized in that, The business request is specifically a request triggered in the nuclear power production management system to synchronize the work order status with the equipment status. The processing of the Transaction Manager™ also includes: a first data operation to update the status of the target work order from "to be prepared" to "in preparation", and a second data operation to update the status of the associated device from "idle" to "to be maintained".

8. The transaction consistency processing method for a nuclear power production management system oriented towards a domestic environment according to claim 1, characterized in that, The specific methods by which the Resource Manager (RM) intercepts data operation requests include: intercepting specified data operation statements through bytecode enhancement technology, obtaining the front image of the data before execution, obtaining the back image of the data after execution, and encapsulating the front image, back image, SQL type, table name, global transaction identifier XID, and branch transaction ID together into a data rollback log record.

9. The transaction consistency processing method for a nuclear power production management system oriented towards a domestic environment as described in claim 8, characterized in that, The data rollback based on the data rollback log includes: restoring data through the previous image recorded in the data rollback log to achieve automatic compensation.