CN109819023A - Distributed transaction processing method and Related product - Google Patents

Distributed transaction processing method and Related product Download PDF

Info

Publication number
CN109819023A
CN109819023A CN201910031513.1A CN201910031513A CN109819023A CN 109819023 A CN109819023 A CN 109819023A CN 201910031513 A CN201910031513 A CN 201910031513A CN 109819023 A CN109819023 A CN 109819023A
Authority
CN
China
Prior art keywords
service
coordinator
message
request
execution
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.)
Granted
Application number
CN201910031513.1A
Other languages
Chinese (zh)
Other versions
CN109819023B (en
Inventor
李春林
尹冲
王丽
石小华
钟斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fly Software Technology Co Ltd
Original Assignee
Hangzhou Fly Software Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Fly Software Technology Co Ltd filed Critical Hangzhou Fly Software Technology Co Ltd
Publication of CN109819023A publication Critical patent/CN109819023A/en
Application granted granted Critical
Publication of CN109819023B publication Critical patent/CN109819023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present application discloses a kind of distributed transaction processing method and Related product, first service applied to Distributed Services processing system, Distributed Services processing system includes the multiple services run in multiple equipment, multiple services include registration center's service, first service, second service and third service, method includes: that first service receives the transaction branch assignment messages sent from registration center's service, response transactions assignment messages send to registration center and determine the response message for opening the first transaction branch of processing;It receives the coordinator service serviced from registration center and elects message, the processing information of the first transaction branch is sent to coordinator service;The execution message from coordinator service is received, execute the first transaction branch executes operation.The embodiment of the present application provides distributed system transaction methods, is conducive to the high efficiency and convenience that improve distributing real time system.

Description

Distributed transaction processing method and Related product
Technical field
This application involves technical field of electronic equipment, and in particular to a kind of distributed transaction processing method and Related product.
Background technique
Distributed transaction refers to the participant of affairs, supports server, Resource Server and the task manager of affairs It is located on the different nodes of different distributed systems.To put it simply, be exactly a distributed transaction by it is multiple not Same business operation composition, these business operations are distributed on a different server, and belong to different applications.Dividing on a large scale Under cloth transaction processing environment, an affairs often cross over multiple databases, how to guarantee the number between this multiple database According to consistency, effective strategy is needed.
In the development frame mode of Distributed Services, a service request generally requires multiple service collaborations and completes, And the service of each of process may all do the operation of persistence to data.If some service operations is because of certain reason Failure, then the operation of the service before the operation needs to carry out rollback.Have at present aiming at the problem that distributed transaction more Solution, but can all have configuration complexity, use cost is high, while network request demand is larger in treatment process, interaction The common problems such as low efficiency.
Summary of the invention
The embodiment of the present application provides a kind of distributed transaction processing method and Related product, to improve distributed transaction The high efficiency and convenience of processing.
In a first aspect, the embodiment of the present application provides a kind of distributed transaction processing method, it is applied to Distributed Services and handles The first service of system, the Distributed Services processing system includes the multiple services run in multiple equipment, the multiple Service includes registration center's service, the first service, second service and third service, which comprises
The transaction branch assignment messages sent from registration center service are received, the affairs assignment messages are responded, It services to send to the registration center and determines the response message for opening the first transaction branch of processing, the transaction branch assignment messages Obtained by operating below registration center's service execution: registration center's service receives processing request from the user, Obtain annotating information;And according to the annotating information, the first transaction branch in the processing request is distributed to described the One service;
It receives the coordinator service serviced from the registration center and elects message, obtain the election of the coordinator service As a result, wherein the coordinator service election message is that registration center's service execution or less is operated and generated: receiving institute Response message is stated, starts to elect coordinator service;And determine that the third service is the coordinator service;And according to true Message is elected in coordinator service described in the fixed coordinator service creation;
According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;
Receive the execution message from the coordinator service, wherein the execution message is that the coordinator service is held The following operation of row obtains: according to the processing information, determining processing result, generates and execute message;
According to the execution message, execute first transaction branch executes operation.
Second aspect, the embodiment of the present application provide a kind of distributing real time system device, are applied to Distributed Services and handle The first service of system, the Distributed Services processing system includes the multiple services run in multiple equipment, the multiple Service includes registration center's service, the first service, second service and third service;The distributing real time system device packet Include processing unit and communication unit, wherein
The processing unit, for receiving the transaction branch assignment messages sent from registration center service, response The affairs assignment messages, the service of Xiang Suoshu registration center send the response message for determining and opening the first transaction branch of processing, institute Transaction branch assignment messages are stated to be obtained by operating below registration center's service execution: registration center service receive Lai It is requested from the processing of user, obtains annotating information;And according to the annotating information, by the first affairs in the processing request Branch distributes to the first service;And message is elected for receiving the coordinator service from registration center service, Obtain the election results of the coordinator service, wherein the coordinator service election message is that registration center's service is held Row is following to be operated and generates: being received the response message, is started to elect coordinator service;And determine that the third service is The coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation;And it uses According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;And for connecing Receive the execution message from the coordinator service, wherein the execution message is that the coordinator service execution or less operates And obtain: according to the processing information, determining processing result, generate and execute message;And for holding according to the execution message Row first transaction branch executes operation.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including processor, memory, communication interface and One or more programs, wherein said one or multiple programs are stored in above-mentioned memory, and are configured by above-mentioned It manages device to execute, above procedure is included the steps that for executing the instruction in the embodiment of the present application first aspect either method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, wherein above-mentioned computer-readable Storage medium storage is used for the computer program of electronic data interchange, wherein above-mentioned computer program executes computer such as Step some or all of described in the embodiment of the present application second aspect either method.
5th aspect, the embodiment of the present application provide a kind of computer program product, wherein above-mentioned computer program product Non-transient computer readable storage medium including storing computer program, above-mentioned computer program are operable to make to calculate Machine executes the step some or all of as described in the embodiment of the present application second aspect either method.The computer program product It can be a software installation packet.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is that the embodiment of the present application provides a kind of system architecture schematic diagram of Distributed Services processing system;
Fig. 2 is a kind of flow diagram of distributed transaction processing method provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another distributed transaction processing method provided by the embodiments of the present application;
Fig. 4 is the flow diagram of another distributed transaction processing method provided by the embodiments of the present application;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application;
Fig. 6 is a kind of functional unit composition block diagram of distributing real time system device provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall in the protection scope of this application.
The description and claims of this application and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing Different objects, are not use to describe a particular order.In addition, term " includes " and " having " and their any deformations, it is intended that It is to cover and non-exclusive includes.Such as the process, method, system, product or equipment for containing a series of steps or units do not have It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally also wrap Include other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
Electronic equipment involved by the embodiment of the present application may include the various handheld devices with wireless communication function, Mobile unit, wearable device calculate equipment or are connected to other processing equipments and various forms of radio modem User equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal device (terminal Device) etc..
It describes in detail below to the embodiment of the present application.
Referring to Fig. 1, Fig. 1 is that the embodiment of the present application provides a kind of system architecture of Distributed Services processing system 100 Schematic diagram, the Distributed Services processing system 100 include server-side 110 and multiple client 120, the multiple client 120 In include using the client of different type development language, each operation of client 120 has destination application, wherein described Server-side 110 can use micro services architecture design, specifically include registration center and service 111, first service 112, second service 113 and third service 114, each client and the registration center service 111 communication connection.Based on the above design, note Following functions are provided in the configuration management of volume center service 111: distribution transaction branch, election coordinator service etc..
The micro services framework uses Distributed Services Processing System Design mode, and each sub-services are one and individually answer With, reduce coupling, make Distributed Services processing system it is more expansible, improve stability.Secondly, using service registration and feedback Mechanism, realize the communication between each service.Other sub-services of registration center's service 111 and Distributed Services processing system Establish communication, by explain drive distribution transaction branch, provide note mode for easily realization assigning process.Third service 114 be the sub-services supplier of Distributed Services processing system, is also set to the coordinator service of micro services, the two is in In the same process, it is difficult to can simplify operation.
In the specific implementation, the server-side 110 can concentrate deployment registration center service 111, the using separate server One service 112, second service 113 and third service 114, can also use Distributed Design mechanism, pass through distributed system point Not deployment registration center service 111, first service 112, second service 113 and third service 114 on different devices, specifically may be used To carry out flexible setting according to business demand, unique restriction is not done.The client 120 can using the terminal devices such as mobile phone into Row deployment carries out flexible setting with specific reference to business demand.
Referring to Fig. 2, Fig. 2 is that the embodiment of the present application provides a kind of flow diagram of distributed transaction processing method, Applied to the first service of Distributed Services processing system, the Distributed Services processing system includes running in multiple equipment Multiple services, the multiple service includes registration center's service, the first service, second service and third service;It is described Method includes:
S201, first service receives the transaction branch assignment messages sent from registration center service, described in response Affairs assignment messages, Xiang Suoshu registration center send the response message for determining and opening and handling first transaction branch;
Wherein, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the processing request, and according to institute Annotating information is stated, load and parses the annotating information after the annotating information is parsed;And according to the note after parsing Information is solved, the first transaction branch in the processing request is distributed into the first service;
Wherein, the annotating information includes at least one transaction branch in the multiple transaction branch for inquiry mark Know, inquire preset mapping relations and obtain, the mapping relations include at least one described transaction branch and note letter Corresponding relationship between breath;
S202, the first service receive the coordinator service serviced from the registration center and elect message, obtain institute State the election results of coordinator service;
Wherein, the coordinator service election message is that registration center's service execution or less is operated and generated: into Row coordinator service election;And determine that the third service is the coordinator service;And according to the determining coordination Message is elected in coordinator service described in device service creation;
Wherein, the coordinator service includes but is not limited to third service;
S203, for the first service according to the election results, Xiang Suoshu coordinator service sends first affairs point The processing information of branch;
S204, the first service receive the execution message from the coordinator service;
Wherein, the execution message includes executing to submit operation information or execution rolling back action message;
S205, for the first service according to the execution message, execute first transaction branch executes operation.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
It is described to receive the coordinator service election message serviced from the registration center in a possible example, Obtain the election results of the coordinator service, comprising: first service is when detecting processing request, according to the note Information, Xiang Suoshu registration center send creation host node and itself Internet protocol address are written and configures the request of port;Institute It states first service and receives the coordinator service election message from the registration center, the coordinator service election message is institute It states registration center and executes and following operate and generate: receiving the request from the first service, determine the first request results;With And receive the second request from the second service, determine second request results;And it receives and is taken from the third The third of business is requested, and determines the third request results;And according to first request results, the second request results and third Request results, determination has and the only described third services and successfully obtains host node, determines that the third service is coordinator service; Wherein, second request is used to indicate the second service and sends creation host node to the registration center and itself is written mutually Networking protocol address and configuration port, the third request are used to indicate the third service and send creation to the registration center Simultaneously itself Internet protocol address and configuration port is written in host node;The first service disappears according to coordinator service election Breath, obtaining the third service is coordinator service.
Wherein, the coordinator service election message will be sent to the first service, institute by registration center's service State second service and told third service.
Wherein, the coordinator service election message includes being asked the processing according to the annotating information after the parsing The second transaction branch in asking distributes to the second service;And according to the annotating information after the parsing, by the processing Third transaction branch in request distributes to the third service;And the transaction branch distribution is generated according to corresponding relationship and is disappeared Breath, the corresponding relationship include the corresponding relationship of first transaction branch and the first service, two transaction branch and The corresponding relationship of the corresponding relationship of the second service, three transaction branch and the third service;Wherein, the distribution Affairs include multiple transaction branches, the multiple transaction branch include first transaction branch, second transaction branch and The third transaction branch.
As it can be seen that first service receives the coordinator service serviced from the registration center and elects message in this example, obtain The election results for taking the coordinator service elect a service in the multiple service for coordinator service, saving Cost elects coordinator service based on annotating information, simplifies configuration, meet high concurrent, high-performance, three high scenes of High Availabitity.
In a possible example, described to elect message according to the coordinator service, obtaining the third service is After coordinator service, method further include: first service is received again and come from when detecting that service delay machine occurs for coordinator service Message is elected in the coordinator service of the registration center, and the coordinator service election message is below the registration center executes Operation and generate: receive the request from the first service, determine the first request results;Receive to come from the second service Second request, determine second request results;The third request from the third service is received, determines that the third is asked Seek result;According to first request results, the second request results and third request results, determination has and only described second clothes It is engaged in successfully obtaining host node, determines that the second service is coordinator service;The first service is according to the coordinator service Message is re-elected, obtaining the second service is the second coordinator service.
It is wherein, described that re-elect message according to the coordinator service include repeating the coordinator service to elect Journey.
Wherein, the host node within the same time one and only one, it is the multiple service within the same time only One service can successfully obtain the host node.
As it can be seen that in this example, the host node can guarantee that only one can succeed when concurrently creating, when taking on coordinator Business delay machine, the service of all survivals can detect the event and complete coordinator election again, for guaranteeing in all services forever The remote coordinator survived there are one is being run, it is advantageously ensured that the normal orderly progress of distributing real time system.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, comprising: first service creates the first affairs identity number, and sends to the coordinator service First registration information;The first service is received according to first registration information, the first service from the coordination First registering result of device service;If it is to succeed in registration that the first service, which receives first registering result, Xiang Suoshu Second service sends call request, and the call request is used to indicate the second service and executes following operation: the second thing of creation Business identity number, and the second registration information is sent to the coordinator service, the second registering result is obtained, if getting described Second registering result is to succeed in registration, then services to the third and send call request, and the call request is used to indicate described Operate below third service execution: creation third affairs identity number obtains third registration information, determines third registration knot Fruit.
Wherein, the third service includes the coordinator service.
In the specific implementation, first service creates remaining sum and changes affairs identity number in payment scene, taken to coordinator Business sends the registration information that remaining sum changes, and coordinator service determines that remaining sum changes registration information success, and first service reception comes from The remaining sum of coordinator service changes registration information success message, sends call request, second service creation integral to second service Affairs identity number is changed, sends the registration information that integral changes to coordinator service, coordinator service determines that integral changes Registration information success, second service receives the integral from coordinator service and changes registration information success message, to third service Call request is sent, the transaction fund affairs identity number of third service-creation determines transaction fund registration information result.
As it can be seen that first service sends first affairs according to the election results, Xiang Suoshu coordinator service in this example The processing information of branch, the coordinator service receive the registration information from first service, second service and third service, really Registration information is determined as a result, being conducive to handle the integrality and accuracy of distributed transaction, is met and is solved to divide in high concurrent scene The coherence request of cloth affairs.
It is described according to execution message of the reception from the coordinator service, comprising: first in a possible example Service receives the execution message from the coordinator service, and the execution message is that the coordinator service is following by executing Operation and generate: according to first registering result, second registering result and the third registering result, when the association When device service being adjusted to determine the third registering result to fail, the first service executes the rollback behaviour of first transaction branch Make the rolling back action that second transaction branch is executed with the second service.
Wherein, the execution message includes execution rolling back action message, and/or, it executes and submits operation information.
In the specific implementation, first service is that remaining sum changes service, and second service is that integral changes clothes in payment scene Business, third service are transaction fund service, and coordinator service determines that remaining sum changes registration information success, determines that integral changes registration Information success, determines transaction fund registration information failure, then executing message at this time is that first service executes rolling back action and second Service execution rolling back action.
As it can be seen that being registered and being tied according to first registering result, second registering result and the third in this example Fruit, the coordinator service determine registering result, so that it is determined that executing rolling back action, the first service, which receives, comes from the association The execution message for adjusting device service, is conducive to the concurrent capability for meeting distributed transaction, reduces the expense of system, is conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
It is described according to execution message of the reception from the coordinator service, comprising: first in a possible example Affairs receive the execution message from the coordinator service, and the execution message is that the coordinator service is following by executing Operation and generate: according to first registering result, second registering result and the third registering result, reception is come from The execution message of the coordinator service;And when determining the third registering result is successfully, the first service is executed The submission of first transaction branch operates, and the second service executes the submission operation and described the of second transaction branch The submission of third transaction branch described in three service executions operates.
Wherein, the execution message includes execution rolling back action message, and/or, it executes and submits operation information.
In the specific implementation, first service is that remaining sum changes service, and second service is that integral changes clothes in payment scene Business, third service are transaction fund service, and coordinator service determines that remaining sum changes registration information success, determines that integral changes registration Information success determines fund registration information success of trading, then executing message at this time is that first service executes submission operation, the second clothes Business, which executes, submits operation and third service execution to submit operation.
As it can be seen that being registered and being tied according to first registering result, second registering result and the third in this example Fruit, the coordinator service, which determines to execute, submits operation, and the first service receives the execution from the coordinator service and disappears Breath, is conducive to the concurrent capability for meeting distributed transaction, reduces the expense of system, is conducive to the height for improving distributing real time system Effect property and convenience.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, comprising: first service creates the first affairs identity number, and sends to the coordinator service First registration information;The first service is received according to first registration information, the first service from the coordination First registering result of device service;If it is to succeed in registration that the first service, which receives first registering result, Xiang Suoshu Second service sends call request, and the call request is used to indicate the second service and executes following operation: the second thing of creation Business identity number, and the second registration information is sent to the coordinator service, the second registering result is obtained, if getting described Second registering result is registration failure, then stops calling.
Wherein, it includes that the first service stops calling the second service that the stopping, which is called, and the third service is temporary Withdraw business.
In the specific implementation, first service creates remaining sum and changes affairs identity number in payment scene, taken to coordinator Business sends the registration information that remaining sum changes, and coordinator service determines that remaining sum changes registration information success, and first service reception comes from The remaining sum of coordinator service changes registration information success message, sends call request, second service creation integral to second service Affairs identity number is changed, sends the registration information that integral changes to coordinator service, coordinator service determines that integral changes Registration information success, second service receive the integral from coordinator service and change registration information failed message, stop calling.
As it can be seen that first service sends first affairs according to the election results, Xiang Suoshu coordinator service in this example The processing information of branch, the coordinator service receive the registration information from first service and second service, determine registration letter Breath stops calling, avoids the extra wasting of resources, be conducive at raising as a result, when the registration information of second service is failure The convenience and high efficiency of distributed transaction are managed, the coherence request for solving distributed transaction in high concurrent scene is met.
In a possible example, the execution message of the reception from the coordinator service, comprising: first service Receive the execution message from the coordinator service, the execution message is the coordinator service by executing following operation And generate: according to first registering result and second registering result, determine to the first service and described second Service the execution message sent;And when the coordinator service determines second registering result to fail, described first The rolling back action of first transaction branch described in service execution.
In the specific implementation, first service is that remaining sum changes service, and second service is that integral changes clothes in payment scene Business, third service are transaction fund service, and coordinator service determines that remaining sum changes registration information success, determines that integral changes registration Information failure, then executing message at this time is that first service executes rolling back action.
As it can be seen that, according to first registering result and second registering result, the coordinator service is true in this example Determine registering result, so that it is determined that executing rolling back action, the first service receives the execution message from the coordinator service, Be conducive to the concurrent capability for meeting distributed transaction, reduce the expense of system, is conducive to improve the efficient of distributing real time system Property and convenience.
It is consistent with above-mentioned embodiment shown in Fig. 2, referring to Fig. 3, Fig. 3 is a kind of distribution provided by the embodiments of the present application The flow diagram of formula transaction methods, applied to the first service of Distributed Services processing system, the Distributed Services Processing system includes the multiple services run in multiple equipment, and the multiple service includes registration center's service, described first Service, second service and third service;As shown, this distributed transaction processing method includes:
S301, first service receives the transaction branch assignment messages sent from registration center service, described in response Affairs assignment messages, Xiang Suoshu registration center send the response message for determining and opening and handling first transaction branch;
S302, the first service is when detecting processing request, according to the annotating information, into the registration The heart sends creation host node and itself Internet protocol address is written and configures the request of port;
S303, the first service receive the coordinator service from the registration center and elect message;
S304, the first service elect message according to the coordinator service, and obtaining the third service is coordinator Service;
S305, for the first service according to the election results, Xiang Suoshu coordinator service sends first affairs point The processing information of branch;
S306, the first service receive the execution message from the coordinator service;
S307, for the first service according to the execution message, execute first transaction branch executes operation.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
It is consistent with above-mentioned embodiment shown in Fig. 2, referring to Fig. 4, Fig. 4 is a kind of distribution provided by the embodiments of the present application The flow diagram of formula transaction methods, applied to the first service of Distributed Services processing system, the Distributed Services Processing system includes the multiple services run in multiple equipment, and the multiple service includes registration center's service, described first Service, second service and third service,;As shown, this distributed transaction processing method includes:
S401, first service receives the transaction branch assignment messages sent from registration center service, described in response Affairs assignment messages, Xiang Suoshu registration center send the response message for determining and opening and handling first transaction branch;
S402, the first service receive the coordinator service serviced from the registration center and elect message, obtain institute State the election results of coordinator service;
S403, the first service creates the first affairs identity number, and sends the first note to the coordinator service Volume information;
S404, the first service are received according to first registration information, the first service from the coordination First registering result of device service;
S405, if it is to succeed in registration that the first service, which receives first registering result, to the second service Send call request;
S406, the first service receive the execution message from the coordinator service;
S407, for the first service according to the execution message, execute first transaction branch executes operation.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
In addition, according to first registering result, second registering result and the third registering result, the coordination Device service, which determines to execute, submits operation, and the first service receives the execution message from the coordinator service, is conducive to full The concurrent capability of sufficient distributed transaction reduces the expense of system, is conducive to improve the high efficiency of distributing real time system and convenient Property.
It is consistent with above-mentioned Fig. 2, Fig. 3, embodiment shown in Fig. 4, referring to Fig. 5, Fig. 5 is provided by the embodiments of the present application The structural schematic diagram of a kind of electronic equipment 500, as shown, the electronic equipment 500 includes application processor 510, memory 520, communication interface 530 and one or more programs 521, wherein one or more of programs 521 are stored in above-mentioned deposit In reservoir 520, and it is configured to be executed by above-mentioned application processor 510, one or more of programs 521 include for executing The instruction of following steps;
The transaction branch assignment messages sent from registration center service are received, the affairs assignment messages are responded, It services to send to the registration center and determines the response message for opening the first transaction branch of processing, the transaction branch assignment messages Obtained by operating below registration center's service execution: registration center's service receives processing request from the user, Obtain annotating information;And according to the annotating information, the first transaction branch in the processing request is distributed to described the One service;
It receives the coordinator service serviced from the registration center and elects message, obtain the election of the coordinator service As a result, wherein the coordinator service election message is that registration center's service execution or less is operated and generated: receiving institute Response message is stated, starts to elect coordinator service;And determine that the third service is the coordinator service;And according to true Message is elected in coordinator service described in the fixed coordinator service creation;
According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;
Receive the execution message from the coordinator service, wherein the execution message is that the coordinator service is held The following operation of row obtains: according to the processing information, determining processing result, generates and execute message;
According to the execution message, execute first transaction branch executes operation.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
It is described to receive the coordinator service election message serviced from the registration center in a possible example, The election results of the coordinator service are obtained, the instruction in described program is specifically used for executing following operation: detecting When stating processing request, according to the annotating information, Xiang Suoshu registration center sends creation host node and itself internet protocol is written It discusses address and configures the request of port;It receives the coordinator service from the registration center and elects message, the coordinator clothes Business election message is that the registration center executes following operation and generates: receiving the request from the first service, determines First request results;And receive the second request from the second service, determine second request results;And it receives Third request from the third service, determines the third request results;And according to first request results, second Request results and third request results, determination has and the only described third services and successfully obtains host node, determines the third clothes Business is coordinator service;Wherein, second request is used to indicate the second service and sends creation master to the registration center Node is simultaneously written itself Internet protocol address and configuration port, and third request is used to indicate the third service to described Registration center sends creation host node and itself Internet protocol address and configuration port is written;It is selected according to the coordinator service Message is lifted, obtaining the third service is coordinator service.
In a possible example, described to elect message according to the coordinator service, obtaining the third service is After coordinator services, the instruction in method also described program is specifically used for executing following operation: detecting coordinator service hair When raw service delay machine, the coordinator service election message from the registration center, the coordinator service election are received again Message is that the registration center executes following operation and generates: receiving the request from the first service, determines that first asks Seek result;Receive the second request from the second service, determines second request results;It receives and is taken from the third The third of business is requested, and determines the third request results;It is requested according to first request results, the second request results and third As a result, determination has and the only described second service successfully obtains host node, determine that the second service is coordinator service;According to The coordinator service re-elects message, and obtaining the second service is the second coordinator service.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, the instruction in described program are specifically used for executing following operation: the first affairs identity of creation Number, and the first registration information is sent to the coordinator service;According to first registration information, the first service is received The first registering result from the coordinator service;If receiving first registering result is to succeed in registration, Xiang Suoshu Second service sends call request, and the call request is used to indicate the second service and executes following operation: the second thing of creation Business identity number, and the second registration information is sent to the coordinator service, the second registering result is obtained, if getting described Second registering result is to succeed in registration, then services to the third and send call request, and the call request is used to indicate described Operate below third service execution: creation third affairs identity number obtains third registration information, determines third registration knot Fruit.
It is described according to execution message of the reception from the coordinator service, described program in a possible example In instruction be specifically used for executing following operation: receive the execution message from the coordinator service, the execution message is What the coordinator service was generated by executing following operation: according to first registering result, second registering result With the third registering result, when the coordinator service determines the third registering result to fail, the first service The rolling back action and the second service that execute first transaction branch execute the rolling back action of second transaction branch.
It is described according to execution message of the reception from the coordinator service, described program in a possible example In instruction be specifically used for executing following operation: receive the execution message from the coordinator service, the execution message is What the coordinator service was generated by executing following operation: according to first registering result, second registering result With the third registering result, when determining the third registering result is successfully, the first service executes first thing The submission operation of business branch, the second service execute the submission operation and the third service execution of second transaction branch The submission of the third transaction branch operates.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, the instruction in described program are specifically used for executing following operation: the first affairs identity of creation Number, and the first registration information is sent to the coordinator service;According to first registration information, the first service is received The first registering result from the coordinator service;If receiving first registering result is to succeed in registration, Xiang Suoshu Second service sends call request, and the call request is used to indicate the second service and executes following operation: the second thing of creation Business identity number, and the second registration information is sent to the coordinator service, the second registering result is obtained, if getting described Second registering result is registration failure, then stops calling.
In a possible example, the execution message of the reception from the coordinator service, in described program Instruction is specifically used for executing following operation: receiving the execution message from the coordinator service, the execution message is described What coordinator service was generated by executing following operation: according to first registering result and second registering result, really Orient the execution message that the first service and the second service are sent;And when the coordinator service determines described second When registering result is failure, the first service executes the rolling back action of first transaction branch.
It is above-mentioned that mainly the scheme of the embodiment of the present application is described from the angle of method side implementation procedure.It is understood that , in order to realize the above functions, it comprises execute the corresponding hardware configuration of each function and/or software mould for electronic equipment Block.Those skilled in the art should be readily appreciated that, in conjunction with each exemplary unit of embodiment description presented herein And algorithm steps, the application can be realized with the combining form of hardware or hardware and computer software.Some function actually with Hardware or computer software drive the mode of hardware to execute, the specific application and design constraint item depending on technical solution Part.Professional technician can specifically realize described function to each using distinct methods, but this reality Now it is not considered that exceeding scope of the present application.
The embodiment of the present application can carry out the division of functional unit according to above method example to electronic equipment, for example, can With each functional unit of each function division of correspondence, two or more functions can also be integrated in a processing unit In.Above-mentioned integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.It needs It is noted that be schematical, only a kind of logical function partition to the division of unit in the embodiment of the present application, it is practical real It is current that there may be another division manner.
Fig. 6 is the functional unit composition block diagram of distributing real time system device 600 involved in the embodiment of the present application.It should Distributing real time system device 600 is applied to the first service of Distributed Services processing system, including processing unit 601 and communication Unit 602, wherein
The processing unit 601 is rung for receiving the transaction branch assignment messages sent from registration center service The affairs assignment messages are answered, the service of Xiang Suoshu registration center sends the response message for determining and opening the first transaction branch of processing, The transaction branch assignment messages are obtained by operating below registration center's service execution: registration center's service receives Processing request from the user, obtains annotating information;And according to the annotating information, by the first thing in the processing request Business branch distributes to the first service;And disappear for receiving the coordinator service election from registration center service Breath, obtains the election results of the coordinator service, wherein the coordinator service election message is registration center's service It executes and following operate and generate: receiving the response message, start to elect coordinator service;And determine the third service For the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation;And For according to the election results, Xiang Suoshu coordinator service to send the processing information of first transaction branch;And it is used for Receive the execution message from the coordinator service, wherein the execution message is that the coordinator service execution or less is grasped Make to obtain: according to the processing information, determining processing result, generate and execute message;And be used for according to the execution message, Execute first transaction branch executes operation.
As can be seen that first service receives the affairs point sent from registration center service in the embodiment of the present application Branch assignment messages respond the affairs assignment messages, and the service of Xiang Suoshu registration center, which is sent, determines unlatching processing the first affairs point The response message of branch, the transaction branch assignment messages are obtained by operating below registration center's service execution: the note Volume center service receives processing request from the user, obtains annotating information;And according to the annotating information, by the processing The first transaction branch in request distributes to the first service;Receive the coordinator service choosing serviced from the registration center Message is lifted, the election results of the coordinator service are obtained, wherein the coordinator service election message is the registration center It operates and generates below service execution: receiving the response message, start to elect coordinator service;And determine the third Service is the coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation; According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;It receives from described The execution message of coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained: according to The processing information determines processing result, generates and executes message;According to the execution message, first transaction branch is executed Execute operation.By the above method, the embodiment of the present application provides a kind of no code intrusion and meets point of high concurrent scene Cloth system things consistency solution is disappeared by receiving the transaction branch distribution sent from registration center service Breath introduces and obtains annotating information, can simplify configuration, reduce the use cost and learning cost of frame, make developer more special It infuses in business, while frame and business can also be allowed to decouple, improve concurrent capability, reduce the expense of system, be conducive to improve and divide The high efficiency and convenience of cloth issued transaction.
It is described to receive the coordinator service election message serviced from the registration center in a possible example, The election results of the coordinator service are obtained, the processing unit 601 is specifically used for: when detecting processing request, According to the annotating information, Xiang Suoshu registration center sends creation host node and itself Internet protocol address and configuration end is written The request of mouth;It receives the coordinator service from the registration center and elects message, the coordinator service election message is institute It states registration center and executes and following operate and generate: receiving the request from the first service, determine the first request results;With And receive the second request from the second service, determine second request results;And it receives and is taken from the third The third of business is requested, and determines the third request results;And according to first request results, the second request results and third Request results, determination has and the only described third services and successfully obtains host node, determines that the third service is coordinator service; Wherein, second request is used to indicate the second service and sends creation host node to the registration center and itself is written mutually Networking protocol address and configuration port, the third request are used to indicate the third service and send creation to the registration center Simultaneously itself Internet protocol address and configuration port is written in host node;Message is elected according to the coordinator service, described in acquisition Third service is coordinator service.
In a possible example, described to elect message according to the coordinator service, obtaining the third service is After coordinator service, the also described processing unit 601 of method is specifically used for: when detecting that service delay machine occurs for coordinator service, Again the coordinator service election message from the registration center is received, the coordinator service election message is the registration Center, which executes, following to be operated and generates: being received the request from the first service, is determined the first request results;Receiving comes from Second request of the second service, determines second request results;The third request from the third service is received, really The fixed third request results;According to first request results, the second request results and third request results, determining has and only There is the second service successfully to obtain host node, determines that the second service is coordinator service;According to the coordinator service Message is re-elected, obtaining the second service is the second coordinator service.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, the processing unit 601 are specifically used for: the first affairs identity number of creation, and to the association Device service is adjusted to send the first registration information;According to first registration information, the first service is received from the coordination First registering result of device service;If receiving first registering result is to succeed in registration, sent to the second service Call request, the call request are used to indicate the second service and execute following operation: the second affairs identity number of creation, And the second registration information is sent to the coordinator service, the second registering result is obtained, if getting second registering result It to succeed in registration, is then serviced to the third and sends call request, the call request is used to indicate the third service execution Operate below: creation third affairs identity number obtains third registration information, determines third registering result.
It is described according to execution message of the reception from the coordinator service, the processing in a possible example Unit 601 is specifically used for: receiving the execution message from the coordinator service, the execution message is the coordinator service It is generated by executing following operation: being registered according to first registering result, second registering result and the third As a result, the first service executes first thing when the coordinator service determines the third registering result to fail The rolling back action and the second service of business branch execute the rolling back action of second transaction branch.
It is described according to execution message of the reception from the coordinator service, the processing in a possible example Unit 601 is specifically used for: receiving the execution message from the coordinator service, the execution message is the coordinator service It is generated by executing following operation: being registered according to first registering result, second registering result and the third As a result, the first service executes the submission behaviour of first transaction branch when determining the third registering result is successfully Make, the second service executes third affairs point described in the submission operation and the third service execution of second transaction branch The submission operation of branch.
In a possible example, described according to the election results, Xiang Suoshu coordinator service sends described first The processing information of transaction branch, the processing unit 601 are specifically used for: the first affairs identity number of creation, and to the association Device service is adjusted to send the first registration information;According to first registration information, the first service is received from the coordination First registering result of device service;If receiving first registering result is to succeed in registration, sent to the second service Call request, the call request are used to indicate the second service and execute following operation: the second affairs identity number of creation, And the second registration information is sent to the coordinator service, the second registering result is obtained, if getting second registering result For registration failure, then stop calling.
In a possible example, the execution message of the reception from the coordinator service, the processing unit 601 are specifically used for: receiving the execution message from the coordinator service, the execution message is that the coordinator service passes through It executes and following operate and generate: according to first registering result and second registering result, determining to first clothes The execution message that business and the second service are sent;And when the coordinator service determines second registering result for failure When, the first service executes the rolling back action of first transaction branch.
The embodiment of the present application also provides a kind of computer storage medium, wherein computer storage medium storage is for electricity The computer program of subdata exchange, the computer program make computer execute any as recorded in above method embodiment Some or all of method step, above-mentioned computer include electronic equipment.
The embodiment of the present application also provides a kind of computer program product, and above-mentioned computer program product includes storing calculating The non-transient computer readable storage medium of machine program, above-mentioned computer program are operable to that computer is made to execute such as above-mentioned side Some or all of either record method step in method embodiment.The computer program product can be a software installation Packet, above-mentioned computer includes electronic equipment.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of said units, it is only a kind of Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit, It can be electrical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment (can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the application Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English: Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas; At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the application There is change place, in conclusion the contents of this specification should not be construed as limiting the present application.

Claims (11)

1. a kind of distributed transaction processing method, which is characterized in that applied to the first service of Distributed Services processing system, institute Stating Distributed Services processing system includes the multiple services run in multiple equipment, and the multiple service includes that registration center takes Business, the first service, second service and third service, which comprises
The transaction branch assignment messages sent from registration center service are received, the affairs assignment messages are responded, to institute It states registration center's service and sends the response message for determining and opening the first transaction branch of processing, the transaction branch assignment messages are by institute State registration center's service execution or less and operate and obtain: registration center's service receives processing request from the user, acquisition Annotating information;And according to the annotating information, the first transaction branch in the processing request is distributed into first clothes Business;
It receives the coordinator service serviced from the registration center and elects message, obtain the election knot of the coordinator service Fruit, wherein the coordinator service election message is that registration center's service execution or less is operated and generated: described in reception Response message starts to elect coordinator service;And determine that the third service is the coordinator service;And according to determination The coordinator service creation described in coordinator service elect message;
According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;
Receive the execution message from the coordinator service, wherein the execution message be the coordinator service execution with Lower operation obtains: according to the processing information, determining processing result, generates and execute message;
According to the execution message, execute first transaction branch executes operation.
2. the method according to claim 1, wherein described receive the coordinator serviced from the registration center Service election message, obtains the election results of the coordinator service, comprising:
When detecting processing request, according to the annotating information, Xiang Suoshu registration center sends creation host node and writes Enter itself Internet protocol address and configures the request of port;
It receives the coordinator service from the registration center and elects message, the coordinator service election message is the registration Center, which executes, following to be operated and generates: being received the request from the first service, is determined the first request results;And receive The second request from the second service, determines second request results;And receive from the third service the Three requests, determine the third request results;And it requests to tie according to first request results, the second request results and third Fruit, determination has and the only described third services and successfully obtains host node, determines that the third service is coordinator service;Wherein, Second request is used to indicate the second service and sends creation host node to the registration center and itself internet is written Protocol address and configuration port, the third request are used to indicate the third service and send the main section of creation to the registration center Put and be written itself Internet protocol address and configuration port;
Message is elected according to the coordinator service, obtaining the third service is coordinator service.
3. according to the method described in claim 2, it is characterized in that, described elect message, acquisition according to the coordinator service The third service is method after coordinator service further include:
When detecting that service delay machine occurs for coordinator service, the coordinator service election from the registration center is received again Message, coordinator service election message are that the registration center executes following operation and generates: receiving and come from described the The request of one service, determines the first request results;Receive the second request from the second service, determines second request As a result;The third request from the third service is received, determines the third request results;According to the first request knot Fruit, the second request results and third request results, determining has and the only described second service successfully obtains host node, determine described in Second service is coordinator service;
Message is re-elected according to the coordinator service, obtaining the second service is the second coordinator service.
4. the method according to claim 1, wherein described according to the election results, Xiang Suoshu coordinator clothes Business sends the processing information of first transaction branch, comprising:
The first affairs identity number is created, and sends the first registration information to the coordinator service;
According to first registration information, the first service receives the first registering result from the coordinator service;
If receiving first registering result is to succeed in registration, call request, the calling are sent to the second service Request is used to indicate the second service and executes following operation: the second affairs identity number of creation, and takes to the coordinator Business sends the second registration information, obtains the second registering result, if getting second registering result is to succeed in registration, to institute It states third service and sends call request, the call request is used to indicate the third service execution or less and operates: creation third Affairs identity number obtains third registration information, determines third registering result.
5. according to the method described in claim 4, it is characterized in that, described according to execution of the reception from the coordinator service Message, comprising:
Receive the execution message from the coordinator service, the execution message is that the coordinator service is following by executing Operation and generate: according to first registering result, second registering result and the third registering result, reception is come from The execution message of the coordinator service;And when the coordinator service determines the third registering result to fail, institute State that first service executes the rolling back action of first transaction branch and the second service executes second transaction branch Rolling back action.
6. according to the method described in claim 4, it is characterized in that, described according to execution of the reception from the coordinator service Message, comprising:
Receive the execution message from the coordinator service, the execution message is that the coordinator service is following by executing Operation and generate: according to first registering result, second registering result and the third registering result, reception is come from The execution message of the coordinator service;And when determining the third registering result is successfully, the first service is executed The submission of first transaction branch operates, and the second service executes the submission operation and described the of second transaction branch The submission of third transaction branch described in three service executions operates.
7. the method according to claim 1, wherein described according to the election results, Xiang Suoshu coordinator clothes Business sends the processing information of first transaction branch, comprising:
The first affairs identity number is created, and sends the first registration information to the coordinator service;
According to first registration information, the first service receives the first registering result from the coordinator service;
If receiving first registering result is to succeed in registration, call request, the calling are sent to the second service Request is used to indicate the second service and executes following operation: the second affairs identity number of creation, and takes to the coordinator Business sends the second registration information, obtains the second registering result, if getting second registering result is registration failure, stops It calls.
8. the method according to the description of claim 7 is characterized in that the execution of the reception from the coordinator service disappears Breath, comprising:
Receive the execution message from the coordinator service, the execution message is that the coordinator service is following by executing Operation and generate: according to first registering result and second registering result, determine to the first service and described The execution message that second service is sent;It is described and when the coordinator service determines second registering result to fail First service executes the rolling back action of first transaction branch.
9. a kind of distributing real time system device, which is characterized in that applied to the first service of Distributed Services processing system, institute Stating Distributed Services processing system includes the multiple services run in multiple equipment, and the multiple service includes that registration center takes Business, the first service, second service and third service;The distributing real time system device includes processing unit and communication unit Member, wherein
The processing unit, for receiving the transaction branch assignment messages sent from registration center service, described in response Affairs assignment messages, the service of Xiang Suoshu registration center send the response message for determining and opening the first transaction branch of processing, the thing Business branch's assignment messages are obtained by operating below registration center's service execution: registration center's service receives to use by oneself The processing at family is requested, and annotating information is obtained;And according to the annotating information, by the first transaction branch in the processing request Distribute to the first service;And message is elected for receiving the coordinator service from registration center service, it obtains The election results of the coordinator service, wherein coordinator service election message be registration center's service execution with It is lower operation and generate: receive the response message, start elect coordinator service;And determine that the third service is described Coordinator service;And message is elected in the coordinator service according to the determining coordinator service creation;And it is used for root According to the election results, Xiang Suoshu coordinator service sends the processing information of first transaction branch;And come for receiving From the execution message of the coordinator service, wherein the execution message is that the coordinator service execution or less is operated and obtained It arrives: according to the processing information, determining processing result, generate and execute message;And for executing institute according to the execution message That states the first transaction branch executes operation.
10. a kind of electronic equipment, which is characterized in that including processor, memory, communication interface, and one or more programs, One or more of programs are stored in the memory, and are configured to be executed by the processor, described program packet Include the instruction for executing the step in the method according to claim 1.
11. a kind of computer readable storage medium, which is characterized in that storage is used for the computer program of electronic data interchange, In, the computer program makes computer execute the method according to claim 1.
CN201910031513.1A 2018-12-29 2019-01-14 Distributed transaction processing method and related product Active CN109819023B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811646840 2018-12-29
CN201811646840X 2018-12-29

Publications (2)

Publication Number Publication Date
CN109819023A true CN109819023A (en) 2019-05-28
CN109819023B CN109819023B (en) 2021-09-14

Family

ID=66603428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910031513.1A Active CN109819023B (en) 2018-12-29 2019-01-14 Distributed transaction processing method and related product

Country Status (1)

Country Link
CN (1) CN109819023B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143040A (en) * 2019-12-30 2020-05-12 北京三快在线科技有限公司 Transaction processing method, device, system and storage medium
CN112100188A (en) * 2020-09-01 2020-12-18 上海交通大学 Concurrent control method and system based on machine learning
CN112799799A (en) * 2020-12-29 2021-05-14 杭州涂鸦信息技术有限公司 Data consumption method and device
CN113301091A (en) * 2020-07-31 2021-08-24 阿里巴巴集团控股有限公司 Message processing method and device for distributed system, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6873987B1 (en) * 2000-05-31 2005-03-29 International Business Machines Corporation Method, system and program products for recovering from failures within a shared nothing distributed computing environment
CN106325978A (en) * 2015-06-19 2017-01-11 阿里巴巴集团控股有限公司 Distributed transaction processing method and apparatus
CN108845866A (en) * 2018-06-28 2018-11-20 阿里巴巴集团控股有限公司 The method and apparatus for handling distributed transaction
CN108958894A (en) * 2018-06-14 2018-12-07 阿里巴巴集团控股有限公司 A kind of distributed transaction processing method, system, task manager and terminal device
CN109002462A (en) * 2018-06-04 2018-12-14 北京明朝万达科技股份有限公司 A kind of method and system for realizing distributed things

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6873987B1 (en) * 2000-05-31 2005-03-29 International Business Machines Corporation Method, system and program products for recovering from failures within a shared nothing distributed computing environment
CN106325978A (en) * 2015-06-19 2017-01-11 阿里巴巴集团控股有限公司 Distributed transaction processing method and apparatus
CN109002462A (en) * 2018-06-04 2018-12-14 北京明朝万达科技股份有限公司 A kind of method and system for realizing distributed things
CN108958894A (en) * 2018-06-14 2018-12-07 阿里巴巴集团控股有限公司 A kind of distributed transaction processing method, system, task manager and terminal device
CN108845866A (en) * 2018-06-28 2018-11-20 阿里巴巴集团控股有限公司 The method and apparatus for handling distributed transaction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何一昕: ""SOA环境下分布式事务处理的研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143040A (en) * 2019-12-30 2020-05-12 北京三快在线科技有限公司 Transaction processing method, device, system and storage medium
CN113301091A (en) * 2020-07-31 2021-08-24 阿里巴巴集团控股有限公司 Message processing method and device for distributed system, electronic equipment and medium
CN113301091B (en) * 2020-07-31 2022-10-28 阿里巴巴集团控股有限公司 Message processing method and device for distributed system, electronic equipment and medium
CN112100188A (en) * 2020-09-01 2020-12-18 上海交通大学 Concurrent control method and system based on machine learning
CN112100188B (en) * 2020-09-01 2024-05-28 上海交通大学 Concurrency control method and system based on machine learning
CN112799799A (en) * 2020-12-29 2021-05-14 杭州涂鸦信息技术有限公司 Data consumption method and device

Also Published As

Publication number Publication date
CN109819023B (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN109819023A (en) Distributed transaction processing method and Related product
CN108510389B (en) Intelligent contract calling method and device based on block chain and readable storage medium
CN111245916B (en) Service calling method, service arranging method and device based on micro-service gateway
CN110392052A (en) A kind of block chain intelligence contract processing system and method
CN110166409A (en) Equipment cut-in method, related platform and computer storage medium
CN105634778B (en) Method and system for realizing VNF instantiation, NFVO and VNFM
CN109104336A (en) Service request processing method, device, computer equipment and storage medium
CN108965457A (en) A kind of message delivery method of distributed cluster system, device, equipment and medium
CN109391502A (en) A kind of information configuring methods and administrative unit
CN107920138A (en) A kind of user's unifying identifier generation method, apparatus and system
CN110502319A (en) Processing method, device, electronic equipment and the storage medium of distributed transaction
CN110324238A (en) Online customer service method, apparatus and equipment
CN106612196B (en) Obtain the method and device of resource
CN109324913B (en) Management method and device for multiple OpenStack cloud platforms
CN108885564A (en) Resource in network virtualization scene places control
CN109104368A (en) A kind of request connection method, device, server and computer readable storage medium
CN109634735A (en) A kind of method and device for dispatching Pod
CN109213567A (en) Method and equipment for managing VNF instantiation
CN103326935B (en) The method and system that a kind of intelligence based on microblog is waited in turn
CN109684048A (en) The method and device of affairs is handled in affairs submission system
CN108028806A (en) The method and apparatus that virtual resource is distributed in network function virtualization NFV networks
CN114157720A (en) Method, device, electronic equipment and medium for processing service request
CN104657240B (en) The Failure Control method and device of more kernel operating systems
CN109491767A (en) The processing method and distributed system of distributed transaction
WO2023016460A1 (en) Computing task policy determination or resource allocation method and apparatus, network element, 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
GR01 Patent grant
GR01 Patent grant