WO2016155332A1 - 一种服务器和数据处理方法 - Google Patents

一种服务器和数据处理方法 Download PDF

Info

Publication number
WO2016155332A1
WO2016155332A1 PCT/CN2015/095169 CN2015095169W WO2016155332A1 WO 2016155332 A1 WO2016155332 A1 WO 2016155332A1 CN 2015095169 W CN2015095169 W CN 2015095169W WO 2016155332 A1 WO2016155332 A1 WO 2016155332A1
Authority
WO
WIPO (PCT)
Prior art keywords
data server
data
request
server
layer service
Prior art date
Application number
PCT/CN2015/095169
Other languages
English (en)
French (fr)
Inventor
曾建国
秦翼
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP15887285.3A priority Critical patent/EP3270298A4/en
Publication of WO2016155332A1 publication Critical patent/WO2016155332A1/zh
Priority to US15/719,768 priority patent/US20180025049A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0686Additional information in the notification, e.g. enhancement of specific meta-data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/84Using snapshots, i.e. a logical point-in-time copy of the data

Definitions

  • the present invention relates to computer communication technologies, and in particular, to a server and a data processing method.
  • pre-commit means that all operations in the transaction are executed in the cache. If all operations are successful, then “submit”, otherwise “rollback”; “commit” means writing data to the database; “rollback” is Refers to clearing the cache and reverting to pre-commit data.
  • a persistence layer service that shields different database deployment forms, version differences, and/or database providers to provide a uniform interface to the application for accessing the database.
  • Figure 1 shows a typical architecture for providing persistence layer services to application services in a cloud service scenario.
  • the application service (App Service) sends a request to the persistence layer service of the cloud, and the persistence layer service provides a service to the application in response to the request of the application service.
  • the cloud service developer provides the persistence layer service, but the provided persistence layer service usually does not have the function of transaction management. This is because: the persistence layer service needs to be compatible with different types of databases, but different types of databases implement different transaction management functions. If the persistence layer service provides transaction management functions, the transaction management implementation mechanism for different databases, the persistence layer service. Adaptation is required, and some databases do not have transaction management capabilities, which increases the difficulty of the persistence layer service to provide transaction management functions.
  • the common implementation of the persistence layer service is: the persistence layer service itself through the non-relational database, and the storage area network (SAN) or network storage Network Attached Storage (NAS) together provide scalable data storage capabilities without the use of traditional relational databases to organize data.
  • SAN storage area network
  • NAS network storage Network Attached Storage
  • the persistence layer service implements the transaction management function itself, it needs to consume additional data processing resources.
  • the occupied data processing resources are large, if the data processing resources available to the persistent layer service are limited, the persistent layer service may be used. It has its own impact.
  • An embodiment of the present invention provides a server and a data processing method, which are used to provide a simple solution for implementing transaction management in a cloud service scenario where a persistent service provided by a cloud service developer does not have a transaction management function. To reduce the complexity of application service implementation.
  • an embodiment of the present invention provides a second data server, where the second data server has a communication connection with a first data server and one or more application servers; and the one or more application servers are used to provide an application.
  • the first data server is configured to provide a first persistence layer service, the first data server includes first data
  • the second data server is configured to provide a second persistence layer service, the second data server Included in the second data, the second data includes the same data as the first data;
  • the second data server provides a second application interface API to the one or more application servers, the one or more
  • the application server requests the first data layer service from the first data server by calling the second API;
  • the first data server provides a first API to the second data server, the second data server Requesting the first persistence layer service by calling the first API;
  • the second data server includes:
  • the second interface is configured to provide the second API, and receive a first operation request sent by the one or more application servers by calling the second API, where the first operation request is used to request to perform at least An operation, the at least one operation belongs to the same transaction;
  • the transaction management module is configured to determine that the first operation request is for requesting the first After the at least one operation is performed by the persistence layer service, performing the at least one operation on the second data; if each operation is successful, generating a second operation request, where the second operation request is used to request the opposite Determining the first data to perform the at least one operation;
  • the first interface is configured to invoke the first API to send the second operation request to the first data server.
  • the transaction management module is specifically configured to: when determining that the first operation request is used to request the first persistence layer service to perform the at least one operation, specifically :
  • the first persistence layer service performs the at least one operation.
  • the transaction management module is further configured to:
  • the second data is rolled back to a state before the performing the at least one operation.
  • the transaction management module is configured to perform each of the at least one operation on the second data, to:
  • Decomposing the at least one operation comprising: decomposing operations of the at least one operation for the plurality of resource objects into a plurality of atomic operations for a single resource object, the resource object being a resource object managed by the first persistence layer service, the atomic operation being an operation that is inseparable from a resource object managed by the first persistence layer service;
  • the transaction management includes: recording, for each atomic operation obtained by the disassembling process, a type of the atomic operation, and a resource object targeted by the atomic operation Identifying a correspondence between the transaction identifiers of the same transaction and each of the atomic operations obtained by the disassembly process.
  • the transaction management module is specifically configured to: when the second data is rolled back to a state before performing each of the at least one operation:
  • the second data is rolled back to a state before each of the at least one operation is performed according to the correspondence recorded in the transaction.
  • the transaction management module is configured to: remove the transaction identifier of the same transaction in the first operation request to generate the second operation request, when the second operation request is generated.
  • the transaction management module is further configured to: if the at least one operation fails, generate a failure response for the first operation request, where the failure response is used to indicate that the at least one operation fails to be performed;
  • the second interface is further configured to: send the failure response to the one or more application servers.
  • the failure response includes at least one of the following information that is not performed successfully in the at least one operation:
  • the second data server and the The first data server is the same server; or
  • the second data server and the first data server are different servers; or
  • the application server and the second data server are the same server.
  • the second data server and the first data server are different servers;
  • the first data server and the second data server are cloud servers, and the first data server and the second data server are carried on different virtual machine VMs.
  • an embodiment of the present invention is an application server, where the second data server has a communication connection with the first data server and one or more of the application servers; the application server is configured to provide an application service; the first data The server is configured to provide a first persistence layer service, where the first data server includes first data; the second data server provides a second application program interface API to one or more of the application servers, one or more The application server requests the first data layer service from the first data server by calling the second API; the first data server provides a first API to the second data server, the second data server Requesting the first persistence layer service by calling the first API;
  • the application server includes:
  • An operation request generating module configured to generate a first operation request, and instructing the first operation request to request the first persistence layer service to perform at least one operation, the at least one operation belongs to the same transaction, the first
  • the operation request includes indication information for indicating that the first operation request is used to request the first persistence layer service;
  • An interface configured to invoke the second API, to send the first operation request to the second data server, to instruct the second data server to perform the at least one operation on the second data; If the operation is successful, generating a second operation request, and sending the second operation request to the first data server by calling the first API, where the second operation request is used to request the first data Performing the at least one operation.
  • the indication information that is used to indicate that the first operation request is used to request the first persistent layer service includes:
  • the first operation request is further configured to instruct the second data server to roll back the second data to a state before the performing the at least one operation when the at least one operation fails.
  • the first possible implementation manner of the second aspect, or the second possible implementation manner, in a third possible implementation manner includes the transaction of the same transaction Logo.
  • the interface is further configured to:
  • the failure response is used to indicate that the at least one operation fails to execute.
  • the failure response includes at least one of the following information that is not performed successfully in the at least one operation:
  • the application server and the second The data server is the same server.
  • an embodiment of the present invention provides a data processing method, which is applied to a second data server, where the second data server has a communication connection with a first data server and one or more application servers; Providing an application service; the first data server is configured to provide a first persistence layer service, the first data server includes first data; and the second data server is configured to provide a second persistence layer service, The second data server includes second data, the second data includes the same data as the first data; the second data server provides a second application program interface API to the application server, where the application server is invoked The second API Requesting the first persistence layer service from the first data server; the first data server providing a first API to the second data server, the second data server requesting by calling the first API a first persistence layer service; the method comprises:
  • the second data server If each operation is successful, the second data server generates a second operation request, and sends the second operation request to the first data server by calling the first API, where the second operation The request is for requesting to perform the at least one operation on the first data.
  • the second data server determines that the first operation request is used to request the first persistent layer service to perform the at least one operation, including:
  • An operation request is for requesting the first persistence layer service.
  • the method further includes:
  • the second data server rolls back the second data to a state before the performing the at least one operation.
  • each of the at least one operation on the second data including:
  • the resource object is a resource pair managed by the first persistence layer service
  • the atomic operation is an operation that is not subdividable for resource objects managed by the first persistence layer service
  • the second data server performs transaction management on the atomic operation obtained after the disassembling process, and the transaction management includes: recording, for each atomic operation obtained by the disassembling process, a type of the atomic operation, the atomic operation Corresponding relationship between the identifier of the resource object targeted and the transaction identifier of the same transaction; and performing each atomic operation obtained by the disassembly process.
  • the second data server the second data to a state before performing each of the at least one operation, including:
  • the second data server rolls back the second data to a state before performing each of the at least one operation according to the correspondence recorded in the transaction.
  • the generating, by the second data server, the second operation request includes: deleting, by the second data server, a transaction identifier of the same transaction in the first operation request to generate the second operation request.
  • the method further includes: if the at least one operation fails, the second data server sends a failure response to the one or more application servers for the first operation request, the failure response is used to indicate The at least one operation fails to execute.
  • the failure response includes at least one of the following information that is not performed successfully in the at least one operation:
  • the first server and the second data The server is a cloud server, and the first data server and the second data server are carried on different virtual machine VMs.
  • an embodiment of the present invention provides a data processing method, which is applied to one or more application servers, where the second data server has a communication connection with the first data server and the one or more application servers; Or a plurality of application servers for providing an application service; the first data server is configured to provide a first persistence layer service, the first data server includes first data; and the second data server provides the application server a second application interface API, the one or more application servers requesting the first data persistence service from the first data server by calling the second API; the first data server to the second data
  • the server provides a first API, and the second data server requests the first persistence layer service by calling the first API; the method includes:
  • the one or more application servers generate a first operation request, the first operation request is used to request the first persistence layer service to perform at least one operation, the at least one operation belongs to the same transaction, the first operation
  • the request includes indication information for indicating that the first operation request is used to request the first persistence layer service;
  • the one or more application servers send the first operation request to the second data server by invoking the second API to indicate the second data server:
  • the second operation request is for requesting to perform the at least one operation on the first data.
  • the indication information that is used to indicate that the first operation request is used to request the first persistent layer service includes:
  • the method further includes:
  • the first operation request is further configured to instruct the second data server to roll back the second data to a state before the performing the at least one operation when the at least one operation fails.
  • the first possible implementation manner of the fourth aspect, or the second possible implementation manner, in a third possible implementation manner includes the transaction of the same transaction Logo.
  • the method further includes:
  • the failure response is used to indicate that the at least one operation fails to execute.
  • the failure response includes at least one of the following information that is not performed successfully in the at least one operation:
  • the first data server and the second data server are cloud servers, and the first data server and the second data server are carried on different virtual machine VMs.
  • the embodiments of the present invention provide a server and a data processing method, which provide a unified transaction management for different application services by providing a persistence layer service with transaction management function between an application service and a persistent layer service in the cloud.
  • the ability to implement transaction management without individual application services reduces the complexity of application service implementation.
  • the persistence layer service with transaction management function implements transaction management, and multiple application services can implement transaction management functions through the persistence layer service, thereby avoiding redundant development and configuration caused by repeated implementation of transaction management functions on various application services. And the compatibility issues that come with it.
  • the application service is also prevented from directly sending an operation request to the persistent layer service of the cloud.
  • the cloud service does not have the transaction management function, and the data cannot be restored to the state before the operation is performed.
  • the persistence layer service with transaction management function performs data rollback when transaction management fails, and ensures data consistency between the persistence layer service with transaction management function and the persistence layer service of the cloud.
  • the persistence layer service with transaction management function is also located in the cloud, and the cloud server including the persistent layer service is carried on a different virtual machine (VM) from the cloud server including the original cloud persistent layer service.
  • VM virtual machine
  • the cloud-based VM implements a persistence layer service with transaction management function, which can realize data resource allocation on demand; on the other hand, it is persistent with the original cloud because of the cloud server including the persistence layer service with transaction management function.
  • the cloud server of the layer service is carried on different VMs. This avoids the implementation of the data processing resource of the original persistence layer service by the persistence layer service with transaction management function, and avoids the impact on the original persistence layer service.
  • FIG. 1 is a typical network architecture diagram of providing a persistence layer service to an application service in a cloud service scenario
  • FIG. 2 is a structural diagram of a network for providing a persistent layer service with a transaction management function to an application service according to an embodiment of the present invention
  • 3A-3C are schematic diagrams of three alternative implementations of the network shown in FIG. 2;
  • FIG. 4 to FIG. 6 are schematic diagrams of three manners for implementing a transaction management function according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a first type of second data server according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a second second data server according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a first application server according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a second application server according to an embodiment of the present disclosure.
  • FIG. 11 is a flowchart of a first data processing method according to an embodiment of the present invention.
  • FIG. 12 is a flowchart of a second data processing method according to an embodiment of the present invention.
  • FIG. 13 is a network architecture diagram of Embodiment 1 of the present invention.
  • FIG. 14 is a structural component diagram of a persistence layer service in a cloud environment according to Embodiment 1 of the present invention.
  • FIG. 15 is an internal structural diagram of a transaction service in a persistence layer service according to Embodiment 1 of the present invention.
  • FIG. 16 is a flowchart of processing a persistent layer service according to Embodiment 1 of the present invention.
  • An embodiment of the present invention provides a server and a data processing method, which are used to provide a simple solution for implementing transaction management in a cloud service scenario where a persistent service provided by a cloud service developer does not have a transaction management function. To reduce the complexity of application service implementation.
  • the application is implemented by providing a persistent layer service with transaction management function between the application service and the persistent layer service of the cloud.
  • Service-to-transaction management eliminates the need for application services to implement transaction management, reducing the complexity of application service implementation.
  • the persistence layer service with transaction management function implements transaction management, and multiple application services can implement transaction management functions through the persistence layer service, thereby avoiding redundancy development and configuration caused by repeated implementation of transaction management functions on various application services.
  • the application service is also prevented from directly sending an operation request to the persistent layer service of the cloud.
  • the cloud service does not have the transaction management function, and the data cannot be restored to the state before the operation is performed.
  • the persistence layer service with transaction management function performs data rollback when transaction management fails, and ensures data consistency between the persistence layer service with transaction management function and the persistence layer service of the cloud.
  • the persistence layer service with transaction management function is also located in the cloud, and the cloud server including the persistent layer service is carried on a different VM from the cloud server including the original cloud persistent layer service.
  • the cloud-based VM implements a persistence layer service with transaction management function, which can realize data resource allocation on demand; on the other hand, it is persistent with the original cloud because of the cloud server including the persistence layer service with transaction management function.
  • the cloud server of the layer service is carried on different VMs. This avoids the implementation of the data processing resource of the original persistence layer service by the persistence layer service with transaction management function, and avoids the impact on the original persistence layer service.
  • the network architecture of the persistence layer service with the transaction management function is provided to the application service in the embodiment of the present invention, and then three optional implementation manners of the network architecture are introduced respectively.
  • the data server and the application server are finally introduced.
  • the data processing method provided by the embodiment of the present invention is finally introduced.
  • FIG. 2 is a network architecture diagram of providing a persistence layer service with transaction management function to an application service according to an embodiment of the present invention.
  • the network 20 includes: a first data server 203, a second data server 202, and one or more application servers 201; wherein the second data server 202 and the first data server 203 and the one or more Application servers 201 have communication connections;
  • One or more application servers 201 are used to provide application services
  • the first data server 203 is configured to provide a first persistence layer service, where the first data is included;
  • the second data server 202 is configured to provide a second persistence layer service, where the second data includes second data, and the second data includes the same data as the first data;
  • the second data server 202 provides a second application program interface (API) to the one or more application servers 201, and the application server 201 requests the first data server to request the first persistence layer service by calling the second API;
  • API application program interface
  • the first data server 203 provides a first API to the second data server 202, and the second data server 202 requests the first persistence layer service by invoking the first API.
  • the application server 201 is configured to generate a first operation request and indicate the first operation request For requesting a first persistence layer service, the first operation request is for requesting to perform at least one operation, the at least one operation belongs to the same transaction; and sending the first operation request to the second data server 202 by calling the second API;
  • a second data server 202 configured to receive a first operation request sent by the application server 201, where the second data server determines that the first operation request is used to request the first persistence layer service to perform the at least one operation Performing at least one operation on the second data; if each operation is successful, generating a second operation request, and sending a second operation request to the first data server 203 by calling the first API, where the second operation request Used to request to perform the at least one operation on the first data;
  • the first data server 203 is configured to receive a second operation request sent by the second data server 202, and process the first data in the self according to the second operation request;
  • the second data in the second data server 202 is consistent with the first data in the first data server 203.
  • the second data server 202 may copy the first data to generate the second data before providing the service to the application server 201.
  • the first data in the first data server 203 and the second data in the second data server 202 may be data stored on the power-down storage medium, and after the power-down storage medium is powered off, on the storage medium The data will not be lost.
  • the data organization of the first data and the second data may be various, including but not limited to: a database, a file, a memory, and the like.
  • the application service provided by the application server 201 may be provided by the application developer, the first persistent layer service provided by the first data server 203 may be provided by the cloud service developer, and the second persistent layer service provided by the second data server 202 may be provided by the third party. Provided by the developer or cloud service developer.
  • the sending manner that the application server 201 can use when sending the first operation request includes but is not limited to the following three modes:
  • the transaction identifier (TransactionId) of the same transaction to which the at least one operation of the first operation request belongs is not indicated, and all the operations in the first operation request belong to the same transaction and have the same transaction identifier.
  • Manner 3 Instructing the transaction identifier, at least one of the first operation requests belongs to a plurality of transactions, and the application server 201 indicates the transaction identifier of the transaction to which each operation belongs when transmitting the first operation request.
  • the first operation request includes a transaction identifier
  • the second data server 202 after generating the second operation request, removes the transaction identifier of the same transaction in the first operation request, Generate a second operation request.
  • the optional solution avoids the modification of the first API provided by the first data server 203. Since the original persistence layer service usually does not have the transaction management function in the cloud service scenario, the first data server 203 does not recognize.
  • the transaction identifier, the second data server 202 removes the transaction identifier, is better compatible with the previous persistence layer service.
  • the first operation request includes multiple operations belonging to different transactions, such as: including multiple operations belonging to transaction 1 and multiple operations belonging to transaction 2, then second data server 202 respectively for transaction 1 and transaction 2 Perform transaction management.
  • the generated second operation request includes only multiple operations of transaction 1.
  • the generated second operation request includes only multiple operations of transaction 2.
  • the transaction identifier may be a combination of one or more fields as long as it can uniquely identify the transaction to which the plurality of operations that the application server 201 desires to perform transaction management.
  • the application server 201 may indicate that the first operation request is used to request the first persistent layer service by:
  • the user protocol information for instructing the application service to request the first persistent layer service is carried in the first operation request.
  • the second data server 202 may determine the first information according to the identifier information of the first persistent layer service in the first operation request, or the user protocol information used to indicate that the application service requests the first persistent layer service.
  • An operation request is used to request the first persistence layer service.
  • the at least one operation fails to be performed, for example, performing the at least one operation one by one, determining that performing the at least one operation fails when an operation that fails the execution is encountered.
  • the second data server 202 rolls back the second data to a state before the execution of the at least one operation described above. In this way, data rollback is performed when the operation fails, and the second data in the second data server 202 is ensured to be consistent with the first data in the first data server 203.
  • the second data server 202 does not generate the second operation request, and does not send the second operation request to the first data server 203.
  • the second data server 202 sends a failure response to the application server 201 for the first operation request, indicating that the at least one operation fails.
  • the failure response includes at least one of the following information of the operation that failed to be performed:
  • the application server 201 can be made aware of the execution result of the first operation request, and by using the further provided detailed information, the application server 201 can be made aware of the partial operation as detailed information of successful execution, which is convenient for the application server. 201 its own flexible processing.
  • the resource object refers to the resource object: the object entity obtained in the process of modeling the technical domain may use a noun description, and the operations executable on the entity include: creating, reading, updating, and deleting.
  • FIG. 2 can be implemented in various manners.
  • FIG. 3A to FIG. 3C show three alternative implementations. For the sake of simplicity, only one application server 201 is shown.
  • the application server 201, the second data server 202, and the first data server 203 are implemented on three different servers of server A, server B, and server C, respectively.
  • the first data server 203 can be implemented in the cloud, and the first data server 203 and the second data server 202 are carried on different VMs.
  • the second persistent layer service is implemented by the VM in the cloud, and the data resource can be allocated on demand; on the other hand, the second persistent layer service including the transaction management function is included.
  • the data server 202 is carried on a different VM from the first data server 203 including the first persistent layer service of the original cloud, so that the second persistent layer service with the transaction management function is used to occupy the original first persistent
  • the data processing resources of the layer service avoid the impact on the original first persistence layer service.
  • the application server 201 is implemented on the server A.
  • the first data server 203 and the second data server 202 are implemented on a server in the same cloud, server B, which is located in the cloud.
  • the second persistence layer service provided by the second data server 202 can be implemented by patching or installing the program on the first data server 203.
  • the second data server 202 need not be deployed separately during network deployment.
  • the application server 201 and the second data server 202 are implemented on the same server, the server A, and the first data server 203 is implemented on the server B in the cloud.
  • the application server 201 can be played on the application server 201.
  • a patch or installer implements the second persistence layer service provided by the second data server 202.
  • the second data server 202 need not be deployed separately during network deployment.
  • the second data server 202 can be implemented in various manners, including but not limited to the three implementation manners shown in FIG. 4 to FIG. 6. The following three implementation manners are taken as an example for description.
  • the second data server 202 includes:
  • NBI North Bound Interface
  • the transaction management module 2022 is configured to perform the at least one operation on the second data after determining that the first operation request is for requesting the first persistence layer service; if each operation is successful, generating a second operation request, The second operation request is for requesting to perform at least one operation on the first data;
  • SBI South Bound Interface
  • FIG. 5 is a schematic diagram of a second implementation of the second data server 202.
  • the difference from the first implementation shown in FIG. 4 is that the transaction management module 2022 is further subdivided into a disassembler 2022a, a resource manager 2022b, and a transaction manager 2022c.
  • the connection relationship is shown in Figure 5.
  • the disassembler 2022a is configured to perform a disassembly process on at least one of the first operation requests received by the NBI 2021.
  • the disassembling process includes: decomposing the operations on the plurality of resource objects in the at least one operation into a plurality of atomic operations for a single resource object, wherein the resource object is a resource object managed by the first persistence layer service,
  • the atomic operation is an operation that is not subdividable for the resource objects managed by the first data server 203.
  • the first operation request sent by the application server 201 is:
  • the resource objects for the at least one operation of the first operation request include: ne1, ne2, port1, and port2, and operations on the resource objects are all posts, that is, newly added resource objects.
  • an operation corresponds to multiple resource objects.
  • the ellipses following the remark indicate other portable parameters.
  • the operation type may include: CRUD, wherein
  • C is Create: new, corresponding to Post in RESTful standard
  • R is Retrieve: read, the corresponding RESTful standard is get;
  • D is Delete: Delete, and the RESTful standard corresponds to delete.
  • the NBI 2021 can receive the first operation request sent by the application server 201 in accordance with various formats, for example, conforming to certain network communication protocols, such as the Simple Network Management Protocol (Simple Network Management Protocol). , SNMP) operation request.
  • Simple Network Management Protocol Simple Network Management Protocol
  • SNMP Simple Network Management Protocol
  • the disassembler 2022a decomposes the operations for ne1 and ne2 in the first operation request and the two post operations for port1 and port2 into four atomic operations.
  • the atomic operations are for resource objects ne1, ne2, port1, and port2, respectively.
  • the body of the data in the first operation request that is, the portion in the curly braces after the data statement conforms to the JavaScript Object Notation (JSON) format, and optionally, the disassembler 2022a will be in the first operation request.
  • JSON JavaScript Object Notation
  • the body converts the format to conform to the JavaBean format.
  • each of the braces is an atomic operation.
  • the above four atomic operations are operations of a minimum granularity that are not redetributable for the second data server 202.
  • the operations of the first operation request for ne1 and ne2 and the two post operations for port1 and port2 are decomposed into four atomic operations, the four atoms.
  • the operations are for resource objects ne1, ne2, port1, and port2, respectively.
  • the purpose of the interpretation process is to be able to lock on resource objects so that operations on the same resource object can be performed sequentially. Among them, "locking" means that if two operations are for the same resource object, the second operation needs to wait while performing the first operation.
  • the resource manager 2022b is an optional part for resource management for each atomic operation obtained after the disassembler 2022a is disassembled.
  • the resource management includes: generating atomic operations belonging to the same transaction for each atomic operation.
  • the operation queue, the same transaction is the transaction identified by the above Transaction_Id.
  • the operation queue is generated, so that the subsequent transaction manager 2022c processes the atomic operations sequentially. It also acts as a data cache.
  • the transaction manager 2022c is configured to perform transaction management on each atomic operation. If the resource manager 2022b exists, the transaction manager 2022c processes the queue of atomic operations; if the resource manager 2022b does not exist, the transaction manager 2022c directly processes Each atom output by the disassembler 2022a operates.
  • the transaction management performed by the transaction manager 2022c includes:
  • the execution time of the atomic operation ie the timestamp, may be recorded, which is used to assist in marking the execution order of each atomic operation in subsequent possible data rollbacks.
  • each atomic operation is pre-submitted one by one, that is, each atomic operation is performed one by one;
  • the pre-commit fails.
  • the second data is rolled back.
  • the transaction identifies the correspondence of the three, and performs a rollback, that is, restores the second data to a state before performing at least one of the first operation requests.
  • the corresponding resource object is restored to the previous record of the resource object when the rollback is performed;
  • the corresponding resource object is added when the rollback is performed.
  • the content of the data object of the newly added resource object is consistent with the last record of the resource object in the second data before the deletion operation is performed.
  • the transaction manager 2022c is further configured to: atomic operations output by the resource manager 2022b before each atomic operation is performed one by one.
  • the queue generates a transaction object instance belonging to the same transaction; then, the transaction manager 2022c performs each atomic operation one by one, specifically, each atomic operation in the generated transaction object instance is pre-submitted one by one.
  • generating a transaction object instance belonging to the same transaction is to cope with a concurrent operation in which a plurality of operations process a resource object.
  • the transaction object needs to be managed, and the transaction object is managed to generate a corresponding Transaction object instance.
  • the application server 201 submits a first operation request conforming to the RESTful format as an example.
  • the application server 201 may also send a first operation request that conforms to a specific network communication protocol format.
  • an interface converter 2024 may be added between the interface compliant with the RESTful format NBI2021 and the application server 201, and the interface is converted.
  • the device 2024 is configured to convert the first operation request conforming to the specific network communication protocol format into the first operation request conforming to the RESTful format.
  • the interface converter 2024 can be located on the application server 201 or on the second data server 202, as shown in FIG.
  • the embodiment of the present invention further provides a second data server, an application server, and a data processing method, which are provided by the embodiments of the present invention.
  • the network is similar, and its implementation can refer to the implementation of the network, and the repetition will not be described again.
  • FIG. 7 is a schematic structural diagram of a first type of second data server according to an embodiment of the present invention.
  • the second data server has a communication connection with the first data server and one or more application servers; one or more application servers are used to provide application services; and the first data server is configured to provide a first persistence layer service, the first data server Included in the first data; the second data server is configured to provide a second persistence layer service, the second data server includes second data, the second data includes the same data as the first data; and the second data server is directed to one or more
  • the application server provides a second application interface API, and the one or more application servers request the first data persistence service from the first data server by calling the second API; the first data server provides the first data, the second data to the second data server The server requests the first persistence layer service by calling the first API.
  • the second data server includes:
  • a second interface 701 configured to provide a second API, and receive a first operation request sent by the one or more application servers by calling a second API, where the first operation request is used to request to perform at least one operation, and at least one operation belongs to the same Transaction
  • the transaction management module 702 is configured to perform at least one operation on the second data after determining that the first operation request is to request the first persistence layer service to perform the at least one operation; if each operation is successful, generating the second operation a request, the second operation request is for requesting to perform at least one operation on the first data;
  • the first interface 703 is configured to invoke the first API to send a second operation request to the first data server.
  • the transaction management module 702 is specifically configured to:
  • the transaction management module 702 is further configured to:
  • the second data is rolled back to a state prior to performing at least one operation.
  • transaction management module 702 performs each of the at least one operation on the second data, specifically:
  • Disassembling at least one operation includes: decomposing operations of the plurality of resource objects in at least one operation into a plurality of atomic operations for a single resource object, and the resource object is a resource managed by the first persistence layer service An object, an atomic operation that is inseparable from a resource object managed by the first persistence layer service;
  • Transaction management is performed on the atomic operation obtained after the disassembly process.
  • the transaction management includes: recording each atomic operation obtained by the disassembly process, recording the type of the atomic operation, the identifier of the resource object to which the atomic operation is directed, and the same transaction.
  • the transaction identifies the correspondence between the three; and performs each atomic operation obtained by the disassembly process.
  • the transaction management module 702 rolls back the second data to perform at least one operation
  • the state before each operation is specifically used to:
  • the second data is rolled back to a state before each of the at least one operation is performed, according to the correspondence recorded in the transaction.
  • the first operation request includes a transaction identifier of the same transaction
  • the transaction management module 702 is specifically configured to: remove the transaction identifier of the same transaction in the first operation request to generate a second operation request.
  • the transaction management module 702 is further configured to: if the at least one operation fails, generate a failure response for the first operation request, where the failure response is used to indicate that the at least one operation fails to be performed;
  • the second interface 701 is further configured to: send a failure response to one or more application servers.
  • the failure response includes at least one of the following information that the at least one operation does not perform the successful operation:
  • the second data server is the same server as the first data server; or
  • the second data server and the first data server are different servers; or
  • the application server is the same server as the second data server.
  • the second data server and the first data server are different servers;
  • the first data server and the second data server are cloud servers, and the first data server and the second data server are carried on different virtual machine VMs.
  • FIG. 8 is a schematic structural diagram of a second second data server according to an embodiment of the present invention.
  • the second type of second data server has a communication connection with the first data server and one or more application servers; one or more application servers are used to provide application services.
  • the first data server is configured to provide a first persistence layer service, the first data server includes first data, and the second data server is configured to provide a second persistence layer service,
  • the second data server includes second data, the second data includes the same data as the first data;
  • the second data server provides a second application interface API to one or more application servers, and one or more application servers call the first
  • the second API requests the first data persistence service from the first data server;
  • the first data server provides the first data server to the second data server, and the second data server requests the first persistence layer service by calling the first API.
  • the second data server includes: a network interface 801, a processor 802, and a memory 803;
  • the memory 803 is configured to store a transaction management program, where the transaction management program includes code for implementing the second API;
  • the processor 802 is configured to call the transaction management program stored in the memory 803, and performs the following operations:
  • the second data server If the operation is successful, the second data server generates a second operation request, and sends a second operation request to the first data server by using the network interface 801 to invoke the first API, where the second operation request is used to request the first operation.
  • the data performs at least one operation.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 802 and various circuits of memory represented by memory 803.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides a network interface 801 for communicating with other devices on the network, such as a first data server, one or more application servers, and the like.
  • the user interface 804 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
  • FIG. 9 is a schematic structural diagram of a first application server according to an embodiment of the present invention.
  • the second data server has a communication connection with the first data server and one or more of the first application servers; the application server is configured to provide an application service; and the first data server is configured to provide a first persistence layer service, first
  • the first data is provided in the data server; the second data server provides a second application interface API to the one or more application servers, and the one or more application servers request the first data persistence service from the first data server by calling the second API;
  • the first data server provides a first API to the second data server, and the second data server requests the first persistence layer service by calling the first API.
  • the application server includes:
  • the operation request generating module 901 is configured to generate a first operation request, and instruct the first operation request to request the first persistence layer service to perform at least one operation, the at least one operation belongs to the same transaction, and the first operation request includes The first operation request is used to request indication information of the first persistence layer service;
  • the interface 902 is configured to invoke the second API, and send a first operation request to the second data server, instructing the second data server to: perform at least one operation on the second data; if each operation is performed successfully, generate a second operation request And sending a second operation request to the first data server by calling the first API, the second operation request for requesting to perform at least one operation on the first data.
  • the indication information used to indicate that the first operation request is used to request the first persistence layer service includes:
  • the first operation request is further used to indicate the second data server: when the at least one operation fails, the second data is rolled back to a state before the at least one operation is performed.
  • the first operation request includes a transaction identifier of the same transaction.
  • the interface 902 is further configured to:
  • the failure response is used to indicate that at least one operation failed.
  • the failure response includes at least one of the following information that the at least one operation does not perform the successful operation:
  • the application server is the same server as the second data server.
  • FIG. 10 is a schematic structural diagram of a second application server according to an embodiment of the present invention.
  • the second data server has a communication connection with the first data server and one or more of the first application servers; the application server is configured to provide an application service; and the first data server is configured to provide a first persistence layer service, first
  • the first data is provided in the data server; the second data server provides a second application interface API to the one or more application servers, and the one or more application servers request the first data persistence service from the first data server by calling the second API;
  • the first data server provides a first API to the second data server, and the second data server requests the first persistence layer service by calling the first API.
  • the application server includes:
  • the memory 1003 is used to operate the request processing program
  • the processor 1002 is configured to invoke the operation request processing program stored in the memory 1003, and perform the following operations:
  • the first operation request is for requesting the first persistence layer service to perform at least one operation, the at least one operation belongs to the same transaction, and the first operation request includes, for indicating the first operation request, for requesting the first persistent Information about the layer service;
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 1002 and various circuits of memory represented by memory 1003.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides a network interface 1001 for communicating with other devices on the network, such as a second data server.
  • the user interface 1004 may also be an interface capable of externally connecting the required devices, including but not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
  • FIG. 11 is a flowchart of a first data processing method according to an embodiment of the present invention.
  • the first data processing method is applicable to a second data server, the second data server has a communication connection with the first data server and one or more application servers; the application server is configured to provide an application service; and the first data server is used for the first data server Providing a first persistence layer service, the first data server includes first data; the second data server is configured to provide a second persistence layer service, the second data server includes second data, and the second data includes the same as the first data Data; the second data server provides a second application interface API to the application server, the application server requests the first data server to the first data server by calling the second API; the first data server provides the first API to the second data server, The second data server requests the first persistence layer service by calling the first API.
  • the method includes:
  • the second data server receives a first operation request sent by one or more application servers, where the first operation request is sent by the one or more application servers by calling the second API, and is configured to request to perform at least one operation, at least one operation. Belong to the same transaction;
  • the second data server performs at least one operation on the second data after determining that the first operation request is for requesting the first persistence layer service to perform at least one operation;
  • the second data server If each operation is successful, the second data server generates a second operation request, and sends a second operation request to the first data server by calling the first API, where the second operation request is used to request the first data. Perform at least one operation.
  • the second data server determines that the first operation request is used to request the first persistence layer service to perform at least one operation, including:
  • the second data server determines, according to the identifier information of the first persistence layer service in the first operation request, or the user protocol information used to instruct the application service to request the first persistence layer service, to determine that the first operation request is used to request the first persistent layer service.
  • the method further includes:
  • the second data server rolls back the second data to a state prior to performing at least one operation.
  • the second data server performs each of the at least one operation on the second data, including:
  • the second data server performs a disassembly process on the at least one operation, and the disassembling process includes: decomposing the operations for the plurality of resource objects in the at least one operation into a plurality of atomic operations for the single resource object, and the resource object is the first persistence layer a resource object managed by a service, an atomic operation being an operation that is inseparable from a resource object managed by the first persistence layer service;
  • the second data server performs transaction management on the atomic operations obtained after the disassembly process, and the transaction management includes: recording each atomic operation obtained by the disassembly process, recording the type of the atomic operation, the identifier of the resource object to which the atomic operation is directed, and The transaction of the same transaction identifies the correspondence between the three; and performs each atomic operation obtained by the disassembly process.
  • the second data server rolls back the second data to a state before performing each of the at least one operation, including:
  • the second data server rolls back the second data to a state prior to performing each of the at least one operation based on the correspondence recorded in the transaction.
  • the first operation request includes a transaction identifier of the same transaction
  • the generating, by the second data server, the second operation request includes: removing, by the second data server, the transaction identifier of the same transaction in the first operation request to generate a second operation request.
  • the method further includes: if the at least one operation fails, the second data server sends a failure response to the one or more application servers for the first operation request, where the failure response is used to indicate that the at least one operation fails.
  • the failure response includes at least one of the following information that the at least one operation does not perform the successful operation:
  • the first server and the second data server are cloud servers, and the first data server and the second data server are carried on different virtual machine VMs.
  • FIG. 12 is a flowchart of a second data processing method according to an embodiment of the present invention.
  • the method can be applied to one or more application servers, the second data server has a communication connection with the first data server and one or more application servers; one or more application servers are used to provide application services; and the first data server is used by the first data server Providing a first persistence layer service, the first data server includes first data; the second data server provides a second application program interface API to the application server, and the one or more application servers request the first data server by calling the second API a first persistence layer service; the first data server provides a first API to the second data server, and the second data server requests the first persistence layer service by invoking the first API.
  • the method includes:
  • the one or more application servers generate a first operation request, where the first operation request is used to request the first persistence layer service to perform at least one operation, at least one operation belongs to the same transaction, and the first operation request includes Operation request request letter for requesting the first persistence layer service interest;
  • S1202 The one or more application servers send a first operation request to the second data server by calling the second API to indicate the second data server:
  • the indication information used to indicate that the first operation request is used to request the first persistence layer service includes:
  • the method further includes:
  • the first operation request is further for indicating the second data server: when the at least one operation fails, the second data is rolled back to a state before the at least one operation is performed.
  • the first operation request includes a transaction identifier of the same transaction.
  • the method further includes:
  • the failure response is used to indicate that at least one operation failed.
  • the failure response includes at least one of the following information that the at least one operation does not perform the successful operation:
  • the first data server and the second data server are cloud servers, and the first data server and the second data server are carried on different virtual machine VMs.
  • the end user that is, the browser establishes a session, invokes an application service provided by the application server 201, and the application service uses the second data server provided by the embodiment of the present invention through the NBI interface conforming to the RESTful format.
  • 202 provides a second persistence layer service.
  • the second data server 202 provides a transaction service for its own second data (herein, a database is referred to as a "history library"), and if the transaction is completed, sends a SBI interface message conforming to the RESTful format to the first data server 203, wherein
  • the type of operation is a CRUD operation specified by the RESTful standard.
  • the first data server 203 further refers to the first data (here, a database) as a “current library” for processing according to the received operation request.
  • FIG. 14 is a structural component diagram of a second persistence layer service provided in the second data server 202 in the cloud service scenario based on the network architecture shown in FIG.
  • the second data server 202 includes the NBI 2021, the SBI 2023 and the transaction management module 2022 in FIG. 14 .
  • the application server 201 provides an application service
  • the second data server 202 provides a second persistence layer service, that is, a transaction service.
  • the first data server 203 Provide the original cloud persistence layer service.
  • the application service adds a transaction ID (TransactionID) field to the northbound interface NBI conforming to the RESTFul format of the original cloud persistence layer service. You can tie an operation with the same TransactionID to a transaction.
  • TransactionID Transaction ID
  • the type of operation can be divided into CRUD operations according to RESTful standards.
  • the transaction service disassembles the CRUD operation interface delivered by the application service, splits into multiple atomic operations, binds the atomic operations with the same TransactionID into a transaction object instance, and, for each atomic operation, the atom
  • the operation type of the operation, the TransactionId correspondence of the Transaction to which the object IDID of the resource object for which the atomic operation belongs, is stored as a record in the history library for data rollback when the operation fails.
  • Figure 15 is a diagram showing the internal structure of the transaction service of Figure 14. As shown in Figure 15, the transaction services include: Parser, ResourceMgr, TransactionMgr, and Database-HIS.
  • the first operation request is sent by the application service in the RESTful format, and after entering the transaction service via the NBI interface, the disassembler firstly disassembles the multiple operations having the same TransactionId included in the first operation request into atomic operations;
  • the resource manager generates a atomic operation queue by using a plurality of atomic operations obtained by disassembling the disassembler, and sends the atomic operation queue to the transaction manager;
  • the transaction manager generates an instance of the transaction object from the atomic operation queue, and pre-submits the atomic operations therein one by one;
  • the second operation request is generated, and the second operation request includes all the operations in the first operation request, and is sent to the first data server 203;
  • the history library is rolled back to the state before the atomic operation was performed.
  • FIG. 16 shows the process of the second data server 202 processing. As shown in FIG. 16, the processing of the second data server 202 includes the following steps:
  • S1601 Receive a first operation request sent by the application server 201.
  • S1602 The disassembler disassembles the first operation request to generate a plurality of atomic operations
  • S1603 The resource manager generates an atomic operation queue
  • S1604 The transaction manager generates a transaction object instance and performs pre-submission
  • step S1605 determining whether all atomic operations are performed successfully; if yes, executing step S1606; otherwise performing step S1607;
  • the embodiments of the present invention provide a server and a data processing method, which implements an application service to manage a transaction by providing a persistent layer service with a transaction management function between an application service and a persistent layer service in the cloud, without applying an application.
  • the service itself implements transaction management, which reduces the complexity of application service implementation.
  • the persistence layer service with transaction management function implements transaction management, and multiple application services can implement transaction management functions through the persistence layer service, thereby avoiding transaction management functions in various application services. Redundancy development and configuration caused by repeated implementations.
  • the application service is also prevented from directly sending an operation request to the persistent layer service of the cloud.
  • the cloud service does not have the transaction management function, and the data cannot be restored to the state before the operation is performed.
  • the persistence layer service with transaction management function performs data rollback when transaction management fails, and ensures data consistency between the persistence layer service with transaction management function and the persistence layer service of the cloud.
  • the persistence layer service with transaction management function is also located in the cloud, and the cloud server including the persistent layer service is carried on a different virtual machine (VM) from the cloud server including the original cloud persistent layer service.
  • VM virtual machine
  • the cloud-based VM implements a persistence layer service with transaction management function, which can realize data resource allocation on demand; on the other hand, it is persistent with the original cloud because of the cloud server including the persistence layer service with transaction management function.
  • the cloud server of the layer service is carried on different VMs. This avoids the implementation of the data processing resource of the original persistence layer service by the persistence layer service with transaction management function, and avoids the impact on the original persistence layer service.
  • the persistence layer service with transaction management function provided by the embodiment of the present invention can be used as a loosely coupled component designed based on a Service-Oriented Architecture (SOA) architecture, and integrated by other services to provide a service with transaction management function.
  • SOA Service-Oriented Architecture
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种服务器和数据处理方法,用于在云服务场景下简单实现事务管理。其中提供的第二数据服务器(202)与应用服务器(201)和云端的第一数据服务器(203)连接,接收应用服务器(201)发送的用于请求第一数据服务器(203)提供的第一持久层服务的第一操作请求,该请求中包括属于同一个事务的至少一个操作;第二数据服务器(202)中的事务管理模块(2022)对自身中的第二数据执行上述至少一个操作;该第二数据与第一数据服务器(203)中的第一数据相同;若操作均执行成功则生成第二操作请求,以请求对第一数据执行上述至少一个操作,并发给第一数据服务器(203)。通过在应用服务和云服务之间提供具有事务管理功能的持久层服务,无需应用服务实现事务管理,降低应用服务的复杂度。

Description

一种服务器和数据处理方法
本申请要求在2015年3月31日提交中国专利局、申请号为201510148274.X、发明名称为“一种服务器和数据处理方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机通信技术,尤其涉及一种服务器和数据处理方法。
背景技术
在传统的数据库事务管理技术中,通常将数据操作的执行分为三个步骤:预提交、提交,以及数据操作失败时的回滚。其中“预提交”是指事务中的所有操作在缓存中执行,若所有操作均成功,则“提交”,否则“回滚”;“提交”是指将数据写入数据库;“回滚”是指清理缓存,恢复到预提交前的数据。
持久层服务,用于屏蔽不同数据库部署形式、版本差异和/或数据库提供商,向应用提供统一的访问数据库的接口。
图1示出了在云服务场景下,向应用服务提供持久层服务的典型架构。其中,应用服务(Application Service,App Service)向云端的持久层服务发送请求,持久层服务响应应用服务的请求向应用提供服务。在具体实现时,通常应用服务和持久层服务由不同的开发商实现,云服务开发商提供持久层服务,但提供的持久层服务通常不具有事务管理的功能。这是因为:持久层服务需要兼容不同类型的数据库,但是不同类型的数据库实现事务管理功能的机制不同,若持久层服务提供事务管理功能,则针对不同数据库的事务管理的实现机制,持久层服务均需要进行适配,并且某些数据库不具备事务管理功能,这更增加了持久层服务提供事务管理功能的难度。
另一方面,目前,持久层服务常见的实现方式是:持久层服务自身通过非关系数据库,以及存储区域网络(Storage Area Network,SAN)或网络存 储(Network Attached Storage,NAS)一起提供可扩展的数据存贮能力,而不使用传统的关系数据库来组织数据。此时,持久层服务若自身实现事务管理功能,则需要耗费额外的数据处理资源,当占用的数据处理资源较大时,若持久层服务可用的数据处理资源有限,则可能会对持久层服务自身造成影响。
因此,目前的云服务场景中,不同应用服务的开发商通常需要自身提供事务管理功能,导致应用开发的复杂度高,同时不同应用的事务管理功能差异性较大,兼容性难以保证。
发明内容
本发明实施例提供一种服务器和数据处理方法,用于在云服务场景下,云服务开发商提供的持久层服务不具有事务管理的功能的情况下,提供一种简单的实现事务管理的方案,以降低应用服务实现的复杂度。
第一方面,本发明实施例提供一种第二数据服务器,所述第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;所述一个或多个应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器用于提供第二持久层服务,所述第二数据服务器中包括第二数据,所述第二数据包括与所述第一数据相同的数据;所述第二数据服务器向所述一个或多个应用服务器提供第二应用程序接口API,所述一个或多个应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;
所述第二数据服务器包括:
所述第二接口,用于提供所述第二API,并接收所述一个或多个应用服务器通过调用所述第二API发送的第一操作请求,所述第一操作请求用于请求执行至少一个操作,所述至少一个操作属于同一个事务;
所述事务管理模块,用于在确定所述第一操作请求是用于请求所述第一 持久层服务执行所述至少一个操作后,对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作;
所述第一接口,用于调用所述第一API向所述第一数据服务器发送所述第二操作请求。
结合第一方面,在第一种可能的实现方式中,所述事务管理模块在确定所述第一操作请求是用于请求所述第一持久层服务执行所述至少一个操作时,具体用于:
根据所述第一操作请求中所述第一持久层服务的标识信息,或用于指示所述应用服务请求所述第一持久层服务的用户协议信息,确定所述第一操作请求用于请求所述第一持久层服务执行所述至少一个操作。
结合第一方面,或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述事务管理模块还用于:
若执行所述至少一个操作失败,则将所述第二数据回滚至执行所述至少一个操作之前的状态。
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述事务管理模块在对所述第二数据执行所述至少一个操作中的每一个操作时,具体用于:
对所述至少一个操作进行拆解处理,所述拆解处理包括:将所述至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,所述资源对象为所述第一持久层服务管理的资源对象,所述原子操作为对于所述第一持久层服务管理的资源对象不可再分的操作;以及
对所述拆解处理后得到的原子操作进行事务管理,所述事务管理包括:针对所述拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和所述同一个事务的事务标识三者的对应关系;并执行所述拆解处理得到的每一个原子操作。
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,
所述事务管理模块在将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态时,具体用于:
根据所述事务处理中记录的所述对应关系,将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态。
结合第一方面,或第一方面的第一种可能的实现方式至第四种可能的实现方式中的任一种,在第五种可能的实现方式中,
所述第一操作请求中包括所述同一个事务的事务标识;
所述事务管理模块在生成所述第二操作请求时,具体用于:去掉所述第一操作请求中的所述同一个事务的事务标识,以生成所述第二操作请求。
结合第一方面,或第一方面的第一种可能的实现方式至第五种可能的实现方式中的任一种,在第六种可能的实现方式中,
所述事务管理模块还用于:若执行所述至少一个操作失败,则针对所述第一操作请求生成失败响应,所述失败响应用于指示所述至少一个操作执行失败;
所述第二接口还用于:向所述一个或多个应用服务器发送所述失败响应,。
结合第一方面的第六种可能的实现方式,在第七种可能的实现方式中,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的所述第一持久层服务的资源对象;
操作失败原因。
结合第一方面,或第一方面的第一种可能的实现方式至第七种可能的实现方式中的任一种,在第八种可能的实现方式中,所述第二数据服务器与所述第一数据服务器为同一服务器;或
所述第二数据服务器与所述第一数据服务器为不同服务器;或
所述应用服务器与所述第二数据服务器为同一服务器。
结合第一方面的第八种可能的实现方式,在第九种可能的实现方式中,所述第二数据服务器与所述第一数据服务器为不同服务器;
所述第一数据服务器和第二数据服务器为云服务器,且所述第一数据服务器和所述第二数据服务器承载在不同的虚拟机VM上。
第二方面,本发明实施例一种应用服务器,第二数据服务器与第一数据服务器以及一个或多个所述应用服务器具有通信连接;所述应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器向一个或多个所述应用服务器提供第二应用程序接口API,一个或多个所述应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;
所述应用服务器包括:
操作请求生成模块,用于生成第一操作请求,并指示所述第一操作请求用于请求所述第一持久层服务执行至少一个操作,所述至少一个操作属于同一个事务,所述第一操作请求中包括用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息;
接口,用于调用所述第二API,向所述第二数据服务器发送所述第一操作请求,指示所述第二数据服务器:对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
结合第二方面,在第一种可能的实现方式中,所述用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息包括:
所述第一持久层服务的标识信息;或
用于指示所述应用服务请求所述第一持久层服务的用户协议信息。
结合第二方面,或第二方面的第一种可能的实现方式,在第二种可能的 实现方式中,
所述第一操作请求还用于指示所述第二数据服务器:在执行所述至少一个操作失败时,将所述第二数据回滚至执行所述至少一个操作之前的状态。
结合第二方面、第二方面的第一种可能的实现方式或第二种可能的实现方式,在第三种可能的实现方式中,所述第一操作请求中包括所述同一个事务的事务标识。
结合第二方面,或第二方面的第一种可能的实现方式至第三种可能的实现方式中的任一种,在第四种可能的实现方式中,所述接口还用于:
接收所述第二数据服务器在执行所述至少一个操作失败后发送的失败响应;
所述失败响应用于指示所述至少一个操作执行失败。
结合第二方面的第四种可能的实现方式,在第五种可能的实现方式中,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的所述第一持久层服务的资源对象;
操作失败原因。
结合第二方面,或第二方面的第一种可能的实现方式至第五种可能的实现方式中的任一种,在第六种可能的实现方式中,所述应用服务器与所述第二数据服务器为同一服务器。
第三方面,本发明实施例提供一种数据处理方法,应用于第二数据服务器上,所述第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;所述应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器用于提供第二持久层服务,所述第二数据服务器中包括第二数据,所述第二数据包括与所述第一数据相同的数据;所述第二数据服务器向所述应用服务器提供第二应用程序接口API,所述应用服务器通过调用所述第二API 向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;所述方法包括:
所述第二数据服务器接收所述一个或多个应用服务器发送的第一操作请求,所述第一操作请求是所述一个或多个应用服务器通过调用所述第二API发送的,用于请求执行至少一个操作,所述至少一个操作属于同一个事务;
所述第二数据服务器在确定所述第一操作请求是用于请求所述第一持久层服务执行所述至少一个操作后,
对所述第二数据执行所述至少一个操作;
若每一个操作均执行成功,则所述第二数据服务器生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,其中所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
结合第三方面,在第一种可能的实现方式中,第二数据服务器确定所述第一操作请求用于请求所述第一持久层服务执行所述至少一个操作,包括:
所述第二数据服务器根据所述第一操作请求中所述第一持久层服务的标识信息,或用于指示所述应用服务请求所述第一持久层服务的用户协议信息,确定所述第一操作请求用于请求所述第一持久层服务。
结合第三方面,或第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:
若执行所述至少一个操作失败,则所述第二数据服务器将所述第二数据回滚至执行所述至少一个操作之前的状态。
结合第三方面的第二种可能的实现方式,在第三种可能的实现方式中,
所述第二数据服务器对所述第二数据执行所述至少一个操作中的每一个操作,包括:
所述第二数据服务器对所述至少一个操作进行拆解处理,所述拆解处理包括:将所述至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,所述资源对象为所述第一持久层服务管理的资源对 象,所述原子操作为对于所述第一持久层服务管理的资源对象不可再分的操作;以及
所述第二数据服务器对所述拆解处理后得到的原子操作进行事务管理,所述事务管理包括:针对所述拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和所述同一个事务的事务标识三者的对应关系;并执行所述拆解处理得到的每一个原子操作。
结合第三方面的第三种可能的实现方式,在第四种可能的实现方式中,
所述第二数据服务器将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态,包括:
所述第二数据服务器根据所述事务处理中记录的所述对应关系,将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态。
结合第三方面,或第三方面的第一种可能的实现方式至第四种可能的实现方式中的任一种,在第五种可能的实现方式中,
所述第一操作请求中包括所述同一个事务的事务标识;
所述第二数据服务器生成所述第二操作请求包括:所述第二数据服务器去掉所述第一操作请求中的所述同一个事务的事务标识,以生成所述第二操作请求。
结合第三方面,或第三方面的第一种可能的实现方式至第五种可能的实现方式中的任一种,在第六种可能的实现方式中,
所述方法还包括:若执行所述至少一个操作失败,则所述第二数据服务器针对所述第一操作请求,向所述一个或多个应用服务器发送失败响应,所述失败响应用于指示所述至少一个操作执行失败。
结合第三方面的第六种可能的实现方式,在第七种可能的实现方式中,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的所述第一持久层服务的资源对象;
操作失败原因。
结合第三方面,或第三方面的第一种可能的实现方式至第七种可能的实现方式中的任一种,在第八种可能的实现方式中,所述第一服务器和第二数据服务器为云服务器,且所述第一数据服务器和所述第二数据服务器承载在不同的虚拟机VM上。
第四方面,本发明实施例提供一种数据处理方法,应用于一个或多个应用服务器上,第二数据服务器与第一数据服务器以及所述一个或多个应用服务器具有通信连接;所述一个或多个应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器向所述应用服务器提供第二应用程序接口API,所述一个或多个应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;所述方法包括:
所述一个或多个应用服务器生成第一操作请求,所述第一操作请求用于请求所述第一持久层服务执行至少一个操作,所述至少一个操作属于同一个事务,所述第一操作请求中包括用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息;
所述一个或多个应用服务器通过调用所述第二API,向所述第二数据服务器发送所述第一操作请求,以指示所述第二数据服务器:
对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
结合第四方面,在第一种可能的实现方式中,所述用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息包括:
所述第一持久层服务的标识信息;或
用于指示所述应用服务请求所述第一持久层服务的用户协议信息。
结合第四方面或第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:
所述第一操作请求还用于指示所述第二数据服务器:在执行所述至少一个操作失败时,将所述第二数据回滚至执行所述至少一个操作之前的状态。
结合第四方面、第四方面的第一种可能的实现方式或第二种可能的实现方式,在第三种可能的实现方式中,所述第一操作请求中包括所述同一个事务的事务标识。
结合第四方面、第四方面的第一种可能的实现方式至第三种可能的实现方式中的任一种,在第四种可能的实现方式中,所述方法还包括:
所述一个或多个应用服务器接收所述第二数据服务器在执行所述至少一个操作失败后通过所述第二API发送的失败响应;
所述失败响应用于指示所述至少一个操作执行失败。
结合第四方面的第四种可能的实现方式,在第五种可能的实现方式中,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的所述第一持久层服务的资源对象;
操作失败原因。
结合第四方面、第四方面的第一种可能的实现方式至第五种可能的实现方式中的任一种,在第六种可能的实现方式中,
所述第一数据服务器和第二数据服务器为云服务器,且所述第一数据服务器和所述第二数据服务器承载在不同的虚拟机VM上。
综上,本发明实施例提供了一种服务器和数据处理方法,通过在应用服务和云端的持久层服务之间提供具有事务管理功能的持久层服务,为不同的应用服务提供了统一的事务管理能力,无需各个应用服务自身实现事务管理,降低了应用服务实现的复杂度。
并且,具有事务管理功能的持久层服务实现了事务管理,多个应用服务可通过该持久层服务实现事务管理功能,避免了事务管理功能在各个应用服务上重复实现造成的冗余开发和配置,以及带来的兼容性问题。
并且,也避免了应用服务直接向云端的持久层服务发送操作请求,在部分操作执行失败的情况下,由于云服务不具备事务管理功能,导致数据无法恢复到这些操作执行之前的状态的问题。
进一步地,具有事务管理功能的持久层服务在事务管理失败时,进行数据回滚,保证了具有事务管理功能的持久层服务与云端的持久层服务之间数据的一致性。
进一步地,具有事务管理功能的持久层服务也位于云端,包括该持久层服务的云服务器,与包括原有的云端的持久层服务的云服务器承载在不同的虚拟机(Virtual Machine,VM)上。一方面,由云端的VM实现具有事务管理功能的持久层服务,可实现按需分配数据资源;另一方面,由于包括具有事务管理功能的持久层服务的云服务器,与原有的云端的持久层服务的云服务器承载在不同的VM上,这样避免了实现该具有事务管理功能的持久层服务占用原有的持久层服务的数据处理资源,避免了对原有的持久层服务的影响。
附图说明
图1为在云服务场景下,向应用服务提供持久层服务的典型的网络架构图;
图2为本发明实施例中,向应用服务提供具有事务管理功能的持久层服务的网络的架构图;
图3A~图3C为图2所示的网络的三种可选实现方式的示意图;
图4~图6分别为本发明实施例中实现事务管理功能的三种方式的示意图;
图7为本发明实施例提供的第一种第二数据服务器的结构示意图;
图8为本发明实施例提供的第二种第二数据服务器的结构示意图;
图9为本发明实施例提供的第一种应用服务器的结构示意图;
图10为本发明实施例提供的第二种应用服务器的结构示意图;
图11为本发明实施例提供的第一种数据处理方法的流程图;
图12为本发明实施例提供的第二种数据处理方法的流程图;
图13为本发明实施例一中的网络架构图;
图14为本发明实施例一中云环境下持久层服务的架构组件图;
图15为本发明实施例一中持久层服务中的事务服务的内部结构图;
图16为本发明实施例一中持久层服务的处理流程图。
具体实施方式
本发明实施例提供一种服务器和数据处理方法,用于在云服务场景下,云服务开发商提供的持久层服务不具有事务管理的功能的情况下,提供一种简单的实现事务管理的方案,以降低应用服务实现的复杂度。
为了向应用服务提供事务管理功能,又不增加应用服务实现的复杂度,本发明实施例中,通过在应用服务和云端的持久层服务之间提供具有事务管理功能的持久层服务,实现了应用服务对事务的管理,无需应用服务自身实现事务管理,降低了应用服务实现的复杂度。
并且,具有事务管理功能的持久层服务实现了事务管理,多个应用服务可通过该持久层服务实现事务管理功能,避免了事务管理功能在各个应用服务上重复实现造成的冗余开发和配置。
并且,也避免了应用服务直接向云端的持久层服务发送操作请求,在部分操作执行失败的情况下,由于云服务不具备事务管理功能,导致数据无法恢复到这些操作执行之前的状态的问题。
进一步地,具有事务管理功能的持久层服务在事务管理失败时,进行数据回滚,保证了具有事务管理功能的持久层服务与云端的持久层服务之间数据的一致性。
进一步地,具有事务管理功能的持久层服务也位于云端,包括该持久层服务的云服务器,与包括原有的云端的持久层服务的云服务器承载在不同的VM上。一方面,由云端的VM实现具有事务管理功能的持久层服务,可实现按需分配数据资源;另一方面,由于包括具有事务管理功能的持久层服务的云服务器,与原有的云端的持久层服务的云服务器承载在不同的VM上,这样避免了实现该具有事务管理功能的持久层服务占用原有的持久层服务的数据处理资源,避免了对原有的持久层服务的影响。
下面,结合附图对本发明实施例进行详细说明。
首先,介绍为本发明实施例中,向应用服务提供具有事务管理功能的持久层服务的网络架构,然后分别介绍该网络架构的三种可选实现方式,接下来介绍本发明实施例提供的第二数据服务器、应用服务器,最后介绍本发明实施例提供的数据处理方法。
图2为本发明实施例中,向应用服务提供具有事务管理功能的持久层服务的网络架构图。
如图2所示,网络20中包括:第一数据服务器203、第二数据服务器202,以及一个或多个应用服务器201;其中,第二数据服务器202与第一数据服务器203以及该一个或多个应用服务器201具有通信连接;
一个或多个应用服务器201用于提供应用服务;
第一数据服务器203用于提供第一持久层服务,其中包括第一数据;
第二数据服务器202用于提供第二持久层服务,其中包括第二数据,第二数据包括与第一数据相同的数据;
第二数据服务器202向一个或多个应用服务器201提供第二应用程序接口(Application Programming Interface,API),应用服务器201通过调用第二API向第一数据服务器请求第一持久层服务;
第一数据服务器203向第二数据服务器202提供第一API,第二数据服务器202通过调用第一API请求第一持久层服务。
具体地,应用服务器201,用于生成第一操作请求,并指示第一操作请求 用于请求第一持久层服务,第一操作请求用于请求执行至少一个操作,该至少一个操作属于同一个事务;以及通过调用第二API,向第二数据服务器202发送第一操作请求;
第二数据服务器202,用于接收应用服务器201发送的第一操作请求,所述第二数据服务器在确定所述第一操作请求是用于请求所述第一持久层服务执行上述至少一个操作后,对第二数据执行上述至少一个操作;若每一个操作均执行成功,则所生成第二操作请求,并通过调用第一API向第一数据服务器203发送第二操作请求,其中第二操作请求用于请求对第一数据执行该至少一个操作;
第一数据服务器203,用于接收第二数据服务器202发送的第二操作请求,根据该第二操作请求对自身中的第一数据进行处理;
其中,第二数据服务器202中的第二数据,与第一数据服务器203中的第一数据一致。可选地,第二数据服务器202可在向应用服务器201提供服务之前,对第一数据进行复制,生成第二数据。
第一数据服务器203中的第一数据和第二数据服务器202中的第二数据可为存储在可掉电存储介质上的数据,对于可掉电存储介质,其掉电后,存储介质上的数据不会丢失。第一数据和第二数据的数据组织形式可有多种,包括但不限于:数据库、文件、内存等。
其中,应用服务器201提供的应用服务可由应用开发商提供,第一数据服务器203提供的第一持久层服务可由云服务开发商提供,而第二数据服务器202提供的第二持久层服务可由第三方开发商或云服务开发商提供。
其中,应用服务器201在发送第一操作请求时,可采用的发送方式包括但不限于下述三种方式:
方式一、不指示第一操作请求中的至少一个操作所属的同一个事务的事务标识(TransactionId),则可认为第一操作请求中的所有操作属于同一个事务,具有相同的事务标识;
方式二、指示事务标识,但第一操作请求中的所有操作属于同一个事务;
方式三、指示事务标识,第一操作请求中的至少一个操作分别属于多个事务,应用服务器201在发送第一操作请求时指示各操作所属的事务的事务标识。
可选地,对于方式二和方式三,第一操作请求包括事务标识的情况,第二数据服务器202在生成第二操作请求时,将第一操作请求中的同一个事务的事务标识去掉后,生成第二操作请求。
该可选方案避免了对第一数据服务器203提供的第一API的改动,由于原有的在云服务场景下,持久层服务通常不具备事务管理功能,因此,第一数据服务器203并不识别事务标识,第二数据服务器202将事务标识去掉,则更好地兼容了以往的持久层服务。
对于方式三,第一操作请求中包括分属于不同事务的多个操作,比如:包括属于事务1的多个操作和属于事务2的多个操作,则第二数据服务器202分别对事务1和事务2进行事务管理,针对事务1,生成的第二操作请求中仅包括事务1的多个操作;针对事务2,生成的第二操作请求中仅包括事务2的多个操作。
其中,事务标识可为一个或多个字段的组合,只要能唯一标识应用服务器201期望进行事务管理的多个操作所属的事务即可。
可选地,应用服务器201可通过如下方式,指示第一操作请求用于请求所述第一持久层服务:
方式一、
在第一操作请求中携带第一持久层服务的标识信息;
方式二、
在第一操作请求中携带用于指示应用服务请求第一持久层服务的用户协议信息。
第二数据服务器202在收到第一操作请求后,即可根据第一操作请求中第一持久层服务的标识信息,或用于指示应用服务请求第一持久层服务的用户协议信息,确定第一操作请求用于请求第一持久层服务。
可选地,若执行上述至少一个操作失败,比如:逐条执行上述至少一个操作,在遇到执行失败的操作时,确定执行上述至少一个操作失败。此时,第二数据服务器202将第二数据回滚至执行上述至少一个操作之前的状态。这样,在操作失败时进行数据回滚,保证了第二数据服务器202中的第二数据与第一数据服务器203中的第一数据一致。
并且,可选地,若执行上述至少一个操作失败,则第二数据服务器202不会生成第二操作请求,也不会向第一数据服务器203发送第二操作请求。
可选地,若可选地,若执行上述至少一个操作失败,则第二数据服务器202针对第一操作请求,向应用服务器201发送失败响应,指示上述至少一个操作执行失败。
进一步可选地,该失败响应中包括上述执行失败的操作的下列信息中的至少一种:
操作类型;
操作所针对的第一持久层服务的资源对象;
操作失败原因。
通过向应用服务器201发送失败响应,可使应用服务器201获知第一操作请求的执行结果,并且,通过进一步提供的详细信息,可使应用服务器201获知部分操作为执行成功的详细信息,便于应用服务器201自身的灵活处理。
其中,资源对象是指资源对象:在对技术领域建模过程中得到的对象实体,可使用名词描述,对这些实体可执行的操作包括:创建、读取、更新、删除。
图2所示的网络20可有多种实现方式,图3A~图3C示出了其中的三种可选实现方式,为了简单示意,仅示出了一个应用服务器201。
图3A中,应用服务器201、第二数据服务器202和第一数据服务器203分别在服务器A、服务器B和服务器C三个不同的服务器上实现。其中,可选地,第一数据服务器203可在云端实现,且第一数据服务器203和第二数据服务器202承载在不同的VM上。
采用图3A所示的实现方式,一方面,由云端的VM实现第二持久层服务,可实现按需分配数据资源;另一方面,由于包括具有事务管理功能的第二持久层服务的第二数据服务器202,与包括原有云端的第一持久层服务的第一数据服务器203承载在不同的VM上,这样避免了实现该具有事务管理功能的第二持久层服务占用原有的第一持久层服务的数据处理资源,避免了对原有的第一持久层服务的影响。
图3B中,应用服务器201在服务器A上实现,第一数据服务器203和第二数据服务器202在同一个云中的服务器——服务器B上实现,该服务器B位于云中。在具体实施时,可通过在第一数据服务器203上打补丁或安装程序来实现第二数据服务器202提供的第二持久层服务。对应地,在网络部署时,无需单独部署第二数据服务器202。
图3B中,应用服务器201和第二数据服务器202在同一个服务器——服务器A上实现,第一数据服务器203在云端的服务器B上实现,在具体实施时,可通过在应用服务器201上打补丁或安装程序来实现第二数据服务器202提供的第二持久层服务。对应地,在网络部署时,无需单独部署第二数据服务器202。
可选地,第二数据服务器202的实现方式有多种,包括但不限于图4~图6所示的三种实现方式,下面,以这三种实现方式为例加以说明。
图4为第二数据服务器202的第一种实现方式的示意图。如图4所示,第二数据服务器202包括:
北向接口(North Bound Interface,NBI)2021,用于提供第二API,并接收应用服务器201通过调用第二API发送的第一操作请求,第一操作请求用于请求执行至少一个操作,该至少一个操作属于同一个事务;
事务管理模块2022,用于在确定第一操作请求是用于请求第一持久层服务后,对第二数据执行该至少一个操作;若每一个操作均执行成功,则生成第二操作请求,第二操作请求用于请求对第一数据执行至少一个操作;
南向接口(South Bound Interface,SBI)2023,用于调用第一API向第一 数据服务器203发送第二操作请求。
图5为第二数据服务器202的第二种实现方式的示意图。与图4所示的第一种实现方式的区别在于,事务管理模块2022又细分为拆解器2022a,资源管理器2022b和事务管理器2022c。连接关系如图5所示。
具体地,拆解器2022a用于对NBI2021收到的第一操作请求中的至少一个操作进行拆解处理;
其中,拆解处理包括:将上述至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,上述资源对象为上述第一持久层服务所管理的资源对象,上述原子操作为对于第一数据服务器203所管理的资源对象不可再分的操作。
比如:应用服务器201发送的第一操作请求为:
NE{
url:rest/ne,
data:{[{objectid:id1,name:ne1,remark:core network element,…},{objectid:
id2,name:ne2,remark:access network element,…}]},
type:post,
TransactionID:Transaction_Id1,
},
PORT{
url:rest/port,
data:{[{objectid:id3,name:port1,remark:connect ne1,…},{objectid:
id4,name:port2,remark:connect ne2,…}]},
type:post,
TransactionID:Transaction_Id1,
}
其中,第一操作请求中至少一个操作所针对的资源对象包括:ne1、ne2、port1和port2,对这些资源对象的操作均为post,即新增资源对象。这里一个操作对应多个资源对象。其中,remark后面的省略号表示其他可携带的参数。
这里,以符合RESTful格式的第一操作请求为例,根据RESTful标准的规定,操作类型可包括:CRUD,其中
C为Create:新增,RESTful标准中对应为Post;
R为Retrieve:读取,RESTful标准中对应为get;
U为Update:修改,RESTful标准中对应为put;
D为Delete:删除,RESTful标准中对应为delete。
这里,仅以RESTful格式为例,具体实现时,NBI2021可接收应用服务器201发送的符合各种格式的第一操作请求,比如:符合某些网络通信协议,比如简单网络管理协议(Simple Network Management Protocol,SNMP)的操作请求。
仍以上述符合RESTful格式的第一操作请求为例,拆解器2022a将第一操作请求中针对ne1、ne2的操作和针对port1和port2的两个post操作,分解为四个原子操作,这四个原子操作分别针对资源对象ne1、ne2、port1和port2。
这里,第一操作请求中的数据体(body),即data语句后面大括号中的部分符合JavaScript对象标记(JavaScript Object Notation,JSON)格式,可选地,拆解器2022a将第一操作请求中的body转换格式,使其符合JavaBean格式。
以上述第一操作请求的语句为例,分解转换后的四个原子操作如下,其中每个大括号中的为一个原子操作。
[
{
url:rest/ne,
data:{[{objectid:id1,name:ne1,remark:core network element,…}]},
type:post,
TransactionID:Transaction_Id1,
},
{
url:rest/ne,
data:{[{objectid:id2,name:ne2,remark:access network element,…}]},
type:post,
TransactionID:Transaction_Id1,
},
{
url:rest/port,
data:{[{objectid:id3,name:port1,remark:connect ne1,…}]},
type:post,
TransactionID:Transaction_Id1,
},
{
url:rest/port,
data:{[{objectid:id4,name:port2,remark:connect ne2,…}]},
type:post,
TransactionID:Transaction_Id1,
},
]
上述四个原子操作为对于第二数据服务器202不可再分的最小粒度的操作。
上述拆解器2022a对第一操作请求的拆解处理中,将第一操作请求中针对ne1、ne2的操作和针对port1和port2的两个post操作,分解为四个原子操作,这四个原子操作分别针对资源对象ne1、ne2、port1和port2。解释处理的目的是能够按照资源对象加锁,使针对同一个资源对象的操作能够按顺序执行。其中,“加锁”是指若两个操作针对同一个资源对象,则在执行第一个操作时,第二个操作需等待。资源管理器2022b是一个可选的部分,用于对拆解器2022a进行拆解处理后得到的每一个原子操作进行资源管理,该资源管理包括:将每一个原子操作生成属于同一个事务的原子操作队列,该同一个事务即为上述Transaction_Id所标识的事务。
生成操作队列,便于后续事务管理器2022c对各原子操作按顺序处理, 同时也起到数据缓存的作用。
事务管理器2022c,用于对各原子操作进行事务管理,若存在资源管理器2022b,则事务管理器2022c处理的是原子操作的队列;若不存在资源管理器2022b,则事务管理器2022c直接处理拆解器2022a输出的各原子操作。
其中,事务管理器2022c进行的事务管理包括:
首先,针对每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和同一个事务的事务标识三者的对应关系;
可选地,对于每一个原子操作,还可记录该原子操作的执行时间,即时间戳,该时间戳用于在后续可能的数据回滚中,辅助标记各原子操作的执行顺序。
然后,对各原子操作逐条进行预提交,即逐条执行各原子操作;
若所有原子操作均执行成功,则事务完成,生成第二操作请求,并通知SBI2023将第二操作请求发送给第一数据服务器203;
在遇到原子操作未执行成功时,则预提交失败,此时对第二数据进行回滚,回滚时根据之前记录的原子操作的类型、原子操作所针对的资源对象的标识和同一个事务的事务标识三者的对应关系,进行回滚,即将第二数据恢复到执行第一操作请求中的至少一个操作之前的状态。
在对第二数据恢复时,可采用如下方式:
对于操作类型为读取的操作,由于不会修改数据,所以在回滚时忽略;
对于操作类型为新增的操作,回滚时删除对应的资源对象;
对于操作类型为修改的操作,回滚时将对应资源对象恢复为该资源对象的上一条记录;
对于操作类型为删除的操作,回滚时新增对应的资源对象,新增的资源对象的数据体中的内容与执行该删除操作前,该资源对象在第二数据中的最后一条记录一致。
若事务管理模块2022包括资源管理器2022b,则事务管理器2022c还用于:在逐条执行每一个原子操作之前,将资源管理器2022b输出的原子操作 队列生成属于该同一个事务的事务对象实例;则事务管理器2022c在逐条执行每一个原子操作时,具体地,可将生成的该事务对象实例中的每一个原子操作逐条进行预提交。
这里,生成属于同一个事务的事务对象实例,是为了应对多个操作对一个资源对象进行处理的并发操作的情况,此时,需要对事物对象进行管理,而对事务对象进行管理就生成对应的事务对象实例。
前面,以应用服务器201提交符合RESTful格式的第一操作请求为例。在具体实现时,应用服务器201也可能发送符合特定网络通信协议格式的第一操作请求,此时,可在符合RESTful格式的接口NBI2021与应用服务器201之间,增加接口转换器2024,该接口转换器2024用于将符合特定网络通信协议格式的第一操作请求,转换为符合RESTful格式的第一操作请求。
该接口转换器2024可位于应用服务器201上,也可位于第二数据服务器202上,如图6所示。
前面介绍了本发明实施例提供的网络,基于相同的发明构思,本发明实施例还提供了第二数据服务器、应用服务器,以及数据处理方法,由于它们解决问题的原理与本发明实施例提供的网络类似,其实施可参照该网络的实施,重复之处不再赘述。
图7为本发明实施例提供的第一种第二数据服务器的结构示意图。该第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;一个或多个应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器用于提供第二持久层服务,第二数据服务器中包括第二数据,第二数据包括与第一数据相同的数据;第二数据服务器向一个或多个应用服务器提供第二应用程序接口API,一个或多个应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图7所示,该第二数据服务器包括:
第二接口701,用于提供第二API,并接收一个或多个应用服务器通过调用第二API发送的第一操作请求,第一操作请求用于请求执行至少一个操作,至少一个操作属于同一个事务;
事务管理模块702,用于在确定第一操作请求是用于请求第一持久层服务执行至少一个操作后,对第二数据执行至少一个操作;若每一个操作均执行成功,则生成第二操作请求,第二操作请求用于请求对第一数据执行至少一个操作;
第一接口703,用于调用第一API向第一数据服务器发送第二操作请求。
可选地,事务管理模块702在确定第一操作请求是用于请求第一持久层服务执行至少一个操作时,具体用于:
根据第一操作请求中第一持久层服务的标识信息,或用于指示应用服务请求第一持久层服务的用户协议信息,确定第一操作请求用于请求第一持久层服务执行至少一个操作。
可选地,事务管理模块702还用于:
若执行至少一个操作失败,则将第二数据回滚至执行至少一个操作之前的状态。
可选地,事务管理模块702在对第二数据执行至少一个操作中的每一个操作时,具体用于:
对至少一个操作进行拆解处理,拆解处理包括:将至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,资源对象为第一持久层服务管理的资源对象,原子操作为对于第一持久层服务管理的资源对象不可再分的操作;以及
对拆解处理后得到的原子操作进行事务管理,事务管理包括:针对拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和同一个事务的事务标识三者的对应关系;并执行拆解处理得到的每一个原子操作。
可选地,事务管理模块702在将第二数据回滚至执行至少一个操作中的 每一个操作之前的状态时,具体用于:
根据事务处理中记录的对应关系,将第二数据回滚至执行至少一个操作中的每一个操作之前的状态。
可选地,第一操作请求中包括同一个事务的事务标识;
事务管理模块702在生成第二操作请求时,具体用于:去掉第一操作请求中的同一个事务的事务标识,以生成第二操作请求。
可选地,事务管理模块702还用于:若执行至少一个操作失败,则针对第一操作请求生成失败响应,失败响应用于指示至少一个操作执行失败;
第二接口701还用于:向一个或多个应用服务器发送失败响应,。
可选地,失败响应中包括至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的第一持久层服务的资源对象;
操作失败原因。
可选地,第二数据服务器与第一数据服务器为同一服务器;或
第二数据服务器与第一数据服务器为不同服务器;或
应用服务器与第二数据服务器为同一服务器。
可选地,第二数据服务器与第一数据服务器为不同服务器;
第一数据服务器和第二数据服务器为云服务器,且第一数据服务器和第二数据服务器承载在不同的虚拟机VM上。
该第一种第二数据服务器的其他实现细节,可参见前述的第二数据服务器202,重复之处不再赘述。
图8为本发明实施例提供的第二种第二数据服务器的结构示意图。
与本发明实施例提供的第一种第二数据服务器类似,第二种第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;一个或多个应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器用于提供第二持久层服务, 第二数据服务器中包括第二数据,第二数据包括与第一数据相同的数据;第二数据服务器向一个或多个应用服务器提供第二应用程序接口API,一个或多个应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图8所示,该第二数据服务器包括:网络接口801、处理器802和存储器803;
其中,存储器803用于存储事务管理程序,所述事务管理程序中包括用于实现所述第二API的代码;
处理器802用于调用存储器803中存储的该事务管理程序,执行如下操作:
通过网络接口801接收一个或多个应用服务器发送的第一操作请求,第一操作请求是一个或多个应用服务器通过调用第二API发送的,用于请求执行至少一个操作,至少一个操作属于同一个事务;
在确定第一操作请求是用于请求第一持久层服务执行至少一个操作后,对第二数据执行至少一个操作;
若每一个操作均执行成功,则第二数据服务器生成第二操作请求,并通过网络接口801调用第一API向第一数据服务器发送第二操作请求,其中第二操作请求用于请求对第一数据执行至少一个操作。
其中,在图8中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器802代表的一个或多个处理器和存储器803代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供网络接口801,用于与网络上的其他设备通信,比如第一数据服务器、一个或多个应用服务器等。针对不同的用户设备,用户接口804还可以是能够外接内接需要设备的接口,连接的设备包括但不限于小键盘、显示器、扬声器、麦克风、操纵杆等。
该第二种第二数据服务器的其他实现细节可参考前述的第二数据服务器202,重复之处不再赘述。
图9为本发明实施例提供的第一种应用服务器的结构示意图。
其中,第二数据服务器与第一数据服务器以及一个或多个该第一种应用服务器具有通信连接;该应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器向一个或多个应用服务器提供第二应用程序接口API,一个或多个应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图9所示,该应用服务器包括:
操作请求生成模块901,用于生成第一操作请求,并指示第一操作请求用于请求第一持久层服务执行至少一个操作,至少一个操作属于同一个事务,第一操作请求中包括用于指示第一操作请求用于请求第一持久层服务的指示信息;
接口902,用于调用第二API,向第二数据服务器发送第一操作请求,指示第二数据服务器:对第二数据执行至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用第一API向第一数据服务器发送第二操作请求,第二操作请求用于请求对第一数据执行至少一个操作。
可选地,用于指示第一操作请求用于请求第一持久层服务的指示信息包括:
第一持久层服务的标识信息;或
用于指示应用服务请求第一持久层服务的用户协议信息。
可选地,第一操作请求还用于指示第二数据服务器:在执行至少一个操作失败时,将第二数据回滚至执行至少一个操作之前的状态。
可选地,第一操作请求中包括同一个事务的事务标识。
可选地,接口902还用于:
接收第二数据服务器在执行至少一个操作失败后发送的失败响应;
失败响应用于指示至少一个操作执行失败。
可选地,失败响应中包括至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的第一持久层服务的资源对象;
操作失败原因。
可选地,该应用服务器与第二数据服务器为同一服务器。
该应用服务器的其他实现细节可参考前述的应用服务器201,重复之处不再赘述。
图10为本发明实施例提供的第二种应用服务器的结构示意图。
其中,第二数据服务器与第一数据服务器以及一个或多个该第一种应用服务器具有通信连接;该应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器向一个或多个应用服务器提供第二应用程序接口API,一个或多个应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图10所示,该应用服务器包括:
网络接口1001、处理器1002和存储器1003;
其中,存储器1003用于操作请求处理程序;
处理器1002用于调用存储器1003中存储的该操作请求处理程序,执行如下操作:
生成第一操作请求,第一操作请求用于请求第一持久层服务执行至少一个操作,至少一个操作属于同一个事务,第一操作请求中包括用于指示第一操作请求用于请求第一持久层服务的指示信息;
调用第二API,向第二数据服务器发送第一操作请求,以指示第二数据服 务器:
对第二数据执行至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用第一API向第一数据服务器发送第二操作请求,第二操作请求用于请求对第一数据执行至少一个操作。
其中,在图10中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器1002代表的一个或多个处理器和存储器1003代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供网络接口1001,用于与网络上的其他设备通信,比如第二数据服务器等。针对不同的用户设备,用户接口1004还可以是能够外接内接需要设备的接口,连接的设备包括但不限于小键盘、显示器、扬声器、麦克风、操纵杆等。
该第二种应用服务器的其他实现细节可参考前述的应用服务器201,重复之处不再赘述。
图11为本发明实施例提供的第一种数据处理方法的流程图。
该第一种数据处理方法可应用于第二数据服务器上,第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器用于提供第二持久层服务,第二数据服务器中包括第二数据,第二数据包括与第一数据相同的数据;第二数据服务器向应用服务器提供第二应用程序接口API,应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图11所示,该方法包括:
S1101:第二数据服务器接收一个或多个应用服务器发送的第一操作请求,第一操作请求是一个或多个应用服务器通过调用第二API发送的,用于请求执行至少一个操作,至少一个操作属于同一个事务;
S1102:第二数据服务器在确定第一操作请求是用于请求第一持久层服务执行至少一个操作后,对第二数据执行至少一个操作;
S1103:若每一个操作均执行成功,则第二数据服务器生成第二操作请求,并通过调用第一API向第一数据服务器发送第二操作请求,其中第二操作请求用于请求对第一数据执行至少一个操作。
可选地,第二数据服务器确定第一操作请求用于请求第一持久层服务执行至少一个操作,包括:
第二数据服务器根据第一操作请求中第一持久层服务的标识信息,或用于指示应用服务请求第一持久层服务的用户协议信息,确定第一操作请求用于请求第一持久层服务。
可选地,该方法还包括:
若执行至少一个操作失败,则第二数据服务器将第二数据回滚至执行至少一个操作之前的状态。
可选地,第二数据服务器对第二数据执行至少一个操作中的每一个操作,包括:
第二数据服务器对至少一个操作进行拆解处理,拆解处理包括:将至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,资源对象为第一持久层服务管理的资源对象,原子操作为对于第一持久层服务管理的资源对象不可再分的操作;以及
第二数据服务器对拆解处理后得到的原子操作进行事务管理,事务管理包括:针对拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和同一个事务的事务标识三者的对应关系;并执行拆解处理得到的每一个原子操作。
可选地,第二数据服务器将第二数据回滚至执行至少一个操作中的每一个操作之前的状态,包括:
第二数据服务器根据事务处理中记录的对应关系,将第二数据回滚至执行至少一个操作中的每一个操作之前的状态。
可选地,第一操作请求中包括同一个事务的事务标识;
第二数据服务器生成第二操作请求包括:第二数据服务器去掉第一操作请求中的同一个事务的事务标识,以生成第二操作请求。
可选地,该方法还包括:若执行至少一个操作失败,则第二数据服务器针对第一操作请求,向一个或多个应用服务器发送失败响应,失败响应用于指示至少一个操作执行失败。
可选地,失败响应中包括至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的第一持久层服务的资源对象;
操作失败原因。
可选地,第一服务器和第二数据服务器为云服务器,且第一数据服务器和第二数据服务器承载在不同的虚拟机VM上。
该方法的其他实现细节可参考前述的第二数据服务器202的具体实现,重复之处不再赘述。
图12为本发明实施例提供的第二种数据处理方法的流程图。
该方法可应用于一个或多个应用服务器上,第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;一个或多个应用服务器用于提供应用服务;第一数据服务器用于提供第一持久层服务,第一数据服务器中包括第一数据;第二数据服务器向应用服务器提供第二应用程序接口API,一个或多个应用服务器通过调用第二API向第一数据服务器请求第一持久层服务;第一数据服务器向第二数据服务器提供第一API,第二数据服务器通过调用第一API请求第一持久层服务。
如图12所示,该方法包括:
S1201:一个或多个应用服务器生成第一操作请求,第一操作请求用于请求第一持久层服务执行至少一个操作,至少一个操作属于同一个事务,第一操作请求中包括用于指示第一操作请求用于请求第一持久层服务的指示信 息;
S1202:该一个或多个应用服务器通过调用第二API,向第二数据服务器发送第一操作请求,以指示第二数据服务器:
对第二数据执行至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用第一API向第一数据服务器发送第二操作请求,第二操作请求用于请求对第一数据执行至少一个操作。
可选地,用于指示第一操作请求用于请求第一持久层服务的指示信息包括:
第一持久层服务的标识信息;或
用于指示应用服务请求第一持久层服务的用户协议信息。
可选地,该方法还包括:
第一操作请求还用于指示第二数据服务器:在执行至少一个操作失败时,将第二数据回滚至执行至少一个操作之前的状态。
可选地,第一操作请求中包括同一个事务的事务标识。
可选地,该方法还包括:
一个或多个应用服务器接收第二数据服务器在执行至少一个操作失败后通过第二API发送的失败响应;
失败响应用于指示至少一个操作执行失败。
可选地,失败响应中包括至少一个操作中未执行成功的操作的下列信息中的至少一种:
操作类型;
操作所针对的第一持久层服务的资源对象;
操作失败原因。
可选地,第一数据服务器和第二数据服务器为云服务器,且第一数据服务器和第二数据服务器承载在不同的虚拟机VM上。
该方法的其他实现细节可参考前述的应用服务器201的具体实现,重复之处不再赘述。
以上,介绍了本发明实施例的各种可能的实现方式。下面,通过图13所示的网络架构,对本发明实施例提供的持久层服务进一步说明。
如图13所示,其中,最终用户,即浏览器建立会话(Session),调用应用服务器201提供的应用服务,该应用服务通过符合RESTful格式的NBI接口使用本发明实施例提供的第二数据服务器202提供的第二持久层服务。
第二数据服务器202针对自身的第二数据(这里以数据库为例,称为“历史库”)提供事务服务,若事务完成,则向第一数据服务器203发送符合RESTful格式的SBI接口消息,其中的操作类型为RESTful标准规定的CRUD操作。
第一数据服务器203再根据收到的操作请求,对第一数据(这里以数据库)为例,称为“当前库”进行处理,
如图14为基于图13所示的网络架构,在云服务场景下第二数据服务器202中提供的第二持久层服务的架构组件图。其中,第二数据服务器202包括图14中的NBI2021、SBI2023和即事务管理模块2022,应用服务器201提供应用服务,第二数据服务器202提供第二持久层服务,即事务服务,第一数据服务器203提供原有的云端的持久层服务。
其中,应用服务在原有的云端的持久层服务的符合RESTFul格式的北向接口NBI中增加事务标识(TransactionID)字段。即可将有相同TransactionID的操作绑成事务。操作类型按RESTful标准可划分为CRUD操作。
事务服务对应用服务下发的CRUD操作接口进行拆解,拆解成多个原子操作,将其中具有相同TransactionID的原子操作绑定成一个事务对象实例,并且,对于每一个原子操作,将该原子操作的操作类型、该原子操作所针对的资源对象的标识ObjectID所属的Transaction的TransactionId对应关系,作为一条记录保存至历史库,用于操作失败时的数据回滚。
图15为图14中的事务服务的内部结构图。如图15所示,事务服务包括:拆解器(Parser)、资源管理器(ResourceMgr)、事务管理器(TransactionMgr)和历史库(Database-HIS)。
由应用服务按RESTful格式下发第一操作请求,经由NBI接口,进入事务服务后,首先由拆解器将第一操作请求中包括的具有相同TransactionId的多个操作拆解成原子操作;
然后,资源管理器将拆解器拆解得到的多个原子操作生成原子操作队列,发给事务管理器;
事务管理器将原子操作队列生成一个事务对象实例,将其中的原子操作逐条进行预提交;
若所有原子操作均执行成功,则生成第二操作请求,该第二操作请求中包括第一操作请求中的所有操作,发给第一数据服务器203;
若在逐条执行原子操作过程中,遇到执行失败的原子操作,则将历史库回滚到执行各原子操作之前的状态。
图16示出了第二数据服务器202处理的过程。如图16所示,第二数据服务器202的处理包括如下步骤:
S1601:接收应用服务器201发送的第一操作请求;
S1602:拆解器拆解该第一操作请求,生成多个原子操作;
S1603:资源管理器生成原子操作队列;
S1604:事务管理器生成事务对象实例,进行预提交;
S1605:判断是否所有原子操作均执行成功;若是,则执行步骤S1606;否则执行步骤S1607;
S1606:事务执行成功,生成第二操作请求,发给第一数据服务器203;
S1607:数据回滚,回到初始状态。
综上,本发明实施例提供了一种服务器和数据处理方法,通过在应用服务和云端的持久层服务之间提供具有事务管理功能的持久层服务,实现了应用服务对事务的管理,无需应用服务自身实现事务管理,降低了应用服务实现的复杂度。
并且,具有事务管理功能的持久层服务实现了事务管理,多个应用服务可通过该持久层服务实现事务管理功能,避免了事务管理功能在各个应用服 务上重复实现造成的冗余开发和配置。
并且,也避免了应用服务直接向云端的持久层服务发送操作请求,在部分操作执行失败的情况下,由于云服务不具备事务管理功能,导致数据无法恢复到这些操作执行之前的状态的问题。
进一步地,具有事务管理功能的持久层服务在事务管理失败时,进行数据回滚,保证了具有事务管理功能的持久层服务与云端的持久层服务之间数据的一致性。
进一步地,具有事务管理功能的持久层服务也位于云端,包括该持久层服务的云服务器,与包括原有的云端的持久层服务的云服务器承载在不同的虚拟机(Virtual Machine,VM)上。一方面,由云端的VM实现具有事务管理功能的持久层服务,可实现按需分配数据资源;另一方面,由于包括具有事务管理功能的持久层服务的云服务器,与原有的云端的持久层服务的云服务器承载在不同的VM上,这样避免了实现该具有事务管理功能的持久层服务占用原有的持久层服务的数据处理资源,避免了对原有的持久层服务的影响。
本发明实施例提供的具有事务管理功能的持久层服务,可作为基于面向服务的体系结构(Service-Oriented Architecture,SOA)架构设计的松耦合组件,被其他服务集成从而提供具有事务管理功能的服务,从而更灵活地实现持久层服务的事务管理功能。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程 和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (23)

  1. 一种数据处理方法,应用于第二数据服务器上,其特征在于,所述第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;所述应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器用于提供第二持久层服务,所述第二数据服务器中包括第二数据,所述第二数据包括与所述第一数据相同的数据;所述第二数据服务器向所述应用服务器提供第二应用程序接口API,所述应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;所述方法包括:
    所述第二数据服务器接收所述一个或多个应用服务器发送的第一操作请求,所述第一操作请求是所述一个或多个应用服务器通过调用所述第二API发送的,用于请求执行至少一个操作,所述至少一个操作属于同一个事务;
    所述第二数据服务器在确定所述第一操作请求是用于请求所述第一持久层服务执行所述至少一个操作后,对所述第二数据执行所述至少一个操作;
    若每一个操作均执行成功,则所述第二数据服务器生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,其中所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
  2. 如权利要求1所述的方法,其特征在于,第二数据服务器确定所述第一操作请求用于请求所述第一持久层服务执行所述至少一个操作,包括:
    所述第二数据服务器根据所述第一操作请求中所述第一持久层服务的标识信息,或用于指示所述应用服务请求所述第一持久层服务的用户协议信息,确定所述第一操作请求用于请求所述第一持久层服务。
  3. 如权利要求1或2所述的方法,其特征在于,所述方法还包括:
    若执行所述至少一个操作失败,则所述第二数据服务器将所述第二数据 回滚至执行所述至少一个操作之前的状态。
  4. 如权利要求3所述的方法,其特征在于,
    所述第二数据服务器对所述第二数据执行所述至少一个操作中的每一个操作,包括:
    所述第二数据服务器对所述至少一个操作进行拆解处理,所述拆解处理包括:将所述至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,所述资源对象为所述第一持久层服务管理的资源对象,所述原子操作为对于所述第一持久层服务管理的资源对象不可再分的操作;以及
    所述第二数据服务器对所述拆解处理后得到的原子操作进行事务管理,所述事务管理包括:针对所述拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和所述同一个事务的事务标识三者的对应关系;并执行所述拆解处理得到的每一个原子操作。
  5. 如权利要求4所述的方法,其特征在于,
    所述第二数据服务器将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态,包括:
    所述第二数据服务器根据所述事务处理中记录的所述对应关系,将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态。
  6. 如权利要求1~5任一项所述的方法,其特征在于,
    所述第一操作请求中包括所述同一个事务的事务标识;
    所述第二数据服务器生成所述第二操作请求包括:所述第二数据服务器去掉所述第一操作请求中的所述同一个事务的事务标识,以生成所述第二操作请求。
  7. 如权利要求1~6任一项所述的方法,其特征在于,所述方法还包括:若执行所述至少一个操作失败,则所述第二数据服务器针对所述第一操作请求,向所述一个或多个应用服务器发送失败响应,所述失败响应用于指示所述至少一个操作执行失败。
  8. 如权利要求7所述的方法,其特征在于,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
    操作类型;
    操作所针对的所述第一持久层服务的资源对象;
    操作失败原因。
  9. 如权利要求1~8任一项所述的方法,其特征在于,所述第一服务器和第二数据服务器为云服务器,且所述第一数据服务器和所述第二数据服务器承载在不同的虚拟机VM上。
  10. 一种数据处理方法,应用于一个或多个应用服务器上,其特征在于,第二数据服务器与第一数据服务器以及所述一个或多个应用服务器具有通信连接;所述一个或多个应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器向所述应用服务器提供第二应用程序接口API,所述一个或多个应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;所述方法包括:
    所述一个或多个应用服务器生成第一操作请求,所述第一操作请求用于请求所述第一持久层服务执行至少一个操作,所述至少一个操作属于同一个事务,所述第一操作请求中包括用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息;
    所述一个或多个应用服务器通过调用所述第二API,向所述第二数据服务器发送所述第一操作请求,以指示所述第二数据服务器:
    对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
  11. 如权利要求10所述的方法,其特征在于,所述用于指示所述第一操 作请求用于请求所述第一持久层服务的指示信息包括:
    所述第一持久层服务的标识信息;或
    用于指示所述应用服务请求所述第一持久层服务的用户协议信息。
  12. 一种第二数据服务器,其特征在于,所述第二数据服务器与第一数据服务器以及一个或多个应用服务器具有通信连接;所述一个或多个应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器用于提供第二持久层服务,所述第二数据服务器中包括第二数据,所述第二数据包括与所述第一数据相同的数据;所述第二数据服务器向所述一个或多个应用服务器提供第二应用程序接口API,所述一个或多个应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;
    所述第二数据服务器包括:
    所述第二接口,用于提供所述第二API,并接收所述一个或多个应用服务器通过调用所述第二API发送的第一操作请求,所述第一操作请求用于请求执行至少一个操作,所述至少一个操作属于同一个事务;
    所述事务管理模块,用于在确定所述第一操作请求是用于请求所述第一持久层服务执行所述至少一个操作后,对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作;
    所述第一接口,用于调用所述第一API向所述第一数据服务器发送所述第二操作请求。
  13. 如权利要求12所述的第二数据服务器,其特征在于,所述事务管理模块在确定所述第一操作请求是用于请求所述第一持久层服务执行所述至少一个操作时,具体用于:
    根据所述第一操作请求中所述第一持久层服务的标识信息,或用于指示所述应用服务请求所述第一持久层服务的用户协议信息,确定所述第一操作请求用于请求所述第一持久层服务执行所述至少一个操作。
  14. 如权利要求12或13所述的第二数据服务器,其特征在于,所述事务管理模块还用于:
    若执行所述至少一个操作失败,则将所述第二数据回滚至执行所述至少一个操作之前的状态。
  15. 如权利要求14所述的第二数据服务器,其特征在于,所述事务管理模块在对所述第二数据执行所述至少一个操作中的每一个操作时,具体用于:
    对所述至少一个操作进行拆解处理,所述拆解处理包括:将所述至少一个操作中针对多个资源对象的操作,分解为多个针对单个资源对象的原子操作,所述资源对象为所述第一持久层服务管理的资源对象,所述原子操作为对于所述第一持久层服务管理的资源对象不可再分的操作;以及
    对所述拆解处理后得到的原子操作进行事务管理,所述事务管理包括:针对所述拆解处理得到的每一个原子操作,记录该原子操作的类型、该原子操作所针对的资源对象的标识和所述同一个事务的事务标识三者的对应关系;并执行所述拆解处理得到的每一个原子操作。
  16. 如权利要求15所述的第二数据服务器,其特征在于,
    所述事务管理模块在将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态时,具体用于:
    根据所述事务处理中记录的所述对应关系,将所述第二数据回滚至执行所述至少一个操作中的每一个操作之前的状态。
  17. 如权利要求12~16任一项所述的第二数据服务器,其特征在于,
    所述第一操作请求中包括所述同一个事务的事务标识;
    所述事务管理模块在生成所述第二操作请求时,具体用于:去掉所述第一操作请求中的所述同一个事务的事务标识,以生成所述第二操作请求。
  18. 如权利要求12~16任一项所述的第二数据服务器,其特征在于,
    所述事务管理模块还用于:若执行所述至少一个操作失败,则针对所述第一操作请求生成失败响应,所述失败响应用于指示所述至少一个操作执行失败;
    所述第二接口还用于:向所述一个或多个应用服务器发送所述失败响应,。
  19. 如权利要求18所述的第二数据服务器,其特征在于,所述失败响应中包括所述至少一个操作中未执行成功的操作的下列信息中的至少一种:
    操作类型;
    操作所针对的所述第一持久层服务的资源对象;
    操作失败原因。
  20. 如权利要求12~19任一项所述的第二数据服务器,其特征在于,
    所述第二数据服务器与所述第一数据服务器为同一服务器;或
    所述第二数据服务器与所述第一数据服务器为不同服务器;或
    所述应用服务器与所述第二数据服务器为同一服务器。
  21. 如权利要求20所述的第二数据服务器,其特征在于,所述第二数据服务器与所述第一数据服务器为不同服务器;
    所述第一数据服务器和第二数据服务器为云服务器,且所述第一数据服务器和所述第二数据服务器承载在不同的虚拟机VM上。
  22. 一种应用服务器,其特征在于,第二数据服务器与第一数据服务器以及一个或多个所述应用服务器具有通信连接;所述应用服务器用于提供应用服务;所述第一数据服务器用于提供第一持久层服务,所述第一数据服务器中包括第一数据;所述第二数据服务器向一个或多个所述应用服务器提供第二应用程序接口API,一个或多个所述应用服务器通过调用所述第二API向所述第一数据服务器请求所述第一持久层服务;所述第一数据服务器向所述第二数据服务器提供第一API,所述第二数据服务器通过调用所述第一API请求所述第一持久层服务;
    所述应用服务器包括:
    操作请求生成模块,用于生成第一操作请求,并指示所述第一操作请求用于请求所述第一持久层服务执行至少一个操作,所述至少一个操作属于同一个事务,所述第一操作请求中包括用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息;
    接口,用于调用所述第二API,向所述第二数据服务器发送所述第一操作请求,指示所述第二数据服务器:对所述第二数据执行所述至少一个操作;若每一个操作均执行成功,则生成第二操作请求,并通过调用所述第一API向所述第一数据服务器发送所述第二操作请求,所述第二操作请求用于请求对所述第一数据执行所述至少一个操作。
  23. 如权利要求22所述的应用服务器,其特征在于,所述用于指示所述第一操作请求用于请求所述第一持久层服务的指示信息包括:
    所述第一持久层服务的标识信息;或
    用于指示所述应用服务请求所述第一持久层服务的用户协议信息。
