CN115390997A - Distributed transaction processing method and device and electronic equipment - Google Patents
Distributed transaction processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN115390997A CN115390997A CN202110563326.5A CN202110563326A CN115390997A CN 115390997 A CN115390997 A CN 115390997A CN 202110563326 A CN202110563326 A CN 202110563326A CN 115390997 A CN115390997 A CN 115390997A
- Authority
- CN
- China
- Prior art keywords
- service
- thread information
- currently available
- processed
- state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000000034 method Methods 0.000 claims abstract description 67
- 238000012544 monitoring process Methods 0.000 claims abstract description 64
- 238000012545 processing Methods 0.000 claims abstract description 50
- 230000008569 process Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 9
- 239000000725 suspension Substances 0.000 abstract 1
- 230000001360 synchronised effect Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000000903 blocking effect Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000011144 upstream manufacturing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/522—Barrier synchronisation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明实施例涉及数据处理技术领域,尤其涉及一种分布式事务处理方法、装置及电子设备。Embodiments of the present invention relate to the technical field of data processing, and in particular, to a distributed transaction processing method, device, and electronic equipment.
背景技术Background technique
分布式事务是指事务的参与者、支持者的服务器、资源服务器以及事务管理器分别位于不同的分布式系统的不同节点之上,或者可以理解为,一次大的操作由不同的小操作组成,这些小的操作分布在不同的服务器上,且属于不同的业务应用。A distributed transaction means that the participants of the transaction, the server of the supporter, the resource server, and the transaction manager are located on different nodes of different distributed systems, or it can be understood that a large operation is composed of different small operations. These small operations are distributed on different servers and belong to different business applications.
现有技术中,分布式事务的实现过程主要可以包括两个阶段,一个是准备阶段(Prepare Phase),另一个是提交阶段(Commit Phase)。对应的,准备阶段为事务管理器给每个参与者发送Prepare消息,每个数据库参与者在本地执行事务,并写本地的Undo/Redo日志,此时事务没有提交。提交阶段为如果事务管理器收到了参与者的执行失败或者超时消息时,直接给每个参与者发送回滚(Rollback)消息;否则,发送提交(Commit)消息,参与者可以根据事务管理器的指令执行提交或者回滚操作,并释放事务处理过程中使用的锁资源。In the prior art, the implementation process of a distributed transaction may mainly include two phases, one is a prepare phase (Prepare Phase), and the other is a commit phase (Commit Phase). Correspondingly, in the preparation phase, the transaction manager sends a Prepare message to each participant, and each database participant executes the transaction locally and writes the local Undo/Redo log. At this time, the transaction is not committed. In the commit phase, if the transaction manager receives a participant's execution failure or timeout message, it will directly send a rollback (Rollback) message to each participant; otherwise, send a commit (Commit) message, and the participant can follow the transaction manager's The instruction executes a commit or rollback operation, and releases lock resources used during transaction processing.
然而,对于二阶段的这种实现方式,所有参与者在事务提交阶段均处于同步阻塞状态,且如果协调者出现故障,对应的业务将一直处于锁定状态,降低了业务的处理效率,进而影响了业务的正常实现。However, for this implementation of the second phase, all participants are in a synchronous blocking state during the transaction submission phase, and if the coordinator fails, the corresponding business will always be locked, which reduces the processing efficiency of the business and affects normal operation of the business.
发明内容Contents of the invention
本发明实施例提供一种分布式事务处理方法、装置及电子设备,以保证业务的正常实现。Embodiments of the present invention provide a distributed transaction processing method, device, and electronic equipment to ensure normal implementation of services.
第一方面,本发明实施例提供一种分布式事务处理方法,包括:In a first aspect, an embodiment of the present invention provides a distributed transaction processing method, including:
在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将所述第一服务对应的线程状态设置为挂起状态;When listening to the first service requesting the second service in the business to be processed, obtaining the thread information corresponding to the first service requesting the second service, and setting the thread state corresponding to the first service to a suspended state;
从事务存储调度中心中获取当前可用的线程信息,并对所述第一服务请求第二服务时对应的线程信息和所述当前可用的线程信息进行监听,得到监听结果,并将所述监听结果同步至备份服务器;Obtain currently available thread information from the transaction storage dispatch center, and monitor the corresponding thread information and the currently available thread information when the first service requests the second service, obtain a monitoring result, and store the monitoring result Synchronize to backup server;
根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务。The second service and the first service are respectively processed according to the monitoring result, so as to realize the service to be processed.
可选的,所述根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务,包括:Optionally, processing the second service and the first service respectively according to the monitoring result, so as to realize the service to be processed, includes:
若所述监听结果为所述当前可用的线程信息为所述第二服务接收到所述第一服务的请求时,对所述第二服务进行处理,并在处理完成所述第二服务时,将所述当前可用的线程信息对应的线程状态设置为完成状态;If the monitoring result is that the currently available thread information is that the second service receives the request of the first service, process the second service, and when the processing of the second service is completed, Setting the thread state corresponding to the currently available thread information to a completed state;
将所述第一服务对应的线程状态设置为请求状态,并根据所述请求状态对所述第一服务进行处理,进而实现所述待处理业务。Setting the state of the thread corresponding to the first service as a request state, and processing the first service according to the request state, so as to realize the service to be processed.
可选的,所述方法还包括:Optionally, the method also includes:
若所述监听结果为所述当前可用的线程信息被除所述第一服务和所述第二服务之外的其他服务占用时,则将所述第二服务的状态设置为挂起状态;If the monitoring result is that the currently available thread information is occupied by services other than the first service and the second service, then setting the state of the second service to a suspended state;
每隔预设时长确定所述当前可用的线程信息的状态,并在所述当前可用的线程信息没有被所述其他服务占用时,为所述第二服务分配所述当前可用的线程信息,并对所述第二服务进行处理。Determining the state of the currently available thread information every preset time period, and assigning the currently available thread information to the second service when the currently available thread information is not occupied by the other services, and The second service is processed.
可选的,所述方法还包括:Optionally, the method also includes:
若在预设时长内没有实现所述待处理业务,则启动所述备份服务器,以使所述备份服务器根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务。If the service to be processed is not realized within the preset time length, start the backup server, so that the backup server processes the second service and the first service respectively according to the monitoring result, thereby realizing The business to be processed.
可选的,在所述从事务存储调度中心中获取当前可用的线程信息之前,所述方法还包括:Optionally, before obtaining the currently available thread information from the transaction storage dispatch center, the method further includes:
根据预存的动态路由负载规则确定当前可用的线程信息,其中,所述当前可用的线程信息为至少一服务对应的线程信息;Determine currently available thread information according to a prestored dynamic routing load rule, wherein the currently available thread information is thread information corresponding to at least one service;
将所述当前可用的线程信息存储至事务存储调度中心。Store the currently available thread information in the transaction storage dispatch center.
可选的,在所述从事务存储调度中心中获取当前可用的线程信息之后,还包括:Optionally, after obtaining the currently available thread information from the transaction storage dispatch center, further include:
根据零拷贝规则将所述第一服务请求第二服务时对应的线程信息以及所述当前可用的线程信息存储至磁盘。The thread information corresponding to when the first service requests the second service and the currently available thread information are stored in the disk according to the zero-copy rule.
第二方面,本发明实施例提供一种分布式事务处理装置,包括:In a second aspect, an embodiment of the present invention provides a distributed transaction processing device, including:
监听模块,用于在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将所述第一服务对应的线程状态设置为挂起状态;The monitoring module is configured to obtain thread information corresponding to the first service requesting the second service when the first service requesting the second service is detected in the business to be processed, and set the thread state corresponding to the first service to hang starting state;
处理模块,用于从事务存储调度中心中获取当前可用的线程信息,并对所述第一服务请求第二服务时对应的线程信息和所述当前可用的线程信息进行监听,得到监听结果,并将所述监听结果同步至备份服务器;A processing module, configured to obtain currently available thread information from the transaction storage scheduling center, and monitor the corresponding thread information and the currently available thread information when the first service requests the second service, obtain a monitoring result, and Synchronizing the monitoring result to a backup server;
所述处理模块,还用于根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务。The processing module is further configured to respectively process the second service and the first service according to the monitoring result, so as to realize the service to be processed.
第三方面,本发明实施例提供一种电子设备,包括:至少一个处理器和存储器;In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor and a memory;
所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如第一方面任一项所述的分布式事务处理方法。The at least one processor executes the computer-implemented instructions stored in the memory, so that the at least one processor executes the distributed transaction processing method according to any one of the first aspect.
第四方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如第一方面任一项所述的分布式事务处理方法。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, any one of the first aspects can be realized. The described distributed transaction processing method.
第五方面,本发明实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现如上第一方面以及第一方面各种可能的设计所述的分布式事务处理方法。In the fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the distributed transaction processing described in the above first aspect and various possible designs of the first aspect is realized. method.
本发明实施例提供了一种分布式事务处理方法、装置及电子设备,采用上述方案后,能在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将第一服务对应的线程状态设置为挂起状态,然后可以从事务调度中心中获取当前可用的线程信息,并对第一服务请求第二服务时对应的线程信息和当前可用的线程信息进行监听,得到监听结果,并将监听结果同步至备份服务器,再根据监听结果分别对第二服务和第一服务进行处理,进而实现待处理业务,通过实时对当前可用的线程信息和第一服务请求第二服务时对应的线程信息进行监控,并根据监控结果进行处理的方式,减少了所有参与者均处于同步阻塞状态的情况,并且在协调者出现故障时,也可以通过备份服务器进行处理,避免了业务一直处于锁定状态的情况,提高了业务的处理效率。Embodiments of the present invention provide a distributed transaction processing method, device, and electronic equipment. After adopting the above scheme, when the first service request and the second service in the business to be processed are monitored, the first service request and the second service request can be obtained. The thread information corresponding to the time, and set the thread state corresponding to the first service to the suspended state, and then obtain the currently available thread information from the transaction scheduling center, and request the thread information corresponding to the second service for the first service and Monitor the currently available thread information, obtain the monitoring results, and synchronize the monitoring results to the backup server, and then process the second service and the first service respectively according to the monitoring results, and then realize the pending business. The information and the corresponding thread information when the first service requests the second service are monitored, and the method of processing according to the monitoring results reduces the situation that all participants are in a synchronous blocking state, and when the coordinator fails, it can also be passed The backup server is used for processing, which avoids the situation that the business is always locked, and improves the processing efficiency of the business.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为本发明实施例提供的现有技术中分布式事务处理过程的应用示意图;FIG. 1 is an application schematic diagram of a distributed transaction processing process in the prior art provided by an embodiment of the present invention;
图2为本发明实施例提供的分布式事务处理方法的流程示意图;FIG. 2 is a schematic flowchart of a distributed transaction processing method provided by an embodiment of the present invention;
图3为本发明实施例提供的分布式事务处理方法的原理示意图;FIG. 3 is a schematic diagram of the principle of a distributed transaction processing method provided by an embodiment of the present invention;
图4为本发明实施例提供的分布式事务处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a distributed transaction processing device provided by an embodiment of the present invention;
图5为本发明实施例提供的电子设备的硬件结构示意图。FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例还能够包括除了图示或描述的那些实例以外的其他顺序实例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects and not necessarily Describe a specific order or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are also capable of other sequential instances than those illustrated or described. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.
随着互联网技术的发展,大多数互联网公司会将系统进行服务拆分,系统服务化变得越来越流行,在这期间就会出现各种服务与服务之间事务提交问题。即可以将一个待处理业务拆分成多个服务,在实现待处理业务的过程中,会涉及到各服务与服务之间进行提交的问题,现有技术中,分布式事务的实现过程主要可以包括两个阶段,一个是准备阶段(Prepare phase),另一个是提交阶段(commit phase)。With the development of Internet technology, most Internet companies will split the system into services, and system service becomes more and more popular. During this period, there will be transaction submission problems between various services. That is, a pending business can be split into multiple services. In the process of realizing the pending business, the problem of submitting between services will be involved. In the existing technology, the implementation process of distributed transactions can mainly be It includes two phases, one is the prepare phase (Prepare phase), the other is the commit phase (commit phase).
具体的,图1为本发明实施例提供的现有技术中分布式事务处理过程的应用示意图,如图1中a和图1中b所示,为分布式事务提交成功的情况,在准备阶段(Prepare phase),事务管理器给每个参与者发送Prepare消息,每个数据库参与者在本地执行事务,并写本地的Undo/Redo日志,此时事务没有提交。(Undo日志是记录修改前的数据,用于数据库回滚,Redo日志是记录修改后的数据,用于提交事务后写入数据文件)在提交阶段(commitphase),如果事务管理器收到了参与者的执行失败或者超时消息时,直接给每个参与者发送回滚(Rollback)消息;否则,发送提交(Commit)消息。参与者根据事务管理器的指令执行提交或者回滚操作,并释放事务处理过程中使用的锁资源。其中,必须在最后阶段释放锁资源。如图1中c和图1中d所示,为分布式事务提交失败的情况,在二阶段提交过程中可能存在的问题:所有参与者在事务提交阶段处于同步阻塞状态,占用系统资源,容易导致性能瓶颈。如果协调者存在单点故障问题,或出现故障,提供者将一直处于锁定状态。在二阶段中,如果出现协调者和参与者都挂了的情况,有可能导致数据不一致,降低了业务的处理效率,进而影响了业务的正常实现。Specifically, FIG. 1 is a schematic diagram of the application of the distributed transaction processing process in the prior art provided by the embodiment of the present invention, as shown in a in FIG. 1 and b in FIG. (Prepare phase), the transaction manager sends a Prepare message to each participant, each database participant executes the transaction locally, and writes the local Undo/Redo log, and the transaction is not committed at this time. (The Undo log is to record the data before modification, which is used for database rollback, and the Redo log is to record the modified data, which is used to write the data file after committing the transaction) In the commit phase (commitphase), if the transaction manager receives the participant When the execution fails or a timeout message, send a rollback (Rollback) message to each participant directly; otherwise, send a commit (Commit) message. Participants perform commit or rollback operations according to the instructions of the transaction manager, and release the lock resources used in the transaction process. Among them, the lock resource must be released in the final stage. As shown in c in Figure 1 and d in Figure 1, it is the case that the distributed transaction fails to commit. There may be problems in the two-phase commit process: all participants are in a synchronous blocking state during the transaction commit phase, which occupies system resources and is easy to lead to performance bottlenecks. If the coordinator is a single point of failure, or fails, the provider will remain locked. In the second stage, if both the coordinator and the participants hang up, it may cause data inconsistency, reduce the processing efficiency of the business, and affect the normal realization of the business.
基于上述问题,本申请通过实时对当前可用的线程信息和第一服务请求第二服务时对应的线程信息进行监控,并根据监控结果进行处理的方式,达到了既减少了所有参与者均处于同步阻塞状态的情况,并且在协调者出现故障时,也可以通过备份服务器进行处理,避免了业务一直处于锁定状态的情况,又提高了业务的处理效率的技术效果。Based on the above problems, this application monitors the currently available thread information and the corresponding thread information when the first service requests the second service in real time, and processes it according to the monitoring results, so as to reduce the need for all participants to be synchronized In the case of blocked state, and when the coordinator fails, it can also be processed by the backup server, avoiding the situation that the business is always locked, and improving the technical effect of business processing efficiency.
下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。The technical solution of the present invention will be described in detail below with specific embodiments. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
图2为本发明实施例提供的分布式事务处理方法的流程示意图,本实施例的方法可以由主服务器执行。如图2所示,本实施例的方法,可以包括:FIG. 2 is a schematic flowchart of a distributed transaction processing method provided by an embodiment of the present invention, and the method of this embodiment may be executed by a master server. As shown in Figure 2, the method of this embodiment may include:
S201:在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将第一服务对应的线程状态设置为挂起状态。S201: Obtain thread information corresponding to the first service requesting the second service when it is detected that the first service requests the second service in the pending business, and set the thread state corresponding to the first service to a suspended state.
在本实施例中,待处理业务在实现过程中,可能会涉及到多个服务,各个服务之间按预设交互顺序有序进行交互,进而可以实现该待处理业务。在该实施例中,以待处理业务包含第一服务和第二服务为例进行说明,当然包含其他服务数量的方式也在本申请的保护范围内,在此不再详细进行论述。In this embodiment, during implementation of the service to be processed, multiple services may be involved, and the services interact with each other in an orderly manner according to a preset interaction sequence, so that the service to be processed can be realized. In this embodiment, an example is taken in which the service to be processed includes the first service and the second service. Of course, the manner of including other service quantities is also within the protection scope of the present application, and will not be discussed in detail here.
进一步的,可以实时对第一服务的状态进行监听,在监听到第一服务请求第二服务时,可以获取第一服务请求第二服务时对应的线程信息,其中,第一服务请求第二服务时对应的线程信息可以包括线程ID、线程名称以及请求状态等。示例性的,请求状态可以包括已发起状态、请求中状态和已完成状态。Furthermore, the status of the first service can be monitored in real time, and when the first service requests the second service, the thread information corresponding to the first service requesting the second service can be obtained, wherein the first service requests the second service The corresponding thread information may include a thread ID, a thread name, and a request status. Exemplarily, the request status may include an initiated status, a requesting status and a completed status.
此外,在监听到第一服务请求第二服务时,可以先将第一服务对应的线程的状态设置为挂起状态,即先不对第一服务进行处理,等待第二服务处理完成之后再对第一服务进行处理。In addition, when listening to the first service requesting the second service, the state of the thread corresponding to the first service can be set to a suspended state first, that is, the first service will not be processed first, and the second service will be processed after the second service is completed. A service for processing.
S202:从事务存储调度中心中获取当前可用的线程信息,并对第一服务请求第二服务时对应的线程信息和当前可用的线程信息进行监听,得到监听结果,并将监听结果同步至备份服务器。S202: Obtain the currently available thread information from the transaction storage scheduling center, and monitor the corresponding thread information and the currently available thread information when the first service requests the second service, obtain the monitoring result, and synchronize the monitoring result to the backup server .
在本实施例中,实务存储调度中心中存储有当前可用的线程信息,在监听到第一服务请求第二服务之后,可以从实务存储调度中心中获取当前可用的线程信息,然后对第一服务请求第二服务时对应的线程信息和当前可用的线程信息进行监听,判断当前可用的线程信息是否分配给第一服务请求第二服务时对应的线程,得到监听结果。In this embodiment, the currently available thread information is stored in the practice storage and dispatch center, and after listening to the request of the first service for the second service, the currently available thread information can be obtained from the practice storage and dispatch center, and then the first service Monitor the corresponding thread information when requesting the second service and the currently available thread information, judge whether the currently available thread information is assigned to the corresponding thread when the first service requests the second service, and obtain the monitoring result.
此外,在得到监听结果之后,为了避免主服务器发生故障造成数据丢失,可以将监听结果同步至备份服务器。另外,待处理业务处理过程中的其他数据也可以同步至备份服务器,保证备份服务器与主服务器中的数据一致性。In addition, after obtaining the monitoring results, in order to avoid data loss caused by failure of the primary server, the monitoring results can be synchronized to the backup server. In addition, other data in the pending business process can also be synchronized to the backup server to ensure data consistency between the backup server and the master server.
S203:根据监听结果分别对第二服务和第一服务进行处理,进而实现待处理业务。S203: Process the second service and the first service respectively according to the monitoring result, so as to realize the service to be processed.
在本实施例中,在得到监听结果之后,可以根据该监听结果依次对第二服务和第一服务进行处理,进而实现该待处理业务。In this embodiment, after the monitoring result is obtained, the second service and the first service may be processed sequentially according to the monitoring result, so as to realize the service to be processed.
进一步的,根据监听结果依次对第二服务和第一服务进行处理的具体过程可以为:Further, the specific process of sequentially processing the second service and the first service according to the monitoring result may be as follows:
若监听结果为当前可用的线程信息为第二服务接收到所述第一服务的请求时,对所述第二服务进行处理,并在处理完成所述第二服务时,将所述当前可用的线程信息对应的线程状态设置为完成状态。If the monitoring result is that the currently available thread information is the second service when the request for the first service is received, the second service is processed, and when the processing of the second service is completed, the currently available The thread state corresponding to the thread information is set to the completed state.
将所述第一服务对应的线程状态设置为请求状态,并根据所述请求状态对所述第一服务进行处理,进而实现所述待处理业务。Setting the state of the thread corresponding to the first service as a request state, and processing the first service according to the request state, so as to realize the service to be processed.
另外,所述方法还可以包括:In addition, the method may also include:
若监听结果为当前可用的线程信息被除第一服务和第二服务之外的其他服务占用时,则将所述第二服务的状态设置为挂起状态;If the monitoring result is that the currently available thread information is occupied by services other than the first service and the second service, then the state of the second service is set to a suspended state;
每隔预设时长确定所述当前可用的线程信息的状态,并在所述当前可用的线程信息没有被所述其他服务占用时,为所述第二服务分配所述当前可用的线程信息,并对所述第二服务进行处理。Determining the state of the currently available thread information every preset time period, and assigning the currently available thread information to the second service when the currently available thread information is not occupied by the other services, and The second service is processed.
具体的,监听结果可以包括两种,一种为当前可用的线程信息被第二服务接收到第一服务的请求所对应的线程占用时,即当前可用的线程信息为第二服务接收到第一服务的请求时,可以对第二服务进行处理,并在第二服务处理完成时,将当前可用的线程信息对应的线程状态设置为完成状态,即表明第二服务已经处理完成,可以根据第二服务处理完成之后的信息对第一服务继续进行处理了。Specifically, the monitoring results may include two types, one is when the currently available thread information is occupied by the thread corresponding to the second service receiving the first service request, that is, the currently available thread information is the second service receiving the first service request. When a service request is requested, the second service can be processed, and when the second service processing is completed, the thread status corresponding to the currently available thread information is set to the completed state, which means that the second service has been processed, and the second service can be processed according to the second service. The information after the service processing is completed continued processing to the first service.
另一种监听结果为当前可用的线程信息被除第一服务和第二服务之外的其他服务占用时,即当前可用的线程信息被其他待处理业务占用时,暂时不能处理第二服务,可以先将第二服务的状态设置为挂起状态。并且每隔预设时长确定一次当前可用的线程信息的状态,并在当前可用的线程信息没有被其他服务占用时,为第二服务分配当前可用的线程信息,并对第二服务进行处理,并在处理完成第二服务时,将当前可用的线程信息对应的线程状态设置为完成状态。Another monitoring result is that when the currently available thread information is occupied by services other than the first service and the second service, that is, when the currently available thread information is occupied by other pending services, the second service cannot be processed temporarily, and you can The state of the second service is first set to a suspended state. And determine the state of the currently available thread information every preset time length, and when the currently available thread information is not occupied by other services, assign the currently available thread information to the second service, and process the second service, and When the processing of the second service is completed, the thread state corresponding to the currently available thread information is set as the completed state.
采用上述方案后,能在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将第一服务对应的线程状态设置为挂起状态,然后可以从事务调度中心中获取当前可用的线程信息,并对第一服务请求第二服务时对应的线程信息和当前可用的线程信息进行监听,得到监听结果,并将监听结果同步至备份服务器,再根据监听结果分别对第二服务和第一服务进行处理,进而实现待处理业务,通过实时对当前可用的线程信息和第一服务请求第二服务时对应的线程信息进行监控,并根据监控结果进行处理的方式,减少了所有参与者均处于同步阻塞状态的情况,并且在协调者出现故障时,也可以通过备份服务器进行处理,避免了业务一直处于锁定状态的情况,提高了业务的处理效率。After adopting the above solution, when the first service requesting the second service in the pending business is monitored, the thread information corresponding to the first service requesting the second service can be obtained, and the thread state corresponding to the first service can be set to suspend state, and then obtain the currently available thread information from the transaction scheduling center, and monitor the corresponding thread information and the currently available thread information when the first service requests the second service, obtain the monitoring result, and synchronize the monitoring result to the backup The server then processes the second service and the first service respectively according to the monitoring results, and then realizes the business to be processed, and monitors the currently available thread information and the corresponding thread information when the first service requests the second service in real time, and according to The method of processing the monitoring results reduces the situation that all participants are in a synchronous blocking state, and when the coordinator fails, it can also be processed through the backup server, avoiding the situation that the business is always locked and improving the business. Processing efficiency.
基于图2的方法,本说明书实施例还提供了该方法的一些具体实施方案,下面进行说明。Based on the method in FIG. 2 , the embodiment of this specification also provides some specific implementations of the method, which will be described below.
此外,在另一实施例中,所述方法还可以包括:In addition, in another embodiment, the method may also include:
若在预设时长内没有实现待处理业务,则启动备份服务器,以使所述备份服务器根据监听结果分别对第二服务和第一服务进行处理,进而实现所述待处理业务。If the service to be processed is not realized within the preset time length, the backup server is started, so that the backup server processes the second service and the first service respectively according to the monitoring result, and then realizes the service to be processed.
在本实施例中,若在预设时长内仍没有实现待处理业务时,则表明实现该待处理业务的主服务器可能存在故障,为了避免影响待处理业务的正常实现,可以启动备份服务器,由于备份服务器中的数据与主服务器中的数据是实时同步的,因此,可以通过备份服务器对第二服务和第一服务进行处理,进而实现该待处理业务。In this embodiment, if the business to be processed is still not realized within the preset period of time, it indicates that the main server that realizes the business to be processed may be faulty. In order to avoid affecting the normal realization of the business to be processed, the backup server can be started. The data in the backup server is synchronized with the data in the main server in real time, therefore, the second service and the first service can be processed by the backup server, and then the service to be processed can be realized.
此外,在另一实施例中,在从事务存储调度中心中获取当前可用的线程信息之前,所述方法还可以包括:In addition, in another embodiment, before obtaining the currently available thread information from the transaction storage dispatch center, the method may further include:
根据预存的动态路由负载规则确定当前可用的线程信息,其中,所述当前可用的线程信息为至少一服务对应的线程信息。Determine currently available thread information according to a prestored dynamic routing load rule, where the currently available thread information is thread information corresponding to at least one service.
将所述当前可用的线程信息存储至事务存储调度中心。Store the currently available thread information in the transaction storage dispatch center.
进一步的,在从事务存储调度中心中获取当前可用的线程信息之后,还可以包括:Further, after obtaining the currently available thread information from the transaction storage dispatch center, it may also include:
根据零拷贝规则将第一服务请求第二服务时对应的线程信息以及所述当前可用的线程信息存储至磁盘。According to the zero-copy rule, the corresponding thread information when the first service requests the second service and the currently available thread information are stored in the disk.
在本实施例中,图3为本发明实施例提供的分布式事务处理方法的原理示意图,如图3所示,可以包括事务存储调度(Transaction Scheduling)、事务服务发现(TransactionRegistry)、事务控制中心服务(Transaction Control)、事务监听(Transaction Monitor)以及服务通信(Transaction Remoting)几个具体模块。In this embodiment, FIG. 3 is a schematic diagram of the principle of the distributed transaction processing method provided by the embodiment of the present invention. As shown in FIG. 3 , it may include transaction storage scheduling (Transaction Scheduling), transaction service discovery (TransactionRegistry), transaction control center Service (Transaction Control), transaction monitoring (Transaction Monitor) and service communication (Transaction Remoting) several specific modules.
具体的,事务存储调度模块为事务控制中心的一个组件,主要是用来缓存、存储服务与服务之间的调度关系,方便于更快定位当前调用链路关系。例如,A服务访问B服务期间,事务控制中心会将当前线程挂起(CPU切换上下文),然后会将当前线程进行持久化,防止数据丢失,等B服务是否Confirm确认提交完毕后。在执行A服务事务commit提交。事务存储调度服务存储技术会在启动时在磁盘中默认开辟一个连续的存储空间,这样能够保障挂起的线程持久化时能保证数据的顺序性,然后读取时在利用零拷贝高效读取。事务服务发现可以看作是整个框架的注册中心,主要有两个功能,一是集群的事务控制中心、事务存储调度服务的路由配置。二是:获取两个服务的实时配置信息,其他模块通过访问事务控制中心来获取最新的服务状态以及地址。事务控制中心主要为管控事务存储调度和事务监控的控制器,来处理数据存储,以及事件监听后向各服务扭转消息等处理过程。事务控制中心支持集群模式Master或者Slave。多个主从组成的集群,同时还提供下游系统是否Confirm确认提交查询功能。事务监听模块为事务控制中心的一个组件,主要是来监控服务与服务之间的发起,利用自定义注解的方式,当A服务调用B服务时,服务监控会记录以及跟踪当前线程ID状态以及请求状态,然后把数据传递给事务控制中心来处理。具体可以为服务监听监测到A服务调用B服务时会获取当前线程ID,线程名称,请求状态等数据发送到事务控制中心,事务控制中心则会将数据缓存起来并持久化。当下游服务Confirm确认提交后,监控中心会接受下游系统指令,并向服务控制中心发起请求,告知上游戏事务提交状态。服务通信模块主要可以基于netty底层通信来实现所有服务间的交互。Specifically, the transaction storage scheduling module is a component of the transaction control center, which is mainly used to cache and store the scheduling relationship between services, so as to facilitate faster positioning of the current calling link relationship. For example, when service A accesses service B, the transaction control center will suspend the current thread (CPU switches context), and then persist the current thread to prevent data loss, and wait for service B to confirm whether the submission is completed. Submit the A service transaction commit. The transaction storage scheduling service storage technology will open up a continuous storage space in the disk by default at startup, which can ensure the order of data when the suspended thread persists, and then use zero copy to read efficiently when reading. Transaction service discovery can be regarded as the registration center of the entire framework. It has two main functions. One is the transaction control center of the cluster and the routing configuration of the transaction storage scheduling service. The second is to obtain the real-time configuration information of the two services, and other modules obtain the latest service status and address by accessing the transaction control center. The transaction control center is mainly a controller that manages and controls transaction storage scheduling and transaction monitoring to handle data storage, and process processes such as reversing messages to various services after event monitoring. The transaction control center supports cluster mode Master or Slave. A cluster composed of multiple masters and slaves also provides the function of whether the downstream system confirms and submits the query. The transaction monitoring module is a component of the transaction control center, mainly to monitor the initiation between services, using custom annotations, when A service calls B service, the service monitoring will record and track the current thread ID status and request state, and then pass the data to the transaction control center for processing. Specifically, it can be monitored by the service that when A service calls B service, it will obtain the current thread ID, thread name, request status and other data and send it to the transaction control center, and the transaction control center will cache and persist the data. When the downstream service Confirm confirms the submission, the monitoring center will accept the downstream system instructions and initiate a request to the service control center to inform the online game transaction submission status. The service communication module can mainly realize the interaction between all services based on netty underlying communication.
其中,当服务与服务之间进行通讯时,事务监听(Transaction Monitor)则会将数据传递到事务控制中心,这个时候事务控制中心则会发起2个步骤,第一步为往内存中写入当前线程ID状态以及请求状态,第二步为利用零拷贝技术将数据按照一定排序写入到磁盘中,这主要是防止数据丢失。其他服务在启动时会向事务服务发现发送指令,并传递当前服务信息如服务名称,服务地址等。动态路由机制的运作,主要可以模仿Gateway动态路由的配置。通过采用零拷贝技术,可以避免CPU将数据从一块存储拷贝到另外一块存储,主要就是利用各种零拷贝技术,避免让CPU做大量的数据拷贝任务,减少不必要的拷贝,或者让别的组件来做这一类简单的数据传输任务,能够大量节省时间来,来进行磁盘与IO之间互动。Among them, when the service communicates with the service, the transaction monitor (Transaction Monitor) will pass the data to the transaction control center. At this time, the transaction control center will initiate two steps. The first step is to write the current Thread ID status and request status. The second step is to use zero-copy technology to write the data to the disk in a certain order, which is mainly to prevent data loss. When other services are started, they will send instructions to transaction service discovery and pass current service information such as service name, service address, etc. The operation of the dynamic routing mechanism can mainly imitate the configuration of Gateway dynamic routing. By adopting zero-copy technology, it is possible to prevent the CPU from copying data from one piece of storage to another piece of storage. Doing this kind of simple data transfer tasks can save a lot of time for the interaction between disk and IO.
另外,当A服务请求B服务时,服务监听会获取当前线程ID,线程名称,请求状态(已发起)等数据发送到事务控制中心,服务注册发现会根据当前事务存储调度有哪些阶段是存活可用的,然后通过动态路由负载到具体的事务存储调度中心,然后事务存储调度中心会保持并持久化当前数据,同时如果是集群模式也会将数据同步到slave中,当B服务收到请求后,服务监听也会监听到当前请求接口的程ID,线程名称,请求状态(请求中)等数据,直到B服务线程处理完成后,监听服务会回写当前线程请求状态已完成,并将A服务线程挂起状态调整成正常状态。In addition, when service A requests service B, the service monitor will obtain the current thread ID, thread name, request status (initiated) and other data and send them to the transaction control center, and the service registration will discover which stages are alive and available according to the current transaction storage scheduling Yes, and then dynamically route the load to the specific transaction storage scheduling center, then the transaction storage scheduling center will maintain and persist the current data, and if it is a cluster mode, it will also synchronize the data to the slave. When the B service receives the request, The service monitoring will also monitor the process ID, thread name, request status (in progress) and other data of the current request interface. After the B service thread is processed, the monitoring service will write back that the current thread request status has been completed, and send the A service thread Suspended state is adjusted to normal state.
本申请通过服务架构特性将当前分布式事务用第三方插件引用的形式来使得服务能够进行双向通信,并且采用线程切换的技术来达到线程阻塞以及向数据库发送指令来达到事务回滚的目的,既能保障服务与服务之间达到双向通信,又可以告知上下游系统事务回归状态以及是否commit事务,理论上只要保障服务之间达到双向通信就能准确保证事务的最终一致性以及时效性,并支持高可用,多节点部署。This application uses the characteristics of the service architecture to use the current distributed transaction in the form of a third-party plug-in reference to enable the service to perform two-way communication, and uses the thread switching technology to achieve thread blocking and send instructions to the database to achieve the purpose of transaction rollback, both It can ensure two-way communication between services, and can also inform upstream and downstream systems of transaction return status and whether to commit transactions. In theory, as long as two-way communication between services is guaranteed, the final consistency and timeliness of transactions can be accurately guaranteed, and support High availability, multi-node deployment.
基于同样的思路,本说明书实施例还提供了上述方法对应的装置,图4为本发明实施例提供的分布式事务处理装置的结构示意图,如图4所示,可以包括:Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method. FIG. 4 is a schematic structural diagram of a distributed transaction processing device provided by an embodiment of the present invention. As shown in FIG. 4 , it may include:
监听模块401,用于在监听到待处理业务中的第一服务请求第二服务时,获取第一服务请求第二服务时对应的线程信息,并将所述第一服务对应的线程状态设置为挂起状态。The
处理模块402,用于从事务存储调度中心中获取当前可用的线程信息,并对所述第一服务请求第二服务时对应的线程信息和所述当前可用的线程信息进行监听,得到监听结果,并将所述监听结果同步至备份服务器。The
所述处理模块402,还用于根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务。The
在本实施例中,所述处理模块402,还用于:In this embodiment, the
若所述监听结果为所述当前可用的线程信息为所述第二服务接收到所述第一服务的请求时,对所述第二服务进行处理,并在处理完成所述第二服务时,将所述当前可用的线程信息对应的线程状态设置为完成状态。If the monitoring result is that the currently available thread information is that the second service receives the request of the first service, process the second service, and when the processing of the second service is completed, Setting the thread state corresponding to the currently available thread information to a completed state.
将所述第一服务对应的线程状态设置为请求状态,并根据所述请求状态对所述第一服务进行处理,进而实现所述待处理业务。Setting the state of the thread corresponding to the first service as a request state, and processing the first service according to the request state, so as to realize the service to be processed.
在本实施例中,所述处理模块402,还用于:In this embodiment, the
若所述监听结果为所述当前可用的线程信息被除所述第一服务和所述第二服务之外的其他服务占用时,则将所述第二服务的状态设置为挂起状态。If the monitoring result is that the currently available thread information is occupied by services other than the first service and the second service, then setting the state of the second service to a suspended state.
每隔预设时长确定所述当前可用的线程信息的状态,并在所述当前可用的线程信息没有被所述其他服务占用时,为所述第二服务分配所述当前可用的线程信息,并对所述第二服务进行处理。Determining the state of the currently available thread information every preset time period, and assigning the currently available thread information to the second service when the currently available thread information is not occupied by the other services, and The second service is processed.
此外,在另一实施例中,所述处理模块402,还用于:In addition, in another embodiment, the
若在预设时长内没有实现所述待处理业务,则启动所述备份服务器,以使所述备份服务器根据所述监听结果分别对所述第二服务和所述第一服务进行处理,进而实现所述待处理业务。If the service to be processed is not realized within the preset time length, start the backup server, so that the backup server processes the second service and the first service respectively according to the monitoring result, thereby realizing The business to be processed.
此外,在另一实施例中,所述处理模块402,还用于:In addition, in another embodiment, the
根据预存的动态路由负载规则确定当前可用的线程信息,其中,所述当前可用的线程信息为至少一服务对应的线程信息。Determine currently available thread information according to a prestored dynamic routing load rule, where the currently available thread information is thread information corresponding to at least one service.
将所述当前可用的线程信息存储至事务存储调度中心。Store the currently available thread information in the transaction storage dispatch center.
在本实施例中,所述处理模块402,还用于:In this embodiment, the
根据零拷贝规则将所述第一服务请求第二服务时对应的线程信息以及所述当前可用的线程信息存储至磁盘。The thread information corresponding to when the first service requests the second service and the currently available thread information are stored in the disk according to the zero-copy rule.
本发明实施例提供的装置,可以实现上述如图2所示的实施例的方法,其实现原理和技术效果类似,此处不再赘述。The device provided by the embodiment of the present invention can implement the method of the above embodiment as shown in FIG. 2 , and its implementation principle and technical effect are similar, and will not be repeated here.
图5为本发明实施例提供的电子设备的硬件结构示意图。如图5所示,本实施例提供的设备500包括:至少一个处理器501和存储器502。其中,处理器501、存储器502通过总线503连接。FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 5 , a device 500 provided in this embodiment includes: at least one
在具体实现过程中,至少一个处理器501执行所述存储器502存储的计算机执行指令,使得至少一个处理器501执行上述方法实施例中的方法。In a specific implementation process, at least one
处理器501的具体实现过程可参见上述方法实施例,其实现原理和技术效果类似,本实施例此处不再赘述。For the specific implementation process of the
在上述的图5所示的实施例中,应理解,处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application SpecificIntegrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合发明所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the above-mentioned embodiment shown in FIG. 5, it should be understood that the processor can be a central processing unit (English: Central Processing Unit, referred to as: CPU), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, referred to as: DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as: ASIC), etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in conjunction with the invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
存储器可能包含高速RAM存储器,也可能还包括非易失性存储NVM,例如至少一个磁盘存储器。The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory.
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。The bus may be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现上述方法实施例的分布式事务处理方法方法。The embodiment of the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the distributed transaction processing method of the above-mentioned method embodiment is implemented method.
本发明实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现如上所述的分布式事务处理方法方法。An embodiment of the present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the above-mentioned distributed transaction processing method is realized.
上述的计算机可读存储介质,上述可读存储介质可以是由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。可读存储介质可以是通用或专用计算机能够存取的任何可用介质。The above-mentioned computer-readable storage medium, the above-mentioned readable storage medium can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
一种示例性的可读存储介质耦合至处理器,从而使处理器能够从该可读存储介质读取信息,且可向该可读存储介质写入信息。当然,可读存储介质也可以是处理器的组成部分。处理器和可读存储介质可以位于专用集成电路(Application Specific IntegratedCircuits,简称:ASIC)中。当然,处理器和可读存储介质也可以作为分立组件存在于设备中。An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium may be located in application specific integrated circuits (Application Specific Integrated Circuits, ASIC for short). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110563326.5A CN115390997A (en) | 2021-05-24 | 2021-05-24 | Distributed transaction processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110563326.5A CN115390997A (en) | 2021-05-24 | 2021-05-24 | Distributed transaction processing method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115390997A true CN115390997A (en) | 2022-11-25 |
Family
ID=84113875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110563326.5A Pending CN115390997A (en) | 2021-05-24 | 2021-05-24 | Distributed transaction processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115390997A (en) |
-
2021
- 2021-05-24 CN CN202110563326.5A patent/CN115390997A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10255343B2 (en) | Initialization protocol for a peer-to-peer replication environment | |
US10382380B1 (en) | Workload management service for first-in first-out queues for network-accessible queuing and messaging services | |
US8930316B2 (en) | System and method for providing partition persistent state consistency in a distributed data grid | |
US10496671B1 (en) | Zone consistency | |
WO2018103318A1 (en) | Distributed transaction handling method and system | |
US7900085B2 (en) | Backup coordinator for distributed transactions | |
CN111314479B (en) | Data processing method and equipment | |
US9417906B2 (en) | Transaction participant registration with caveats | |
US20170153910A1 (en) | System and method for supporting transaction affinity based on resource manager (rm) instance awareness in a transactional environment | |
JP2015531512A (en) | System and method for supporting a scalable message bus in a distributed data grid cluster | |
CN112148798A (en) | Data processing method and device applied to distributed system | |
CN109783204A (en) | Distributed transaction processing method, device and storage medium | |
CN111158949A (en) | Disaster-tolerant architecture configuration method, switching method, device, device, and storage medium | |
US10721335B2 (en) | Remote procedure call using quorum state store | |
CN109783151B (en) | Method and device for rule change | |
CN114363407A (en) | Message service method and apparatus, readable storage medium and electronic device | |
CN111385255B (en) | Asynchronous call implementation method, device, server and server cluster | |
CN104580428B (en) | A kind of data routing method, data administrator and distributed memory system | |
CN111666134A (en) | Method and system for scheduling distributed tasks | |
CN115098469A (en) | Database migration method and apparatus, electronic device and readable storage medium | |
CN115390997A (en) | Distributed transaction processing method and device and electronic equipment | |
CN111274047A (en) | Information processing method, terminal, system, computer device and storage medium | |
CN112463887B (en) | A data processing method, device, equipment and storage medium | |
CN117056198A (en) | Mock test method, mock test device, medium and computer equipment | |
CN113992750B (en) | Global transaction cooperation method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |