CN111240851B - Transaction processing method, device, equipment and system based on tangent plane programming - Google Patents

Transaction processing method, device, equipment and system based on tangent plane programming Download PDF

Info

Publication number
CN111240851B
CN111240851B CN201811446226.9A CN201811446226A CN111240851B CN 111240851 B CN111240851 B CN 111240851B CN 201811446226 A CN201811446226 A CN 201811446226A CN 111240851 B CN111240851 B CN 111240851B
Authority
CN
China
Prior art keywords
service
data
transaction
data processing
initiating
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.)
Active
Application number
CN201811446226.9A
Other languages
Chinese (zh)
Other versions
CN111240851A (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.)
Hefei Youquan Information Technology Co ltd
Original Assignee
Hefei Youquan Information 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 Hefei Youquan Information Technology Co ltd filed Critical Hefei Youquan Information Technology Co ltd
Priority to CN201811446226.9A priority Critical patent/CN111240851B/en
Publication of CN111240851A publication Critical patent/CN111240851A/en
Application granted granted Critical
Publication of CN111240851B publication Critical patent/CN111240851B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Transaction processing method, device, equipment and system based on cut-plane programming, which are applied to micro-service architecture, wherein the method comprises the following steps: receiving a data processing request sent by an initiating service device or a calling service device, wherein the data processing request comprises a service identifier, and the service identifier is used for uniquely indicating a service; processing data in a database of the service indicated by the service identifier according to the data processing request; and sending a processing completion response to the device sending the data processing request. According to the scheme provided by the application, the proxy service equipment receives the data processing request and processes the data in the database, and the initiating service equipment or the calling service equipment does not directly process the data. Therefore, the proxy service equipment does not need to carry out communication confirmation, and the overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.

Description

Transaction processing method, device, equipment and system based on tangent plane programming
Technical Field
The present application relates to the field of micro-services, and in particular, to a transaction processing method, apparatus, device, and system based on tangent plane programming.
Background
With the rapid development of the internet industry in recent years, the problems of high coupling degree, large code quantity, difficult maintenance, rapid deployment and the like of the traditional single architecture are reproduced while the system scale and project developers are expanding. The principle of the micro-service architecture is to split the system into a plurality of services which can be independently developed, designed, operated and maintained, each of which can be independently deployed and isolated from each other, and the services are called through application programming interfaces (Application Programming Interface, API).
Because each service in the micro-service architecture is independently deployed and corresponds to the own database, the method is different from the database in the single architecture to realize a transaction mechanism, and the services in the micro-service architecture are mutually called, so that the consistency of the transaction is required to be realized. The service in the micro service architecture refers to a function that can be independently implemented by a program, and the transaction includes a plurality of services that are sequentially executed in a preset order. Existing transaction solutions are mainly two-phase commit protocols (Two Phase Commitment Protocol,2 PC). The specific process is divided into two stages. In the first phase, the transaction coordinator initiates a transaction, and communicates with the service devices where the services are deployed to confirm whether the preparation is completed. After the transaction coordinator gets a positive reply from all the service devices, it goes to the second phase. In the second phase, the transaction coordinator communicates with the respective service devices, indicating to begin executing the respective services. Under the control of the main service, each service device performs data processing in a database of the service according to a predetermined sequence.
First, in the first phase, the transaction coordinator needs to wait for positive replies from all the service devices to enter the second phase. If multiple services are involved in the transaction process, this can result in the transaction coordinator waiting too long. Second, for each service in the transaction, the transaction coordinator needs to communicate at least twice in addition to the communication with the master service. When the service is too many, the communication time is too long due to the too many times of communication.
Therefore, in the prior art, the transaction processing process consumes excessive time due to the excessively long waiting time and the excessively long communication time of the transaction coordinator, which reduces the efficiency of the transaction processing system.
Disclosure of Invention
The application provides a transaction processing method, device, equipment and system based on tangent plane programming, which can be used for solving the problems that in the prior art, excessive time is consumed in the transaction processing process and the efficiency of a transaction processing system is reduced due to overlong waiting time and overlong communication time of a transaction coordinator.
In a first aspect, the present application provides a transaction processing method based on tangent plane programming, applied to a micro-service architecture, the method comprising:
Receiving a data processing request sent by an initiating service device or a calling service device, wherein the data processing request comprises a service identifier, and the service identifier is used for uniquely indicating a service;
processing data in a database of the service indicated by the service identifier according to the data processing request;
And sending a processing completion response to the device sending the data processing request, wherein the processing completion response is used for indicating that the data processing request is completed.
Optionally, before receiving the data processing request sent by the initiating service device or the calling service device, the method further includes:
Receiving a transaction token request sent by the initiating service device, wherein the transaction token request is used for requesting a transaction token, and the transaction token is used for indicating a transaction initiated by the initiating service device;
and generating the transaction token and sending the transaction token to the initiating service device.
Optionally, the data processing request further includes the transaction token;
before the processing of the data in the database of the service indicated by the service identifier, the method further comprises:
Detecting whether a locking identifier corresponding to the service identifier is stored or not, wherein the locking identifier indicates that data of the service indicated by the corresponding service identifier is locked;
And if the locking identifier is not stored, correspondingly storing the transaction token and the locking identifier.
Optionally, the data processing request is a data adding request, and the data adding request includes: newly adding data;
the processing data in the database of the service indicated by the service identification comprises:
adding the newly added data in a database of the service indicated by the service identifier according to the data newly added request;
and acquiring first primary key information, wherein the first primary key information is used for indicating the newly added data in the database.
Optionally, the data processing request is a data modification request, and the data modification request includes: the system comprises second main key information and target data, wherein the second main key information is used for indicating original data to be modified;
The processing of the data in the database of the service indicated by the service identifier comprises:
Acquiring the original data from a database of the service indicated by the service identifier according to the second primary key information;
And modifying the original data into the target data in a database of the service indicated by the service identifier.
Optionally, the method further comprises:
when the data processing is abnormal, an abnormal response is sent to the initiating service device, and the abnormal response is used for notifying the initiating service device that the data processing is abnormal;
receiving a rollback instruction sent by the initiating service device, wherein the rollback instruction comprises the transaction token;
according to the rollback instruction, recovering the data in the database into the data before the transaction processing starts;
And deleting the transaction token and the locking identifier which are correspondingly stored.
Optionally, after the sending the processing completion response to the device that sends the data processing request, the method further includes:
And deleting the corresponding stored transaction token and the locking identifier when receiving a transaction ending instruction sent by the initiating service device, wherein the transaction ending instruction comprises the transaction token.
In a second aspect, the present application provides a transaction processing method based on tangent plane programming, applied to a micro-service architecture, the method comprising:
transmitting a data processing request comprising a service identifier to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier, wherein the service identifier is used for uniquely indicating a service;
and receiving a processing completion response sent by the proxy service equipment, wherein the processing completion response is used for indicating that the data processing request is completed.
Optionally, before sending the data processing request including the service identifier to the proxy service device, the method further includes:
sending a transaction token request to the proxy service device, wherein the transaction token request is used for requesting a transaction token, and the transaction token is used for indicating a transaction initiated by the initiating service device;
and receiving the transaction token sent by the proxy service equipment.
Optionally, the method further comprises:
sending a calling instruction to calling service equipment, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service equipment;
and receiving a call completion response sent by the call service equipment, wherein the call completion response is used for indicating that the service call of the initiating service equipment is completed.
Optionally, the method further comprises:
And when an abnormal response sent by the proxy service equipment is received, sending a rollback instruction to the proxy service equipment, wherein the abnormal response is used for notifying the initiating service equipment that the data processing is abnormal, and the rollback instruction is used for indicating the proxy service equipment to restore the data in the database into the data before the transaction processing starts.
Optionally, after receiving the processing completion response sent by the proxy service device, the method further includes:
And sending a transaction ending instruction to the proxy service device, wherein the transaction ending instruction comprises the transaction token.
In a third aspect, the present application provides a transaction processing method based on tangent plane programming, applied to a micro-service architecture, the method comprising:
Receiving a calling instruction sent by an initiating service device, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service device, and the service identifier is used for uniquely indicating a service;
Sending a data processing request to proxy service equipment so that the proxy service equipment processes data in a database of a service indicated by the service identifier;
receiving a processing completion response sent by the proxy service device, wherein the processing completion response is used for indicating that the data processing request is completed;
And sending a call completion response to the initiating service device, wherein the call completion response is used for indicating that the service call of the initiating service device is completed.
In a fourth aspect, the present application provides a transaction processing device based on slice programming, applied to a micro-service architecture, the device comprising:
The first receiving module is used for receiving a data processing request sent by the initiating service device or the calling service device, wherein the data processing request comprises a service identifier, and the service identifier is used for uniquely indicating a service;
The first processing module is used for processing the data in the database of the service indicated by the service identifier according to the data processing request;
and the first sending module is used for sending a processing completion response to the equipment for sending the data processing request, wherein the processing completion response is used for indicating that the data processing request is completed.
In a fifth aspect, the present application provides a transaction processing device based on slice programming, applied to a micro-service architecture, the device comprising:
The second sending module is used for sending a data processing request comprising a service identifier to the proxy service equipment so that the proxy service equipment processes data in a database of the service indicated by the service identifier, and the service identifier is used for uniquely indicating a service;
and the second receiving module is used for receiving a processing completion response sent by the proxy service equipment, wherein the processing completion response is used for indicating that the data processing request is completed.
In a sixth aspect, the present application provides a transaction processing device based on slice programming, applied to a micro-service architecture, the device comprising:
The third receiving module is used for receiving a calling instruction sent by the initiating service equipment, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service equipment, and the service identifier is used for uniquely indicating a service;
A third sending module, configured to send a data processing request to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier;
The third receiving module is further configured to receive a processing completion response sent by the proxy service device, where the processing completion response is used to indicate that the data processing request is completed;
The third sending module is further configured to send a call completion response to the service initiating device, where the call completion response is used to indicate that the service initiating device service call is completed.
In a seventh aspect, the present application provides a transaction device based on slice programming, for use in a micro-service architecture, the device comprising an apparatus as described in the fourth aspect and/or an apparatus as described in the fifth aspect and/or an apparatus as described in the sixth aspect.
In an eighth aspect, the present application provides a transaction processing system based on slice programming, applied to a micro-service architecture, the system comprising at least one device according to the seventh aspect.
In the scheme provided by the application, the proxy service equipment receives the data processing request and responds to the data processing request to process the data in the database, and the data is not directly processed by the initiating service equipment or the calling service equipment. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment or the calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
Drawings
FIG. 1 is a schematic diagram of a network architecture provided by one embodiment of the present application;
FIG. 2 is a flow chart of a transaction method provided by one embodiment of the present application;
FIG. 3 is a schematic diagram of data in a database provided by one embodiment of the present application;
FIG. 4 is a flow chart of a transaction method provided by another embodiment of the present application;
FIG. 5 is a flow chart of a transaction method provided by another embodiment of the present application;
FIG. 6 is a flow chart of a transaction method provided by another embodiment of the present application;
FIG. 7 is a flow chart of a method of rolling back data provided by one embodiment of the present application;
FIG. 8 is a schematic block diagram of a transaction device provided in accordance with one embodiment of the present application;
FIG. 9 is a schematic block diagram of a transaction device provided in accordance with another embodiment of the present application;
Fig. 10 is a schematic block diagram of a transaction processing device provided in another embodiment of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The network architecture described in the embodiments of the present application is for more clearly describing the technical solution of the embodiments of the present application, and does not constitute a limitation on the technical solution provided by the embodiments of the present application, and as a person of ordinary skill in the art can know that, with the evolution of the network architecture and the appearance of a new transaction scenario, the technical solution provided by the embodiments of the present application is equally applicable to similar technical problems.
A possible network architecture to which the embodiment of the present application is applicable will be described first with reference to fig. 1.
Referring to fig. 1, a schematic diagram of a network architecture to which an embodiment of the present application is applicable is shown. The network architecture includes: an originating service device 101, at least one invoking service device 102 and a proxy service device 103. In the embodiment of the application, in the process of one transaction, an initiating service is required to initiate the transaction, and the service controls the transaction and invokes other services. And the originating service apparatus 101 refers to an apparatus deployed with an originating service. The call service device 102 refers to a device that deploys a service that is initiated by a service call. Since a transaction includes a plurality of services that are sequentially executed according to a preset sequence, the service-initiating device 101 can invoke the service deployed on the service-invoking device 102 by invoking the service-initiating device 102 in the transaction process, in addition to the service-initiating device deployed by itself. In addition, the initiation services in different transactions may be the same or different. The same service is an initiating service in one transaction and may be a called service in another transaction. Thus, the initiating service device 101 may also be a calling service device during other transactions. It should be noted that, a plurality of services may be deployed on the initiating service device 101 and the calling service device 102. For example, on the initiating service device 101, services invoked in a transaction may be deployed in addition to the initiating service. When the originating service and the invoked service are deployed on the same device, the originating service device 101 may invoke other services that it deploys itself during the transaction.
The proxy service device 103 refers to a device in which a proxy service is deployed, and communicates with the originating service device 101 and the calling service device 102 through the proxy service, and processes data in a database in response to data processing requests sent by the originating service device 101 and the calling service device 102. The service deployed on the originating service apparatus 101 and the calling service apparatus 102 no longer directly processes data, but is uniformly processed by the proxy service. The originating service device 101 and the invoking service device 102 have respective databases. For different services, the proxy service device 103 processes data in different databases.
In a possible implementation, the proxy service device 103 stores a database of services, and in response to the data processing request, the proxy service device 103 performs data processing directly in the stored database.
In another possible implementation manner, the network architecture further includes: a data storage device. The data storage device stores databases of the originating service device 101 and the various services deployed on the calling service device 102. The proxy service device 103, in response to the data processing request sent by the originating service device 101 and the calling service device 102, communicates with the data storage device to process the data in the corresponding database.
It should be noted that in the micro-service architecture, different services may be deployed on the same device. Thus, when the above-described originating service, the invoked service, and the proxy service are deployed on the same device, the device is configured to implement the functions of the originating service device 101, the invoking service device 102, and the proxy service device 103.
Referring to fig. 2, a flowchart of a transaction processing method according to an embodiment of the application is shown. The method may be applied to a proxy service device in the network architecture shown in fig. 1. The method may comprise the following steps.
Step 201, a data processing request is received.
In the embodiment of the application, whether the service equipment is initiated or invoked, the service is executed, and the function of the service is realized by processing the data in the database of the service. For example, data is newly added and modified in a database of the service. In the embodiment of the application, for any service in the transaction, the proxy service equipment processes the data in the database of the service. The initiating service device or the invoking service device is no longer responsible for the data processing of the respective service.
Thus, the originating service device or the calling service device sends a data processing request to the proxy service device to request the proxy service device to perform data processing. Accordingly, the proxy service device receives a data processing request sent by the initiating service device or the calling service device. The data processing request includes a service identifier, and the service identifier is used to uniquely indicate a service. The data processing request may be sent by the originating service device to the proxy service device, or may be sent by the calling service device to the proxy service device when called by the originating service device.
Step 202, according to the data processing request, processing the data in the database of the service indicated by the service identifier.
After receiving the data processing request, the proxy service device can determine a database of the service indicated by the service identifier according to the service identifier in the data processing request. Because the service identifier indicates the service corresponding to the data processing request, and each service corresponds to the respective database one by one, a corresponding relationship exists between the service identifier and the database of the service. The proxy service device stores a correspondence between the service identification and the database. According to the correspondence, the proxy service device can determine a database corresponding to the service identifier in the data processing request. After the database is determined, the proxy service device performs relevant data processing according to the data processing request.
Illustratively, the data processing request is sent by an originating service device, and the originating service deployed on the originating service device is to manage a student roster. As shown in fig. 3, a student roster 301 is stored in the database. Included in the student roster 301 are names and academia. The data processing request is student information requesting that one student be newly added to three in the student roster 301. After receiving the data processing request, the proxy service device determines a database storing the student roster 301 according to the service identifier, and adds three pieces of student information 302 to the student roster 301 of the database.
Step 203, a process completion response is sent to the device that sent the data processing request.
After the data processing is completed, the proxy service device returns a processing completion response to the device that sent the data processing request. The process complete response is used to indicate that the data processing request is complete.
In the embodiment of the application, the proxy service device receives the data processing request and processes the data in the database in response to the data processing request, and the data is not directly processed by the initiating service device or the calling service device. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment or the calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
Referring to fig. 4, a flowchart of a transaction processing method according to an embodiment of the application is shown. The method may be applied to an originating service device in the network architecture shown in fig. 1. The method may comprise the following steps.
Step 401, a data processing request is sent to a proxy service device.
The initiating service device is provided with the initiating service of the transaction. The initiating service device can realize the function of the initiating service deployed by itself besides controlling the transaction processing and calling other services. When the function of initiating the service is realized, the initiating service device sends a data processing request to the proxy service device, so that the proxy service device processes the data in the database of the initiating service according to the data processing request. The data processing request includes a service identifier, where the service identifier is used to indicate the initiation of the service.
Step 402, a process completion response sent by the proxy service device is received.
And after the proxy service equipment finishes processing, returning a processing completion response to the initiating service equipment. Accordingly, the initiating service terminal receives the processing completion response and determines that the proxy service device has completed the data processing request.
In the embodiment of the application, the initiating service device sends a data processing request to the proxy service device, so that the proxy service device processes the data in the database according to the data processing request. The originating service device no longer directly processes the data. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment is not needed, so that overlong communication waiting time is avoided; moreover, the proxy service equipment can realize the function of initiating service only by one communication without communication confirmation, so that the communication times are reduced, the communication time is shortened, and the running efficiency of the transaction processing system can be improved.
Referring to fig. 5, a flowchart of a transaction processing method according to an embodiment of the application is shown. The method can be applied to call service equipment in the network architecture shown in fig. 1. The method may comprise the following steps.
Step 501, a call instruction sent by an initiating service device is received.
Because the transaction includes a plurality of services that are executed sequentially in a preset order, the service-initiating device may need to call services other than the service-initiating device during a transaction. At this time, the originating service device needs to send a call instruction to the call service device in which the other services described above are deployed. The calling instruction comprises a service identifier corresponding to the service to be called by the initiating service device, and is used for indicating the calling service device to provide the service to be called by the initiating service device. Accordingly, the calling service device receives the calling instruction sent by the initiating service device.
Step 502, a data processing request is sent to a proxy service device.
And after receiving the call instruction, the call service equipment sends a data processing request to the proxy service equipment so that the proxy service equipment processes the data in the database of the called service according to the data processing request. The service identifier included in the data processing request indicates the same service as the service identifier included in the call instruction.
In step 503, a process completion response sent by the proxy service device is received.
And after the proxy service equipment finishes processing, returning a processing completion response to the calling service equipment. Accordingly, the calling service device receives the processing completion response, and determines that the proxy service device has completed the data processing request.
Step 504, a call completion response is sent to the initiating service device.
After determining that the proxy service device has completed the data processing request, the calling service device sends a calling completion response to the originating service device. The call completion response is used to inform the originating service device that the service call is complete.
In the embodiment of the application, the initiating service device calls the service device to send a data processing request to the proxy service device, so that the proxy service device processes the data in the database according to the data processing request. The calling service device is no longer directly responsible for data processing. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, the proxy service equipment can realize the function of the called service by only one communication without communication confirmation, so that the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
Referring to fig. 6, a flowchart of a transaction processing method according to an embodiment of the application is shown. The method can be applied to the network architecture shown in fig. 1. The method may comprise the following steps.
In step 601, the initiating service device sends a token request to the proxy service device.
Because the initiating service device is deployed with the initiating service, the initiating service device initiates the transaction. Upon initiation of the transaction, the initiating service device sends a token request to the proxy service device. The token request is for requesting a transaction token from a proxy service device. The transaction token is used to indicate a transaction initiated by the initiating service device. For example, for the same transaction, the initiating service device a initiates a transaction for the transaction twice, and the proxy service device generates a different transaction token for the two transactions: a1 and A2.
The proxy service device generates a transaction token from the token request, step 602.
And after receiving the token request, the proxy service equipment generates a corresponding transaction token. The transaction token may be a number, letter, or symbol. The proxy service device stores the generated transaction token in a cache for use during subsequent transaction processing steps.
The proxy service device sends 603 a transaction token to the initiating service device.
After the proxy service device generates and stores the transaction token, the transaction token is sent to the initiating service device that sent the token request.
In step 604, the originating service apparatus sends a data processing request to the proxy service apparatus.
The initiating service device is provided with the initiating service of the transaction. The initiating service device can realize the function of the initiating service deployed by itself besides controlling the transaction processing and calling other services. When the function of initiating the service is realized, the initiating service device sends a data processing request to the proxy service device. The data processing request includes a transaction token indicating the current transaction and a service identifier corresponding to the initiating service.
The data processing request may be a data addition request or a data modification request. The data new request is to request the proxy service device to add data in the database of the corresponding service, and the data modification request is to request the proxy service device to modify data in the database of the corresponding service. When the data processing request is a data newly-added request, the data processing request further includes newly-added data. The newly added data is data to be added in the database of the corresponding service. When the data processing request is a data modification request, the data processing request further includes second primary key information and target data. The second primary key information is used for indicating original data to be modified in the database of the corresponding service, and the target data is modified data.
Optionally, when the data processing request is a data modification request, if the target data is null, the proxy service device deletes the original data indicated by the second primary key information.
Optionally, both the new data and the second primary key information and the target data are included in the data processing request in the form of a structured query language (Structured Query Language, SQL) statement. Different data processing requests, wherein the content of SQL statements is different.
Optionally, the data processing request further includes a database identifier. The database identification indicates a database of the corresponding service. The proxy service device can determine the database according to the database identification without storing the corresponding relation between the service identification and the database. When new service needs to be developed and deployed, the corresponding relation between the service identifier and the database does not need to be updated in the proxy service equipment, and only the database identifier needs to be newly added on the deployed service equipment, so that the development and maintenance cost is reduced.
Optionally, the data processing request further includes a data positioning identifier. The data positioning identifier is used for indicating a data table in which the object of the current data processing is specifically located in the database, and/or a row or a column in the data table where the object of the current data processing is located.
Step 605, the proxy service device processes the data in the corresponding database according to the data processing request sent by the initiating service device.
There are two types of requests for data processing requests. Therefore, the processing method of the proxy service device is also different for different data processing requests. However, the proxy service device will lock the corresponding service data first, and prohibit other transactions from making new or modification of the same data in the database, regardless of whether the data new or modification request is processed.
During a transaction, the same service may be used in multiple transactions. However, the data in the database of the service is only one part, so that only one transaction is allowed to process the same part of the data in the database of the same service. When one service in the transactions needs to use the database, if no other transaction uses the same piece of data in the same database, the proxy service equipment locks the data in the database, and before the current transaction is finished, the other transaction is not allowed to use the same piece of data in the database even though the service is the same.
Alternatively, the proxy service device may lock the entire database, may lock the data table in which the data being used is located, and may lock the row or column in the data table in which the data being used is located. Other transactions may use data in other data tables in the database when locking the data table in which the data being used is located; when a row or column in the data table in which the data being used is located is locked, other data in the database may be used by other transactions in addition to the data in that row or column. Compared with the mode of locking the whole database, the mode of locking the data table or specific rows in the table enables different transactions to use different data in the database at the same time, and can improve the processing efficiency of the proxy service equipment when processing a plurality of transactions at the same time.
For locking the database, the proxy service device locks the database corresponding to the service identifier by correspondingly storing the transaction token and the locking identifier so as to prohibit other transactions from carrying out data new or modification in the database. Different services correspond to different lock identifications and different services correspond to different service identifications. Thus, there is a one-to-one correspondence between service identification and lock identification.
When the proxy service equipment receives a data processing request, detecting whether a locking identifier corresponding to a service identifier in the data processing request is stored or not; if not, indicating that the database corresponding to the service identifier in the data processing request is not occupied, and correspondingly storing the transaction token and the locking identifier by the proxy service equipment to lock the database; if yes, the fact that the database corresponding to the service identifier in the data processing request is occupied is indicated. At this time, the proxy service device detects the transaction token stored corresponding to the locking identifier, and if the transaction token is consistent with the transaction token in the data processing request, the database corresponding to the service identifier is occupied by the same transaction, and the proxy service device can process the data; if the transaction token is inconsistent with the transaction token in the data processing request, the fact that the database corresponding to the service identifier is occupied by other transactions is indicated, and the proxy service equipment needs to wait for the other transactions to finish.
Illustratively, the proxy service device receives a data processing request including a transaction token a, service identification a. The lock identifier corresponding to the service identifier a is a1. The proxy service device detects whether the lock identification a1 is stored. If not, the proxy service equipment correspondingly stores the locking identification a1 and the transaction token A; if the lock identifier a1 is stored, the proxy service device further detects whether the transaction token corresponding to the lock identifier a1 is a. If yes, the proxy service equipment performs subsequent data processing; if not, the proxy service device waits for the transaction indicated by the transaction token corresponding to the lock identification a1 to end.
The processing method of the proxy service device is also different for different data processing requests. When the agent service device processes the data new request, the above step 605 includes the following sub-steps.
In step 605a, the proxy service device sends newly added data to the data storage device.
After the proxy service equipment locks the database corresponding to the service identifier, new data in the data new-adding request is sent to the data storage equipment where the database is located.
In step 605b, the data storage device sends the first primary key information to the proxy service device after storing the newly added data.
After receiving the newly-added data sent by the proxy service device, the data storage device stores the newly-added data in a corresponding database, and sends first primary key information generated after storing the newly-added data to the proxy service device. Each piece of data in the database corresponds to a piece of primary key information that is used to uniquely indicate a piece of data in the database. The first primary key information indicates newly added data in the current data processing process.
Illustratively, the data stored in the database is student information, which is shown in Table-1 below
Name of name Number of school Main key information
Wangdi (Chinese character) 001 W1
Liwu four-element bag 002 L2
Zhang San (Zhang San) 003 Z3
TABLE-1
Each piece of student information includes the name and number of the student as shown in the above table-1. And each piece of student information also corresponds to a primary key information.
In step 605c, the proxy service device correspondingly stores the transaction token and the first primary key information.
The proxy service device correspondingly stores the transaction token and the first primary key information so as to execute a rollback operation when the transaction indicated by the transaction token is abnormal in the processing process.
The above processing method is directed to the case where the database is stored on other data storage devices. When the database is stored in the proxy service device, the proxy service device directly adds new data into the database corresponding to the service identifier according to the new data adding request, acquires the first primary key information, and stores the first primary key information corresponding to the transaction token.
When the proxy service device receives the data modification request, a different processing method is adopted. When the proxy service appliance processes a data modification request, step 605 described above includes the following sub-steps.
In step 605A, the proxy service device sends an original data request to the data storage device.
The proxy service device requests the original data to be modified in the database from the data storage device so as to execute rollback operation when the transaction occurrence operation indicated by the transaction token fails. The original data request includes second primary key information for indicating the original data.
In step 605C, the data storage device sends the raw data to the proxy service device.
The data storage device determines the original data requested by the proxy service device according to the second primary key information, and returns the original data to the proxy service device. Accordingly, the proxy service device correspondingly stores the transaction token, the original data and the second primary key information after receiving the original data.
In step 605D, the proxy service device sends target data to the data storage device.
After storing the raw data, the proxy service device sends the target data to the data storage device.
In step 605E, the data storage device modifies the original data into target data.
And the data storage device modifies the original data into the target data after receiving the target data sent by the data storage device. After the modification is completed, an update response is returned to the proxy service device to inform the proxy service device that the data modification is completed.
The above-described processing method is directed to the case where the database is stored on other data storage devices. When the database is stored in the proxy service device, the proxy service device directly acquires the original data from the database corresponding to the service identifier according to the second primary key information, and modifies the original data into the target data. In addition, the proxy service device correspondingly stores the transaction token, the original data and the second primary key information.
The proxy service device returns a process complete response to the initiating service device, step 606.
After the data processing is completed, the proxy service device returns a processing completion response to the initiating service device, and notifies the initiating service device that the data processing request sent by the initiating service device is completed. When the data processing request sent by the initiating service device is a data newly-added request, the processing completion response comprises first primary key information corresponding to the newly-added data.
In step 607, the initiating service device sends a call instruction to the calling service device.
Because the transaction includes a plurality of services that are executed sequentially in a preset order, the service-initiating device may need to call services other than the service-initiating device during a transaction. At this time, the originating service device needs to send a call instruction to the call service device in which the other services described above are deployed. The calling instruction is used for indicating the calling service equipment to provide the service to be called by the initiating service equipment. The call instruction includes a service identifier corresponding to a service to be called by the originating service device.
Step 608, the calling service device sends a data processing request to the proxy service device.
In step 609, the proxy service device processes the data in the corresponding database according to the data processing request sent by the calling service device.
In step 610, the proxy service device returns a process completion response to the calling service device.
The method of invoking the service device to perform data processing through the proxy service device in the above steps 608 to 610 is the same as the method of initiating the service device to perform data processing through the proxy service device in the above steps 604 to 606. For details, please refer to the contents from step 604 to step 606, which are not described herein.
In step 611, the calling service device sends a call completion response to the originating service device.
After determining that the proxy service device has completed the data processing request, the calling service device sends a calling completion response to the originating service device. The call completion response is used to inform the originating service device that the service call is complete. When the data processing request sent by the calling service equipment is a data newly-added request, the calling completion response comprises first main key information corresponding to the newly-added data.
In step 612, the initiating service device sends a transaction end instruction to the proxy service device.
And after the initiating service device determines that the services in the transaction are successfully executed according to the preset sequence, sending a transaction ending instruction to the proxy service device so as to end the processing of the transaction. The transaction end instruction includes a transaction token indicating the current transaction.
It should be noted that, in the embodiment of the present application, the initiating transaction of the initiating service device includes executing the initiating service first, and then executing a calling service. But there is no limitation on the type, number, and order of execution of services during the transaction. In practical applications, the service types, the number and the execution sequence of different transactions are not the same. For example, in the transaction a, the initiating service a is executed first, then the calling service B is executed, and finally the calling service C is executed, whereas in the transaction B, the calling service B is executed first, and in the process of executing the initiating service a, the calling service D is executed finally. Therefore, the embodiment of the application only describes the case of executing the initiation service first and then executing the call service, but does not limit the type, the number and the execution sequence of the services in the transaction processing.
In step 613, the proxy service device deletes the transaction token and the lock identifier that are stored correspondingly according to the transaction ending instruction.
After receiving the transaction ending instruction, the proxy service equipment determines that each service in the transaction initiated by the initiating service equipment is successfully completed, and the data of each database locked in the transaction processing process need to be unlocked. In the data processing process, the proxy service equipment correspondingly stores the transaction token and the locking identifier, so that the proxy service equipment deletes the corresponding stored transaction token and locking identifier according to the transaction token in the transaction ending instruction, and unlocks the locked data. After unlocking is completed, the proxy service equipment informs the initiating service equipment that the unlocking is successful, and the transaction processing is finished.
Illustratively, during a transaction, the proxy service device locks a database of 2 services, and stores 2 service lock identifiers: a1 and b1, and is stored corresponding to the transaction token a of the present transaction. Then. The proxy service equipment determines that the transaction token A corresponds to the stored locking identification when receiving a transaction ending instruction comprising the transaction token A: a1 and b1, delete transaction token a, lock identification: a1 and b1, unlocking the databases of the 2 services, and ending the transaction.
In the embodiment of the application, the proxy service device receives the data processing request and processes the data in the database in response to the data processing request, and the data is not directly processed by the initiating service device or the calling service device. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment or the calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
In addition, in the scheme provided by the application, the operations of data processing, data rollback and the like are realized by the proxy service equipment by utilizing the principle of tangent plane programming. Therefore, when each service is deployed, technicians do not need to write the functional codes of the respective data processing and rollback data for each service, and only need to write the functional codes on the proxy service equipment in a unified way, so that development and maintenance costs are reduced.
During the transaction processing, the proxy service device may have an abnormal condition when processing the data processing request of any service in the transaction, which results in the failure of the transaction. Because the transaction comprises a plurality of services which are sequentially executed according to a preset sequence, when one service is abnormal, the whole transaction is abnormal. At this time, it is necessary to rollback the data of the service executed during the transaction process, and restore the data in the database to the data before the transaction process starts. Referring to fig. 7, a flowchart of a data rollback method according to an embodiment of the present application is shown. The method may comprise the following steps.
In step 701, when an exception occurs in data processing, the proxy service device sends an exception response to the originating service device.
The occurrence of the abnormality in the data processing means that the agent service device performs the data processing according to the data processing request. For example, when data is newly added, the newly added data is lost, resulting in failure of the added data, or when data is modified, the updated data is lost, resulting in failure of the modification, or the like. At this time, the proxy service device sends an exception response to the initiating service device, and notifies the initiating service device that the data processing is abnormal, and the transaction processing fails. When the data processing request is sent directly by the originating service apparatus, the proxy service apparatus sends an exception response directly to the originating service apparatus. When the data processing request is sent by the calling service device called by the initiating service device, the proxy service device forwards the exception response to the initiating service device through the calling service device.
In step 702, the initiating service device sends a rollback instruction to the proxy service device.
After the initiating service device receives the abnormal response, the initiating service device determines that the transaction processing fails and needs to roll back the data. Thus, a rollback instruction is sent to the proxy service appliance. The rollback instruction includes a transaction token therein.
In step 703, the proxy service device rolls back the data in the database according to the roll-back instruction.
After receiving the rollback instruction, the proxy service device acquires the stored first primary key information, second primary key information and original data corresponding to the transaction token according to the transaction token in the rollback instruction. The proxy service equipment restores the data in the database which is processed by the data processing in the transaction processing process to the data before the transaction processing. And deleting the corresponding data by the proxy service equipment according to the first primary key information for the database with the newly added data. And for the database subjected to data modification, the proxy service equipment modifies the modified target data into the original data according to the second primary key information and the original data.
Optionally, when the database is stored in other data storage devices, the primary key information corresponding to the transaction token and the original data are included in the rollback request and sent to the data storage device, so that the data storage device rolls back the data in the database according to the rollback request. After recovering the data, the data storage device sends a rollback completion response to the proxy service device informing the proxy service device that the operation of rollback the data is completed.
The proxy service device deletes the corresponding stored transaction token and lock identification, step 704.
After the proxy service equipment determines that the operation of rolling back the data is completed, the data of the database of each service locked in the transaction process needs to be unlocked. In the data processing process, the proxy service equipment correspondingly stores the transaction token and the locking identifier, so that the proxy service equipment deletes the corresponding stored transaction token and locking identifier according to the transaction token in the transaction ending instruction, and unlocks the data of the database of each service.
Step 705, the proxy service device sends a rollback success response to the initiating service device.
After unlocking is completed, the proxy service device sends a rollback success response to the initiating service device, and notifies the initiating service device that rollback is completed and the unlocking is successful, and the transaction processing is finished.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 8 is a schematic block diagram of a transaction device, according to an example embodiment. The device has the function of realizing the proxy service equipment side method, and the function can be realized by hardware or by executing corresponding software by hardware. The apparatus may include: a first receiving module 801, a first processing module 802 and a first transmitting module 803.
A first receiving module 801, configured to receive a data processing request sent by an initiating service device or a calling service device, where the data processing request includes a service identifier, where the service identifier is used to uniquely indicate a service.
A first processing module 802, configured to process, according to the data processing request, data in a database of the service indicated by the service identifier.
A first sending module 803 is configured to send a process completion response to the device that sends the data processing request, where the process completion response is used to indicate that the data processing request is completed.
In the device provided by the embodiment of the application, the proxy service equipment receives the data processing request and processes the data in the database in response to the data processing request, and the initiating service equipment or the calling service equipment does not directly process the data any more. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment or the calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
Optionally, the first receiving module 801 is further configured to receive a transaction token request sent by the initiating service device, where the transaction token request is used to request a transaction token, and the transaction token is used to indicate a transaction initiated by the initiating service device. The first sending module 803 is further configured to generate the transaction token, and send the transaction token to the originating service apparatus.
Optionally, the first processing module 802 is further configured to detect whether a lock identifier corresponding to the service identifier is stored, where the lock identifier indicates that data corresponding to a service indicated by the service identifier is locked; and if the locking identifier is not stored, correspondingly storing the transaction token and the locking identifier.
Optionally, the data processing request is a data adding request, and the data adding request includes: and (5) newly adding data.
The first processing module 802 is specifically configured to:
adding the newly added data in a database of the service indicated by the service identifier according to the data newly added request; and acquiring first primary key information, wherein the first primary key information is used for indicating the newly added data in the database.
Optionally, the data processing request is a data modification request, and the data modification request includes: the system comprises second main key information and target data, wherein the second main key information is used for indicating original data to be modified.
The first processing module 802 is specifically configured to:
Acquiring the original data from a database of the service indicated by the service identifier according to the second primary key information; and modifying the original data into the target data in a database of the service indicated by the service identifier.
Optionally, the first sending module 803 is further configured to send an exception response to the initiating service device when an exception occurs in data processing, where the exception response is used to notify the initiating service device that an exception occurs in data processing. The first receiving module 801 is further configured to receive a rollback instruction sent by the service initiation device, where the rollback instruction includes the transaction token. The first processing module 802 is further configured to restore data in the database to data before the transaction processing starts according to the rollback instruction; and deleting the transaction token and the locking identifier which are correspondingly stored.
Optionally, the first processing module 802 is further configured to delete the transaction token and the lock identifier that are stored correspondingly when receiving a transaction end instruction sent by the service initiation device, where the transaction end instruction includes the transaction token.
Fig. 9 is a schematic block diagram of a transaction device, according to an example embodiment. The device has the function of realizing the method of the side of the initiating service equipment, and the function can be realized by hardware or can be realized by executing corresponding software by the hardware. The apparatus may include: a second transmitting module 901 and a second receiving module 902.
A second sending module 901, configured to send a data processing request including a service identifier to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier, where the service identifier is used to uniquely indicate a service.
And a second receiving module 902, configured to receive a processing completion response sent by the proxy service device, where the processing completion response is used to indicate that the data processing request is completed.
In the device provided by the embodiment of the application, the initiating service device sends the data processing request to the proxy service device, so that the proxy service device processes the data in the database according to the data processing request. The originating service device no longer directly processes the data. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment is not needed, so that overlong communication waiting time is avoided; moreover, the proxy service equipment can realize the function of initiating service only by one communication without communication confirmation, so that the communication times are reduced, the communication time is shortened, and the running efficiency of the transaction processing system can be improved.
Optionally, the second sending module 901 is further configured to send a transaction token request to the proxy service device, where the transaction token request is used to request a transaction token, and the transaction token is used to indicate a transaction initiated by the initiating service device. The second receiving module 902 is further configured to receive the transaction token sent by the proxy service device.
Optionally, the second sending module 901 is further configured to send a call instruction to a calling service device, where the call instruction includes a service identifier corresponding to a service that is called by the initiating service device. The second receiving module 902 is further configured to receive a call completion response sent by the call service device, where the call completion response is used to indicate that the service call of the originating service device is completed.
Optionally, the second sending module 901 is further configured to send, when receiving an exception response sent by the proxy service device, a rollback instruction to the proxy service device, where the exception response is used to notify the initiating service device that data processing is abnormal, and the rollback instruction is used to instruct the proxy service device to restore data in a database to data before transaction processing begins.
Optionally, the second receiving module 902 is further configured to send a transaction end instruction to the proxy service device, where the transaction end instruction includes the transaction token.
Fig. 10 is a schematic block diagram of a transaction device, according to an example embodiment. The device has the function of realizing the method of calling the service equipment side, and the function can be realized by hardware or by executing corresponding software by the hardware. The apparatus may include: a third receiving module 1001 and a third transmitting module 1002.
A third receiving module 1001, configured to receive a call instruction sent by an initiating service device, where the call instruction includes a service identifier corresponding to a service that is called by the initiating service device, where the service identifier is used to uniquely indicate a service;
a third sending module 1002, configured to send a data processing request to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier;
The third receiving module 1001 is further configured to receive a process completion response sent by the proxy service device, where the process completion response is used to indicate that the data processing request is completed;
The third sending module 1002 is further configured to send a call completion response to the service initiating device, where the call completion response is used to indicate that the service call of the service initiating device is completed.
In the device provided by the embodiment of the application, the initiating service device calls the service device to send the data processing request to the proxy service device, so that the proxy service device processes the data in the database according to the data processing request. The calling service device is no longer directly responsible for data processing. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, the proxy service equipment can realize the function of the called service by only one communication without communication confirmation, so that the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
An exemplary embodiment of the present application provides a transaction device based on slice programming, which is applied to a micro-service architecture. The apparatus comprises means as shown in the embodiment of fig. 8 and/or means as shown in the embodiment of fig. 9 and/or means as shown in the embodiment of fig. 10 and has the function of implementing the method example described above.
Another exemplary embodiment of the present application provides a transaction processing system based on slice programming, for use in a micro-service architecture, comprising at least one device as described in the device embodiments above.
In the system provided by the application, the proxy service device receives the data processing request and processes the data in the database in response to the data processing request, and the data is not directly processed by the initiating service device or the calling service device. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service, and communication confirmation with the initiating service equipment or the calling service equipment is not needed, so that overlong communication waiting time is avoided; in addition, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in the execution process of each service, the communication times are reduced, the communication time is shortened, and the operation efficiency of the transaction processing system can be improved.
In an exemplary embodiment, there is also provided a computer-readable storage medium having stored therein a computer program or a smart contract that is loaded and executed by a node to implement the transaction method provided by the above embodiment. Alternatively, the above-mentioned computer readable storage medium may be a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.
It will be apparent to those skilled in the art that the techniques of embodiments of the present application may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A transaction processing method based on tangent plane programming, which is applied to a micro-service architecture, and is characterized in that the method comprises the following steps:
Receiving a data processing request sent by an initiating service device, wherein the data processing request is a transaction token request, the transaction token request is used for requesting a transaction token, and the transaction token is used for indicating a transaction initiated by the initiating service device; the data processing request comprises a data newly-added request and a data modification request; the data adding request comprises adding data; the data modification request comprises second main key information and target data, wherein the second main key information is used for indicating original data to be modified;
Generating the transaction token and sending the transaction token to the initiating service device; when the same transaction is initiated for a plurality of times, the generated transaction tokens are different;
Receiving a data processing request sent by an initiating service device or a calling service device, wherein the data processing request of the initiating service device comprises a transaction token and a service identifier, the data processing request of the calling service device comprises a service identifier, and the service identifier is used for uniquely indicating a service;
Processing data in a database of the service indicated by the service identifier according to the data processing request; the processing data in the database of the service indicated by the service identification comprises: adding the newly added data in a database of the service indicated by the service identifier according to the data newly added request; acquiring first primary key information, wherein the first primary key information is used for indicating the newly added data in the database; acquiring the original data from a database of the service indicated by the service identifier according to the second primary key information; modifying the original data into the target data in a database of the service indicated by the service identifier;
And sending a processing completion response to the device sending the data processing request, wherein the processing completion response is used for indicating that the data processing request is completed.
2. The method of claim 1, wherein prior to processing the data in the database of services indicated by the service identification, further comprising:
Detecting whether a locking identifier corresponding to the service identifier is stored or not, wherein the locking identifier indicates that data of the service indicated by the corresponding service identifier is locked;
And if the locking identifier is not stored, correspondingly storing the transaction token and the locking identifier.
3. The method according to any one of claims 1-2, wherein the method further comprises:
when the data processing is abnormal, an abnormal response is sent to the initiating service device, and the abnormal response is used for notifying the initiating service device that the data processing is abnormal;
receiving a rollback instruction sent by the initiating service device, wherein the rollback instruction comprises the transaction token;
according to the rollback instruction, recovering the data in the database into the data before the transaction processing starts;
And deleting the transaction token and the locking identifier which are correspondingly stored.
4. The method according to any one of claims 1-2, wherein after said sending a process completion response to the device sending said data processing request, further comprising:
And deleting the corresponding stored transaction token and locking identification when receiving a transaction ending instruction sent by the initiating service device, wherein the transaction ending instruction comprises the transaction token.
5. A transaction processing method based on tangent plane programming, which is applied to a micro-service architecture, and is characterized in that the method comprises the following steps:
Transmitting a data processing request to proxy service equipment, wherein the data processing request is a transaction token request, the transaction token request is used for requesting a transaction token, and the transaction token is used for indicating a transaction initiated by initiating service equipment; the data processing request comprises a data newly-added request and a data modification request; the data adding request comprises adding data; the data modification request comprises second primary key information and target data;
receiving the transaction token sent by the proxy service equipment; when the same transaction is initiated for a plurality of times, the received transaction tokens are different;
transmitting a data processing request comprising a service identifier to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier, wherein the service identifier is used for uniquely indicating a service;
and receiving a processing completion response sent by the proxy service equipment, wherein the processing completion response is used for indicating that the data processing request is completed.
6. The method of claim 5, wherein the method further comprises:
sending a calling instruction to calling service equipment, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service equipment;
and receiving a call completion response sent by the call service equipment, wherein the call completion response is used for indicating that the service call of the initiating service equipment is completed.
7. The method according to any one of claims 5 or 6, further comprising:
And when an abnormal response sent by the proxy service equipment is received, sending a rollback instruction to the proxy service equipment, wherein the abnormal response is used for notifying the initiating service equipment that the data processing is abnormal, and the rollback instruction is used for indicating the proxy service equipment to restore the data in the database into the data before the transaction processing starts.
8. The method according to any one of claims 5 or 6, further comprising, after receiving the processing completion response sent by the proxy service device:
And sending a transaction ending instruction to the proxy service device, wherein the transaction ending instruction comprises the transaction token.
9. A transaction processing method based on tangent plane programming, which is applied to a micro-service architecture, and is characterized in that the method comprises the following steps:
Receiving a calling instruction sent by an initiating service device, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service device, and the service identifier is used for uniquely indicating a service;
Sending a data processing request to proxy service equipment so that the proxy service equipment processes data in a database of a service indicated by the service identifier;
receiving a processing completion response sent by the proxy service device, wherein the processing completion response is used for indicating that the data processing request is completed;
And sending a call completion response to the initiating service device, wherein the call completion response is used for indicating that the service call of the initiating service device is completed.
10. A transaction device based on cut plane programming, applied to a micro-service architecture, the device comprising:
The first receiving module is used for receiving a data processing request sent by the initiating service device or the calling service device, wherein the data processing request comprises a service identifier, and the service identifier is used for uniquely indicating a service;
The first processing module is used for processing the data in the database of the service indicated by the service identifier according to the data processing request;
and the first sending module is used for sending a processing completion response to the equipment for sending the data processing request, wherein the processing completion response is used for indicating that the data processing request is completed.
11. A transaction device based on cut plane programming, applied to a micro-service architecture, the device comprising:
The second sending module is used for sending a data processing request comprising a service identifier to the proxy service equipment so that the proxy service equipment processes data in a database of the service indicated by the service identifier, and the service identifier is used for uniquely indicating a service;
and the second receiving module is used for receiving a processing completion response sent by the proxy service equipment, wherein the processing completion response is used for indicating that the data processing request is completed.
12. A transaction device based on cut plane programming, applied to a micro-service architecture, the device comprising:
The third receiving module is used for receiving a calling instruction sent by the initiating service equipment, wherein the calling instruction comprises a service identifier corresponding to a service called by the initiating service equipment, and the service identifier is used for uniquely indicating a service;
A third sending module, configured to send a data processing request to a proxy service device, so that the proxy service device processes data in a database of a service indicated by the service identifier;
The third receiving module is further configured to receive a processing completion response sent by the proxy service device, where the processing completion response is used to indicate that the data processing request is completed;
The third sending module is further configured to send a call completion response to the service initiating device, where the call completion response is used to indicate that the service initiating device service call is completed.
13. Transaction device based on cut plane programming, applied to a micro-service architecture, characterized in that it comprises an apparatus according to claim 10 and/or an apparatus according to claim 11 and/or an apparatus according to claim 12.
14. A transaction system based on cut-plane programming, applied to a micro-service architecture, characterized in that it comprises at least one device according to claim 13.
CN201811446226.9A 2018-11-29 2018-11-29 Transaction processing method, device, equipment and system based on tangent plane programming Active CN111240851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811446226.9A CN111240851B (en) 2018-11-29 2018-11-29 Transaction processing method, device, equipment and system based on tangent plane programming

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811446226.9A CN111240851B (en) 2018-11-29 2018-11-29 Transaction processing method, device, equipment and system based on tangent plane programming

