CN111240851A - 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
CN111240851A
CN111240851A CN201811446226.9A CN201811446226A CN111240851A CN 111240851 A CN111240851 A CN 111240851A CN 201811446226 A CN201811446226 A CN 201811446226A CN 111240851 A CN111240851 A CN 111240851A
Authority
CN
China
Prior art keywords
service
data
transaction
initiating
data processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811446226.9A
Other languages
Chinese (zh)
Other versions
CN111240851B (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
Youxinpai Beijing 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 Youxinpai Beijing Information Technology Co ltd filed Critical Youxinpai Beijing 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

Images

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

A transaction processing method, device, equipment and system based on tangent plane programming are applied to a micro-service architecture, and the method comprises the following steps: receiving a data processing request sent by initiating service equipment or calling service equipment, wherein the data processing request comprises a service identifier which 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 any more. Therefore, the proxy service equipment does not need to carry out communication confirmation, and the communication waiting time is avoided to be too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.

Description

Transaction processing method, device, equipment and system based on tangent plane programming
Technical Field
The present application relates to the field of micro service technologies, 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 amount, difficulty in maintenance, rapid deployment and the like of the traditional monomer architecture are solved while the system scale and project developers are expanded more and more. The principle of the micro-service architecture is to split a system into a plurality of services which can be independently developed, designed, operated and maintained, each service can be independently deployed and isolated from each other, and the services are called through Application Programming Interfaces (APIs).
Because each service in the micro-service architecture is independently deployed and corresponds to the own database, the micro-service architecture is different from a database implementation transaction mechanism in a single architecture, and the services in the micro-service architecture are mutually called, so that the consistency of transactions needs to be realized. A service in a microservice architecture refers to a function that can be implemented independently by a program, and a transaction includes multiple services that are executed in sequence according to a predetermined order. The existing transaction solution is mainly a Two-Phase commit protocol (2 PC). The specific process is divided into two stages. In the first phase, the transaction coordinator initiates a transaction to communicate with the service devices on which the services are deployed to confirm that the preparation is complete. After the transaction coordinator gets a positive reply from all the service devices, the second phase is entered. In the second phase, the transaction coordinator communicates with the respective service devices, indicating the start of execution of the respective service. Under the control of the main service, each service device performs data processing in a database of services in a predetermined order.
First, in the first phase, the transaction coordinator needs to wait for positive replies from all the serving 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 a transaction, the transaction coordinator needs to communicate at least twice, in addition to the communication with the primary service. When the service is excessive, the communication time is too long due to the excessive number of times of communication.
Therefore, in the prior art, the transaction coordinator has too long waiting time and too long communication time, so that the transaction processing process consumes too much time, and the efficiency of the transaction processing system is reduced.
Disclosure of Invention
The application provides a transaction processing method, a transaction processing device, transaction processing equipment and a transaction processing system based on section programming, which can be used for solving the problems that in the prior art, due to overlong waiting time and overlong communication time of a transaction coordinator, excessive time is consumed in a transaction processing process, and the efficiency of the transaction processing system is reduced.
In a first aspect, the present application provides a transaction processing method based on tangent plane programming, applied to a micro-service architecture, where the method includes:
receiving a data processing request sent by initiating service equipment or calling service equipment, wherein the data processing request comprises a service identifier which is used for uniquely indicating a service;
processing data in a database of the service indicated by the service identification according to the data processing request;
and sending a processing completion response to the equipment 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 invoking 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 which 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 equipment.
Optionally, the data processing request further comprises the transaction token;
before the processing the data in the database of the service indicated by the service identification, the method further includes:
detecting whether a locking identifier corresponding to the service identifier is stored or not, wherein the locking identifier indicates that data of a 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 addition request, where the data addition request includes: newly adding data;
the processing the 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: second primary key information and target data, wherein the second primary key information is used for indicating original data to be modified;
the processing data in the database of the service indicated by the service identification comprises:
acquiring the original data from a database of the service indicated by the service identification 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 identification.
Optionally, the method further comprises:
when data processing is abnormal, sending an abnormal response to the initiating service equipment, wherein the abnormal response is used for informing the initiating service equipment that the data processing is abnormal;
receiving a rollback instruction sent by the initiating service device, wherein the rollback instruction comprises the transaction token;
restoring the data in the database into the data before the transaction processing starts according to the rollback instruction;
and deleting the correspondingly stored transaction token and the locking identification.
Optionally, after sending a processing completion response to the device that sent the data processing request, the method further includes:
and when a transaction ending instruction sent by the initiating service equipment is received, deleting the correspondingly stored transaction token and the correspondingly stored locking identification, 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 including:
sending a data processing request including a service identification to a proxy service device so that the proxy service device processes data in a database of services indicated by the service identification, wherein the service identification 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 equipment, wherein the transaction token request is used for requesting a transaction token which is used for indicating a transaction initiated by the initiating service equipment;
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 service initiating 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 receiving an abnormal response sent by the proxy service equipment, sending a rollback instruction to the proxy service equipment, wherein the abnormal response is used for informing the initiating service equipment that data processing is abnormal, and the rollback instruction is used for indicating the proxy service equipment to restore the data in the database to the data before the start of transaction processing.
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 equipment, 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, which is applied to a micro-service architecture, and the method includes:
receiving a calling instruction sent by 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;
sending a data processing request to a proxy service device so that the proxy service device processes data in a database of the service indicated by the service identification;
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;
and sending a call completion response to the initiating service equipment, wherein the call completion response is used for indicating that the service call of the initiating service equipment is completed.
In a fourth aspect, the present application provides a transaction processing apparatus based on tangent plane programming, applied to a micro-service architecture, the apparatus including:
the system comprises a first receiving module, a second receiving module and a first sending module, wherein the first receiving module is used for receiving a data processing request sent by an initiating service device or a calling service device, 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 data in a 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 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 apparatus based on tangent plane programming, applied to a micro-service architecture, the apparatus including:
the second sending module is used for sending a data processing request comprising a service identifier to the proxy service equipment so as to enable the proxy service equipment to process data in a database of the service indicated by the service identifier, wherein the service identifier is used for uniquely indicating a service;
and a second receiving module, 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 a sixth aspect, the present application provides a transaction processing apparatus based on tangent plane programming, applied to a micro-service architecture, the apparatus including:
a third receiving module, configured to receive a call instruction sent by an initiating service device, where the call instruction includes a service identifier corresponding to a service called by the initiating service device, and the service identifier is used to uniquely indicate 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 initiating service device, where the call completion response is used to indicate that the service call of the initiating service device is completed.
In a seventh aspect, the present application provides a transaction device based on tangent plane programming, which is applied to a micro-service architecture, and the device includes the apparatus according to the fourth aspect, and/or the apparatus according to the fifth aspect, and/or the apparatus according to the sixth aspect.
In an eighth aspect, the present application provides a transaction processing system based on tangent plane programming, applied to a micro-service architecture, the system including at least one device as described in the above seventh aspect.
In the solution provided by the application, the proxy service device receives the data processing request, and responds to the data processing request to process the data in the database, instead of directly processing the data 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 without communication confirmation with the initiating service equipment or the calling service equipment, so that the communication waiting time is avoided from being too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
Drawings
FIG. 1 is a schematic diagram of a network architecture provided by one embodiment of the present application;
FIG. 2 is a flow diagram of a transaction processing 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 diagram of a transaction processing method provided by another embodiment of the present application;
FIG. 5 is a flow diagram of a transaction processing method provided by another embodiment of the present application;
FIG. 6 is a flow diagram of a transaction processing method provided by another embodiment of the present application;
FIG. 7 is a flow diagram of a data rollback method provided by an embodiment of the present application;
FIG. 8 is a schematic block diagram of a transaction device provided by one embodiment of the present application;
FIG. 9 is a schematic block diagram of a transaction device provided in another embodiment of the present application;
fig. 10 is a schematic block diagram of a transaction processing apparatus according to another embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The network architecture described in the embodiment of the present application is for more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation to the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows, along with the evolution of the network architecture and the appearance of a new business scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
A possible network architecture to which the embodiments of the present application are applicable will be first described with reference to fig. 1.
Please refer to fig. 1, which illustrates a schematic diagram of a network architecture suitable for use in the embodiment of the present application. The network architecture includes: an initiating 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, one initiating service is required to initiate the transaction, and the service controls the transaction and calls other services. And the originating service device 101 refers to a device in which an originating service is deployed. Invoking the service device 102 refers to a device that deploys the service that is invoked by the initiating service. Since a transaction includes a plurality of services executed in sequence according to a preset order, the initiating service device 101 may call the service deployed on the calling service device 102 by calling the service device 102 in the transaction processing, in addition to the initiating service deployed by itself. In addition, the initiating service in different transactions may be the same or different. The same service is the initiating service in one transaction and may be the called service in another transaction. Therefore, 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 invoking 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 initiating service and the called service are deployed on the same device, the initiating service device 101 may call other services deployed by itself during the transaction.
The proxy service device 103 is a device in which a proxy service is deployed, communicates with the initiating service device 101 and the invoking service device 102 through the proxy service, and processes data in a database in response to data processing requests sent by the initiating service device 101 and the invoking service device 102. The services deployed on the initiating service device 101 and the invoking service device 102 no longer directly process data, but are processed collectively by the proxy service. The services deployed on the initiating service device 101 and the invoking service device 102 have respective databases. The proxy service apparatus 103 processes data in different databases for different services.
In a possible embodiment, the proxy service device 103 stores a database of each service, and when responding to the data processing request, the proxy service device 103 directly performs data processing in the stored database.
In another possible implementation, the network architecture further includes: a data storage device. The data storage device stores a database of the various services deployed on the initiating service device 101 and the invoking service device 102. When the proxy service device 103 responds to the data processing request sent by the initiating service device 101 and the calling service device 102, the proxy service device communicates with the data storage device to process data in the corresponding database.
It should be noted that in the micro-service architecture, different services may be deployed on the same device. Therefore, when the initiating service, the called service, and the proxy service are deployed on the same device, the device is used to implement the functions of the initiating service device 101, the calling 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 present application is shown. The method can be applied to a proxy service device in the network architecture shown in fig. 1. The method may include several steps as follows.
Step 201, a data processing request is received.
In the embodiment of the present application, whether the service device is initiated or called, executing the service and implementing the function thereof are actually processing data in a database of the service. For example, new data and modified data are added to the database of the service. In the embodiment of the application, for any service in the transaction, the proxy service device processes data in the database of the service. The initiating service device or the invoking service device is no longer responsible for data processing of the respective service.
Therefore, the initiating 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 the 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 for uniquely indicating a service. The data processing request may be sent from the initiating service device to the proxy service device, or may be sent from the invoking service device to the proxy service device when being invoked by the initiating service device.
Step 202, processing the data in the database of the service indicated by the service identifier according to the data processing request.
After receiving the data processing request, the proxy service equipment can determine a database of the service indicated by the service identifier according to the service identifier in the data processing request. Since the service identifier indicates a service corresponding to the data processing request, and each service corresponds to its respective database one-to-one, there is a correspondence between the service identifier and the database of the service. The proxy service equipment stores the corresponding relation between the service identification and the database. According to the corresponding relation, the proxy service equipment can determine the database corresponding to the service identifier in the data processing request. After determining the database, the agent service equipment performs related data processing according to the data processing request.
Illustratively, the data processing request is sent by an initiating service device, and the initiating service deployed on the initiating service device is a management student roster. As shown in fig. 3, a student roster 301 is stored in the database. The student roster 301 includes a name and a school number. The data processing request is to request that the student information of one new student page three is added to 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, sending a processing completion response to the device sending the data processing request.
And after the data processing is finished, the proxy service equipment returns a processing completion response to the equipment sending the data processing request. The process complete response is used to indicate that the data processing request has been completed.
In the embodiment of the application, the proxy service device receives the data processing request and responds to the data processing request to process the data in the database, and the initiating service device or the calling service device 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 without communication confirmation with the initiating service equipment or the calling service equipment, so that the communication waiting time is avoided from being too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
Referring to fig. 4, a flowchart of a transaction processing method according to an embodiment of the present application is shown. The method may be applied to an originating service device in the network architecture shown in fig. 1. The method may include several steps as follows.
Step 401, sending a data processing request to the proxy service device.
The initiating service device is deployed with the initiating service of the transaction. The service initiating device can control the transaction and call other services, and can also realize the function of self-deployed service initiating. When the function of initiating the service is realized, the initiating service equipment sends a data processing request to the proxy service equipment, so that the proxy service equipment processes data in a database of the initiating service according to the data processing request. The data processing request comprises a service identification, and the service identification is used for indicating the service initiation.
Step 402, receiving a processing completion response sent by the proxy service device.
And after the proxy service equipment completes the 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 data in the database according to the data processing request. The initiating service device does not directly perform data processing any more. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service without communication confirmation with the initiating service equipment, thereby avoiding overlong communication waiting time; moreover, because communication confirmation is not needed, the proxy service equipment can realize the function of initiating the service only by communicating once, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
Referring to fig. 5, a flowchart of a transaction processing method according to an embodiment of the present application is shown. The method can be applied to a calling service device in the network architecture shown in fig. 1. The method may include several steps as follows.
Step 501, receiving a call instruction sent by an initiating service device.
Since the transaction includes a plurality of services executed in sequence according to the preset sequence, the originating service device may need to invoke other services except the originating service in the process of one transaction. At this time, the initiating service device needs to send a call instruction to the calling service device in which the other services are deployed. The calling instruction comprises a service identifier corresponding to a 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 equipment receives the calling instruction sent by the initiating service equipment.
Step 502, sending a data processing request to the proxy service device.
After receiving the calling instruction, the calling service equipment sends a data processing request to the proxy service equipment, so that the proxy service equipment processes data in a database of the called service according to the data processing request. The service identifier included in the data processing request and the service identifier included in the call instruction indicate the same service.
Step 503, receiving the processing completion response sent by the proxy service device.
And after the proxy service equipment completes the 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, sending a call completion response to the initiating service device.
And after determining that the proxy service equipment completes the data processing request, the calling service equipment sends a calling completion response to the initiating service equipment. The call complete response is used to notify the initiating service device that the service call is complete.
In the embodiment of the application, the initiating service device calls the calling service device to send a data processing request to the proxy service device, so that the proxy service device processes 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 without communication confirmation with the calling service equipment, so that the communication waiting time is avoided being too long; moreover, because communication confirmation is not needed, the proxy service equipment can realize the function of the called service only by communicating once, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
Referring to fig. 6, a flowchart of a transaction processing method according to an embodiment of the present application is shown. The method may be applied to the network architecture shown in fig. 1. The method may include several steps as follows.
Step 601, the initiating service device sends a token request to the proxy service device.
The initiating service device initiates the transaction because the initiating service is deployed on the initiating service device. Upon starting a transaction, the initiating service device sends a token request to the proxy service device. The token request is for requesting a transaction token from the proxy service device. The transaction token is used to indicate the transaction initiated by the initiating service device. For example, for the same transaction, the initiating service device a initiates two transactions of the transaction, and the proxy service device generates different transaction tokens for the two transactions: a1 and a 2.
In step 602, the proxy service device generates a transaction token according to the token request.
And after the proxy service equipment receives the token request, generating a corresponding transaction token. The transaction token may be a number, letter, or symbol. The proxy service equipment stores the generated transaction token into a cache so as to be used in the transaction processing process of the subsequent step.
Step 603, the proxy service device sends the 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 sending the token request.
Step 604, the initiating service device sends a data processing request to the proxy service device.
The initiating service device is deployed with the initiating service of the transaction. The service initiating device can control the transaction and call other services, and can also realize the function of self-deployed service initiating. When the function of initiating service is realized, the initiating service equipment sends a data processing request to the proxy service equipment. The data processing request comprises a transaction token indicating the transaction and a service identifier corresponding to the initiated service.
The data processing request may be a data addition request or a data modification request. The data adding request is to request the proxy service device to add data in the database of the corresponding service, and the data modifying 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 addition request, the data processing request further includes addition data. The new data is data to be added to the database corresponding to the 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 a 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 empty, the proxy service device deletes the original data indicated by the second primary key information.
Optionally, the new added data, the second primary key information, and the target data are included in the data processing request in the form of Structured Query Language (SQL) statements. Different data processing requests have different SQL statements.
Optionally, the data processing request further includes a database identifier. The database identification is used to indicate the database of the corresponding service. The agent service equipment can determine the database according to the database identification without storing the corresponding relation between the service identification and the database. When new services need to be developed and deployed, the corresponding relation between the service identification and the database does not need to be updated in the proxy service equipment, and the database identification only needs to be newly added to the deployed service equipment, so that the development and maintenance cost is reduced.
Optionally, the data processing request further includes a data location identifier. The data positioning identifier is used for indicating a data table in which an object of the data processing is specifically located in the database, and/or a row or a column in the data table.
Step 605, according to the data processing request sent by the initiating service device, the proxy service device processes the data in the corresponding database.
There are two types of requests for data processing. Therefore, the processing method of the proxy service device is different for different data processing requests. However, no matter processing the data adding request or the data modifying request, the proxy service device will lock the data of the corresponding service first, and prohibit other transactions from adding or modifying the same data in the database.
During the course of a transaction, the same service may be used in multiple transactions. But there is only one copy of data in the database of a service, so for the same service, only one transaction is allowed to process the same copy of data in its database. When one service in the transaction needs to use the database, if no other transaction uses the same data in the same database, the proxy service equipment locks the data in the database, and other transactions, even the same service, are not allowed to use the same data in the database before the current transaction is ended.
Optionally, the proxy service device may lock the entire database, may lock a data table in which the data being used is located, and may lock a row or a column in the data table in which the data being used is located. When locking the data table in which the data being used is located, other transactions may use the data in other data tables in the database; when a row or column in the data table in which the used data is located is locked, other data in the database may be used by other transactions than the data in the row or column. Compared with the mode of locking the whole database, the mode of locking the specific row in the data table or the table enables different transactions to use different data in the database at the same time, and the processing efficiency of the proxy service equipment during processing a plurality of transactions at the same time can be improved.
For the locking 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 performing data addition or modification in the database. Different services correspond to different locking identifiers, and different services correspond to different service identifiers. Therefore, there is a one-to-one correspondence between service identifiers and lock identifiers.
When the agent service equipment receives a data processing request, detecting whether a locking identifier corresponding to a service identifier in the data processing request is stored; if not, indicating that the database corresponding to the service identifier in the data processing request is not occupied, and locking the database by the proxy service equipment corresponding to the stored transaction token and the locking identifier; if yes, the database corresponding to the service identifier in the data processing request is occupied. 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, it indicates that the database corresponding to the service identifier is occupied by the same transaction, and the proxy service device can perform data processing; if the transaction token is inconsistent with the transaction token in the data processing request, it indicates that the database corresponding to the service identifier is occupied by other transactions, and the proxy service device needs to wait for the end of other transactions.
Illustratively, the proxy service device receives a data processing request, which includes a transaction token A and a service identifier a. The service identifier a corresponds to a lock identifier a 1. The proxy service device detects whether lock identification a1 is stored. If not, the proxy service device corresponds to the storage locking identifier a1 and the transaction token A; if the lock identification a1 is stored, the proxy service device further detects whether the transaction token corresponding to the lock identification a1 is a. If yes, the proxy service equipment performs subsequent data processing; if not, the proxy service device waits for the lock identification a1 to end the transaction indicated by the transaction token.
The processing method of the proxy service device is different for different data processing requests. When the proxy server apparatus processes the data addition request, step 605 includes the following sub-steps.
In step 605a, the proxy service device sends the new data to the data storage device.
And after locking the database corresponding to the service identifier, the proxy service equipment sends the new data in the data adding request to the data storage equipment where the database is located.
Step 605b, after the data storage device stores the newly added data, the data storage device sends the first primary key information to the proxy service device.
And after receiving the new data sent by the proxy service equipment, the data storage equipment stores the new data in a corresponding database and sends the first primary key information generated after storing the new data to the proxy service equipment. Each piece of data in the database corresponds to a piece of primary key information for uniquely indicating a piece of data in the database. The first primary key information indicates newly added data in the data processing process.
Illustratively, the data stored in the database is student information, which is shown in Table-1 below
Name (I) Number learning Primary key information
Wangsan
001 W1
Li four 002 L2
Zhang three 003 Z3
TABLE-1
In the student information shown in the above table-1, each piece of student information includes the name and the school number of the student. And each piece of student information also corresponds to one piece of primary key information.
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 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 in the database corresponding to the service identifier according to the data new-adding request, then obtains the first primary key information, and correspondingly stores the first primary key information and the transaction token.
When the proxy service device receives the data modification request, different processing methods are adopted. When the proxy service device processes a data modification request, step 605 includes the following sub-steps.
Step 605A, the proxy service device sends the 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 a rollback operation when the transaction occurrence operation indicated by the transaction token fails. The original data request comprises second primary key information used for indicating original data.
Step 605C, the data storage device sends the original data to the proxy service device.
And the data storage equipment determines the original data requested by the proxy service equipment according to the second primary key information and returns the original data to the proxy service equipment. Correspondingly, after the proxy service equipment receives the original data, the transaction token, the original data and the second primary key information are correspondingly stored.
Step 605D, the proxy service device sends the target data to the data storage device.
After storing the original data, the proxy service device sends the target data to the data storage device.
Step 605E, the data storage device modifies the original data into the target data.
And after the data storage equipment receives the target data sent by the data storage equipment, modifying the original data into the target data. And after the modification is completed, returning an update response to the proxy service equipment to inform the proxy service equipment of the completion of the data modification.
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 equipment, the proxy service equipment directly obtains the original data from the database corresponding to the service identifier according to the second main key information, and modifies the original data into the target data. In addition, the proxy service device also correspondingly stores the transaction token, the original data and the second primary key information.
In step 606, the proxy service device returns a process complete response to the initiating service device.
After the data processing is completed, the proxy service equipment returns a processing completion response to the initiating service equipment to inform the initiating service equipment that the data processing request sent by the initiating service equipment is completed. And when the data processing request sent by the initiating service equipment is a data adding request, the processing completion response comprises first primary key information corresponding to the added data.
Step 607, the initiating service device sends a call instruction to the calling service device.
Since the transaction includes a plurality of services executed in sequence according to the preset sequence, the originating service device may need to invoke other services except the originating service in the process of one transaction. At this time, the initiating service device needs to send a call instruction to the calling service device in which the other services 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 calling instruction comprises a service identifier corresponding to a service to be called by the initiating service equipment.
Step 608, the calling service device sends a data processing request to the proxy service device.
Step 609, according to the data processing request sent by the calling service equipment, the proxy service equipment processes the data in the corresponding database.
In step 610, the proxy service device returns a processing completion response to the calling service device.
The method for 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 for initiating the service device to perform data processing through the proxy service device in the above steps 604 to 606. Please refer to the contents of step 604 to step 606 for details, which are not described herein again.
Step 611, the calling service device sends a call completion response to the initiating service device.
And after determining that the proxy service equipment completes the data processing request, the calling service equipment sends a calling completion response to the initiating service equipment. The call complete response is used to notify the initiating service device that the service call is complete. And when the data processing request sent by the calling service equipment is a data adding request, the calling completion response comprises first primary key information corresponding to the added data.
Step 612, the initiating service device sends a transaction ending instruction to the proxy service device.
And when the initiating service equipment determines that the services in the transaction are successfully executed according to the preset sequence, sending a transaction ending instruction to the proxy service equipment to end the processing of the transaction. The transaction ending instruction comprises a transaction token indicating the current transaction.
It should be noted that, in the embodiment of the present application, the transaction initiated by the service initiating device includes executing the service initiating device first, and then executing a calling service. But do not limit the type, amount, and order of execution of services in the transaction. In practical applications, the service types, the number and the execution sequence of different transactions are different. For example, in transaction a, the initiating service a is executed first, then the calling service B is executed, and finally the calling service C is executed, while in transaction B, the calling service B is executed first, and in the executing initiating service a, the calling service D is executed finally. Therefore, although the embodiment of the present application only describes a case where the initiating service is executed first and then the calling service is executed, the embodiment of the present application does not limit the type, the number, and the execution sequence of the services in the transaction process.
Step 613, the proxy service device deletes the corresponding stored transaction token and the locking identifier according to the transaction ending instruction.
After the agent service device receives the transaction ending instruction, it is determined that each service in the transaction initiated by the initiating service device has been successfully completed, and the data of each database locked in the transaction processing process needs to be unlocked. In the data processing process, the proxy service device correspondingly stores the transaction token and the locking identifier, so that the proxy service device deletes the correspondingly stored transaction token and the locking identifier according to the transaction token in the transaction ending instruction, and unlocks the locked data. After the unlocking is completed, the physical service equipment informs the initiating service equipment that the unlocking is successful, and the transaction processing is finished.
Illustratively, in the transaction process, the proxy service device locks a database of 2 services, and then stores 2 service locking identifiers: a1 and b1, and is stored corresponding to the transaction token A of the present transaction. Then it is. When the proxy service equipment receives a transaction ending instruction comprising a transaction token A, the proxy service equipment determines a locking identifier which is correspondingly stored by the transaction token A: a1 and b1, delete transaction token A, and lock identification: a1 and b1, unlocking the database of the 2 services and ending the transaction.
In the embodiment of the application, the proxy service device receives the data processing request and responds to the data processing request to process the data in the database, and the initiating service device or the calling service device 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 without communication confirmation with the initiating service equipment or the calling service equipment, so that the communication waiting time is avoided from being too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
In addition, in the scheme provided by the application, the data processing, data rollback and other operations are realized by the proxy service device by utilizing the principle of tangent plane programming. Therefore, when each service is deployed, technicians do not need to write the function codes of respective data processing and rollback data for each service, and only need to write the function codes uniformly on proxy service equipment, so that the development and maintenance cost is reduced.
In the transaction processing process, when the proxy service device processes a data processing request of any service in the transaction, an abnormal condition may occur, which may cause the transaction processing to fail. Because the transaction comprises a plurality of services executed in sequence according to the preset sequence, when one service is abnormal, the whole transaction is abnormal. At this time, data rollback needs to be performed on data that has already been serviced during the transaction process, and the data in the database is restored 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 include several steps as follows.
Step 701, when the data processing is abnormal, the proxy service device sends an abnormal response to the initiating service device.
The abnormal data processing means that the abnormal data processing performed by the proxy service device according to the data processing request occurs. For example, when data is newly added, the newly added data is lost, resulting in failure to add data, or when data is modified, update data is lost, resulting in failure to modify, and the like. At this time, the proxy service device sends an exception response to the initiating service device to notify the initiating service device that the data processing is abnormal, and the transaction processing fails. When the data processing request is directly sent by the initiating service device, the proxy service device directly sends an abnormal response to the initiating service device. When the data processing request is sent by a calling service device called by the initiating service device, the proxy service device forwards the abnormal response to the initiating service device through the calling service device.
Step 702, the initiating service device sends a rollback instruction to the proxy service device.
After receiving the abnormal response, the initiating service device determines that the transaction fails and needs to roll back the data. Accordingly, a rollback instruction is sent to the proxy service device. The rollback instruction includes a transaction token.
And 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 main key information, second main key information and original data corresponding to the transaction token according to the transaction token in the rollback instruction. And the proxy service equipment restores the data in the database subjected to the data processing in the transaction processing process to the data before the transaction processing. And for the database subjected to the newly added data, the proxy service equipment deletes the corresponding data according to the first main key information. 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 another data storage device, the primary key information and the original data corresponding to the transaction token 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. And after the data storage device recovers the data, sending a rollback completion response to the proxy service device, and informing the proxy service device that the data rollback operation is completed.
Step 704, the proxy service device deletes the corresponding stored transaction token and lock identification.
After determining that the operation of rolling back the data is completed, the proxy service device needs to unlock the data of the database of each service locked in the transaction processing process. In the data processing process, the proxy service device correspondingly stores the transaction token and the locking identifier, so that the proxy service device deletes the correspondingly stored transaction token and the 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 the unlocking is completed, the proxy service equipment sends a rollback success response to the initiating service equipment, informs the initiating service equipment that the rollback is completed and the unlocking is successful, and ends the transaction processing.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 8 is a schematic block diagram illustrating a transaction device in accordance with an exemplary embodiment. The device has the function of realizing the method of the proxy service equipment side, and the function can be realized by hardware or by hardware executing corresponding software. 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, and 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, configured to send a processing completion response to the device that sent the data processing request, where the processing completion response is used to indicate that the data processing request is completed.
In the apparatus provided in the embodiment of the present application, the proxy service device receives the data processing request, and responds to the data processing request to process the data in the database, instead of directly processing the data by the originating service device or the calling service device. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service without communication confirmation with the initiating service equipment or the calling service equipment, so that the communication waiting time is avoided from being too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
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 initiating service device.
Optionally, the first processing module 802 is further configured to detect whether a locking identifier corresponding to the service identifier is stored, where 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 addition request, where the data addition request includes: and adding new 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 second primary 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 identification 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 identification.
Optionally, the first sending module 803 is further configured to send an exception response to the initiating service device when data processing is abnormal, where the exception response is used to notify the initiating service device that the data processing is abnormal. The first receiving module 801 is further configured to receive a rollback instruction sent by the initiating service device, where the rollback instruction includes the transaction token. The first processing module 802 is further configured to restore, according to the rollback instruction, data in the database to data before transaction processing starts; and deleting the correspondingly stored transaction token and the locking identification.
Optionally, the first processing module 802 is further configured to delete the correspondingly stored transaction token and the lock identifier when a transaction end instruction sent by the initiation service device is received, where the transaction end instruction includes the transaction token.
Fig. 9 is a schematic block diagram illustrating a transaction device in accordance with an exemplary embodiment. The device has the function of realizing the method of the initiating service device side, and the function can be realized by hardware or by hardware executing corresponding software. The apparatus may include: a second sending 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 services indicated by the service identifier, where the service identifier is used to uniquely indicate a service.
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 apparatus provided in the embodiment of the present application, the initiating service device sends a data processing request to the proxy service device, so that the proxy service device processes data in the database according to the data processing request. The initiating service device does not directly perform data processing any more. Therefore, the proxy service equipment can directly determine whether to perform data processing related to the service without communication confirmation with the initiating service equipment, thereby avoiding overlong communication waiting time; moreover, because communication confirmation is not needed, the proxy service equipment can realize the function of initiating the service only by communicating once, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
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 called by the service device. The second receiving module 902 is further configured to receive a call completion response sent by the calling service device, where the call completion response is used to indicate that the service call of the initiating service device is completed.
Optionally, the second sending module 901 is further configured to send a rollback instruction to the proxy service device when receiving an abnormal response sent by the proxy service device, where the abnormal 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 starts.
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 illustrating a transaction device in accordance with an exemplary embodiment. The device has the function of realizing the method for calling the service equipment side, and the function can be realized by hardware or by hardware executing corresponding software. 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 called by the initiating service device, and 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 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 1002 is further configured to send a call completion response to the initiating service device, where the call completion response is used to indicate that the service call of the initiating service device is completed.
In the apparatus provided in the embodiment of the present application, the initiating service device invokes, and the invoking service device sends the data processing request to the proxy service device, so that the proxy service device processes 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 without communication confirmation with the calling service equipment, so that the communication waiting time is avoided being too long; moreover, because communication confirmation is not needed, the proxy service equipment can realize the function of the called service only by communicating once, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
An exemplary embodiment of the present application provides a transaction processing device based on tangent plane programming, which is applied to a micro-service architecture. The apparatus comprises a device as described in the embodiment of fig. 8 above, and/or a device as described in the embodiment of fig. 9 above, and/or a device as described in the embodiment of fig. 10 above, having functionality to implement the above-described method examples.
Another exemplary embodiment of the present application provides a transaction processing system based on tangent plane programming, which is applied to a micro-service architecture, and the system includes at least one device as described in the above device embodiment.
In the system 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 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 without communication confirmation with the initiating service equipment or the calling service equipment, so that the communication waiting time is avoided from being too long; moreover, because communication confirmation is not needed, the proxy service equipment only needs to communicate once in each service execution process, thereby reducing the communication times, shortening the communication time and improving the operation efficiency of the transaction processing system.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program or an intelligent contract is stored, and the computer program or the intelligent contract is loaded and executed by a node to implement the transaction processing method provided by the above-described embodiment. Alternatively, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Those skilled in the art will clearly understand that the techniques in the embodiments of the present application may be implemented by way of software plus a required general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be essentially implemented or a part contributing to the prior art may be embodied 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., and includes several instructions for enabling 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 variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. A transaction processing method based on tangent plane programming 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 initiating service equipment or calling service equipment, wherein the data processing request comprises a service identifier which is used for uniquely indicating a service;
processing data in a database of the service indicated by the service identification according to the data processing request;
and sending a processing completion response to the equipment 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 before receiving the data processing request sent by the initiating service device or the invoking service device, the method further comprises:
receiving a transaction token request sent by the initiating service device, wherein the transaction token request is used for requesting a transaction token which 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 equipment.
3. The method of claim 2, wherein the data processing request further comprises the transaction token;
before the processing the data in the database of the service indicated by the service identification, the method further includes:
detecting whether a locking identifier corresponding to the service identifier is stored or not, wherein the locking identifier indicates that data of a 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.
4. The method of claim 3, wherein the data processing request is a data addition request, and the data addition request comprises: newly adding data;
the processing the 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.
5. The method of claim 3, wherein the data processing request is a data modification request, and wherein the data modification request comprises: second primary key information and target data, wherein the second primary key information is used for indicating original data to be modified;
the processing data in the database of the service indicated by the service identification comprises:
acquiring the original data from a database of the service indicated by the service identification 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 identification.
6. The method according to any one of claims 2-5, further comprising:
when data processing is abnormal, sending an abnormal response to the initiating service equipment, wherein the abnormal response is used for informing the initiating service equipment that the data processing is abnormal;
receiving a rollback instruction sent by the initiating service device, wherein the rollback instruction comprises the transaction token;
restoring the data in the database into the data before the transaction processing starts according to the rollback instruction;
and deleting the correspondingly stored transaction token and the locking identification.
7. The method according to any one of claims 2 to 5, wherein after sending a processing completion response to the device that sent the data processing request, further comprising:
and when a transaction ending instruction sent by the initiating service equipment is received, deleting the correspondingly stored transaction token and the correspondingly stored locking identification, wherein the transaction ending instruction comprises the transaction token.
8. A transaction processing method based on tangent plane programming is applied to a micro-service architecture, and is characterized in that the method comprises the following steps:
sending a data processing request including a service identification to a proxy service device so that the proxy service device processes data in a database of services indicated by the service identification, wherein the service identification 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.
9. The method of claim 8, wherein before sending the data processing request including the service identifier to the proxy service device, the method further comprises:
sending a transaction token request to the proxy service equipment, wherein the transaction token request is used for requesting a transaction token which is used for indicating a transaction initiated by the initiating service equipment;
and receiving the transaction token sent by the proxy service equipment.
10. The method of claim 9, further comprising:
sending a calling instruction to calling service equipment, wherein the calling instruction comprises a service identifier corresponding to a service called by the service initiating 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.
11. The method according to any one of claims 9 or 10, further comprising:
and when receiving an abnormal response sent by the proxy service equipment, sending a rollback instruction to the proxy service equipment, wherein the abnormal response is used for informing the initiating service equipment that data processing is abnormal, and the rollback instruction is used for indicating the proxy service equipment to restore the data in the database to the data before the start of transaction processing.
12. The method according to any one of claims 9 or 10, wherein after receiving the processing completion response sent by the proxy service device, the method further comprises:
and sending a transaction ending instruction to the proxy service equipment, wherein the transaction ending instruction comprises the transaction token.
13. A transaction processing method based on tangent plane programming is applied to a micro-service architecture, and is characterized in that the method comprises the following steps:
receiving a calling instruction sent by 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;
sending a data processing request to a proxy service device so that the proxy service device processes data in a database of the service indicated by the service identification;
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;
and sending a call completion response to the initiating service equipment, wherein the call completion response is used for indicating that the service call of the initiating service equipment is completed.
14. A transaction processing device based on section programming, applied to a micro-service architecture, the device comprising:
the system comprises a first receiving module, a second receiving module and a first sending module, wherein the first receiving module is used for receiving a data processing request sent by an initiating service device or a calling service device, 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 data in a 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 sending the data processing request, wherein the processing completion response is used for indicating that the data processing request is completed.
15. A transaction processing device based on section 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 as to enable the proxy service equipment to process data in a database of the service indicated by the service identifier, wherein the service identifier is used for uniquely indicating a service;
and a second receiving module, 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.
16. A transaction processing device based on section programming, applied to a micro-service architecture, the device comprising:
a third receiving module, configured to receive a call instruction sent by an initiating service device, where the call instruction includes a service identifier corresponding to a service called by the initiating service device, and the service identifier is used to uniquely indicate 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 initiating service device, where the call completion response is used to indicate that the service call of the initiating service device is completed.
17. Transaction device based on section programming, applied to a microservice architecture, characterized in that it comprises an apparatus according to claim 14, and/or an apparatus according to claim 15, and/or an apparatus according to claim 16.
18. Transaction system based on tangent plane programming, applied to micro-service architecture, characterized in that it comprises at least one device according to claim 17.
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 true CN111240851A (en) 2020-06-05
CN111240851B 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 (6)

* 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
US20170286150A1 (en) * 2014-12-24 2017-10-05 Huawei Technologies Co., Ltd. Transaction Processing Method and Apparatus, and Computer System
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

Patent Citations (6)

* 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
US20170286150A1 (en) * 2014-12-24 2017-10-05 Huawei Technologies Co., Ltd. Transaction Processing Method and Apparatus, and Computer System
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
CN111240851B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
US6216126B1 (en) Method for transaction within a distributed database
CN108491252B (en) Distributed transaction processing method and distributed system
CN110032428B (en) Method and device for executing distributed transaction
CN105512266A (en) Method and device for achieving operational consistency of distributed database
JPH05173988A (en) Decentralized processing system and transaction processing system applied to the same
CN112491959B (en) Cross-link resource exchange method, device and system based on relay link
CN110888893A (en) Order processing method based on micro-service e-commerce system
CN106155775B (en) Message processing method, device and system
CN109862102B (en) Distributed data multi-copy concurrency control system, server and method
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
CN112596801A (en) Transaction processing method, device, equipment, storage medium and database
CN107465725B (en) Heterogeneous long transaction processing system and method based on client information control system
CN112559496B (en) Method and device for realizing transaction atomicity of distributed database
CN113836155A (en) Data processing method and device based on distributed system and storage medium
CN111143041B (en) Data consistency method, distributed coordinator and central coordinator
CN111240851B (en) Transaction processing method, device, equipment and system based on tangent plane programming
CN112598520B (en) Transaction management method, device, electronic equipment and storage medium
CN114356888A (en) Transaction processing method and device, storage medium and electronic equipment
CN115145997A (en) Distributed transaction implementation method and distributed system
GB2335516A (en) Failure recovery in distributed transaction avoids heuristic damage
CN112434007A (en) Database transaction group submitting method, device, equipment and storage medium
CN117453750B (en) Data processing method, device, electronic equipment and storage medium
CN116775325A (en) Distributed transaction processing method and system
CN114217910A (en) Data processing method, device and system

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
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.

GR01 Patent grant
GR01 Patent grant