PCT/CN2015/095169 2015-03-31 2015-11-20 一种服务器和数据处理方法 WO2016155332A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP15887285.3A EP3270298A4 (en) 2015-03-31 2015-11-20 Server and data processing method
US15/719,768 US20180025049A1 (en) 2015-03-31 2017-09-29 Server and Data Processing Method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510148274.X 2015-03-31
CN201510148274.XA CN104731943B (zh) 2015-03-31 2015-03-31 一种服务器和数据处理方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/719,768 Continuation US20180025049A1 (en) 2015-03-31 2017-09-29 Server and Data Processing Method

Publications (1)

Publication Number Publication Date
WO2016155332A1 true WO2016155332A1 (zh) 2016-10-06

Family

ID=53455830

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095169 WO2016155332A1 (zh) 2015-03-31 2015-11-20 一种服务器和数据处理方法

Country Status (4)

Country Link
US (1) US20180025049A1 (zh)
EP (1) EP3270298A4 (zh)
CN (1) CN104731943B (zh)
WO (1) WO2016155332A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900424A (zh) * 2022-05-27 2022-08-12 网易(杭州)网络有限公司 数据热修复方法、装置、电子设备及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731943B (zh) * 2015-03-31 2019-09-13 华为技术有限公司 一种服务器和数据处理方法
CN107153599B (zh) * 2017-06-14 2021-02-26 上海点融信息科技有限责任公司 一种记录以及回放用户操作的方法及设备
CN110019112B (zh) * 2017-08-25 2023-10-31 阿里巴巴集团控股有限公司 数据事务处理方法、装置以及电子设备
WO2019060758A1 (en) * 2017-09-22 2019-03-28 Intel Corporation DEVICE MANAGEMENT SERVICES BASED ON NON-REST MESSAGING
CN110365719B (zh) 2018-03-26 2021-10-01 华为技术有限公司 一种数据处理的方法以及相关设备
US11368547B2 (en) * 2019-10-11 2022-06-21 Sap Se Component zones in a cloud platform
CN112104504B (zh) * 2020-09-17 2023-06-02 汇智点亮科技(北京)有限公司 一种大规模资源访问的事务管理框架、设计方法及云平台
CN113722105B (zh) * 2021-09-14 2023-08-01 百度在线网络技术(北京)有限公司 云应用操作方法、装置、设备、介质及产品
CN115205046B (zh) * 2022-09-15 2022-12-09 北京锐融天下科技股份有限公司 一种数据处理方法、装置、电子设备及存储介质
CN115422210A (zh) * 2022-11-08 2022-12-02 北京锐融天下科技股份有限公司 一种多活架构下保障业务操作数据有效性的方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101089857A (zh) * 2007-07-24 2007-12-19 中兴通讯股份有限公司 一种内存数据库事务管理方法及系统
US20120030313A1 (en) * 2010-07-01 2012-02-02 Unicorn Media, Inc. Cloud data persistence engine
CN103677771A (zh) * 2012-09-06 2014-03-26 阿里巴巴集团控股有限公司 一种并发事务的处理方法和装置
CN104731943A (zh) * 2015-03-31 2015-06-24 华为技术有限公司 一种服务器和数据处理方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8417897B2 (en) * 2010-03-31 2013-04-09 Oracle International Corporation System and method for providing locale-based optimizations in a transactional memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101089857A (zh) * 2007-07-24 2007-12-19 中兴通讯股份有限公司 一种内存数据库事务管理方法及系统
US20120030313A1 (en) * 2010-07-01 2012-02-02 Unicorn Media, Inc. Cloud data persistence engine
CN103677771A (zh) * 2012-09-06 2014-03-26 阿里巴巴集团控股有限公司 一种并发事务的处理方法和装置
CN104731943A (zh) * 2015-03-31 2015-06-24 华为技术有限公司 一种服务器和数据处理方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3270298A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900424A (zh) * 2022-05-27 2022-08-12 网易(杭州)网络有限公司 数据热修复方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
US20180025049A1 (en) 2018-01-25
EP3270298A4 (en) 2018-03-14
CN104731943B (zh) 2019-09-13
EP3270298A1 (en) 2018-01-17
CN104731943A (zh) 2015-06-24

