Cross-system data access method, apparatus, device, and medium
By classifying and controlling data access messages in a distributed system, the data access problem between distributed and centralized systems is solved, achieving efficient data access and stable system transition, avoiding deadlocks and conflicts, and ensuring data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2022-07-19
- Publication Date
- 2026-06-02
AI Technical Summary
During data access between distributed and centralized systems, high concurrency and high traffic can lead to deadlocks, conflicts, and failure rollbacks caused by concurrent data access or asynchronous calls, affecting the stability of business systems and the transition process.
By classifying data access messages of distributed applications into data query messages and data update messages, and using transaction context to record and control their access paths, these messages are processed separately in the centralized system. This includes calling the update data service when sending data update messages, receiving the update results, and determining the rollback operation to ensure the consistency and stability of transactions.
It effectively solves the deadlock, conflict, and failure rollback problems that occur during concurrent data access or asynchronous calls, promotes the smooth transition from centralized applications to distributed applications, and improves the efficiency of data access and the stability of the system.
Smart Images

Figure CN115146316B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the financial sector, and more specifically, to a cross-system data access method, apparatus, device, medium, and program product. Background Technology
[0002] With the development of distributed technologies, the stability of distributed architectures has gradually improved, and some enterprises' business systems are gradually evolving from traditional centralized architectures to distributed architectures. During the transition from centralized to distributed architectures, considering factors such as the complexity, stability, and sensitivity of the business systems, the transformation needs to be carried out in stages and gradually. This transformation involves data access between two heterogeneous systems: a distributed system and a centralized system. The high concurrency and large traffic brought about by business growth have led to problems such as deadlocks, conflicts, and failure rollbacks caused by concurrent data access or asynchronous calls. Summary of the Invention
[0003] In view of the above problems, this disclosure provides a cross-system data access method, apparatus, device, medium and program product.
[0004] One aspect of this disclosure provides a cross-system data access method for a distributed system, comprising: determining at least one target data service invoked by the distributed application based on N data access messages from the distributed application, wherein the at least one target data service is encapsulated according to a service provided by a centralized system; classifying M data access messages invoking a first data service into data query messages and / or data update messages to obtain a first classification result, wherein the first data service is any one of the at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N; recording the first classification result in the transaction context of a first transaction; and accessing an application database in the centralized system according to the transaction context, wherein the data query messages and the data update messages have different access paths.
[0005] According to embodiments of this disclosure, accessing the application database in the centralized system based on the transaction context includes: invoking an update-type data service in the centralized system when sending the data update-type message, wherein the update-type data service is used to access the application database based on the data update-type message; or directly accessing the application database when sending the data query-type message.
[0006] According to an embodiment of this disclosure, after sending the data update type message, the method further includes: receiving the update result of the update type data service; and determining the data update status of each data update type message based on the update result.
[0007] According to an embodiment of this disclosure, the method further includes: determining the pending execution status of a rollback operation based on the data update status of each data update class message; and, if the rollback operation is to be executed, sending a rollback operation signal to the update class data service, wherein the update class data service is used to cause the application database to execute the rollback operation based on the rollback operation signal.
[0008] According to an embodiment of this disclosure, before invoking the update-type data service in the centralized system, the method further includes: generating the update-type data service based on the transaction interface document of the centralized system; and sending the file of the update-type data service to the centralized system, wherein the centralized system is configured to deploy the update-type data service based on the file of the update-type data service.
[0009] According to an embodiment of this disclosure, before accessing the application database in the centralized system based on the transaction context, the method further includes: classifying each of the M data access messages based on at least one of the access data volume, the number of data records, and the business type to obtain a second classification result; and recording the second classification result in the transaction context.
[0010] According to an embodiment of this disclosure, after obtaining the second classification result, the method further includes: splitting the data access messages under at least one category in the second classification result according to the access restriction conditions of the first data service to obtain a splitting result, wherein the access restriction conditions are obtained based on at least one of concurrent access count, access data volume, data record count, and service type; and recording the splitting result in the transaction context.
[0011] Another aspect of this disclosure provides a cross-system data access method for a centralized system, comprising: receiving a data access message sent by a distributed system, wherein the distributed system is configured to send the data access message according to the cross-system data access method for a distributed system as described above; and returning a data access result to the distributed system in response to the data access message accessing an application database.
[0012] According to embodiments of this disclosure, receiving a data access request sent by a distributed system includes: receiving a data update message using an update-type data service, wherein the update-type data service is used to access the application database based on the data update message; or receiving a data query message using the application database.
[0013] Another aspect of this disclosure provides a cross-system data access apparatus for a distributed system, comprising: a target determination module, configured to determine at least one target data service invoked by the distributed application based on N data access messages from the distributed application, wherein the at least one target data service is encapsulated according to a service provided by a centralized system; a message classification module, configured to classify M data access messages invoking a first data service into data query messages and / or data update messages, obtaining a first classification result, wherein the first data service is any one of the at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N; a result recording module, configured to record the first classification result in the transaction context of a first transaction; and a first access module, configured to access an application database in the centralized system according to the transaction context, wherein the data query messages and the data update messages have different access paths.
[0014] Another aspect of this disclosure provides a cross-system data access apparatus for a centralized system, comprising: a message receiving module for receiving a data access message sent by a distributed system, wherein the distributed system is configured to send the data access message according to the cross-system data access method for a distributed system as described above; and a second access module for returning a data access result to the distributed system in response to the data access message accessing an application database.
[0015] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method as described above.
[0016] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method described above.
[0017] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0018] The above one or more embodiments have the following beneficial effects: First, for N data access messages of a distributed application, M data access messages accessing the first data service are determined at the granularity of a single data service; then, the M data access messages are classified into data query messages and / or data update messages, and the first classification result is recorded using the transaction context of the first transaction; finally, the data query messages and data update messages are processed separately to achieve the purpose of accessing the application database of the centralized system. This provides effective transaction control measures, solves problems such as deadlock, conflicts, and failure rollbacks generated during concurrent data access or asynchronous calls, and effectively promotes the smooth transition from centralized applications to distributed applications. Attached Figure Description
[0019] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 This diagram illustrates an application scenario of the cross-system data access method according to an embodiment of the present disclosure.
[0021] Figure 2 A flowchart illustrating a cross-system data access method for a distributed system according to an embodiment of the present disclosure is shown schematically.
[0022] Figure 3 A flowchart illustrating the deployment of update-type data services according to embodiments of the present disclosure is shown schematically.
[0023] Figure 4 A flowchart illustrating the recording of second classification results according to an embodiment of the present disclosure is shown schematically;
[0024] Figure 5 A flowchart illustrating the record splitting results according to an embodiment of the present disclosure is shown schematically;
[0025] Figure 6 A flowchart illustrating the determination of data update status according to an embodiment of the present disclosure is shown schematically;
[0026] Figure 7 A flowchart illustrating the execution of a rollback operation according to an embodiment of the present disclosure is shown schematically;
[0027] Figure 8 A flowchart illustrating a cross-system data access method for a centralized system according to an embodiment of the present disclosure is shown schematically.
[0028] Figure 9 A flowchart illustrating cross-system data access for a distributed system according to another embodiment of the present disclosure is shown schematically;
[0029] Figure 10This schematically illustrates a structural block diagram of a cross-system data access apparatus for a distributed system according to an embodiment of the present disclosure;
[0030] Figure 11 A schematic diagram illustrating a cross-system data access apparatus for a centralized system according to embodiments of the present disclosure; and
[0031] Figure 12 A block diagram of an electronic device suitable for implementing a cross-system data access method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0032] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0033] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0034] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0035] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0036] It should be noted that the cross-system data access methods, apparatus, devices, media, and program products provided in the embodiments of this disclosure can be used in the financial field, or in any field other than the financial field. The application fields of the cross-system data access methods, apparatus, devices, media, and program products provided in the embodiments of this disclosure are not limited.
[0037] Figure 1The diagram illustrates an application scenario of the cross-system data access method according to an embodiment of the present disclosure.
[0038] like Figure 1 As shown, application scenario 100 includes two types of heterogeneous systems: open platform system 111 and host system 133. Open platform system 111 is a distributed architecture, while host system 133 is a centralized architecture. Open platform system 111 comprises two devices and four applications: a data service generation device 114, a data service provision device 120, data service production applications 112 and 113, and data service consumption applications 131 and 132. Data service generation device 114 includes a transaction interface 115, an interface parsing unit 116, an automatic conversion unit 117, a data service generation unit 118, and a data service file 119. Data service provision device 120 includes a data service registration unit 121, a data service disclosure unit 122, a data service notification unit 123, a message inspection unit 124, a protocol matching unit 125, a code conversion unit 126, a transaction control unit 127, a data query message unit 128, a data update message unit 129, and a monitoring unit 130. The host system 133 includes host application 134, application database 135, and update-type data service 136.
[0039] During online data access between heterogeneous systems, data service production applications 112 and 113 provide the transaction interface documents of the enterprise's existing host application transactions to the data service generation device 114 through the transaction interface 115. The data service generation device 114 generates the corresponding data service file 119 through the interface parsing unit 116, the automatic conversion unit 117, and the data service generation unit 118. The data service is registered to the data service public unit 122 through the data service registration unit 121 of the data service providing device 120 for service exposure. The data service providing device 120 notifies the data service consuming applications 131 and 132 of the registered service through the data service notification unit 123. The data service consuming applications 131 and 132 call the service. The data service providing device 120 converts the data service call into an application database 135 or an update data service 136 that can be accessed by the host system 133 through the message inspection unit 124, the protocol matching unit 125, the code conversion unit 126, and the transaction control unit 127.
[0040] The data service generation device 114 is generally used in the design and development stage. It automatically encapsulates and converts application transactions containing data interaction logic in the host system into data service files through the transaction interface provided by the data service production application, and registers and publishes them. This improves R&D efficiency and reduces the development cost of data services and the cost of migrating host application transactions to the open platform.
[0041] The data service provider 120 is used in business processing as a bridge connecting the data service consumption application and the host application database. It enables access to the host application database through distributed data service calls, allowing the existing centralized host database to transition smoothly to the enterprise's unified distributed architecture, maximizing the reuse of the enterprise's existing resources.
[0042] The message inspection unit 124 performs relevant verifications on the received service request messages according to the data service file format standard published by the data service generation device 114, such as checking and verifying message format requirements through regular expressions.
[0043] The protocol matching unit 125 compares the received data service call message with the data service file generated by the data service generation device 114 to achieve protocol matching between the data service message and the host DB2 online data access message, so as to meet the needs of remote data service calls between systems, including message splitting and combining, communication protocol adaptation and conversion, data type conversion, etc.
[0044] The code conversion unit 126 performs matching and conversion of different message code systems used between cross-system open platform access hosts DB2 databases.
[0045] For data service call messages (i.e., data access messages) that have been inspected, matched, and transformed, the transaction control unit 127 creates a transaction context based on the transaction type, transaction nature, and data access characteristics in the message, in conjunction with the data service file 119, and distinguishes between data query messages and data update messages. In some embodiments, for the same service call, the transaction control unit 127 records both data query messages and data update messages.
[0046] The data query message unit 128 interacts directly with the application database 135 of the host system 133 to access data and transmit messages. It can transmit the operation status returned from the application database 135 of the host system 133 to the transaction control unit for query and data update messages.
[0047] The data update message unit 129 accesses the update data service 136 of the host system 133 and then accesses the application database 135 to realize update data access, and is used to transmit the transaction rollback operation signal of the transaction control unit 127 to the update data service 136 and the application database 135 of the host system 133.
[0048] The update-type data service 136 can provide update-type data calling services for the data service providing device 120 of the open platform system 111 to call, and can also return the results or status of the data update-type message to the transaction control unit 127 of the data service providing device 120.
[0049] As a centralized application, host application 134 implements load balancing and concurrency control functions when open platform system 111 accesses application database 135 and update data service 136 of host system 133.
[0050] The monitoring unit 130 is used to monitor the message inspection unit 124, protocol matching unit 125, code conversion unit 126, and transaction control unit 127, and to promptly detect problems and issue alarms.
[0051] The following will be based on Figure 1 The described scene, through Figures 2-9 The cross-system data access method according to embodiments of this disclosure will be described in detail.
[0052] Figure 2 A flowchart illustrating a cross-system data access method for a distributed system according to an embodiment of the present disclosure is shown schematically.
[0053] like Figure 2 As shown, the cross-system data access method of this embodiment includes operations S210 to S240.
[0054] In operation S210, based on N data access messages from the distributed application, at least one target data service invoked by the distributed application is determined, wherein the at least one target data service is encapsulated based on the service provided by the centralized system.
[0055] Reference Figure 1 Data service consumption applications 131 and 132 are distributed applications, each providing distributed services. They are connected via RPC (Remote Procedure Call). Data service consumption applications 131 and 132 are also connected to the data service providing device via RPC. It should be noted that the number of distributed applications can be one or more, not limited to data service consumption applications 131 and 132.
[0056] When a distributed application accesses data in online services, it can send data access messages to the target data service exposed by the data service public unit. These messages are processed sequentially by the message inspection unit 124, the protocol matching unit 125, and the code conversion unit 126. The transaction control unit 127 can then determine the target data service invoked by each of the N data access messages. At least one target data service can be encapsulated by the data service generation device 114 based on the transaction interface document (including the service content provided by the centralized system) provided by the centralized system.
[0057] In operation S220, the M data access messages that call the first data service are classified into data query messages and / or data update messages to obtain a first classification result. The first data service is any one of at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N.
[0058] For example, the transaction control unit 127 categorizes each of the M data access messages that invoke the same data service. Data updates may include operations such as adding, modifying, and deleting data in the application database.
[0059] In operation S230, the first classification result is recorded in the transaction context of the first transaction.
[0060] For example, when processing accounting transactions, the transaction control unit 127 can create a transaction context for the first transaction based on the characteristics of data access in the data access message, the type of accounting transaction, and the steps in the accounting transaction such as account sorting, accounting, and accounting result query, combined with the data service files such as the account sorting service and accounting service called. In some embodiments, if other transactions involving account sorting services are also processed, they can also be recorded in the transaction context of the first transaction. Therefore, in high-concurrency access scenarios, multiple data access messages calling the same data service are distinguished into data query messages and data update messages, and are included in the same transaction for unified management.
[0061] In operation S240, the application database in the centralized system is accessed according to the transaction context. During the access process, data query messages and data update messages have different access paths.
[0062] According to embodiments of this disclosure, the transaction control unit 128 of the data service providing device 120 effectively distinguishes between data query messages and data update messages, performs distributed transaction management, and solves the database locking and rollback problems caused by concurrent data transaction interactions, especially concurrent updates, and the complexity of developing and designing distributed applications. It can provide effective transaction control measures to solve deadlock, conflict, and failure rollback problems arising during concurrent data access or asynchronous calls, effectively promoting a smooth transition from centralized applications to distributed applications.
[0063] In some embodiments, accessing the application database in a centralized system based on a transaction context includes: invoking an update-type data service 136 in the centralized system when sending a data update-type message, wherein the update-type data service 136 is used to access the application database based on the data update-type message; or directly accessing the application database when sending a data query-type message.
[0064] For example, based on the characteristics of data access, query classes mainly read data, while update classes mainly write data. Reading data is more suitable for high-concurrency asynchronous access, while writing data is prone to deadlocks and data inconsistencies. Therefore, the access path is divided into data query messages that directly access the application database and data update messages that indirectly access the application database. Based on the first classification result in the transaction context, access is performed according to the category of each message, and each message is sent to the centralized system.
[0065] According to embodiments of this disclosure, centralized control operation means that the update-type data service 136 can receive concurrent access from the distributed system to uniformly perform update operations on the application database.
[0066] In some embodiments, distinct from Figure 1 Instead of deploying update-type data services 136 in the centralized system, an intermediate system can be added between the distributed and centralized systems to deploy update-type data services 136, thereby reducing the host resource consumption of the centralized system.
[0067] Figure 3 A flowchart illustrating the deployment of update class data service 136 according to an embodiment of the present disclosure is shown.
[0068] Before calling update-type data service 136 in the centralized system, such as Figure 3 As shown, the deployment update data service 136 of this embodiment includes operations S310 to S320.
[0069] When operating S310, update-type data services are generated based on the transaction interface documentation of the centralized system.
[0070] For example, in a centralized system, each transaction of a host application has its own transaction interface document, and various data services are encapsulated according to the transaction interface document, including update-type data service 136.
[0071] In operation S320, the file of update class data service 136 is sent to the centralized system, wherein the centralized system is configured to deploy update class data service 136 according to the file of update class data service 136.
[0072] For example, the files for the update-type data service 136 include code files, protocol files, or service description files for the centralized system to run the update-type data service 136.
[0073] According to embodiments of this disclosure, the update-type data service 136 is placed as a separate data service in the host application 134 of the host system 133. For centralized host applications, this allows for centralized control of data operations and reduces application complexity.
[0074] According to embodiments of this disclosure, since distributed data services are prone to problems such as data inconsistency and dirty data reading and writing when accessing asynchronous data, data update messages are independently encapsulated into a host-centralized data service and uniformly controlled by the transaction control unit 127 to avoid database inconsistency caused by asynchronous concurrent updates, and to solve access problems when rolling back transactions and controlling database locks.
[0075] Figure 4 A flowchart illustrating the recording of second classification results according to an embodiment of the present disclosure is shown schematically.
[0076] Before accessing the application database in a centralized system based on the transaction context, such as Figure 4 As shown, the recording of the second classification result in this embodiment includes operations S410 to S420.
[0077] In operation S410, based on at least one of the following: the amount of data accessed, the number of data records, and the type of business, each of the M data access messages is classified to obtain a second classification result.
[0078] For example, data access messages are categorized into batches based on the size of the data to be accessed, the number of data records, and the type of business, and these records are stored in the context of the same transaction for processing during the transaction process.
[0079] In operation S420, the second classification result is recorded in the transaction context.
[0080] According to embodiments of this disclosure, during transaction processing, messages of different categories can be classified and processed based on the second classification result in the transaction context. For example, firstly, the messages are classified into data query messages and data update messages. Then, within each category, data query messages and data update messages are sorted and classified according to the size of the accessed data, such as large data volume, medium data volume, and small data volume (for example only). Finally, the messages of each category are processed separately according to the sorting and classification result (i.e., the second classification result). This improves data access efficiency.
[0081] In some embodiments, messages of each category can also be processed in conjunction with their respective business type or business step. For example, messages from the account sorting step in different accounting businesses, or messages from the account sorting step and messages from the accounting step in an accounting business, may be processed in different ways.
[0082] Figure 5 A flowchart illustrating the result of record splitting according to an embodiment of the present disclosure is shown schematically.
[0083] After obtaining the second classification result, such as Figure 5 As shown, the record splitting result of this embodiment includes operations S510 to S520.
[0084] In operation S510, data access messages under at least one category in the second classification result are split according to the access restriction conditions of the first data service to obtain the splitting result. The access restriction conditions are obtained based on at least one of the concurrent access number, access data volume, data record number and service type.
[0085] For example, access restrictions may include the maximum number of concurrent accesses, the maximum amount of data accessed, or the maximum number of data records, and may include the number of concurrent accesses, the amount of data accessed, and the number of data records for a specific business type.
[0086] For example, the transaction control unit 127 refines the data access in batches, breaking it down to a predetermined granularity suitable for classifying concurrent access.
[0087] When operating S520, the splitting results are recorded in the transaction context.
[0088] For data query messages, the transaction control unit 127 parses the service call messages and categorizes and splits the accessed data. Based on the preset concurrent access limits of the application database 135 of the host system 133, it adjusts and controls the data access speed, transaction volume, and concurrency, thereby achieving concurrent data access control. For data update messages, the same categorization and splitting can be used to adjust and control the data update speed, transaction volume, and concurrency, thus achieving concurrent data access control.
[0089] Figure 6 A flowchart illustrating the determination of data update status according to an embodiment of the present disclosure is shown schematically.
[0090] After sending a data update message, such as Figure 6 As shown, determining the data update status in this embodiment includes operations S610 to S620.
[0091] During operation S610, the update result of update class data service 136 is received.
[0092] In operation S620, the data update status of each data update class message is determined based on the update results.
[0093] For data update messages, the transaction control unit 127 uses the created transaction context to record the data operation record and status (such as data update status, whether the update was successful, etc.) of each update type. It then accesses the update type data service 136 of the host system 133 through the data update type message unit 129 in the form of a service call. Based on the return result of the access to the update type data service 136, it determines the data update status and determines whether the online service has failed or succeeded, which facilitates the unified management of transactions.
[0094] Figure 7 A flowchart illustrating the execution of a rollback operation according to an embodiment of the present disclosure is shown.
[0095] like Figure 7 As shown, the rollback operation in this embodiment includes operations S710 to S720.
[0096] When operating S710, the pending execution status of the rollback operation is determined based on the data update status of each data update class message.
[0097] In some embodiments, the transaction control unit 127 uniformly determines whether the overall data service call needs to be rolled back based on the update-type data operation status of each transaction branch in the transaction context. It also determines whether the database is in a locked state based on the data operation status of the transaction context to control data access. For example, when a certain type of update operation is performing an update operation and holds a lock on its database, it restricts other similar data access service calls.
[0098] In operation S720, when performing a rollback operation, a rollback operation signal is sent to the update class data service 136, whereby the update class data service 136 is used to cause the application database to perform a rollback operation based on the rollback operation signal.
[0099] For example, the update-type data service 136 can receive operation signals such as transaction rollback and supplementation sent by the transaction control unit 127, manage each transaction in a unified manner, and execute corresponding operations, thereby solving problems such as data inconsistency and dirty data caused by distributed data service accessing the database.
[0100] Figure 8 A flowchart illustrating a cross-system data access method for a centralized system according to an embodiment of the present disclosure is shown.
[0101] like Figure 8 As shown, the cross-system data access method of this embodiment includes operations S810 to S820.
[0102] When operating the S810, it receives data access messages sent by the distributed system, wherein the distributed system is configured to... Figures 2-7 One or more embodiments of the corresponding cross-system data access method for distributed systems send data access messages.
[0103] According to embodiments of this disclosure, receiving a data access request sent by a distributed system includes: receiving a data update message using an update-type data service 136, wherein the update-type data service 136 is used to access an application database based on the data update message; or receiving a data query message using the application database.
[0104] When operating the S820, in response to a data access message accessing the application database, the data access result is returned to the distributed system.
[0105] For example, for data update messages, the data access result may include the data update status. For data query messages, the data access result may include the target data being queried.
[0106] In some embodiments, before receiving the data update message sent by the distributed system, the file of the update data service 136 sent by the distributed system can also be received for deployment. This can be referred to in operations S310 to S320, and will not be described in detail here.
[0107] In some embodiments, the update result is sent to the transaction control unit 127 of the distributed system using the update-type data service 136. For example, the update result can be sent to the update-type data access unit 129, and then sent by the update-type data access unit 129 to the transaction control unit 127. In some embodiments, if the update transaction of the application database is in a deadlock state during execution, the update result can be sent to the query-type data access unit 128.
[0108] In some embodiments, after receiving the data update message sent by the distributed system, the update data service 136 can also be used to receive rollback operation information so that the application database can perform a rollback operation. This can be referred to in operations S710 to S720, which will not be described in detail here.
[0109] Figure 9 A flowchart illustrating cross-system data access for a distributed system according to another embodiment of the present disclosure is shown.
[0110] In operation S901, an interface is provided. Data service production applications 112 and 113 provide the data service generation device 114 with the transaction interface documentation for host application transactions.
[0111] In operation S902, service generation occurs. The data service generation device 114 automatically parses and converts the transaction interface provided by the data service production applications 112 and 113 to generate the corresponding data service file 119.
[0112] In operation S903, service is published. The data service file 119 generated by the service is registered to the data service registration unit 121 of the data service providing device through the data service generation device 114.
[0113] In operation S904, service notification. The data service providing device notifies the data service consuming applications 131 and 132 of the registration service through the data service notification unit 123.
[0114] In operation S905, service calls are made. Data service consuming applications 131 and 132 call relevant services from data service public unit 122.
[0115] During operation S906, message inspection is performed. The service received by the data service public unit 122 will trigger message inspection. The message inspection unit 124 performs necessary verification on the received service request message, including verification of required fields and field types in the message according to the format requirements of the registered service.
[0116] During S907 operation, protocol matching is performed. After the message inspection unit completes the verification, it further triggers the protocol matching unit 125 to perform protocol matching, which includes data message splitting and reassembly, communication protocol matching, and data type and format conversion.
[0117] During operation S908, code conversion occurs. After the protocol matching unit 125 completes its processing, it triggers the code conversion unit 126 to realize the conversion of different code systems between heterogeneous systems.
[0118] During S909 operation, transaction control is implemented. After the encoding conversion is completed, the transaction control unit 327 is triggered to determine the database lock access and rollback in case of online service failure based on transaction concurrency.
[0119] During operation S910, data access is performed. The query-type data access unit 128 accesses the application database 135 of the host system 133, and the update-type data access unit 129 accesses the update-type data service 136 of the host system 133. The update-type data service 136 accesses the application database 135 to perform database queries and updates.
[0120] According to embodiments of this disclosure, referring to Figure 1 By leveraging an automated data service generation device, the host DB2 database access transactions are quickly and automatically encapsulated into open platform data services. The data service provider device provides distributed consumer applications with data services that can be called via RPC. The online interaction with the host DB2 database is completed through remote data access SQLJ for query and update classes, respectively. This not only solves the problem of high cost of general-purpose CPUs on the host, but also solves the problems of database deadlock and conflict during concurrent access. It also enables rapid development and efficient management, so as to realize the rapid and secure transformation of the centralized data access architecture to a distributed architecture. The distributed architecture solves the high concurrency problems of the continuous growth of banking business.
[0121] The cross-system data access method according to embodiments of this disclosure is also applicable to data access between one or more distributed systems and one or more centralized systems. For example, during update-type access, update-type data services 136 in multiple centralized systems can call each other.
[0122] Based on the above-described cross-system data access method, this disclosure also provides a cross-system data access apparatus for distributed systems and a cross-system data access apparatus for centralized systems. The following will be combined with... Figure 10 and Figure 11 Provide a detailed description.
[0123] Figure 10 A schematic block diagram of a cross-system data access apparatus for a distributed system according to an embodiment of the present disclosure is shown.
[0124] like Figure 10 As shown, the cross-system data access device 1000 of this embodiment includes a target determination module 1010, a message classification module 1020, a result recording module 1030, and a first access module 1040.
[0125] The target determination module 1010 can perform operation S210 to determine at least one target data service called by the distributed application based on N data access messages of the distributed application, wherein the at least one target data service is obtained by encapsulating the service provided by the centralized system.
[0126] The message classification module 1020 can perform operation S220 to classify M data access messages that call the first data service into data query messages and / or data update messages, and obtain a first classification result, wherein the first data service is any one of at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N.
[0127] The result recording module 1030 can perform operation S230 to record the first classification result in the transaction context of the first transaction.
[0128] According to the embodiments of this disclosure, the result recording module 1030 can perform operations S410 to S420 and operations S510 to S520, which will not be described in detail here.
[0129] The first access module 1040 can perform operation S240 to access the application database in the centralized system according to the transaction context, wherein data query messages and data update messages have different access paths.
[0130] According to embodiments of this disclosure, the cross-system data access device 1000 may further include a service generation module, which can perform operations S310 to S320, which will not be described in detail here.
[0131] According to embodiments of this disclosure, the cross-system data access device 1000 may further include a status receiving module, which can perform operations S610 to S620, which will not be described in detail here.
[0132] According to embodiments of this disclosure, the cross-system data access device 1000 may further include a transaction rollback module, which can perform operations S710 to S720, which will not be described in detail here.
[0133] Figure 11 A schematic block diagram of a cross-system data access device for a centralized system according to an embodiment of the present disclosure is shown.
[0134] like Figure 11 As shown, the cross-system data access device 1100 of this embodiment includes a message receiving module 1110 and a second access module 1120.
[0135] The message receiving module 1110 can perform operation S810 to receive data access messages sent by the distributed system, wherein the distributed system is configured to send data access messages according to the cross-system data access method for the distributed system as described above.
[0136] The second access module 1120 can perform operation S820, which is used to access the application database in response to a data access message and return the data access result to the distributed system.
[0137] It should be noted that the implementation methods, technical problems solved, functions achieved, and technical effects of each module / unit / subunit in the device embodiments are the same as or similar to the implementation methods, technical problems solved, functions achieved, and technical effects of each corresponding step in the method embodiments, and will not be repeated here.
[0138] According to embodiments of this disclosure, any plurality of modules in the cross-system data access device 1000 or the cross-system data access device 1100 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least some of the functionality of one or more of these modules may be combined with at least some of the functionality of other modules and implemented in one module.
[0139] According to embodiments of this disclosure, at least one module of the cross-system data access device 1000 or cross-system data access device 1100 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these. Alternatively, at least one module of the cross-system data access device 1000 or cross-system data access device 1100 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0140] Figure 12 A block diagram of an electronic device suitable for implementing a cross-system data access method according to an embodiment of the present disclosure is shown schematically.
[0141] like Figure 12 As shown, an electronic device 1200 according to an embodiment of the present disclosure includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage portion 1208 into a random access memory (RAM) 1203. The processor 1201 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1201 may also include onboard memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0142] RAM 1203 stores various programs and data required for the operation of electronic device 1200. Processor 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Processor 1201 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1202 and / or RAM 1203. It should be noted that programs may also be stored in one or more memories other than ROM 1202 and RAM 1203. Processor 1201 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.
[0143] According to embodiments of this disclosure, the electronic device 1200 may further include an input / output (I / O) interface 1205, which is also connected to a bus 1204. The electronic device 1200 may also include one or more of the following components connected to the I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1210 as needed so that computer programs read from it can be installed into the storage section 1208 as needed.
[0144] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0145] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1202 and / or RAM 1203 and / or one or more memories other than ROM 1202 and RAM 1203 described above.
[0146] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.
[0147] When the computer program is executed by the processor 1201, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0148] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1209, and / or installed from the removable medium 1211. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0149] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from the removable medium 1211. When the computer program is executed by the processor 1201, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0150] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0152] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0153] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A cross-system data access method for a distributed system, comprising: Based on N data access messages from a distributed application, at least one target data service invoked by the distributed application is determined, wherein the at least one target data service is encapsulated based on the services provided by the centralized system. The M data access messages that call the first data service are classified into data query messages and / or data update messages to obtain a first classification result, wherein the first data service is any one of the at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N. The first classification result is recorded in the transaction context of the first transaction; wherein the transaction context of the first transaction is created based on the data access message and the data service file invoked. Access the application database in the centralized system according to the transaction context, wherein the data query message and the data update message have different access paths.
2. The method according to claim 1, wherein, Accessing the application database in the centralized system based on the transaction context includes: When sending the data update message, the update data service in the centralized system is invoked, wherein the update data service is used to access the application database according to the data update message; or When sending the data query message, the application database is accessed directly.
3. The method according to claim 2, wherein, After sending the data update message, the method further includes: Receive the update results from the update-type data service; The data update status of each data update class message is determined based on the update result.
4. The method according to claim 3, wherein, The method further includes: Based on the data update status of each data update type message, determine the pending execution status of the rollback operation; When the rollback operation is performed, a rollback operation signal is sent to the update-type data service, wherein the update-type data service is used to cause the application database to perform the rollback operation based on the rollback operation signal.
5. The method according to claim 2, wherein, Before invoking the update-type data service in the centralized system, the method further includes: The update-type data service is generated based on the transaction interface document of the centralized system; The update-type data service file is sent to the centralized system, wherein the centralized system is configured to deploy the update-type data service based on the update-type data service file.
6. The method according to claim 1, wherein, Prior to accessing the application database in the centralized system based on the transaction context, the method further includes: Based on at least one of the access data volume, the number of data records, and the business type, each of the M data access messages is classified to obtain a second classification result; The second classification result is recorded in the transaction context.
7. The method according to claim 6, wherein, After obtaining the second classification result, the method further includes: Based on the access restrictions of the first data service, the data access messages under at least one category in the second classification result are split to obtain the splitting result, wherein the access restrictions are obtained based on at least one of the concurrent access count, the amount of accessed data, the number of data records, and the business type; The splitting result is recorded in the transaction context.
8. A cross-system data access method for a centralized system, comprising: Receive a data access message sent by a distributed system, wherein the distributed system is configured to send the data access message according to any one of claims 1 to 7; In response to the data access message accessing the application database, the system returns the data access result to the distributed system.
9. The method according to claim 8, wherein, The receiving of data access requests sent by the distributed system includes: The system receives data update messages using an update-type data service, wherein the update-type data service is used to access the application database based on the data update message; or The application database is used to receive data query messages.
10. A cross-system data access device for a distributed system, comprising: The target determination module is used to determine at least one target data service invoked by the distributed application based on N data access messages of the distributed application, wherein the at least one target data service is obtained by encapsulating the service provided by the centralized system. The message classification module is used to classify M data access messages that call the first data service into data query messages and / or data update messages to obtain a first classification result, wherein the first data service is any one of the at least one target data service, N and M are integers greater than or equal to 1, and M is less than or equal to N. The result recording module is used to record the first classification result in the transaction context of the first transaction; wherein, the transaction context of the first transaction is created based on the data access message and the data service file called. The first access module is used to access the application database in the centralized system according to the transaction context, wherein the data query message and the data update message have different access paths.
11. A cross-system data access device for a centralized system, comprising: A message receiving module is used to receive data access messages sent by a distributed system, wherein the distributed system is configured to send the data access messages according to any one of claims 1 to 7; The second access module is used to respond to the data access message accessing the application database and return the data access result to the distributed system.
12. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 9.
13. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 9.