Publications (2)

Publication Number Publication Date
CN111240851A CN111240851A (en) 2020-06-05
CN111240851B true CN111240851B (en) 2024-05-24

Family

ID=70872205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811446226.9A Active CN111240851B (en) 2018-11-29 2018-11-29 Transaction processing method, device, equipment and system based on tangent plane programming

Country Status (1)

Country Link
CN (1) CN111240851B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102077506A (en) * 2008-05-20 2011-05-25 微软公司 Security architecture for peer-to-peer storage system
CN102209046A (en) * 2010-08-24 2011-10-05 济南聚易信息技术有限公司 Network resource integration system and method
CN107465725A (en) * 2017-07-20 2017-12-12 中国银行股份有限公司 Isomery remote business disposal system and method based on CICS
CN107528912A (en) * 2017-09-11 2017-12-29 金蝶软件(中国)有限公司 A kind of automatic method, system and relevant apparatus for realizing distributing real time system
CN108737176A (en) * 2018-05-20 2018-11-02 湖北九州云仓科技发展有限公司 A kind of data gateway control method, electronic equipment, storage medium and framework

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106716395B (en) * 2014-12-24 2019-04-19 华为技术有限公司 The method, apparatus and computer system of issued transaction

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102077506A (en) * 2008-05-20 2011-05-25 微软公司 Security architecture for peer-to-peer storage system
CN102209046A (en) * 2010-08-24 2011-10-05 济南聚易信息技术有限公司 Network resource integration system and method
CN107465725A (en) * 2017-07-20 2017-12-12 中国银行股份有限公司 Isomery remote business disposal system and method based on CICS
CN107528912A (en) * 2017-09-11 2017-12-29 金蝶软件(中国)有限公司 A kind of automatic method, system and relevant apparatus for realizing distributing real time system
CN108737176A (en) * 2018-05-20 2018-11-02 湖北九州云仓科技发展有限公司 A kind of data gateway control method, electronic equipment, storage medium and framework