Similar Documents

Publication Publication Date Title
WO2016155332A1 (zh) 一种服务器和数据处理方法
US10891305B2 (en) Synchronization of data between systems
KR101863398B1 (ko) 다중-서버 예약 시스템 상의 동기화 메커니즘 시스템 및 방법
US8190562B2 (en) Linking framework for information technology management
WO2017162032A1 (zh) 执行数据恢复操作的方法及装置
EP3803591A1 (en) Managing hosted resources across different virtualization platforms
US10673962B2 (en) Service cross-consumption based on an open service broker application programming interface
WO2019223228A1 (zh) 一种分布式异构数据库的数据同步方法及装置
WO2011108695A1 (ja) 並列データ処理システム、並列データ処理方法及びプログラム
WO2021052502A1 (zh) 一种配置变更的方法及相关装置
US20070124344A1 (en) Method, apparatus and program storage device for providing web services-based data replication for Heterogeneous storage systems
WO2017041649A1 (zh) 一种应用部署方法及设备
US8533230B2 (en) Expressing manageable resource topology graphs as dynamic stateful resources
US20160048703A1 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
US7636873B2 (en) Enhancement of assured event delivery mechanism to eliminate external XA store requirement
CN109144785A (zh) 用于备份数据的方法和装置
US20120316927A1 (en) Computer-implemented method and apparatus for integrating heterogeneous business processes
WO2024021861A1 (zh) 数据恢复方法及电子设备
CN112035062B (zh) 云计算的本地存储的迁移方法、计算机设备及存储介质
WO2018188607A1 (zh) 流处理方法及装置
KR102567900B1 (ko) 클라우드 저하 모드에서 지속적인 디바이스 동작 안정성을 보장하기 위한 방법 및 장치
US9075845B1 (en) Correlating and reconciling descriptor data associated with computing systems
US11290318B2 (en) Disaster recovery of cloud resources
KR101816587B1 (ko) 프로비저닝 이미지 리비전 관리 장치, 프로비저닝 이미지 리비전 관리 방법 및 이를 이용한 프로비저닝 시스템
US11210129B2 (en) Extended architecture as a service to integrate resource and transaction managers

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15887285

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE