Search

CN-122019054-A - Nuclear power production management system transaction consistency processing method oriented to domestic environment

CN122019054ACN 122019054 ACN122019054 ACN 122019054ACN-122019054-A

Abstract

The invention discloses a nuclear power production management system transaction consistency processing method facing to a domestic environment, which is realized based on Seata and is applied to an environment of a micro-service architecture and a dream database constructed by Spring Cloud Alibaba, and comprises the transaction initiation step of initiating a global transaction by TM of Seata according to a service request through declarative annotation, initiating a creation request to a TC cluster and acquiring a global transaction identifier; the method comprises a step of executing each RM participating in global transaction, a step of generating a data rollback log when intercepting a data operation request of a dream database and executing service data update, a step of coordinating the transaction, wherein a step of waiting for all RMs to report branch transaction results and execute successfully, notifying each RM to submit the transaction and clear the corresponding data rollback log, and notifying each RM to perform data rollback based on the data rollback log when executing failure or overtime of any branch transaction.

Inventors

  • CHEN ZHE
  • SUN MINGJUN
  • LIU HUI
  • WANG HAIDONG
  • SONG HUAN
  • XU SHILIN
  • YU MINGJIE
  • HU RUI

Assignees

  • 国核信息科技有限公司
  • 国电投核能有限公司
  • 上海核工程研究设计院股份有限公司
  • 山东核电有限公司
  • 国核示范电站有限责任公司

Dates

Publication Date
20260512
Application Date
20260128

Claims (9)

  1. 1. A nuclear power production management system transaction consistency processing method oriented to a domestic environment is realized based on a distributed transaction framework Seata and is applied to an environment of a micro-service architecture and a domestic dream database constructed by Spring Cloud Alibaba, and the method comprises the following steps: Initiating global transaction by a transaction manager TM of Seata according to the service request through declaration annotation, initiating a creation request to a transaction coordinator TC cluster of Seata, and acquiring a global transaction identifier XID; a step of executing, in which each resource manager RM participating in Seata of the global transaction intercepts the data operation request to the dream database, and generates a data rollback log while executing service data update in the dream database; And the transaction coordination step comprises the steps that the transaction coordinator TC cluster waits for all the resource managers RM to report branch transaction results, when all the branch transactions are successfully executed, each resource manager RM is informed to submit the transaction and clear the corresponding data rollback log, and when any branch transaction fails to be executed or overtime, each resource manager RM is informed to roll back the data based on the data rollback log.
  2. 2. The method for transaction consistency processing of a nuclear power production management system oriented to a domestic environment according to claim 1, wherein the declarative annotation is @ GlobalTransactional annotation in Spring Cloud Alibaba micro-service architecture.
  3. 3. The method for processing the transaction consistency of the nuclear power production management system facing the domestic environment according to claim 1, wherein the transaction coordinator TC cluster performs service registration and discovery through a domestic Nacos registry to realize high availability.
  4. 4. The method for transaction consistency processing of a nuclear power production management system facing to a domestic environment according to claim 3, wherein interaction configuration information of a transaction coordinator TC cluster and a domestic Nacos registry is stored in Nacos configuration in a concentrated mode, and the interaction configuration information comprises a transaction group mapping relation, a TC cluster node address list and a dream database connection parameter.
  5. 5. The nuclear power production management system transaction consistency processing method facing to domestic environment according to claim 3, wherein the transaction coordinator TC cluster has high availability, specifically comprising: When the main node in the transaction coordinator TC cluster fails, the domestic Nacos registration center automatically switches to the standby node, so that the transaction coordination is ensured not to be interrupted.
  6. 6. The nuclear power production management system transaction consistency processing method facing to the domestic environment according to claim 1, wherein the global transaction identifier XID is automatically transferred between micro services through a remote call chain, and specifically comprises the following steps: The transaction manager TM binds the acquired XID to the current thread context, ensuring that all operations within the same thread carry the XID.
  7. 7. The method for processing the transaction consistency of the nuclear power production management system facing the domestic environment according to claim 1, wherein the service request is specifically a request for synchronously updating a work order state and an equipment state triggered in the nuclear power production management system, and the transaction manager TM further comprises a first data operation for updating a target work order state from 'ready' to 'ready' and a second data operation for updating an associated equipment state from 'idle' to 'ready to' operation.
  8. 8. The method for processing transaction consistency of nuclear power production management system facing domestic environment according to claim 1, wherein the specific way for intercepting the data operation request by the resource manager RM comprises intercepting the specified data operation statement by a byte code enhancement technology, acquiring a front mirror image of data before execution, acquiring a rear mirror image of data after execution, and encapsulating the front mirror image, the rear mirror image, the SQL type, the table name, the global transaction identifier XID and the branch transaction ID together into a data rollback log record.
  9. 9. The method for processing the transaction consistency of the nuclear power production management system facing the domestic environment according to claim 8, wherein the step of performing data rollback based on the data rollback log comprises the step of recovering data through a front mirror image in the data rollback log record to realize automatic compensation.

Description

Nuclear power production management system transaction consistency processing method oriented to domestic environment Technical Field The invention belongs to the technical field of distributed transaction processing under a micro-service architecture, and particularly relates to a nuclear power production management system transaction consistency processing method oriented to a domestic environment. Background As the nuclear power production management system migrates to the nationwide production environment micro-service architecture, the system is split into multiple independent service units, each of which independently manages its own data and business logic. While micro-service architecture improves the flexibility and scalability of the system, traditional single transaction management schemes (e.g., local transactions, XA transactions) are difficult to apply in terms of data consistency involving multiple micro-services. In a core business process of nuclear power production management, for example, "work order entering preparation process and synchronously updating equipment states", collaborative data updating often needs to be performed across a plurality of independent micro services (e.g., work order service, equipment service). Such operations must be atomic, either fully successful or fully rolled back, and any intermediate state may lead to production scheduling confusion or equipment management errors, which is unacceptable in the field of nuclear power where security and reliability requirements are extremely high. To ensure data consistency for such cross-service operations, distributed transaction techniques are critical. Currently, typical solutions in the industry mainly include the following types of distributed transaction solutions: XA transactions (two-phase commit) are strongly consistent, but have low performance and are difficult to meet the high concurrency demands of micro-services. TCC transaction (Try-Confirm-cancer) is applicable to business-compensatory scenarios, but implementation complexity is high. Saga transaction (long transaction compensation) is applicable to long-term business processes, but requires manual writing of compensation logic. In summary, the existing mainstream distributed transaction scheme has remarkable limitations in terms of performance, complexity, compatibility or development cost when being applied to a micro-service architecture of a domestic, highly reliable and business complex nuclear power production management system. In recent years, under the domestic environment (dream database), the traditional XA transaction is difficult to popularize due to the performance and database support problems, and the TCC/Saga mode has higher implementation cost. Thus, a distributed transaction scheme based on Seata AT mode becomes the best choice. Seata (Simple Extensible Autonomous Transaction Architecture) is an open source framework specifically designed for distributed transaction management, where the AT mode relies on database local rollback capability, applicable to high concurrency transaction scenarios without traffic compensation. The AT mode ensures the consistency of transactions through a one-stage submitting snapshot and a two-stage automatic rollback mechanism, reduces the complexity of service development, and is very suitable for the service requirements of a nuclear power production management system. However, the successful application of Seata AT mode to the specific domestic technology stack of Spring Cloud Alibaba +dream database and the assurance of stable, high availability operation in the critical area of nuclear power production management systems still faces a series of specific challenges: the deep adaptation problem of Seata and the dream database needs to be solved, and the reliability of an Undo Log mechanism and a rollback function is ensured. A highly available Transaction Coordinator (TC) deployment scheme needs to be designed to avoid single point failures to meet the 7x24 hour uninterrupted operation requirements of a nuclear power system. Seamless integration of Seata and Nacos registration/configuration centers is realized in Spring Cloud Alibaba micro-service ecology, and transparent transfer of transaction contexts and efficient management of clusters are ensured. Therefore, an integrated, highly available distributed transaction scheme aiming at the specific requirements of the domestic environment and industry is needed to ensure the data strong consistency and the service high reliability of the nuclear power production management system under the micro-service architecture. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a nuclear power production management system transaction consistency processing method oriented to a domestic environment. In view of this, the invention provides a nuclear power production management system transaction consistency processing met