Also Published As

Publication number Publication date
CN111240851A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN108874552B (en) Distributed lock execution method, device and system, application server and storage medium
CN106844014B (en) Method and device for realizing suspension prevention of distributed transactions
CN109828847B (en) Block chain-based lock processing method, device, computer equipment and storage medium
US6665814B2 (en) Method and apparatus for providing serialization support for a computer system
CN105512266A (en) Method and device for achieving operational consistency of distributed database
US11681683B2 (en) Transaction compensation for single phase resources
CN106155775B (en) Message processing method, device and system
CN112491959B (en) Cross-link resource exchange method, device and system based on relay link
CN111858629A (en) Method and device for realizing two-stage submission of distributed transaction update database
CN112817995B (en) Data processing method and device, electronic equipment and storage medium
CN109002462A (en) A kind of method and system for realizing distributed things
CN111127088B (en) Method, device, computer equipment and storage medium for realizing final consistency
CN110795171A (en) Service data processing method and device, computer equipment and storage medium
CN107465725B (en) Heterogeneous long transaction processing system and method based on client information control system
CN112596801A (en) Transaction processing method, device, equipment, storage medium and database
CN111240851B (en) Transaction processing method, device, equipment and system based on tangent plane programming
CN112559496B (en) Method and device for realizing transaction atomicity of distributed database
CN111143041A (en) Data consistency method, distributed coordinator and central coordinator
CN112598520B (en) Transaction management method, device, electronic equipment and storage medium
CN101751292A (en) Method for realizing consistency function of multimachine core data in ATC (automatic timing corrector) system
CN114356888A (en) Transaction processing method and device, storage medium and electronic equipment
CN115145997A (en) Distributed transaction implementation method and distributed system
CN113992750A (en) Global transaction coordination method, device, equipment and medium
CN113296895B (en) Transaction processing system, transaction processing method and device
US6772176B1 (en) Coordinating a distributed transaction between participants unable to follow a two-phase commit

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
TA01 Transfer of patent application right

Effective date of registration: 20231128

Address after: 230012 In the factory building of Anhui Guogou Energy Co., Ltd., 100 meters east of the intersection of Guanjing Road and Luban Road in Xinzhan District, Hefei City, Anhui Province

Applicant after: Hefei Youquan Information Technology Co.,Ltd.

Address before: 100102 room 323701, building 5, yard 1, Futong East Street, Chaoyang District, Beijing

Applicant before: YOUXINPAI (BEIJING) INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant